Skip to content

Commit be57f9f

Browse files
chore: remove apitoken.username (#9448)
Removes usage of the deprecated API token property `username` and uses `tokenName` instead. Affected components: Token table: ![image](https://github.com/user-attachments/assets/7275e9ae-a79c-4815-9f8d-157008480b97) Token deletion dialog: ![image](https://github.com/user-attachments/assets/1c47cd3d-c7ff-4547-9779-eaba16274d1e) Environment post-clone screen (which is automatically hidden now, so it ... doesn't matter)
1 parent 143c8a3 commit be57f9f

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

frontend/src/component/common/ApiTokenTable/RemoveApiTokenButton/RemoveApiTokenButton.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ export const RemoveApiTokenButton = ({
6363
<br />
6464
<StyledUl>
6565
<li>
66-
<strong>username</strong>:{' '}
67-
<code>{token.username}</code>
66+
<strong>name</strong>:{' '}
67+
<code>{token.tokenName}</code>
6868
</li>
6969
<li>
7070
<strong>type</strong>: <code>{token.type}</code>

frontend/src/component/common/ApiTokenTable/useApiTokenTable.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const useApiTokenTable = (
3939
},
4040
{
4141
Header: 'Token name',
42-
accessor: 'username',
42+
accessor: 'tokenName',
4343
Cell: HighlightCell,
4444
minWidth: 35,
4545
},

frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentTokenDialog/EnvironmentTokenDialog.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const EnvironmentTokenDialog = ({
2929
Your new token has been created successfully.
3030
</Typography>
3131
<Typography variant='body1'>
32-
You can also find it as "<strong>{token?.username}</strong>" in the{' '}
32+
You can also find it as "<strong>{token?.tokenName}</strong>" in the{' '}
3333
<Link to='/admin/api'>API access page</Link>.
3434
</Typography>
3535
<UserToken token={token?.secret || ''} />

frontend/src/hooks/api/getters/useApiTokens/useApiTokens.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import handleErrorResponses from '../httpErrorResponseHandler';
55

66
export interface IApiToken {
77
createdAt: Date;
8-
username: string;
8+
tokenName: string;
99
secret: string;
1010
type: string;
1111
project?: string;

0 commit comments

Comments
 (0)