[arvados] updated: 2.7.0-6061-g894deddbed

git repository hosting git at public.arvados.org
Fri Mar 22 15:13:46 UTC 2024


Summary of changes:
 .../store/selected-resource/selected-resource-actions.ts |  4 ++--
 .../src/views-components/data-explorer/data-explorer.tsx |  2 +-
 .../src/views-components/details-panel/details-data.tsx  |  2 --
 .../src/views-components/details-panel/details-panel.tsx | 16 ++++++++++------
 .../details-panel/root-project-details.tsx               |  5 +++--
 .../views-components/side-panel-tree/side-panel-tree.tsx |  3 +++
 .../workbench2/src/views/main-panel/main-panel-root.tsx  |  4 +++-
 7 files changed, 22 insertions(+), 14 deletions(-)

       via  894deddbed7f00569ec2fb6d35d5709888b22608 (commit)
      from  a61470255b4874196825dd1a69f1e3d01022ed72 (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 894deddbed7f00569ec2fb6d35d5709888b22608
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Fri Mar 22 11:13:36 2024 -0400

    21224: details panel switches display reliably Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/services/workbench2/src/store/selected-resource/selected-resource-actions.ts b/services/workbench2/src/store/selected-resource/selected-resource-actions.ts
index 0c72cedf82..36f92224b3 100644
--- a/services/workbench2/src/store/selected-resource/selected-resource-actions.ts
+++ b/services/workbench2/src/store/selected-resource/selected-resource-actions.ts
@@ -8,10 +8,10 @@ export const selectedResourceActions = {
 
 type SelectedResourceAction = {
     type: string;
-    payload: string;
+    payload: string | null;
 };
 
-export const setSelectedResourceUuid = (resourceUuid: string): SelectedResourceAction => ({
+export const setSelectedResourceUuid = (resourceUuid: string | null): SelectedResourceAction => ({
     type: selectedResourceActions.SET_SELECTED_RESOURCE,
     payload: resourceUuid
 });
diff --git a/services/workbench2/src/views-components/data-explorer/data-explorer.tsx b/services/workbench2/src/views-components/data-explorer/data-explorer.tsx
index aa5040b3f4..1b62c8dc5d 100644
--- a/services/workbench2/src/views-components/data-explorer/data-explorer.tsx
+++ b/services/workbench2/src/views-components/data-explorer/data-explorer.tsx
@@ -84,7 +84,7 @@ const mapDispatchToProps = () => {
             dispatch<any>(setCheckedListOnStore(checkedList));
         },
 
-        setSelectedUuid: (uuid: string) => {
+        setSelectedUuid: (uuid: string | null) => {
             dispatch<any>(setSelectedResourceUuid(uuid));
         },
         
diff --git a/services/workbench2/src/views-components/details-panel/details-data.tsx b/services/workbench2/src/views-components/details-panel/details-data.tsx
index 83ec4ff6cb..bcca325c01 100644
--- a/services/workbench2/src/views-components/details-panel/details-data.tsx
+++ b/services/workbench2/src/views-components/details-panel/details-data.tsx
@@ -4,7 +4,6 @@
 
 import React from 'react';
 import { DetailsResource } from "models/details";
-import { ResourceKind } from 'models/resource';
 
 interface GetDetailsParams {
   tabNr?: number
@@ -15,7 +14,6 @@ export abstract class DetailsData<T extends DetailsResource = DetailsResource> {
     constructor(protected item: T) { }
 
     getTitle(): string {
-        if((this.item as any).kind === ResourceKind.USER) return 'Home Projects'
         return this.item.name || 'Projects';
     }
 
diff --git a/services/workbench2/src/views-components/details-panel/details-panel.tsx b/services/workbench2/src/views-components/details-panel/details-panel.tsx
index 0c77281a79..05fe53af6e 100644
--- a/services/workbench2/src/views-components/details-panel/details-panel.tsx
+++ b/services/workbench2/src/views-components/details-panel/details-panel.tsx
@@ -66,7 +66,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 
 const EMPTY_RESOURCE: EmptyResource = { kind: undefined, name: 'Projects' };
 
-const getItem = (res: DetailsResource): DetailsData => {
+const getItem = (res: DetailsResource, pathName: string): DetailsData => {
     if ('kind' in res) {
         switch (res.kind) {
             case ResourceKind.PROJECT:
@@ -78,16 +78,18 @@ const getItem = (res: DetailsResource): DetailsData => {
             case ResourceKind.WORKFLOW:
                 return new WorkflowDetails(res);
             case ResourceKind.USER:
-                return new RootProjectDetails(res);
+                if(pathName.includes('projects')) {
+                    return new RootProjectDetails(res);
+                }
             default:
-                return new EmptyDetails(res);
+                return new EmptyDetails(res as EmptyResource);
         }
     } else {
         return new FileDetails(res);
     }
 };
 
-const mapStateToProps = ({ auth, detailsPanel, resources, collectionPanelFiles, selectedResourceUuid, properties }: RootState) => {
+const mapStateToProps = ({ auth, detailsPanel, resources, collectionPanelFiles, selectedResourceUuid, properties, router }: RootState) => {
     const resource = getResource(selectedResourceUuid ?? properties.currentRouteUuid)(resources) as DetailsResource | undefined;
     const file = resource
         ? undefined
@@ -104,6 +106,7 @@ const mapStateToProps = ({ auth, detailsPanel, resources, collectionPanelFiles,
         isOpened: detailsPanel.isOpened,
         tabNr: detailsPanel.tabNr,
         res: resource || (file && file.value) || EMPTY_RESOURCE,
+        pathname: router.location ? router.location.pathname : "",
     };
 };
 
@@ -124,6 +127,7 @@ export interface DetailsPanelDataProps {
     tabNr: number;
     res: DetailsResource;
     isFrozen: boolean;
+    pathname: string;
 }
 
 type DetailsPanelProps = DetailsPanelDataProps & WithStyles<CssRules>;
@@ -163,7 +167,7 @@ export const DetailsPanel = withStyles(styles)(
             }
 
             renderContent() {
-                const { classes, onCloseDrawer, res, tabNr, authConfig } = this.props;
+                const { classes, onCloseDrawer, res, tabNr, authConfig, pathname } = this.props;
                 let shouldShowInlinePreview = false;
                 if (!('kind' in res)) {
                     shouldShowInlinePreview = isInlineFileUrlSafe(
@@ -173,7 +177,7 @@ export const DetailsPanel = withStyles(styles)(
                     ) || authConfig.clusterConfig.Collections.TrustAllContent;
                 }
 
-                const item = getItem(res);
+                const item = getItem(res, pathname);
                 return <Grid
                     data-cy='details-panel'
                     container
diff --git a/services/workbench2/src/views-components/details-panel/root-project-details.tsx b/services/workbench2/src/views-components/details-panel/root-project-details.tsx
index 1a0446bbe9..58c046b68f 100644
--- a/services/workbench2/src/views-components/details-panel/root-project-details.tsx
+++ b/services/workbench2/src/views-components/details-panel/root-project-details.tsx
@@ -15,6 +15,7 @@ import { openProjectUpdateDialog, ProjectUpdateFormDialogData } from 'store/proj
 import { RootState } from 'store/store';
 import { ResourcesState } from 'store/resources/resources';
 import { UserResource } from 'models/user';
+import { UserResourceFullName } from 'views-components/data-explorer/renderers';
 
 export class RootProjectDetails extends DetailsData<UserResource> {
     getIcon(className?: string) {
@@ -22,7 +23,6 @@ export class RootProjectDetails extends DetailsData<UserResource> {
     }
 
     getDetails() {
-      console.log('RootProjectDetails getDetails', this.item);
         return <RootProjectDetailsComponent rootProject={this.item} />;
     }
 }
@@ -66,7 +66,8 @@ const RootProjectDetailsComponent = connect(mapStateToProps, mapDispatchToProps)
     withStyles(styles)(
         ({ rootProject}: RootProjectDetailsComponentProps & { resources: ResourcesState }) => <div>
             <DetailsAttribute label='Type' value="Root Project" />
-            <DetailsAttribute label='User' value={rootProject.fullName} />
+            <DetailsAttribute label='User' />
+            <UserResourceFullName uuid={rootProject.uuid} link={true} />
             <DetailsAttribute label='Created at' value={formatDate(rootProject.createdAt)} />
             <DetailsAttribute label='UUID' linkToUuid={rootProject.uuid} value={rootProject.uuid} />
         </div>
diff --git a/services/workbench2/src/views-components/side-panel-tree/side-panel-tree.tsx b/services/workbench2/src/views-components/side-panel-tree/side-panel-tree.tsx
index f338687de9..cc1b57da48 100644
--- a/services/workbench2/src/views-components/side-panel-tree/side-panel-tree.tsx
+++ b/services/workbench2/src/views-components/side-panel-tree/side-panel-tree.tsx
@@ -16,6 +16,7 @@ import { noop } from 'lodash';
 import { ResourceKind } from "models/resource";
 import { IllegalNamingWarning } from "components/warning/warning";
 import { GroupClass } from "models/group";
+import { setSelectedResourceUuid } from "store/selected-resource/selected-resource-actions";
 
 export interface SidePanelTreeProps {
     onItemActivation: (id: string) => void;
@@ -32,6 +33,8 @@ const mapDispatchToProps = (dispatch: Dispatch, props: SidePanelTreeProps): Side
     },
     toggleItemActive: (_, { id }) => {
         dispatch<any>(activateSidePanelTreeItem(id));
+        const isSidePanelCat = Object.values(SidePanelTreeCategory).includes(id as SidePanelTreeCategory);
+        dispatch<any>(setSelectedResourceUuid(isSidePanelCat ? null : id));
         props.onItemActivation(id);
     },
     toggleItemOpen: (_, { id }) => {
diff --git a/services/workbench2/src/views/main-panel/main-panel-root.tsx b/services/workbench2/src/views/main-panel/main-panel-root.tsx
index da0a298a72..9654f4eb27 100644
--- a/services/workbench2/src/views/main-panel/main-panel-root.tsx
+++ b/services/workbench2/src/views/main-panel/main-panel-root.tsx
@@ -41,7 +41,7 @@ export interface MainPanelRootDataProps {
 
 interface MainPanelRootDispatchProps {
     toggleSidePanel: () => void,
-    setCurrentRouteUuid: (uuid: string) => void;
+    setCurrentRouteUuid: (uuid: string | null) => void;
 }
 
 type MainPanelRootProps = MainPanelRootDataProps & MainPanelRootDispatchProps & WithStyles<CssRules>;
@@ -56,6 +56,8 @@ export const MainPanelRoot = withStyles(styles)(
                 const uuid = splitRoute[splitRoute.length - 1];
                 if(Object.values(Routes).includes(`/${uuid}`) === false) {
                     setCurrentRouteUuid(uuid);
+                } else {
+                    setCurrentRouteUuid(null);
                 }
                 // eslint-disable-next-line react-hooks/exhaustive-deps
             }, [currentRoute]);

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list