Service Accounts: Add enabled/disabled status to list (#46259)

* ServiceAccounts: improve where condition

* ServiceAccounts: Add Enabled/Disabled status to list
This commit is contained in:
J Guerreiro
2022-03-08 14:10:16 +01:00
committed by GitHub
parent 1f3f4ebe21
commit 874ac9180b
3 changed files with 21 additions and 6 deletions
@@ -113,6 +113,7 @@ const ServiceAccountsListPage = ({
<th>Display name</th>
<th>ID</th>
<th>Roles</th>
<th>Status</th>
<th>Tokens</th>
<th style={{ width: '34px' }} />
</tr>
@@ -174,6 +175,9 @@ type ServiceAccountListItemProps = {
const getServiceAccountsAriaLabel = (name: string) => {
return `Edit service account's ${name} details`;
};
const getServiceAccountsEnabledStatus = (disabled: boolean) => {
return disabled ? 'Disabled' : 'Enabled';
};
const ServiceAccountListItem = memo(
({ serviceAccount, onRoleChange, roleOptions, builtInRoles, onSetToRemove }: ServiceAccountListItemProps) => {
@@ -237,7 +241,17 @@ const ServiceAccountListItem = memo(
<a
className="ellipsis"
href={editUrl}
title="tokens"
title={getServiceAccountsEnabledStatus(serviceAccount.isDisabled)}
aria-label={getServiceAccountsAriaLabel(serviceAccount.name)}
>
{getServiceAccountsEnabledStatus(serviceAccount.isDisabled)}
</a>
</td>
<td className="link-td max-width-10">
<a
className="ellipsis"
href={editUrl}
title="Tokens"
aria-label={getServiceAccountsAriaLabel(serviceAccount.name)}
>
<span>