16068: Merge branch 'main' of git.arvados.org:arvados-workbench2 into 16068
[arvados-workbench2.git] / src / store / process-panel / process-panel-actions.ts
index da917f71f70f275aa25e96e3d4861b6b3b9011be..e77c300d8c07cc50a73da44734a59b69b1737211 100644 (file)
@@ -2,30 +2,37 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { unionize, ofType, UnionOf } from "~/common/unionize";
-import { loadProcess } from '~/store/processes/processes-actions';
+import { unionize, ofType, UnionOf } from "common/unionize";
+import { loadProcess } from 'store/processes/processes-actions';
 import { Dispatch } from 'redux';
-import { ProcessStatus } from '~/store/processes/process';
-import { RootState } from '~/store/store';
-import { ServiceRepository } from "~/services/services";
-import { navigateTo, navigateToWorkflows } from '~/store/navigation/navigation-action';
-import { snackbarActions } from '~/store/snackbar/snackbar-actions';
+import { ProcessStatus } from 'store/processes/process';
+import { RootState } from 'store/store';
+import { ServiceRepository } from "services/services";
+import { navigateTo, navigateToWorkflows } from 'store/navigation/navigation-action';
+import { snackbarActions } from 'store/snackbar/snackbar-actions';
 import { SnackbarKind } from '../snackbar/snackbar-actions';
-import { showWorkflowDetails } from '~/store/workflow-panel/workflow-panel-actions';
+import { showWorkflowDetails } from 'store/workflow-panel/workflow-panel-actions';
+import { loadSubprocessPanel } from "../subprocess-panel/subprocess-panel-actions";
+import { initProcessLogsPanel, processLogsPanelActions } from "store/process-logs-panel/process-logs-panel-actions";
 
-export const procesPanelActions = unionize({
+export const processPanelActions = unionize({
+    SET_PROCESS_PANEL_CONTAINER_REQUEST_UUID: ofType<string>(),
     SET_PROCESS_PANEL_FILTERS: ofType<string[]>(),
     TOGGLE_PROCESS_PANEL_FILTER: ofType<string>(),
 });
 
-export type ProcessPanelAction = UnionOf<typeof procesPanelActions>;
+export type ProcessPanelAction = UnionOf<typeof processPanelActions>;
 
-export const toggleProcessPanelFilter = procesPanelActions.TOGGLE_PROCESS_PANEL_FILTER;
+export const toggleProcessPanelFilter = processPanelActions.TOGGLE_PROCESS_PANEL_FILTER;
 
 export const loadProcessPanel = (uuid: string) =>
-    (dispatch: Dispatch) => {
-        dispatch<any>(loadProcess(uuid));
+    async (dispatch: Dispatch) => {
+        dispatch(processLogsPanelActions.RESET_PROCESS_LOGS_PANEL());
+        dispatch<ProcessPanelAction>(processPanelActions.SET_PROCESS_PANEL_CONTAINER_REQUEST_UUID(uuid));
+        await dispatch<any>(loadProcess(uuid));
         dispatch(initProcessPanelFilters);
+        dispatch<any>(initProcessLogsPanel(uuid));
+        dispatch<any>(loadSubprocessPanel());
     };
 
 export const navigateToOutput = (uuid: string) =>
@@ -44,11 +51,13 @@ export const openWorkflow = (uuid: string) =>
         dispatch<any>(showWorkflowDetails(uuid));
     };
 
-export const initProcessPanelFilters = procesPanelActions.SET_PROCESS_PANEL_FILTERS([
+export const initProcessPanelFilters = processPanelActions.SET_PROCESS_PANEL_FILTERS([
     ProcessStatus.QUEUED,
     ProcessStatus.COMPLETED,
     ProcessStatus.FAILED,
     ProcessStatus.RUNNING,
-    ProcessStatus.LOCKED,
+    ProcessStatus.ONHOLD,
+    ProcessStatus.FAILING,
+    ProcessStatus.WARNING,
     ProcessStatus.CANCELLED
 ]);