X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/20f7af812af9bd7094ae71d5a7571cfe556eb968..36b4e36f75ea0035b6b0de6aaaad4edd3231371c:/src/store/workbench/workbench-actions.ts diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts index f2d04188f3..1f31656af2 100644 --- a/src/store/workbench/workbench-actions.ts +++ b/src/store/workbench/workbench-actions.ts @@ -48,6 +48,11 @@ 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'; @@ -81,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); @@ -196,18 +202,21 @@ 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)); @@ -262,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 })); } @@ -367,6 +376,11 @@ export const loadWorkflow = handleFirstTimeLoad(async (dispatch: Dispatch) 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;