[arvados-workbench2] updated: 2.7.0-144-ga4257a0f

git repository hosting git at public.arvados.org
Wed Oct 11 21:05:15 UTC 2023


Summary of changes:
 src/store/context-menu/context-menu-actions.ts | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

       via  a4257a0f91ce403f09c01a89e982e5e336a0f033 (commit)
      from  4841996e3529dc42aa0cbae94389fad85bdde2f6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit a4257a0f91ce403f09c01a89e982e5e336a0f033
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Wed Oct 11 17:05:11 2023 -0400

    15768: integration tests pass locally Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/src/store/context-menu/context-menu-actions.ts b/src/store/context-menu/context-menu-actions.ts
index 71da498f..da6dac5d 100644
--- a/src/store/context-menu/context-menu-actions.ts
+++ b/src/store/context-menu/context-menu-actions.ts
@@ -23,6 +23,7 @@ import { GroupContentsResource } from "services/groups-service/groups-service";
 import { LinkResource } from "models/link";
 import { resourceIsFrozen } from "common/frozen-resources";
 import { ProjectResource } from "models/project";
+import { filterCollectionFilesBySelection } from "store/collection-panel/collection-panel-files/collection-panel-files-state";
 
 export const contextMenuActions = unionize({
     OPEN_CONTEXT_MENU: ofType<{ position: ContextMenuPosition; resource: ContextMenuResource }>(),
@@ -68,7 +69,8 @@ export const openContextMenu = (event: React.MouseEvent<HTMLElement>, resource:
 
 export const openCollectionFilesContextMenu =
     (event: React.MouseEvent<HTMLElement>, isWritable: boolean) => (dispatch: Dispatch, getState: () => RootState) => {
-        const isCollectionFileSelected = JSON.stringify(getState().collectionPanelFiles).includes('"selected":true');
+        const selectedCount = filterCollectionFilesBySelection(getState().collectionPanelFiles, true).length;
+        const multiple = selectedCount > 1;
         dispatch<any>(
             openContextMenu(event, {
                 name: "",
@@ -76,11 +78,16 @@ export const openCollectionFilesContextMenu =
                 ownerUuid: "",
                 description: "",
                 kind: ResourceKind.COLLECTION,
-                menuKind: isCollectionFileSelected
-                    ? isWritable
-                        ? ContextMenuKind.COLLECTION_FILES
-                        : ContextMenuKind.READONLY_COLLECTION_FILES
-                    : ContextMenuKind.COLLECTION_FILES_NOT_SELECTED,
+                menuKind:
+                    selectedCount > 0
+                        ? isWritable
+                            ? multiple
+                                ? ContextMenuKind.COLLECTION_FILES_MULTIPLE
+                                : ContextMenuKind.COLLECTION_FILES
+                            : multiple
+                            ? ContextMenuKind.READONLY_COLLECTION_FILES_MULTIPLE
+                            : ContextMenuKind.READONLY_COLLECTION_FILES
+                        : ContextMenuKind.COLLECTION_FILES_NOT_SELECTED,
             })
         );
     };

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list