20252: Avoid clearing subprocess data explorer when refreshing process panel
authorStephen Smith <stephen@curii.com>
Thu, 30 Mar 2023 18:58:15 +0000 (14:58 -0400)
committerStephen Smith <stephen@curii.com>
Thu, 30 Mar 2023 18:58:15 +0000 (14:58 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/store/process-panel/process-panel-actions.ts
src/store/subprocess-panel/subprocess-panel-actions.ts

index 9668485c2cbbd6fd399ea9776c555fbedd643fe2..d8042ba5ef9942351df2a298635dae0f556bb300 100644 (file)
@@ -12,7 +12,7 @@ import { navigateTo, navigateToWorkflows } from 'store/navigation/navigation-act
 import { snackbarActions } from 'store/snackbar/snackbar-actions';
 import { SnackbarKind } from '../snackbar/snackbar-actions';
 import { showWorkflowDetails } from 'store/workflow-panel/workflow-panel-actions';
-import { loadSubprocessPanel } from "../subprocess-panel/subprocess-panel-actions";
+import { loadSubprocessPanel, subprocessPanelActions } from "../subprocess-panel/subprocess-panel-actions";
 import { initProcessLogsPanel, processLogsPanelActions } from "store/process-logs-panel/process-logs-panel-actions";
 import { CollectionFile } from "models/collection-file";
 import { ContainerRequestResource } from "models/container-request";
@@ -40,7 +40,12 @@ export type ProcessPanelAction = UnionOf<typeof processPanelActions>;
 export const toggleProcessPanelFilter = processPanelActions.TOGGLE_PROCESS_PANEL_FILTER;
 
 export const loadProcessPanel = (uuid: string) =>
-    async (dispatch: Dispatch) => {
+    async (dispatch: Dispatch, getState: () => RootState) => {
+        // Reset subprocess data explorer if navigating to new process
+        //  Avoids resetting pagination when refreshing same process
+        if (getState().processPanel.containerRequestUuid !== uuid) {
+            dispatch(subprocessPanelActions.CLEAR());
+        }
         dispatch(processPanelActions.RESET_PROCESS_PANEL());
         dispatch(processLogsPanelActions.RESET_PROCESS_LOGS_PANEL());
         dispatch<ProcessPanelAction>(processPanelActions.SET_PROCESS_PANEL_CONTAINER_REQUEST_UUID(uuid));
index 0df89d6e19a2a2ac5d34264413b3bf5eb9010e8b..b440776ce0ff6c2ddcd02fe34aa696348f907888 100644 (file)
@@ -12,6 +12,5 @@ export const subprocessPanelActions = bindDataExplorerActions(SUBPROCESS_PANEL_I
 
 export const loadSubprocessPanel = () =>
     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        dispatch(subprocessPanelActions.CLEAR());
         dispatch(subprocessPanelActions.REQUEST_ITEMS());
     };