Skip to content

Commit

Permalink
feat: show token info when deleting SA (#2841)
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois committed Jan 6, 2023
1 parent b10d9c4 commit c244cd6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
@@ -1,6 +1,11 @@
import { Alert, styled } from '@mui/material';
import { Dialogue } from 'component/common/Dialogue/Dialogue';
import { IUser } from 'interfaces/user';
import { ServiceAccountTokens } from '../ServiceAccountModal/ServiceAccountTokens/ServiceAccountTokens';

const StyledTableContainer = styled('div')(({ theme }) => ({
marginTop: theme.spacing(1.5),
}));

const StyledLabel = styled('p')(({ theme }) => ({
marginTop: theme.spacing(3),
Expand Down Expand Up @@ -34,6 +39,13 @@ export const ServiceAccountDeleteDialog = ({
Deleting this service account may break any existing
implementations currently using it.
</Alert>
<StyledLabel>Service account tokens</StyledLabel>
<StyledTableContainer>
<ServiceAccountTokens
serviceAccount={serviceAccount!}
readOnly
/>
</StyledTableContainer>
<StyledLabel>
You are about to delete service account:{' '}
<strong>{serviceAccount?.name}</strong>
Expand Down
Expand Up @@ -105,7 +105,7 @@ export const ServiceAccountTokens = ({
usePersonalAPITokensApi();

const [initialState] = useState(() => ({
sortBy: [defaultSort],
sortBy: readOnly ? [{ id: 'seenAt' }] : [defaultSort],
}));

const [searchValue, setSearchValue] = useState('');
Expand Down

0 comments on commit c244cd6

Please sign in to comment.