X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9ccc7e8ebe82b97e219d65adeea8b03b2c9ed71a..7a8fafa13f5f94945cf0a4c5965db273f3435823:/src/store/workbench/workbench-actions.ts diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts index 3c68c00045..7077f414e5 100644 --- a/src/store/workbench/workbench-actions.ts +++ b/src/store/workbench/workbench-actions.ts @@ -15,7 +15,7 @@ import { favoritePanelActions } from '~/store/favorite-panel/favorite-panel-acti import { projectPanelColumns } from '~/views/project-panel/project-panel'; import { favoritePanelColumns } from '~/views/favorite-panel/favorite-panel'; import { matchRootRoute } from '~/routes/routes'; -import { setCollectionBreadcrumbs, setProjectBreadcrumbs, setSidePanelBreadcrumbs } from '../breadcrumbs/breadcrumbs-actions'; +import { setCollectionBreadcrumbs, setProjectBreadcrumbs, setSidePanelBreadcrumbs, setProcessBreadcrumbs } from '../breadcrumbs/breadcrumbs-actions'; import { navigateToProject } from '../navigation/navigation-action'; import { MoveToFormDialogData } from '~/store/move-to-dialog/move-to-dialog'; import { ServiceRepository } from '~/services/services'; @@ -29,7 +29,10 @@ import * as collectionCopyActions from '~/store/collections/collection-copy-acti import * as collectionUpdateActions from '~/store/collections/collection-update-actions'; import * as collectionMoveActions from '~/store/collections/collection-move-actions'; import * as processesActions from '../processes/processes-actions'; -import { getProcess } from '../processes/process'; +import { trashPanelColumns } from "~/views/trash-panel/trash-panel"; +import { loadTrashPanel, trashPanelActions } from "~/store/trash-panel/trash-panel-action"; +import { initProcessLogsPanel } from '../process-logs-panel/process-logs-panel-actions'; +import { loadProcessPanel } from '~/store/process-panel/process-panel-actions'; export const loadWorkbench = () => @@ -41,6 +44,7 @@ export const loadWorkbench = () => if (userResource) { dispatch(projectPanelActions.SET_COLUMNS({ columns: projectPanelColumns })); dispatch(favoritePanelActions.SET_COLUMNS({ columns: favoritePanelColumns })); + dispatch(trashPanelActions.SET_COLUMNS({ columns: trashPanelColumns })); dispatch(initSidePanelTree()); if (router.location) { const match = matchRootRoute(router.location.pathname); @@ -63,6 +67,12 @@ export const loadFavorites = () => dispatch(setSidePanelBreadcrumbs(SidePanelTreeCategory.FAVORITES)); }; +export const loadTrash = () => + (dispatch: Dispatch) => { + dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH)); + dispatch(loadTrashPanel()); + dispatch(setSidePanelBreadcrumbs(SidePanelTreeCategory.TRASH)); + }; export const loadProject = (uuid: string) => async (dispatch: Dispatch) => { @@ -176,13 +186,20 @@ export const moveCollection = (data: MoveToFormDialogData) => export const loadProcess = (uuid: string) => async (dispatch: Dispatch, getState: () => RootState) => { - await dispatch(processesActions.loadProcess(uuid)); - const process = getProcess(uuid)(getState().resources); - if (process) { - await dispatch(activateSidePanelTreeItem(process.containerRequest.ownerUuid)); - dispatch(setCollectionBreadcrumbs(process.containerRequest.ownerUuid)); - dispatch(loadDetailsPanel(uuid)); - } + dispatch(loadProcessPanel(uuid)); + const process = await dispatch(processesActions.loadProcess(uuid)); + await dispatch(activateSidePanelTreeItem(process.containerRequest.ownerUuid)); + dispatch(setProcessBreadcrumbs(uuid)); + dispatch(loadDetailsPanel(uuid)); + + }; + +export const loadProcessLog = (uuid: string) => + async (dispatch: Dispatch) => { + const process = await dispatch(processesActions.loadProcess(uuid)); + await dispatch(activateSidePanelTreeItem(process.containerRequest.ownerUuid)); + dispatch(setProcessBreadcrumbs(uuid)); + dispatch(initProcessLogsPanel(uuid)); }; export const resourceIsNotLoaded = (uuid: string) => @@ -198,10 +215,10 @@ export const couldNotLoadUser = snackbarActions.OPEN_SNACKBAR({ message: 'Could not load user' }); -const reloadProjectMatchingUuid = (matchingUuids: string[]) => +export const reloadProjectMatchingUuid = (matchingUuids: string[]) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { const currentProjectPanelUuid = getProjectPanelCurrentUuid(getState()); if (currentProjectPanelUuid && matchingUuids.some(uuid => uuid === currentProjectPanelUuid)) { dispatch(loadProject(currentProjectPanelUuid)); } - }; \ No newline at end of file + };