[arvados-workbench2] updated: 2.5.0-116-gbf2e7c93

git repository hosting git at public.arvados.org
Fri Mar 24 15:12:41 UTC 2023


Summary of changes:
 src/store/workbench/workbench-actions.ts | 77 ++++++++++++++++----------------
 1 file changed, 39 insertions(+), 38 deletions(-)

       via  bf2e7c937e911629122eec14c29e8f6fa9b84aa6 (commit)
      from  c872f6b8420d83f2b378a274c412e3bc1865cd8c (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 bf2e7c937e911629122eec14c29e8f6fa9b84aa6
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Mar 24 11:10:23 2023 -0400

    19482: Fix breadcrumbs to display properly when directly navigating
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts
index f4b65e63..52433779 100644
--- a/src/store/workbench/workbench-actions.ts
+++ b/src/store/workbench/workbench-actions.ts
@@ -87,6 +87,7 @@ import {
     loadCollectionPanel,
 } from 'store/collection-panel/collection-panel-action';
 import { CollectionResource } from 'models/collection';
+import { WorkflowResource } from 'models/workflow';
 import {
     loadSearchResultsPanel,
     searchResultsPanelActions,
@@ -452,41 +453,34 @@ export const loadCollection = (uuid: string) =>
                     userUuid,
                     services,
                 });
+                let collection: CollectionResource | undefined;
+                let breadcrumbfunc: ((uuid: string) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => Promise<void>) | undefined;
+                let sidepanel: string | undefined;
                 match({
-                    OWNED: (collection) => {
-                        dispatch(
-                            collectionPanelActions.SET_COLLECTION(
-                                collection as CollectionResource
-                            )
-                        );
-                        dispatch(updateResources([collection]));
-                        dispatch(activateSidePanelTreeItem(collection.ownerUuid));
-                        dispatch(setSidePanelBreadcrumbs(collection.ownerUuid));
-                        dispatch(loadCollectionPanel(collection.uuid));
+                    OWNED: (thecollection) => {
+                        collection = thecollection as CollectionResource;
+                        sidepanel = collection.ownerUuid;
+                        breadcrumbfunc = setSidePanelBreadcrumbs;
                     },
-                    SHARED: (collection) => {
-                        dispatch(
-                            collectionPanelActions.SET_COLLECTION(
-                                collection as CollectionResource
-                            )
-                        );
-                        dispatch(updateResources([collection]));
-                        dispatch<any>(setSharedWithMeBreadcrumbs(collection.ownerUuid));
-                        dispatch(activateSidePanelTreeItem(collection.ownerUuid));
-                        dispatch(loadCollectionPanel(collection.uuid));
+                    SHARED: (thecollection) => {
+                        collection = thecollection as CollectionResource;
+                        sidepanel = collection.ownerUuid;
+                        breadcrumbfunc = setSharedWithMeBreadcrumbs;
                     },
-                    TRASHED: (collection) => {
-                        dispatch(
-                            collectionPanelActions.SET_COLLECTION(
-                                collection as CollectionResource
-                            )
-                        );
-                        dispatch(updateResources([collection]));
-                        dispatch(setTrashBreadcrumbs(''));
-                        dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
-                        dispatch(loadCollectionPanel(collection.uuid));
+                    TRASHED: (thecollection) => {
+                        collection = thecollection as CollectionResource;
+                        sidepanel = SidePanelTreeCategory.TRASH;
+                        breadcrumbfunc = () => setTrashBreadcrumbs('');
                     },
                 });
+                if (collection && breadcrumbfunc && sidepanel) {
+                    dispatch(updateResources([collection]));
+                    await dispatch<any>(finishLoadingProject(collection.ownerUuid));
+                    dispatch(collectionPanelActions.SET_COLLECTION(collection));
+                    await dispatch(activateSidePanelTreeItem(sidepanel));
+                    dispatch(breadcrumbfunc(collection.ownerUuid));
+                    dispatch(loadCollectionPanel(collection.uuid));
+                }
             }
         }
     );
@@ -580,6 +574,7 @@ export const loadProcess = (uuid: string) =>
         dispatch<any>(loadProcessPanel(uuid));
         const process = await dispatch<any>(processesActions.loadProcess(uuid));
         if (process) {
+            await dispatch<any>(finishLoadingProject(process.containerRequest.ownerUuid));
             await dispatch<any>(
                 activateSidePanelTreeItem(process.containerRequest.ownerUuid)
             );
@@ -600,19 +595,25 @@ export const loadRegisteredWorkflow = (uuid: string) =>
                 userUuid,
                 services,
             });
+            let workflow: WorkflowResource | undefined;
+            let breadcrumbfunc: ((uuid: string) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => Promise<void>) | undefined;
             match({
-                OWNED: (workflow) => {
-                    dispatch(updateResources([workflow]));
-                    dispatch<any>(activateSidePanelTreeItem(workflow.ownerUuid));
-                    dispatch<any>(setSidePanelBreadcrumbs(workflow.ownerUuid));
+                OWNED: async (theworkflow) => {
+                    workflow = theworkflow as WorkflowResource;
+                    breadcrumbfunc = setSidePanelBreadcrumbs;
                 },
-                SHARED: (workflow) => {
-                    dispatch<any>(updateResources([workflow]));
-                    dispatch<any>(activateSidePanelTreeItem(workflow.ownerUuid));
-                    dispatch<any>(setSharedWithMeBreadcrumbs(workflow.ownerUuid));
+                SHARED: async (theworkflow) => {
+                    workflow = theworkflow as WorkflowResource;
+                    breadcrumbfunc = setSharedWithMeBreadcrumbs;
                 },
                 TRASHED: () => { }
             });
+            if (workflow && breadcrumbfunc) {
+                dispatch(updateResources([workflow]));
+                await dispatch<any>(finishLoadingProject(workflow.ownerUuid));
+                await dispatch<any>(activateSidePanelTreeItem(workflow.ownerUuid));
+                dispatch<any>(breadcrumbfunc(workflow.ownerUuid));
+            }
         }
     });
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list