mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
add help text to user token detail
This commit is contained in:
parent
6a63af83c0
commit
3cedd0e0bd
@ -12,6 +12,7 @@ import { TokensAPI } from 'api';
|
||||
import { formatDateString } from 'util/dates';
|
||||
import useRequest, { useDismissableError } from 'hooks/useRequest';
|
||||
import { toTitleCase } from 'util/strings';
|
||||
import helptext from '../shared/User.helptext';
|
||||
|
||||
function UserTokenDetail({ token }) {
|
||||
const { scope, description, created, modified, expires, summary_fields } =
|
||||
@ -37,6 +38,7 @@ function UserTokenDetail({ token }) {
|
||||
label={t`Application`}
|
||||
value={summary_fields?.application?.name}
|
||||
dataCy="application-token-detail-name"
|
||||
helpText={helptext.application}
|
||||
/>
|
||||
<Detail
|
||||
label={t`Description`}
|
||||
@ -47,6 +49,7 @@ function UserTokenDetail({ token }) {
|
||||
label={t`Scope`}
|
||||
value={toTitleCase(scope)}
|
||||
dataCy="application-token-detail-scope"
|
||||
helpText={helptext.scope}
|
||||
/>
|
||||
<Detail
|
||||
label={t`Expires`}
|
||||
|
||||
8
awx/ui/src/screens/User/shared/User.helptext.js
Normal file
8
awx/ui/src/screens/User/shared/User.helptext.js
Normal file
@ -0,0 +1,8 @@
|
||||
import { t } from '@lingui/macro';
|
||||
|
||||
const userHelpTextStrings = {
|
||||
application: t`The application that this token belongs to, or leave this field empty to create a Personal Access Token.`,
|
||||
scope: t`Scope for the token's access`,
|
||||
};
|
||||
|
||||
export default userHelpTextStrings;
|
||||
@ -9,6 +9,7 @@ import ApplicationLookup from 'components/Lookup/ApplicationLookup';
|
||||
import Popover from 'components/Popover';
|
||||
import { required } from 'util/validators';
|
||||
import { FormColumnLayout } from 'components/FormLayout';
|
||||
import helptext from './User.helptext';
|
||||
|
||||
function UserTokenFormFields() {
|
||||
const { setFieldValue, setFieldTouched } = useFormikContext();
|
||||
@ -45,9 +46,7 @@ function UserTokenFormFields() {
|
||||
label={
|
||||
<span>
|
||||
{t`Application`}
|
||||
<Popover
|
||||
content={t`Select the application that this token will belong to, or leave this field empty to create a Personal Access Token.`}
|
||||
/>
|
||||
<Popover content={helptext.application} />
|
||||
</span>
|
||||
}
|
||||
touched={applicationMeta.touched}
|
||||
@ -67,9 +66,7 @@ function UserTokenFormFields() {
|
||||
isRequired
|
||||
validated={!scopeMeta.touched || !scopeMeta.error ? 'default' : 'error'}
|
||||
label={t`Scope`}
|
||||
labelIcon={
|
||||
<Popover content={t`Specify a scope for the token's access`} />
|
||||
}
|
||||
labelIcon={<Popover content={helptext.scope} />}
|
||||
>
|
||||
<AnsibleSelect
|
||||
{...scopeField}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user