X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/00a61a4484185dc98daa92af5f189779cc10ad3c..d0b5089542fbb8daf95e5bd82da2cd710bd2b57a:/src/store/workbench/workbench-actions.ts diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts index 2586fdc5..bc2a9ed6 100644 --- a/src/store/workbench/workbench-actions.ts +++ b/src/store/workbench/workbench-actions.ts @@ -47,6 +47,10 @@ import { FilterBuilder } from '~/services/api/filter-builder'; import { GroupContentsResource } from '~/services/groups-service/groups-service'; import { unionize, ofType, UnionOf, MatchCases } from '~/common/unionize'; import { loadRunProcessPanel } from '~/store/run-process-panel/run-process-panel-actions'; +import { loadCollectionFiles } from '~/store/collection-panel/collection-panel-files/collection-panel-files-actions'; +import { SnackbarKind } from '~/store/snackbar/snackbar-actions'; +import { collectionPanelActions } from "~/store/collection-panel/collection-panel-action"; +import { CollectionResource } from "~/models/collection"; export const WORKBENCH_LOADING_SCREEN = 'workbenchLoadingScreen'; @@ -195,19 +199,25 @@ export const loadCollection = (uuid: string) => const match = await loadGroupContentsResource({ uuid, userUuid, services }); match({ OWNED: async collection => { + dispatch(collectionPanelActions.SET_COLLECTION(collection as CollectionResource)); dispatch(updateResources([collection])); await dispatch(activateSidePanelTreeItem(collection.ownerUuid)); dispatch(setSidePanelBreadcrumbs(collection.ownerUuid)); + dispatch(loadCollectionFiles(collection.uuid)); }, SHARED: collection => { + dispatch(collectionPanelActions.SET_COLLECTION(collection as CollectionResource)); dispatch(updateResources([collection])); dispatch(setSharedWithMeBreadcrumbs(collection.ownerUuid)); dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.SHARED_WITH_ME)); + dispatch(loadCollectionFiles(collection.uuid)); }, TRASHED: collection => { + dispatch(collectionPanelActions.SET_COLLECTION(collection as CollectionResource)); dispatch(updateResources([collection])); dispatch(setTrashBreadcrumbs('')); dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH)); + dispatch(loadCollectionFiles(collection.uuid)); }, }); @@ -258,7 +268,7 @@ export const moveCollection = (data: MoveToFormDialogData) => const collection = await dispatch(collectionMoveActions.moveCollection(data)); dispatch(updateResources([collection])); dispatch(reloadProjectMatchingUuid([collection.ownerUuid])); - dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Collection has been moved.', hideDuration: 2000 })); + dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Collection has been moved.', hideDuration: 2000, kind: SnackbarKind.SUCCESS })); } catch (e) { dispatch(snackbarActions.OPEN_SNACKBAR({ message: e.message, hideDuration: 2000 })); } @@ -353,7 +363,7 @@ export const loadSharedWithMe = handleFirstTimeLoad(async (dispatch: Dispatch) = export const loadRunProcess = handleFirstTimeLoad( async (dispatch: Dispatch) => { - dispatch(loadRunProcessPanel()); + await dispatch(loadRunProcessPanel()); } );