From 0198b267921c890d624d4a16b81a334f86ca366d Mon Sep 17 00:00:00 2001 From: Sharon Gratch Date: Tue, 12 Sep 2023 16:52:28 +0300 Subject: [PATCH] Rerender the Mapping actions dropdown when permissions are changed This fixes a bug of Mappings actions dropdown menu options that are always disabled. As a followup for https://github.com/kubev2v/forklift-console-plugin/pull/636, we now need to re-render the Storage/Network Mappings actions dropdown menu once the user's permissions are changed. The root cause is that since the user's access permissions are set to false at loading till it is synced, the menu options are disabled at start and need to be re-rendered once the data is synced. Signed-off-by: Sharon Gratch --- .../src/components/mappings/mappingActions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/forklift-console-plugin/src/components/mappings/mappingActions.tsx b/packages/forklift-console-plugin/src/components/mappings/mappingActions.tsx index 2e475c8c8..c77c1b0a9 100644 --- a/packages/forklift-console-plugin/src/components/mappings/mappingActions.tsx +++ b/packages/forklift-console-plugin/src/components/mappings/mappingActions.tsx @@ -65,7 +65,7 @@ export function useMappingActions({ disabledTooltip: t('Managed mappings can not be deleted'), }, ], - [t, resourceData], + [t, resourceData, canPatch, canDelete], ); return [actions, true, undefined];