21846: applied select to context menu open 21846-rightclick-context-menu
authorLisa Knox <lisa.knox@curii.com>
Wed, 12 Jun 2024 18:18:35 +0000 (14:18 -0400)
committerLisa Knox <lisa.knox@curii.com>
Wed, 12 Jun 2024 18:18:35 +0000 (14:18 -0400)
Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii.com>

services/workbench2/src/store/context-menu/context-menu-actions.ts
services/workbench2/src/views-components/context-menu/action-sets/project-action-set.ts

index 4c31fa4e94b3878631ecadda72b0b832c3e97298..7a640cc20ac7ea6a2000a56c92589c9389a4b004 100644 (file)
@@ -25,6 +25,7 @@ import { resourceIsFrozen } from "common/frozen-resources";
 import { ProjectResource } from "models/project";
 import { getProcess } from "store/processes/process";
 import { filterCollectionFilesBySelection } from "store/collection-panel/collection-panel-files/collection-panel-files-state";
+import { selectOne, deselectAllOthers } from "store/multiselect/multiselect-actions";
 
 export const contextMenuActions = unionize({
     OPEN_CONTEXT_MENU: ofType<{ position: ContextMenuPosition; resource: ContextMenuResource }>(),
@@ -56,6 +57,8 @@ export const isKeyboardClick = (event: React.MouseEvent<HTMLElement>) => event.n
 
 export const openContextMenu = (event: React.MouseEvent<HTMLElement>, resource: ContextMenuResource) => (dispatch: Dispatch) => {
     event.preventDefault();
+    dispatch<any>(selectOne(resource.uuid));
+    dispatch<any>(deselectAllOthers(resource.uuid));
     const { left, top } = event.currentTarget.getBoundingClientRect();
     dispatch(
         contextMenuActions.OPEN_CONTEXT_MENU({
index 8ef968eea9a4025eb10f3f349001898b42be15d8..8098262ec12e0f0a76ce5ab0c6d482b69714a27b 100644 (file)
@@ -50,8 +50,8 @@ export const copyToClipboardMenuAction = {
 export const viewDetailsAction = {
     icon: DetailsIcon,
     name: ContextMenuActionNames.VIEW_DETAILS,
-    execute: dispatch => {
-        dispatch(toggleDetailsPanel());
+    execute: (dispatch, resources) => {
+        dispatch(toggleDetailsPanel(resources[0].uuid));
     },
 };