From 768925d22d08c71b80237446f7285c903bfa8492 Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Thu, 31 Oct 2024 13:22:42 -0400 Subject: [PATCH] 22235: removed unfreeze from manageable_project in toolbar Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- .../context-menu/context-menu-action-set.ts | 1 + .../ms-project-action-set.ts | 23 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/services/workbench2/src/views-components/context-menu/context-menu-action-set.ts b/services/workbench2/src/views-components/context-menu/context-menu-action-set.ts index e99f1d43a6..0f021f02ec 100644 --- a/services/workbench2/src/views-components/context-menu/context-menu-action-set.ts +++ b/services/workbench2/src/views-components/context-menu/context-menu-action-set.ts @@ -33,6 +33,7 @@ export enum ContextMenuActionNames { EDIT_PROCESS = 'Edit process', EDIT_PROJECT = 'Edit project', FREEZE_PROJECT = 'Freeze project', + FREEZE_MANAGEABLE_PROJECT = 'Freeze project ', HOME_PROJECT = 'Home project', LOGIN_AS_USER = 'Login as user', MAKE_A_COPY = 'Make a copy', diff --git a/services/workbench2/src/views-components/multiselect-toolbar/ms-project-action-set.ts b/services/workbench2/src/views-components/multiselect-toolbar/ms-project-action-set.ts index 81805cf687..e7337a6e93 100644 --- a/services/workbench2/src/views-components/multiselect-toolbar/ms-project-action-set.ts +++ b/services/workbench2/src/views-components/multiselect-toolbar/ms-project-action-set.ts @@ -38,6 +38,7 @@ const { MOVE_TO, MOVE_TO_TRASH, FREEZE_PROJECT, + FREEZE_MANAGEABLE_PROJECT, NEW_PROJECT, } = ContextMenuActionNames; @@ -127,6 +128,25 @@ const msFreezeProjectAction: MultiSelectMenuAction = { }, }; +const msFreezeManageableProjectAction: MultiSelectMenuAction = { + name: FREEZE_MANAGEABLE_PROJECT, + icon: FreezeIcon, + hasAlts: true, + altName: 'Unfreeze Project', + altIcon: UnfreezeIcon, + isForMulti: false, + useAlts: (uuid, iconProps) => { + return uuid ? !!(getResource(uuid)(iconProps.resources) as any).frozenByUuid : false; + }, + execute: (dispatch, resources) => { + if ((resources[0] as any).isFrozen) { + dispatch(unfreezeProject(resources[0].uuid)); + } else { + dispatch(freezeProject(resources[0].uuid)); + } + }, +}; + const msNewProjectAction: MultiSelectMenuAction = { name: NEW_PROJECT, icon: NewProjectIcon, @@ -159,6 +179,7 @@ export const msProjectActionSet: MultiSelectMenuActionSet = [ msCopyToClipboardMenuAction, msShareAction, msCopyUuid, + msFreezeManageableProjectAction, ], ]; @@ -183,4 +204,4 @@ export const msAdminFrozenProjectActionFilter = new Set([ADD_TO_FAVORITE export const msWriteableProjectActionFilter = new Set([ADD_TO_FAVORITES, API_DETAILS, COPY_LINK_TO_CLIPBOARD, COPY_UUID, OPEN_IN_NEW_TAB, OPEN_WITH_3RD_PARTY_CLIENT, VIEW_DETAILS,MOVE_TO_TRASH, EDIT_PROJECT, MOVE_TO, NEW_PROJECT]) export const msFilterGroupActionFilter = new Set([ADD_TO_FAVORITES, API_DETAILS, COPY_LINK_TO_CLIPBOARD, COPY_UUID, OPEN_IN_NEW_TAB, OPEN_WITH_3RD_PARTY_CLIENT, VIEW_DETAILS, SHARE, MOVE_TO_TRASH, EDIT_PROJECT, MOVE_TO]) export const msAdminFilterGroupActionFilter = new Set([ADD_TO_FAVORITES, API_DETAILS, COPY_LINK_TO_CLIPBOARD, COPY_UUID, OPEN_IN_NEW_TAB, OPEN_WITH_3RD_PARTY_CLIENT, VIEW_DETAILS, SHARE, MOVE_TO_TRASH, EDIT_PROJECT, MOVE_TO, ADD_TO_PUBLIC_FAVORITES]) -export const msManageableProjectActionFilter = new Set([ADD_TO_FAVORITES, API_DETAILS, COPY_LINK_TO_CLIPBOARD, COPY_UUID, OPEN_IN_NEW_TAB, OPEN_WITH_3RD_PARTY_CLIENT, VIEW_DETAILS, SHARE, FREEZE_PROJECT]) +export const msManageableProjectActionFilter = new Set([ADD_TO_FAVORITES, API_DETAILS, COPY_LINK_TO_CLIPBOARD, COPY_UUID, OPEN_IN_NEW_TAB, OPEN_WITH_3RD_PARTY_CLIENT, VIEW_DETAILS, SHARE, FREEZE_MANAGEABLE_PROJECT]) -- 2.30.2