[arvados] updated: 2.7.0-5835-gbd9d5de766

git repository hosting git at public.arvados.org
Fri Jan 19 19:53:51 UTC 2024


Summary of changes:
 .../store/details-panel/details-panel-action.ts    | 29 +++++++++++--------
 .../main-content-bar/main-content-bar.tsx          | 33 +---------------------
 .../multiselect-toolbar/ms-menu-actions.ts         |  4 +--
 .../project-details-card/project-details-card.tsx  |  3 +-
 4 files changed, 22 insertions(+), 47 deletions(-)

       via  bd9d5de7661670a0e812f70555f33ce7da7be799 (commit)
      from  9ab5ebde9c712235950a1be05a37ed6bf7b7dc2f (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 bd9d5de7661670a0e812f70555f33ce7da7be799
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Fri Jan 19 14:53:45 2024 -0500

    21224: removed info button and rebuilt functionality to govern details panel Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/services/workbench2/src/store/details-panel/details-panel-action.ts b/services/workbench2/src/store/details-panel/details-panel-action.ts
index e14c70ace7..bdfeaa18c1 100644
--- a/services/workbench2/src/store/details-panel/details-panel-action.ts
+++ b/services/workbench2/src/store/details-panel/details-panel-action.ts
@@ -66,20 +66,27 @@ export const refreshCollectionVersionsList = (uuid: string) =>
         );
     };
 
