[arvados-workbench2] updated: 2.4.0-366-gd8c25895

git repository hosting git at public.arvados.org
Mon Dec 19 15:13:20 UTC 2022


Summary of changes:
 src/store/breadcrumbs/breadcrumbs-actions.ts       | 25 ++++++++++++++++++----
 .../side-panel-tree/side-panel-tree.tsx            |  2 +-
 2 files changed, 22 insertions(+), 5 deletions(-)

       via  d8c258955c1cd26ace902639dfb0bc3f0f489e5d (commit)
      from  59c625e23ea98288ed11674f6218b998fc807307 (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 d8c258955c1cd26ace902639dfb0bc3f0f489e5d
Author: Stephen Smith <stephen at curii.com>
Date:   Mon Dec 19 10:12:55 2022 -0500

    19504: Add side panel category icons to first breadcrumb items
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/store/breadcrumbs/breadcrumbs-actions.ts b/src/store/breadcrumbs/breadcrumbs-actions.ts
index d23bd3cd..74cfde00 100644
--- a/src/store/breadcrumbs/breadcrumbs-actions.ts
+++ b/src/store/breadcrumbs/breadcrumbs-actions.ts
@@ -24,6 +24,7 @@ import { Breadcrumb } from 'components/breadcrumbs/breadcrumbs';
 import { ContainerRequestResource, containerRequestFieldsNoMounts } from 'models/container-request';
 import { CollectionIcon, IconType, ProcessIcon, ProjectIcon } from 'components/icon/icon';
 import { CollectionResource } from 'models/collection';
+import { getSidePanelIcon } from 'views-components/side-panel-tree/side-panel-tree';
 
 export const BREADCRUMBS = 'breadcrumbs';
 
@@ -57,7 +58,11 @@ const getSidePanelTreeBreadcrumbs = (uuid: string) => (treePicker: TreePicker):
     const nodes = getSidePanelTreeBranch(uuid)(treePicker);
     return nodes.map(node =>
         typeof node.value === 'string'
-            ? { label: node.value, uuid: node.id }
+            ? {
+                label: node.value,
+                uuid: node.id,
+                icon: getSidePanelIcon(node.value)
+            }
             : resourceToBreadcrumb(node.value));
 };
 
@@ -100,7 +105,11 @@ export const setCategoryBreadcrumbs = (uuid: string, category: string) =>
         const ancestors = await services.ancestorsService.ancestors(uuid, '');
         dispatch(updateResources(ancestors));
         const initialBreadcrumbs: Breadcrumb[] = [
-            { label: category, uuid: category }
+            {
+                label: category,
+                uuid: category,
+                icon: getSidePanelIcon(category)
+            }
         ];
         const { collectionPanel: { item } } = getState();
         const path = getState().router.location!.pathname;
@@ -192,7 +201,11 @@ export const setProcessBreadcrumbs = (processUuid: string) =>
     };
 
 export const setGroupsBreadcrumbs = () =>
-    setBreadcrumbs([{ label: SidePanelTreeCategory.GROUPS }]);
+    setBreadcrumbs([{
+        label: SidePanelTreeCategory.GROUPS,
+        uuid: SidePanelTreeCategory.GROUPS,
+        icon: getSidePanelIcon(SidePanelTreeCategory.GROUPS)
+    }]);
 
 export const setGroupDetailsBreadcrumbs = (groupUuid: string) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
@@ -200,7 +213,11 @@ export const setGroupDetailsBreadcrumbs = (groupUuid: string) =>
         const group = getResource<GroupResource>(groupUuid)(getState().resources);
 
         const breadcrumbs: Breadcrumb[] = [
-            { label: SidePanelTreeCategory.GROUPS, uuid: SidePanelTreeCategory.GROUPS },
+            {
+                label: SidePanelTreeCategory.GROUPS,
+                uuid: SidePanelTreeCategory.GROUPS,
+                icon: getSidePanelIcon(SidePanelTreeCategory.GROUPS)
+            },
             { label: group ? group.name : (await services.groupsService.get(groupUuid)).name, uuid: groupUuid },
         ];
 
diff --git a/src/views-components/side-panel-tree/side-panel-tree.tsx b/src/views-components/side-panel-tree/side-panel-tree.tsx
index c7e33767..de271203 100644
--- a/src/views-components/side-panel-tree/side-panel-tree.tsx
+++ b/src/views-components/side-panel-tree/side-panel-tree.tsx
@@ -65,7 +65,7 @@ const getProjectPickerIcon = (item: TreeItem<ProjectResource | string>) =>
             ? FilterGroupIcon
             : ProjectIcon;
 
-const getSidePanelIcon = (category: string) => {
+export const getSidePanelIcon = (category: string) => {
     switch (category) {
         case SidePanelTreeCategory.FAVORITES:
             return FavoriteIcon;

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list