Skip to content

Commit 2340b1c

Browse files
fix: [UIE-10040] - IAM Delegation: Default Entity Access disable Remove button when loading (#13290)
* fix: [UIE-10040] - IAM Delegation: Default Entity Access disable Remove button when loading * Added changeset: IAM Delegation: Remove button in remove assignment confirmation popup is not disabled after clicking it * review fix
1 parent bdaa80c commit 2340b1c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Fixed
3+
---
4+
5+
IAM Delegation: "Remove" button in remove assignment confirmation popup is not disabled after clicking it ([#13290](https://github.com/linode/manager/pull/13290))

packages/manager/src/features/IAM/Shared/RemoveAssignmentConfirmationDialog/RemoveAssignmentConfirmationDialog.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ export const RemoveAssignmentConfirmationDialog = (props: Props) => {
3333

3434
const {
3535
error,
36-
isPending,
36+
isPending: isUserRolesPending,
3737
mutateAsync: updateUserRoles,
3838
reset,
3939
} = useUserRolesMutation(username ?? '');
4040

41-
const { mutateAsync: updateDefaultDelegationRoles } =
42-
useUpdateDefaultDelegationAccessQuery();
41+
const {
42+
mutateAsync: updateDefaultDelegationRoles,
43+
isPending: isDefaultDelegationRolesPending,
44+
} = useUpdateDefaultDelegationAccessQuery();
45+
46+
const isPending = isUserRolesPending || isDefaultDelegationRolesPending;
4347

4448
const { data: assignedUserRoles } = useUserRoles(
4549
username ?? '',
@@ -64,7 +68,7 @@ export const RemoveAssignmentConfirmationDialog = (props: Props) => {
6468
: assignedUserRoles;
6569

6670
const onDelete = async () => {
67-
if (!role || !assignedRoles) return;
71+
if (!role || !assignedRoles || isPending) return;
6872

6973
const { role_name, entity_id, entity_type } = role;
7074

@@ -96,6 +100,7 @@ export const RemoveAssignmentConfirmationDialog = (props: Props) => {
96100
label: 'Remove',
97101
loading: isPending,
98102
onClick: onDelete,
103+
disabled: isPending,
99104
}}
100105
secondaryButtonProps={{
101106
label: 'Cancel',

0 commit comments

Comments
 (0)