-export const toggleDetailsPanel = () => (dispatch: Dispatch, getState: () => RootState) => {
+export const toggleDetailsPanel = (uuid: string = '') => (dispatch: Dispatch, getState: () => RootState) => {
+    const { detailsPanel, router }= getState()
+    const currentRoute = router.location?.pathname.split('/') || [];
+    const currentItemUuid = currentRoute[currentRoute.length - 1];
     // because of material-ui issue resizing details panel breaks tabs.
     // triggering window resize event fixes that.
-    setTimeout(() => {
-        window.dispatchEvent(new Event('resize'));
-    }, SLIDE_TIMEOUT);
-    startDetailsPanelTransition(dispatch)
-    dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
-    if (getState().detailsPanel.isOpened) {
-        dispatch<any>(loadDetailsPanel(getState().detailsPanel.resourceUuid));
+    if(uuid !== detailsPanel.resourceUuid  && (detailsPanel.isOpened || uuid === currentItemUuid)){
+        dispatch<any>(loadDetailsPanel(uuid));
+    } else {
+        setTimeout(() => {
+            window.dispatchEvent(new Event('resize'));
+        }, SLIDE_TIMEOUT);
+        startDetailsPanelTransition(dispatch)
+        dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
+        if (getState().detailsPanel.isOpened) {
+            dispatch<any>(loadDetailsPanel(getState().detailsPanel.resourceUuid));
+        }
     }
-};
-
-const startDetailsPanelTransition = (dispatch) => {
+    };
+    
+    const startDetailsPanelTransition = (dispatch) => {
         dispatch(detailsPanelActions.START_TRANSITION())
     setTimeout(() => {
         dispatch(detailsPanelActions.END_TRANSITION())
diff --git a/services/workbench2/src/views-components/main-content-bar/main-content-bar.tsx b/services/workbench2/src/views-components/main-content-bar/main-content-bar.tsx
index 3f4de301f2..c014c14cca 100644
--- a/services/workbench2/src/views-components/main-content-bar/main-content-bar.tsx
+++ b/services/workbench2/src/views-components/main-content-bar/main-content-bar.tsx
@@ -4,12 +4,10 @@
 
 import React from "react";
 
-import { Toolbar, StyleRulesCallback, IconButton, Tooltip, Grid, WithStyles, withStyles } from "@material-ui/core";
-import { DetailsIcon } from "components/icon/icon";
+import { Toolbar, StyleRulesCallback, Grid, WithStyles, withStyles } from "@material-ui/core";
 import { Breadcrumbs } from "views-components/breadcrumbs/breadcrumbs";
 import { connect } from 'react-redux';
 import { RootState } from 'store/store';
-import * as Routes from 'routes/routes';
 import { toggleDetailsPanel } from 'store/details-panel/details-panel-action';
 import RefreshButton from "components/refresh-button/refresh-button";
 import { loadSidePanelTreeProjects } from "store/side-panel-tree/side-panel-tree-actions";
@@ -33,28 +31,9 @@ const styles: StyleRulesCallback<CssRules> = theme => ({
 interface MainContentBarProps {
     onRefreshPage: () => void;
     onDetailsPanelToggle: () => void;
-    buttonVisible: boolean;
 }
 
-const isButtonVisible = ({ router }: RootState) => {
-    const pathname = router.location ? router.location.pathname : '';
-    return Routes.matchCollectionsContentAddressRoute(pathname) ||
-        Routes.matchPublicFavoritesRoute(pathname) ||
-        Routes.matchGroupDetailsRoute(pathname) ||
-        Routes.matchGroupsRoute(pathname) ||
-        Routes.matchUsersRoute(pathname) ||
-        Routes.matchSearchResultsRoute(pathname) ||
-        Routes.matchSharedWithMeRoute(pathname) ||
-        Routes.matchProcessRoute(pathname) ||
-        Routes.matchCollectionRoute(pathname) ||
-        Routes.matchProjectRoute(pathname) ||
-        Routes.matchAllProcessesRoute(pathname) ||
-        Routes.matchTrashRoute(pathname) ||
-        Routes.matchFavoritesRoute(pathname);
-};
-
 const mapStateToProps = (state: RootState) => ({
-    buttonVisible: isButtonVisible(state),
     projectUuid: state.detailsPanel.resourceUuid,
 });
 
@@ -76,15 +55,5 @@ export const MainContentBar = connect(mapStateToProps, mapDispatchToProps)(withS
                     props.onRefreshButtonClick(props.projectUuid);
                 }} />
             </Grid>
-            <Grid item>
-                {props.buttonVisible && <Tooltip title="Additional Info">
-                    <IconButton data-cy="additional-info-icon"
-                        color="inherit"
-                        className={props.classes.infoTooltip}
-                        onClick={props.onDetailsPanelToggle}>
-                        <DetailsIcon />
-                    </IconButton>
-                </Tooltip>}
-            </Grid>
         </Grid></Toolbar>
 ));
diff --git a/services/workbench2/src/views-components/multiselect-toolbar/ms-menu-actions.ts b/services/workbench2/src/views-components/multiselect-toolbar/ms-menu-actions.ts
index 91e96d9bfb..91ad96ce4b 100644
--- a/services/workbench2/src/views-components/multiselect-toolbar/ms-menu-actions.ts
+++ b/services/workbench2/src/views-components/multiselect-toolbar/ms-menu-actions.ts
@@ -92,8 +92,8 @@ const msViewDetailsAction: MultiSelectMenuAction  = {
     icon: DetailsIcon,
     hasAlts: false,
     isForMulti: false,
-    execute: (dispatch) => {
-        dispatch<any>(toggleDetailsPanel());
+    execute: (dispatch, resources) => {
+        dispatch<any>(toggleDetailsPanel(resources[0].uuid));
     },
 };
 
diff --git a/services/workbench2/src/views-components/project-details-card/project-details-card.tsx b/services/workbench2/src/views-components/project-details-card/project-details-card.tsx
index d9db66d634..de4376ac4e 100644
--- a/services/workbench2/src/views-components/project-details-card/project-details-card.tsx
+++ b/services/workbench2/src/views-components/project-details-card/project-details-card.tsx
@@ -161,9 +161,8 @@ export const ProjectDetailsCard = connect(mapStateToProps)(
                     <section className={classes.chipsection}>
                         <Typography
                             component='div'
-                            // className={classes.attribute}
                         >
-                            {Object.keys(currentResource.properties).map((k) =>
+                            {typeof currentResource.properties === 'object' && Object.keys(currentResource.properties).map((k) =>
                                 Array.isArray(currentResource.properties[k])
                                     ? currentResource.properties[k].map((v: string) => getPropertyChip(k, v, undefined, classes.tag))
                                     : getPropertyChip(k, currentResource.properties[k], undefined, classes.tag)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list