From bdeeec0a312644f8d5980988a159cc24fb330463 Mon Sep 17 00:00:00 2001 From: mpolotsk Date: Fri, 16 Jan 2026 15:31:58 +0100 Subject: [PATCH 1/3] fix: [UIE-10040] - IAM Delegation: Default Entity Access disable Remove button when loading --- .../RemoveAssignmentConfirmationDialog.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/manager/src/features/IAM/Shared/RemoveAssignmentConfirmationDialog/RemoveAssignmentConfirmationDialog.tsx b/packages/manager/src/features/IAM/Shared/RemoveAssignmentConfirmationDialog/RemoveAssignmentConfirmationDialog.tsx index 5dff89f0051..37438af094b 100644 --- a/packages/manager/src/features/IAM/Shared/RemoveAssignmentConfirmationDialog/RemoveAssignmentConfirmationDialog.tsx +++ b/packages/manager/src/features/IAM/Shared/RemoveAssignmentConfirmationDialog/RemoveAssignmentConfirmationDialog.tsx @@ -6,7 +6,7 @@ import { } from '@linode/queries'; import { ActionsPanel, Notice, Typography } from '@linode/ui'; import { useSnackbar } from 'notistack'; -import React from 'react'; +import React, { useState } from 'react'; import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; @@ -26,6 +26,8 @@ interface Props { export const RemoveAssignmentConfirmationDialog = (props: Props) => { const { onClose: _onClose, onSuccess, open, role, username } = props; + const [isRemoving, setIsRemoving] = useState(false); + const { isDefaultDelegationRolesForChildAccount } = useIsDefaultDelegationRolesForChildAccount(); @@ -52,6 +54,7 @@ export const RemoveAssignmentConfirmationDialog = (props: Props) => { const onClose = () => { reset(); // resets the error state of the useMutation + setIsRemoving(false); _onClose(); }; @@ -64,7 +67,9 @@ export const RemoveAssignmentConfirmationDialog = (props: Props) => { : assignedUserRoles; const onDelete = async () => { - if (!role || !assignedRoles) return; + if (!role || !assignedRoles || isRemoving) return; + + setIsRemoving(true); const { role_name, entity_id, entity_type } = role; @@ -88,14 +93,17 @@ export const RemoveAssignmentConfirmationDialog = (props: Props) => { onClose(); }; + const isLoading = isPending || isRemoving; + return ( Date: Fri, 16 Jan 2026 15:56:17 +0100 Subject: [PATCH 2/3] Added changeset: IAM Delegation: Remove button in remove assignment confirmation popup is not disabled after clicking it --- packages/manager/.changeset/pr-13290-fixed-1768575377810.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 packages/manager/.changeset/pr-13290-fixed-1768575377810.md diff --git a/packages/manager/.changeset/pr-13290-fixed-1768575377810.md b/packages/manager/.changeset/pr-13290-fixed-1768575377810.md new file mode 100644 index 00000000000..df77b80e153 --- /dev/null +++ b/packages/manager/.changeset/pr-13290-fixed-1768575377810.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Fixed +--- + +IAM Delegation: "Remove" button in remove assignment confirmation popup is not disabled after clicking it ([#13290](https://github.com/linode/manager/pull/13290)) From 8e629cb761974ea1e1779e57f9708ec757b40aeb Mon Sep 17 00:00:00 2001 From: mpolotsk Date: Thu, 22 Jan 2026 10:14:05 +0100 Subject: [PATCH 3/3] review fix --- .../RemoveAssignmentConfirmationDialog.tsx | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/packages/manager/src/features/IAM/Shared/RemoveAssignmentConfirmationDialog/RemoveAssignmentConfirmationDialog.tsx b/packages/manager/src/features/IAM/Shared/RemoveAssignmentConfirmationDialog/RemoveAssignmentConfirmationDialog.tsx index 37438af094b..abe400e6680 100644 --- a/packages/manager/src/features/IAM/Shared/RemoveAssignmentConfirmationDialog/RemoveAssignmentConfirmationDialog.tsx +++ b/packages/manager/src/features/IAM/Shared/RemoveAssignmentConfirmationDialog/RemoveAssignmentConfirmationDialog.tsx @@ -6,7 +6,7 @@ import { } from '@linode/queries'; import { ActionsPanel, Notice, Typography } from '@linode/ui'; import { useSnackbar } from 'notistack'; -import React, { useState } from 'react'; +import React from 'react'; import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; @@ -26,8 +26,6 @@ interface Props { export const RemoveAssignmentConfirmationDialog = (props: Props) => { const { onClose: _onClose, onSuccess, open, role, username } = props; - const [isRemoving, setIsRemoving] = useState(false); - const { isDefaultDelegationRolesForChildAccount } = useIsDefaultDelegationRolesForChildAccount(); @@ -35,13 +33,17 @@ export const RemoveAssignmentConfirmationDialog = (props: Props) => { const { error, - isPending, + isPending: isUserRolesPending, mutateAsync: updateUserRoles, reset, } = useUserRolesMutation(username ?? ''); - const { mutateAsync: updateDefaultDelegationRoles } = - useUpdateDefaultDelegationAccessQuery(); + const { + mutateAsync: updateDefaultDelegationRoles, + isPending: isDefaultDelegationRolesPending, + } = useUpdateDefaultDelegationAccessQuery(); + + const isPending = isUserRolesPending || isDefaultDelegationRolesPending; const { data: assignedUserRoles } = useUserRoles( username ?? '', @@ -54,7 +56,6 @@ export const RemoveAssignmentConfirmationDialog = (props: Props) => { const onClose = () => { reset(); // resets the error state of the useMutation - setIsRemoving(false); _onClose(); }; @@ -67,9 +68,7 @@ export const RemoveAssignmentConfirmationDialog = (props: Props) => { : assignedUserRoles; const onDelete = async () => { - if (!role || !assignedRoles || isRemoving) return; - - setIsRemoving(true); + if (!role || !assignedRoles || isPending) return; const { role_name, entity_id, entity_type } = role; @@ -93,17 +92,15 @@ export const RemoveAssignmentConfirmationDialog = (props: Props) => { onClose(); }; - const isLoading = isPending || isRemoving; - return (