From 01dd7e59df5472fefae95efb148f0df887f07fa1 Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Tue, 13 Aug 2024 14:18:46 -0400 Subject: [PATCH] 21898: aligned all info button behavior * set all toggleDetailsPanel calls to use passed in uuid * removed default '' param in toggleDetailsPanel that allowed the above bug to happen * removed info button from main app bar Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- .../src/store/details-panel/details-panel-action.ts | 2 +- .../context-menu/action-sets/collection-action-set.ts | 4 ++-- .../action-sets/process-resource-action-set.ts | 4 ++-- .../action-sets/search-results-action-set.ts | 4 ++-- .../action-sets/trashed-collection-action-set.ts | 4 ++-- .../context-menu/action-sets/workflow-action-set.ts | 4 ++-- .../main-content-bar/main-content-bar.tsx | 10 ---------- 7 files changed, 11 insertions(+), 21 deletions(-) diff --git a/services/workbench2/src/store/details-panel/details-panel-action.ts b/services/workbench2/src/store/details-panel/details-panel-action.ts index ca2db7217f..b41946ee3b 100644 --- a/services/workbench2/src/store/details-panel/details-panel-action.ts +++ b/services/workbench2/src/store/details-panel/details-panel-action.ts @@ -67,7 +67,7 @@ export const refreshCollectionVersionsList = (uuid: string) => ); }; -export const toggleDetailsPanel = (uuid: string = '') => (dispatch: Dispatch, getState: () => RootState) => { +export const toggleDetailsPanel = (uuid: string) => (dispatch: Dispatch, getState: () => RootState) => { const { detailsPanel }= getState() const isTargetUuidNew = uuid !== detailsPanel.resourceUuid if(isTargetUuidNew && uuid !== CLOSE_DRAWER && detailsPanel.isOpened){ diff --git a/services/workbench2/src/views-components/context-menu/action-sets/collection-action-set.ts b/services/workbench2/src/views-components/context-menu/action-sets/collection-action-set.ts index 7f8ad9e9e0..ce6695d73b 100644 --- a/services/workbench2/src/views-components/context-menu/action-sets/collection-action-set.ts +++ b/services/workbench2/src/views-components/context-menu/action-sets/collection-action-set.ts @@ -72,8 +72,8 @@ const commonActionSet: ContextMenuActionSet = [ { icon: DetailsIcon, name: ContextMenuActionNames.VIEW_DETAILS, - execute: dispatch => { - dispatch(toggleDetailsPanel()); + execute: (dispatch, resources) => { + dispatch(toggleDetailsPanel(resources[0].uuid)); }, }, { diff --git a/services/workbench2/src/views-components/context-menu/action-sets/process-resource-action-set.ts b/services/workbench2/src/views-components/context-menu/action-sets/process-resource-action-set.ts index 0203e3fe23..a291913928 100644 --- a/services/workbench2/src/views-components/context-menu/action-sets/process-resource-action-set.ts +++ b/services/workbench2/src/views-components/context-menu/action-sets/process-resource-action-set.ts @@ -65,8 +65,8 @@ export const readOnlyProcessResourceActionSet: ContextMenuActionSet = [ { icon: DetailsIcon, name: ContextMenuActionNames.VIEW_DETAILS, - execute: dispatch => { - dispatch(toggleDetailsPanel()); + execute: (dispatch, resources) => { + dispatch(toggleDetailsPanel(resources[0].uuid)); }, }, { diff --git a/services/workbench2/src/views-components/context-menu/action-sets/search-results-action-set.ts b/services/workbench2/src/views-components/context-menu/action-sets/search-results-action-set.ts index debaf2dabf..0deb8868db 100644 --- a/services/workbench2/src/views-components/context-menu/action-sets/search-results-action-set.ts +++ b/services/workbench2/src/views-components/context-menu/action-sets/search-results-action-set.ts @@ -27,8 +27,8 @@ export const searchResultsActionSet: ContextMenuActionSet = [ { icon: DetailsIcon, name: ContextMenuActionNames.VIEW_DETAILS, - execute: (dispatch) => { - dispatch(toggleDetailsPanel()); + execute: (dispatch, resources) => { + dispatch(toggleDetailsPanel(resources[0].uuid)); }, }, { diff --git a/services/workbench2/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts b/services/workbench2/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts index ea66deb683..e070ca6460 100644 --- a/services/workbench2/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts +++ b/services/workbench2/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts @@ -13,8 +13,8 @@ export const trashedCollectionActionSet: ContextMenuActionSet = [ { icon: DetailsIcon, name: ContextMenuActionNames.VIEW_DETAILS, - execute: (dispatch) => { - dispatch(toggleDetailsPanel()); + execute: (dispatch, resources) => { + dispatch(toggleDetailsPanel(resources[0].uuid)); }, }, { diff --git a/services/workbench2/src/views-components/context-menu/action-sets/workflow-action-set.ts b/services/workbench2/src/views-components/context-menu/action-sets/workflow-action-set.ts index 4e76f2aa4d..55a57b72ec 100644 --- a/services/workbench2/src/views-components/context-menu/action-sets/workflow-action-set.ts +++ b/services/workbench2/src/views-components/context-menu/action-sets/workflow-action-set.ts @@ -28,8 +28,8 @@ export const readOnlyWorkflowActionSet: ContextMenuActionSet = [ { icon: DetailsIcon, name: ContextMenuActionNames.VIEW_DETAILS, - execute: dispatch => { - dispatch(toggleDetailsPanel()); + execute: (dispatch, resources) => { + dispatch(toggleDetailsPanel(resources[0].uuid)); }, }, { diff --git a/services/workbench2/src/views-components/main-content-bar/main-content-bar.tsx b/services/workbench2/src/views-components/main-content-bar/main-content-bar.tsx index 5999b4855a..e3bf24eccd 100644 --- a/services/workbench2/src/views-components/main-content-bar/main-content-bar.tsx +++ b/services/workbench2/src/views-components/main-content-bar/main-content-bar.tsx @@ -82,15 +82,5 @@ export const MainContentBar = connect(mapStateToProps, mapDispatchToProps)(withS props.onRefreshButtonClick(props.projectUuid); }} /> - - {props.buttonVisible && - props.onDetailsPanelToggle(props.projectUuid)}> - - - } - )); -- 2.30.2