[arvados-workbench2] updated: 2.7.1-6-g485fbd2f

git repository hosting git at public.arvados.org
Tue Dec 19 19:18:41 UTC 2023


Summary of changes:
 src/components/breadcrumbs/breadcrumbs.tsx      | 12 ++++++++----
 src/views-components/breadcrumbs/breadcrumbs.ts |  5 ++---
 2 files changed, 10 insertions(+), 7 deletions(-)

       via  485fbd2f20a94147d5a2cb533defa8c42c0abca8 (commit)
      from  4382b235020c3ac011170489fba4ce563b208dd0 (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 485fbd2f20a94147d5a2cb533defa8c42c0abca8
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Tue Dec 19 14:18:35 2023 -0500

    21128: fixed breadcrumb nav to group Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/src/components/breadcrumbs/breadcrumbs.tsx b/src/components/breadcrumbs/breadcrumbs.tsx
index baf84d1d..effcd543 100644
--- a/src/components/breadcrumbs/breadcrumbs.tsx
+++ b/src/components/breadcrumbs/breadcrumbs.tsx
@@ -9,10 +9,11 @@ import { withStyles } from '@material-ui/core';
 import { IllegalNamingWarning } from '../warning/warning';
 import { IconType, FreezeIcon } from 'components/icon/icon';
 import grey from '@material-ui/core/colors/grey';
-import { ResourcesState } from 'store/resources/resources';
+import { getResource, ResourcesState } from 'store/resources/resources';
 import classNames from 'classnames';
 import { ArvadosTheme } from 'common/custom-theme';
-
+import { GroupClass } from "models/group";
+import { navigateTo, navigateToGroupDetails } from 'store/navigation/navigation-action';
 export interface Breadcrumb {
     label: string;
     icon?: IconType;
@@ -59,7 +60,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 export interface BreadcrumbsProps {
     items: Breadcrumb[];
     resources: ResourcesState;
-    onClick: (breadcrumb: Breadcrumb) => void;
+    onClick: (navFunc: (uuid: string) => void, breadcrumb: Breadcrumb) => void;
     onContextMenu: (event: React.MouseEvent<HTMLElement>, breadcrumb: Breadcrumb) => void;
 }
 
@@ -71,6 +72,9 @@ export const Breadcrumbs = withStyles(styles)(
             const isLastItem = index === items.length - 1;
             const isFirstItem = index === 0;
             const Icon = item.icon || (() => (null));
+            const resource = getResource(item.uuid)(resources) as any;
+            const navFunc = resource && 'groupClass' in resource && resource.groupClass === GroupClass.ROLE ? navigateToGroupDetails : navigateTo;
+
             return (
                 <React.Fragment key={index}>
                     {isFirstItem ? null : <IllegalNamingWarning name={item.label} />}
@@ -90,7 +94,7 @@ export const Breadcrumbs = withStyles(styles)(
                                 label: classes.buttonLabel
                             }}
                             color="inherit"
-                            onClick={() => onClick(item)}
+                            onClick={() => onClick(navFunc, item)}
                             onContextMenu={event => onContextMenu(event, item)}>
                             <Icon className={classes.icon} />
                             <Typography
diff --git a/src/views-components/breadcrumbs/breadcrumbs.ts b/src/views-components/breadcrumbs/breadcrumbs.ts
index 0334097d..7e78aace 100644
--- a/src/views-components/breadcrumbs/breadcrumbs.ts
+++ b/src/views-components/breadcrumbs/breadcrumbs.ts
@@ -6,7 +6,6 @@ import { connect } from "react-redux";
 import { Breadcrumb, Breadcrumbs as BreadcrumbsComponent, BreadcrumbsProps } from 'components/breadcrumbs/breadcrumbs';
 import { RootState } from 'store/store';
 import { Dispatch } from 'redux';
-import { navigateTo } from 'store/navigation/navigation-action';
 import { getProperty } from '../../store/properties/properties';
 import { BREADCRUMBS } from '../../store/breadcrumbs/breadcrumbs-actions';
 import { openSidePanelContextMenu } from 'store/context-menu/context-menu-actions';
@@ -20,8 +19,8 @@ const mapStateToProps = () => ({ properties, resources }: RootState): Breadcrumb
 });
 
 const mapDispatchToProps = (dispatch: Dispatch): BreadcrumbsActionProps => ({
-    onClick: ({ uuid }: Breadcrumb) => {
-        dispatch<any>(navigateTo(uuid));
+    onClick: (navFunc, { uuid }: Breadcrumb) => {
+        dispatch<any>(navFunc(uuid));
     },
     onContextMenu: (event, breadcrumb: Breadcrumb) => {
         dispatch<any>(openSidePanelContextMenu(event, breadcrumb.uuid));

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list