mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 07:26:03 -03:30
Add help text popovers to /#/applications details fields (#12222)
Add help text popovers to /#/applications details fields See: https://github.com/ansible/awx/issues/11873
This commit is contained in:
@@ -50,6 +50,7 @@ describe('<ApplicationAdd/>', () => {
|
|||||||
<ApplicationAdd onSuccessfulAdd={onSuccessfulAdd} />
|
<ApplicationAdd onSuccessfulAdd={onSuccessfulAdd} />
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(wrapper.find('ApplicationAdd').length).toBe(1);
|
expect(wrapper.find('ApplicationAdd').length).toBe(1);
|
||||||
expect(wrapper.find('ApplicationForm').length).toBe(1);
|
expect(wrapper.find('ApplicationForm').length).toBe(1);
|
||||||
expect(ApplicationsAPI.readOptions).toBeCalled();
|
expect(ApplicationsAPI.readOptions).toBeCalled();
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { Detail, DetailList, UserDateDetail } from 'components/DetailList';
|
|||||||
import { ApplicationsAPI } from 'api';
|
import { ApplicationsAPI } from 'api';
|
||||||
import DeleteButton from 'components/DeleteButton';
|
import DeleteButton from 'components/DeleteButton';
|
||||||
import ErrorDetail from 'components/ErrorDetail';
|
import ErrorDetail from 'components/ErrorDetail';
|
||||||
|
import applicationHelpTextStrings from '../shared/Application.helptext';
|
||||||
|
|
||||||
function ApplicationDetails({
|
function ApplicationDetails({
|
||||||
application,
|
application,
|
||||||
@@ -81,6 +82,7 @@ function ApplicationDetails({
|
|||||||
application.authorization_grant_type
|
application.authorization_grant_type
|
||||||
)}
|
)}
|
||||||
dataCy="app-detail-authorization-grant-type"
|
dataCy="app-detail-authorization-grant-type"
|
||||||
|
helpText={applicationHelpTextStrings.authorizationGrantType}
|
||||||
/>
|
/>
|
||||||
<Detail
|
<Detail
|
||||||
label={t`Client ID`}
|
label={t`Client ID`}
|
||||||
@@ -88,14 +90,16 @@ function ApplicationDetails({
|
|||||||
dataCy="app-detail-client-id"
|
dataCy="app-detail-client-id"
|
||||||
/>
|
/>
|
||||||
<Detail
|
<Detail
|
||||||
label={t`Redirect uris`}
|
label={t`Redirect URIs`}
|
||||||
value={application.redirect_uris}
|
value={application.redirect_uris}
|
||||||
dataCy="app-detail-redirect-uris"
|
dataCy="app-detail-redirect-uris"
|
||||||
|
helpText={applicationHelpTextStrings.redirectURIS}
|
||||||
/>
|
/>
|
||||||
<Detail
|
<Detail
|
||||||
label={t`Client type`}
|
label={t`Client type`}
|
||||||
value={getClientType(application.client_type)}
|
value={getClientType(application.client_type)}
|
||||||
dataCy="app-detail-client-type"
|
dataCy="app-detail-client-type"
|
||||||
|
helpText={applicationHelpTextStrings.clientType}
|
||||||
/>
|
/>
|
||||||
<UserDateDetail label={t`Created`} date={application.created} />
|
<UserDateDetail label={t`Created`} date={application.created} />
|
||||||
<UserDateDetail label={t`Last Modified`} date={application.modified} />
|
<UserDateDetail label={t`Last Modified`} date={application.modified} />
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ describe('<ApplicationDetails/>', () => {
|
|||||||
expect(
|
expect(
|
||||||
wrapper.find('Detail[label="Authorization grant type"]').prop('value')
|
wrapper.find('Detail[label="Authorization grant type"]').prop('value')
|
||||||
).toBe('Authorization code');
|
).toBe('Authorization code');
|
||||||
expect(wrapper.find('Detail[label="Redirect uris"]').prop('value')).toBe(
|
expect(wrapper.find('Detail[label="Redirect URIs"]').prop('value')).toBe(
|
||||||
'http://www.google.com'
|
'http://www.google.com'
|
||||||
);
|
);
|
||||||
expect(wrapper.find('Detail[label="Client type"]').prop('value')).toBe(
|
expect(wrapper.find('Detail[label="Client type"]').prop('value')).toBe(
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { t } from '@lingui/macro';
|
||||||
|
|
||||||
|
const applicationHelpTextStrings = {
|
||||||
|
authorizationGrantType: t`The Grant type the user must use to acquire tokens for this application`,
|
||||||
|
clientType: t`Set to Public or Confidential depending on how secure the client device is.`,
|
||||||
|
redirectURIS: t`Allowed URIs list, space separated`,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default applicationHelpTextStrings;
|
||||||
@@ -13,6 +13,7 @@ import FormActionGroup from 'components/FormActionGroup/FormActionGroup';
|
|||||||
import OrganizationLookup from 'components/Lookup/OrganizationLookup';
|
import OrganizationLookup from 'components/Lookup/OrganizationLookup';
|
||||||
import AnsibleSelect from 'components/AnsibleSelect';
|
import AnsibleSelect from 'components/AnsibleSelect';
|
||||||
import Popover from 'components/Popover';
|
import Popover from 'components/Popover';
|
||||||
|
import applicationHelpTextStrings from './Application.helptext';
|
||||||
|
|
||||||
function ApplicationFormFields({
|
function ApplicationFormFields({
|
||||||
application,
|
application,
|
||||||
@@ -83,7 +84,7 @@ function ApplicationFormFields({
|
|||||||
label={t`Authorization grant type`}
|
label={t`Authorization grant type`}
|
||||||
labelIcon={
|
labelIcon={
|
||||||
<Popover
|
<Popover
|
||||||
content={t`The Grant type the user must use to acquire tokens for this application`}
|
content={applicationHelpTextStrings.authorizationGrantType}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -113,7 +114,7 @@ function ApplicationFormFields({
|
|||||||
? required(null)
|
? required(null)
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
tooltip={t`Allowed URIs list, space separated`}
|
tooltip={applicationHelpTextStrings.redirectURIS}
|
||||||
/>
|
/>
|
||||||
<FormGroup
|
<FormGroup
|
||||||
fieldId="clientType"
|
fieldId="clientType"
|
||||||
@@ -123,11 +124,7 @@ function ApplicationFormFields({
|
|||||||
}
|
}
|
||||||
isRequired
|
isRequired
|
||||||
label={t`Client type`}
|
label={t`Client type`}
|
||||||
labelIcon={
|
labelIcon={<Popover content={applicationHelpTextStrings.clientType} />}
|
||||||
<Popover
|
|
||||||
content={t`Set to Public or Confidential depending on how secure the client device is.`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<AnsibleSelect
|
<AnsibleSelect
|
||||||
{...clientTypeField}
|
{...clientTypeField}
|
||||||
@@ -145,7 +142,6 @@ function ApplicationFormFields({
|
|||||||
function ApplicationForm({
|
function ApplicationForm({
|
||||||
onCancel,
|
onCancel,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
|
|
||||||
submitError,
|
submitError,
|
||||||
application,
|
application,
|
||||||
authorizationOptions,
|
authorizationOptions,
|
||||||
|
|||||||
Reference in New Issue
Block a user