[arvados] updated: 2.7.0-5858-gff86da6187

git repository hosting git at public.arvados.org
Wed Feb 7 19:42:13 UTC 2024


Summary of changes:
 .../main-content-bar/main-content-bar.tsx               | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

       via  ff86da6187049aad3595e8a3b5b8bd5b079c2bbe (commit)
      from  f9921028b6031789bd0a8f9db229a79256d8dbab (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 ff86da6187049aad3595e8a3b5b8bd5b079c2bbe
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Wed Feb 7 14:42:10 2024 -0500

    21224: details button works as expected Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

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 45da54cc71..8a32eff5c8 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
@@ -35,6 +35,7 @@ interface MainContentBarProps {
     onDetailsPanelToggle: () => void;
     buttonVisible: boolean;
     projectUuid: string;
+    routeUuid: string;
 }
 
 const isButtonVisible = ({ router }: RootState) => {
@@ -54,10 +55,16 @@ const isButtonVisible = ({ router }: RootState) => {
         Routes.matchFavoritesRoute(pathname);
 };
 
-const mapStateToProps = (state: RootState) => ({
-    buttonVisible: isButtonVisible(state),
-    projectUuid: state.detailsPanel.resourceUuid,
-});
+const mapStateToProps = (state: RootState) => {
+    const currentRoute = state.router.location?.pathname.split('/') || [];
+    const routeUuid = currentRoute[currentRoute.length - 1];
+
+    return {
+        buttonVisible: isButtonVisible(state),
+        projectUuid: state.detailsPanel.resourceUuid,
+        routeUuid
+    }
+};
 
 const mapDispatchToProps = () => (dispatch: Dispatch) => ({
     onDetailsPanelToggle: (uuid: string) => dispatch<any>(toggleDetailsPanel(uuid)),
@@ -82,7 +89,7 @@ export const MainContentBar = connect(mapStateToProps, mapDispatchToProps)(withS
                     <IconButton data-cy="additional-info-icon"
                         color="inherit"
                         className={props.classes.infoTooltip}
-                        onClick={()=>props.onDetailsPanelToggle(props.projectUuid)}>
+                        onClick={()=>props.onDetailsPanelToggle(props.routeUuid)}>
                         <DetailsIcon />
                     </IconButton>
                 </Tooltip>}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list