[arvados] updated: 2.7.0-6282-g8f519cc734

git repository hosting git at public.arvados.org
Wed Apr 3 15:04:18 UTC 2024


Summary of changes:
 .../multiselect-toolbar/MultiselectToolbar.tsx     |  7 +++++--
 .../context-menu/menu-item-sort.ts                 | 23 +++++++++++++++++++++-
 2 files changed, 27 insertions(+), 3 deletions(-)

       via  8f519cc734ecd69df86dffff02f460addfa0c6e7 (commit)
      from  e7c1d657a3f6b84dc1e2fa82883d7368c3859011 (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 8f519cc734ecd69df86dffff02f460addfa0c6e7
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Wed Apr 3 11:04:14 2024 -0400

    21448: added default multiselect order Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx b/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx
index 69f5d036d6..3301b5dfe1 100644
--- a/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx
+++ b/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx
@@ -123,8 +123,11 @@ export const MultiselectToolbar = connect(
                         singleSelectedUuid === null ? action.isForMulti : true
                     );
                     
-        const actions: ContextMenuAction[] | MultiSelectMenuAction[] =
-            singleResourceKind && singleResourceKind.length ? sortMenuItems(singleResourceKind[0] as ContextMenuKind, rawActions, menuDirection.HORIZONTAL) : rawActions.sort(sortByProperty('name'));
+        const actions: ContextMenuAction[] | MultiSelectMenuAction[] = sortMenuItems(
+            singleResourceKind && singleResourceKind.length ? (singleResourceKind[0] as ContextMenuKind) : ContextMenuKind.MULTI,
+            rawActions,
+            menuDirection.HORIZONTAL
+        ); 
 
         return (
             <React.Fragment>
diff --git a/services/workbench2/src/views-components/context-menu/menu-item-sort.ts b/services/workbench2/src/views-components/context-menu/menu-item-sort.ts
index 17c3ba7c5f..1f7c61fa15 100644
--- a/services/workbench2/src/views-components/context-menu/menu-item-sort.ts
+++ b/services/workbench2/src/views-components/context-menu/menu-item-sort.ts
@@ -6,6 +6,7 @@ import { ContextMenuAction } from './context-menu-action-set';
 import { ContextMenuActionNames } from 'views-components/context-menu/context-menu-action-set';
 import { sortByProperty } from 'common/array-utils';
 import { horizontalMenuDivider, verticalMenuDivider } from './actions/context-menu-divider';
+import { MultiSelectMenuAction } from 'views-components/multiselect-toolbar/ms-menu-actions';
 
 export enum ContextMenuKind {
     API_CLIENT_AUTHORIZATION = "ApiClientAuthorization",
@@ -53,6 +54,7 @@ export enum ContextMenuKind {
     WORKFLOW = "Workflow",
     READONLY_WORKFLOW = "ReadOnlyWorkflow",
     SEARCH_RESULTS = "SearchResults",
+    MULTI = "Multi",
 }
 
 
@@ -117,7 +119,26 @@ const workflowOrder = [
     ContextMenuActionNames.DELETE_WORKFLOW,
 ]
 
+const defaultMultiOrder = [
+    ContextMenuActionNames.VIEW_DETAILS,
+    ContextMenuActionNames.OPEN_IN_NEW_TAB,
+    ContextMenuActionNames.COPY_LINK_TO_CLIPBOARD,
+    ContextMenuActionNames.OPEN_WITH_3RD_PARTY_CLIENT,
+    ContextMenuActionNames.API_DETAILS,
+    ContextMenuActionNames.SHARE,
+    ContextMenuActionNames.NEW_PROJECT,
+    ContextMenuActionNames.EDIT_PROJECT,
+    ContextMenuActionNames.MOVE_TO,
+    ContextMenuActionNames.MAKE_A_COPY,
+    ContextMenuActionNames.MOVE_TO_TRASH,
+    ContextMenuActionNames.FREEZE_PROJECT,
+    ContextMenuActionNames.ADD_TO_FAVORITES,
+    ContextMenuActionNames.ADD_TO_PUBLIC_FAVORITES,
+];
+
 const kindToOrder: Record<string, ContextMenuActionNames[]> = {
+    [ContextMenuKind.MULTI]: defaultMultiOrder,
+
     [ContextMenuKind.PROCESS]: processOrder,
     [ContextMenuKind.PROCESS_ADMIN]: processOrder,
     [ContextMenuKind.PROCESS_RESOURCE]: processOrder,
@@ -143,7 +164,7 @@ export const menuDirection = {
     HORIZONTAL: 'horizontal'
 }
 
-export const sortMenuItems = (menuKind: ContextMenuKind, menuItems: ContextMenuAction[], orthagonality: string): ContextMenuAction[] => {
+export const sortMenuItems = (menuKind: ContextMenuKind, menuItems: ContextMenuAction[], orthagonality: string): ContextMenuAction[] | MultiSelectMenuAction[] => {
 
     const preferredOrder = kindToOrder[menuKind];
     //if no specified order, sort by name

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list