mirror of
https://github.com/ansible/awx.git
synced 2026-02-21 13:10:11 -03:30
Show PAT as part of bulk delete list
* Show PAT as part of bulk delete list * Update tooltip message in how to create a Personal Access Token See: https://github.com/ansible/awx/issues/8680
This commit is contained in:
@@ -20,7 +20,6 @@ function DeleteButton({
|
|||||||
onConfirm,
|
onConfirm,
|
||||||
modalTitle,
|
modalTitle,
|
||||||
name,
|
name,
|
||||||
|
|
||||||
variant,
|
variant,
|
||||||
children,
|
children,
|
||||||
isDisabled,
|
isDisabled,
|
||||||
|
|||||||
@@ -83,7 +83,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 for acquire tokens for this application`}
|
content={t`The Grant type the user must use to acquire tokens for this application`}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ function UserTokenDetail({ token }) {
|
|||||||
</DetailList>
|
</DetailList>
|
||||||
<CardActionsRow>
|
<CardActionsRow>
|
||||||
<DeleteButton
|
<DeleteButton
|
||||||
name={summary_fields?.application?.name}
|
name={summary_fields?.application?.name || t`Personal Access Token`}
|
||||||
modalTitle={t`Delete User Token`}
|
modalTitle={t`Delete User Token`}
|
||||||
onConfirm={deleteToken}
|
onConfirm={deleteToken}
|
||||||
isDisabled={isLoading}
|
isDisabled={isLoading}
|
||||||
|
|||||||
@@ -99,6 +99,16 @@ function UserTokenList() {
|
|||||||
|
|
||||||
const canAdd = true;
|
const canAdd = true;
|
||||||
|
|
||||||
|
const modifiedSelected = selected.map((item) => {
|
||||||
|
if (item.application === null) {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
name: t`Personal Access Token`,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<PaginatedTable
|
<PaginatedTable
|
||||||
@@ -162,7 +172,7 @@ function UserTokenList() {
|
|||||||
<ToolbarDeleteButton
|
<ToolbarDeleteButton
|
||||||
key="delete"
|
key="delete"
|
||||||
onDelete={handleDelete}
|
onDelete={handleDelete}
|
||||||
itemsToDelete={selected}
|
itemsToDelete={modifiedSelected}
|
||||||
pluralizedItemName={t`User tokens`}
|
pluralizedItemName={t`User tokens`}
|
||||||
/>,
|
/>,
|
||||||
]}
|
]}
|
||||||
@@ -170,7 +180,7 @@ function UserTokenList() {
|
|||||||
)}
|
)}
|
||||||
headerRow={
|
headerRow={
|
||||||
<HeaderRow qsConfig={QS_CONFIG}>
|
<HeaderRow qsConfig={QS_CONFIG}>
|
||||||
<HeaderCell sortKey="application__name">{t`Name`}</HeaderCell>
|
<HeaderCell sortKey="application__name">{t`Application Name`}</HeaderCell>
|
||||||
<HeaderCell sortKey="scope">{t`Scope`}</HeaderCell>
|
<HeaderCell sortKey="scope">{t`Scope`}</HeaderCell>
|
||||||
<HeaderCell sortKey="expires">{t`Expires`}</HeaderCell>
|
<HeaderCell sortKey="expires">{t`Expires`}</HeaderCell>
|
||||||
</HeaderRow>
|
</HeaderRow>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function UserTokenListItem({ token, isSelected, onSelect, rowIndex }) {
|
|||||||
<Link to={`/users/${id}/tokens/${token.id}/details`}>
|
<Link to={`/users/${id}/tokens/${token.id}/details`}>
|
||||||
{token.summary_fields?.application
|
{token.summary_fields?.application
|
||||||
? token.summary_fields.application.name
|
? token.summary_fields.application.name
|
||||||
: `Personal access token`}
|
: t`Personal access token`}
|
||||||
</Link>
|
</Link>
|
||||||
</Td>
|
</Td>
|
||||||
<Td dataLabel={t`Scope`}>{toTitleCase(token.scope)}</Td>
|
<Td dataLabel={t`Scope`}>{toTitleCase(token.scope)}</Td>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ function UserTokenFormFields() {
|
|||||||
<span>
|
<span>
|
||||||
{t`Application`}
|
{t`Application`}
|
||||||
<Popover
|
<Popover
|
||||||
content={t`Select the application that this token will belong to.`}
|
content={t`Select the application that this token will belong to, or leave this field empty to create a Personal Access Token.`}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user