X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c8528155683c9cf4f11ee6d78da8d9b86a3203bf..36b4e36f75ea0035b6b0de6aaaad4edd3231371c:/src/store/workbench/workbench-actions.ts diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts index 8f034ec038..1f31656af2 100644 --- a/src/store/workbench/workbench-actions.ts +++ b/src/store/workbench/workbench-actions.ts @@ -46,6 +46,13 @@ import { ResourceKind, extractUuidKind } from '~/models/resource'; 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"; +import { searchResultsPanelActions, loadSearchResultsPanel } from '~/store/search-results-panel/search-results-panel-actions'; +import { searchResultsPanelColumns } from '~/views/search-results-panel/search-results-panel-view'; export const WORKBENCH_LOADING_SCREEN = 'workbenchLoadingScreen'; @@ -79,6 +86,7 @@ export const loadWorkbench = () => dispatch(trashPanelActions.SET_COLUMNS({ columns: trashPanelColumns })); dispatch(sharedWithMePanelActions.SET_COLUMNS({ columns: projectPanelColumns })); dispatch(workflowPanelActions.SET_COLUMNS({ columns: workflowPanelColumns })); + dispatch(searchResultsPanelActions.SET_COLUMNS({ columns: searchResultsPanelColumns })); dispatch(initSidePanelTree()); if (router.location) { const match = matchRootRoute(router.location.pathname); @@ -194,19 +202,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)); }, }); @@ -257,7 +271,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 })); } @@ -350,11 +364,23 @@ export const loadSharedWithMe = handleFirstTimeLoad(async (dispatch: Dispatch) = await dispatch(setSidePanelBreadcrumbs(SidePanelTreeCategory.SHARED_WITH_ME)); }); +export const loadRunProcess = handleFirstTimeLoad( + async (dispatch: Dispatch) => { + await dispatch(loadRunProcessPanel()); + } +); + export const loadWorkflow = handleFirstTimeLoad(async (dispatch: Dispatch) => { dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.WORKFLOWS)); await dispatch(loadWorkflowPanel()); dispatch(setSidePanelBreadcrumbs(SidePanelTreeCategory.WORKFLOWS)); }); + +export const loadSearchResults = handleFirstTimeLoad( + async (dispatch: Dispatch) => { + await dispatch(loadSearchResultsPanel()); + }); + const finishLoadingProject = (project: GroupContentsResource | string) => async (dispatch: Dispatch) => { const uuid = typeof project === 'string' ? project : project.uuid;