fix(account): enable add access token button EE-7059 (#11745)

pull/11604/merge
Dakota Walsh 2024-05-08 17:07:44 -04:00 committed by GitHub
parent 5a5a10821d
commit 4ef71f4aca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 12 deletions

View File

@ -26,7 +26,8 @@ export const accountModule = angular
)
.component(
'accessTokensDatatable',
r2a(withUIRouter(withReactQuery(withCurrentUser(AccessTokensDatatable))), [
'canExit',
])
r2a(
withUIRouter(withReactQuery(withCurrentUser(AccessTokensDatatable))),
[]
)
).name;

View File

@ -12,7 +12,7 @@ import { TableActions } from './TableActions';
const tableKey = 'access-tokens';
const store = createPersistedStore(tableKey);
export function AccessTokensDatatable({ canExit }: { canExit?: boolean }) {
export function AccessTokensDatatable() {
const query = useAccessTokens();
const tableState = useTableState(store, tableKey);
@ -25,7 +25,7 @@ export function AccessTokensDatatable({ canExit }: { canExit?: boolean }) {
title="Access tokens"
titleIcon={Key}
renderTableActions={(selectedItems) => (
<TableActions selectedItems={selectedItems} canExit={canExit} />
<TableActions selectedItems={selectedItems} />
)}
data-cy="access-tokens-datatable"
/>

View File

@ -9,10 +9,8 @@ import { useDeleteAccessTokensMutation } from './useDeleteAccessTokensMutation';
export function TableActions({
selectedItems,
canExit,
}: {
selectedItems: AccessToken[];
canExit?: boolean;
}) {
const deleteMutation = useDeleteAccessTokensMutation();
@ -25,11 +23,7 @@ export function TableActions({
data-cy="access-tokens-delete-button"
/>
<AddButton
to=".new-access-token"
disabled={!canExit}
data-cy="access-tokens-add-button"
>
<AddButton to=".new-access-token" data-cy="access-tokens-add-button">
Add access token
</AddButton>
</>