[arvados] updated: 2.7.0-5822-g0328407f7c
git repository hosting
git at public.arvados.org
Tue Jan 23 20:17:50 UTC 2024
Summary of changes:
.../store/process-panel/process-panel-actions.ts | 36 ++++++++++++++--------
.../store/process-panel/process-panel-reducer.ts | 15 ++++++---
.../src/store/process-panel/process-panel.ts | 4 +--
.../src/views/process-panel/process-panel-root.tsx | 8 ++---
.../src/views/process-panel/process-panel.tsx | 2 +-
5 files changed, 40 insertions(+), 25 deletions(-)
via 0328407f7cfeba197b5061478869beaf494691de (commit)
from 37f7559e8d9a4df3515d78663b65b9220550457f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 0328407f7cfeba197b5061478869beaf494691de
Author: Stephen Smith <stephen at curii.com>
Date: Tue Jan 23 15:00:51 2024 -0500
21336: Add type checking to output data reducer instead of accepting any, fix
misalignments in payload type. Rename some properties for clarity to align with
passing in uuid in addition to output details to reducer.
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>
diff --git a/services/workbench2/src/store/process-panel/process-panel-actions.ts b/services/workbench2/src/store/process-panel/process-panel-actions.ts
index 2111afdb2f..cbf89983c9 100644
--- a/services/workbench2/src/store/process-panel/process-panel-actions.ts
+++ b/services/workbench2/src/store/process-panel/process-panel-actions.ts
@@ -21,6 +21,7 @@ import { getIOParamDisplayValue, ProcessIOParameter } from "views/process-panel/
import { OutputDetails, NodeInstanceType, NodeInfo } from "./process-panel";
import { AuthState } from "store/auth/auth-reducer";
import { ContextMenuResource } from "store/context-menu/context-menu-actions";
+import { OutputDataUpdate } from "./process-panel-reducer";
export const processPanelActions = unionize({
RESET_PROCESS_PANEL: ofType<{}>(),
@@ -29,7 +30,7 @@ export const processPanelActions = unionize({
TOGGLE_PROCESS_PANEL_FILTER: ofType<string>(),
SET_INPUT_RAW: ofType<WorkflowInputsData | null>(),
SET_INPUT_PARAMS: ofType<ProcessIOParameter[] | null>(),
- SET_OUTPUT_RAW: ofType<OutputDetails | null>(),
+ SET_OUTPUT_DATA: ofType<OutputDataUpdate | null>(),
SET_OUTPUT_DEFINITIONS: ofType<CommandOutputParameter[]>(),
SET_OUTPUT_PARAMS: ofType<ProcessIOParameter[] | null>(),
SET_NODE_INFO: ofType<NodeInfo>(),
@@ -71,10 +72,13 @@ export const loadInputs =
export const loadOutputs =
(containerRequest: ContainerRequestResource) => async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
- const noOutputs = { rawOutputs: {} };
+ const noOutputs: OutputDetails = { raw: {} };
if (!containerRequest.outputUuid) {
- dispatch<ProcessPanelAction>(processPanelActions.SET_OUTPUT_RAW({ uuid: containerRequest.uuid, outputRaw: noOutputs }));
+ dispatch<ProcessPanelAction>(processPanelActions.SET_OUTPUT_DATA({
+ uuid: containerRequest.uuid,
+ payload: noOutputs
+ }));
return;
}
try {
@@ -86,9 +90,12 @@ export const loadOutputs =
// If has propsOutput, skip fetching cwl.output.json
if (propsOutputs !== undefined) {
dispatch<ProcessPanelAction>(
- processPanelActions.SET_OUTPUT_RAW({
- rawOutputs: propsOutputs,
- pdh: collection.portableDataHash,
+ processPanelActions.SET_OUTPUT_DATA({
+ uuid: containerRequest.uuid,
+ payload: {
+ raw: propsOutputs,
+ pdh: collection.portableDataHash,
+ },
})
);
} else {
@@ -97,17 +104,20 @@ export const loadOutputs =
let outputData = outputFile ? await services.collectionService.getFileContents(outputFile) : undefined;
if (outputData && (outputData = JSON.parse(outputData)) && collection.portableDataHash) {
dispatch<ProcessPanelAction>(
- processPanelActions.SET_OUTPUT_RAW({
+ processPanelActions.SET_OUTPUT_DATA({
uuid: containerRequest.uuid,
- outputRaw: { rawOutputs: outputData, pdh: collection.portableDataHash },
+ payload: {
+ raw: outputData,
+ pdh: collection.portableDataHash,
+ },
})
);
} else {
- dispatch<ProcessPanelAction>(processPanelActions.SET_OUTPUT_RAW({ uuid: containerRequest.uuid, outputRaw: noOutputs }));
+ dispatch<ProcessPanelAction>(processPanelActions.SET_OUTPUT_DATA({ uuid: containerRequest.uuid, payload: noOutputs }));
}
}
} catch {
- dispatch<ProcessPanelAction>(processPanelActions.SET_OUTPUT_RAW({ uuid: containerRequest.uuid, outputRaw: noOutputs }));
+ dispatch<ProcessPanelAction>(processPanelActions.SET_OUTPUT_DATA({ uuid: containerRequest.uuid, payload: noOutputs }));
}
};
@@ -149,11 +159,11 @@ export const loadOutputDefinitions =
export const updateOutputParams = () => async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
const outputDefinitions = getState().processPanel.outputDefinitions;
- const outputRaw = getState().processPanel.outputRaw;
+ const outputData = getState().processPanel.outputData;
- if (outputRaw && outputRaw.rawOutputs) {
+ if (outputData && outputData.raw) {
dispatch<ProcessPanelAction>(
- processPanelActions.SET_OUTPUT_PARAMS(formatOutputData(outputDefinitions, outputRaw.rawOutputs, outputRaw.pdh, getState().auth))
+ processPanelActions.SET_OUTPUT_PARAMS(formatOutputData(outputDefinitions, outputData.raw, outputData.pdh, getState().auth))
);
}
};
diff --git a/services/workbench2/src/store/process-panel/process-panel-reducer.ts b/services/workbench2/src/store/process-panel/process-panel-reducer.ts
index ea6de66db4..5c1b916c3a 100644
--- a/services/workbench2/src/store/process-panel/process-panel-reducer.ts
+++ b/services/workbench2/src/store/process-panel/process-panel-reducer.ts
@@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0
-import { ProcessPanel } from "store/process-panel/process-panel";
+import { OutputDetails, ProcessPanel } from "store/process-panel/process-panel";
import { ProcessPanelAction, processPanelActions } from "store/process-panel/process-panel-actions";
const initialState: ProcessPanel = {
@@ -10,12 +10,17 @@ const initialState: ProcessPanel = {
filters: {},
inputRaw: null,
inputParams: null,
- outputRaw: null,
+ outputData: null,
nodeInfo: null,
outputDefinitions: [],
outputParams: null,
};
+export type OutputDataUpdate = {
+ uuid: string;
+ payload: OutputDetails;
+};
+
export const processPanelReducer = (state = initialState, action: ProcessPanelAction): ProcessPanel =>
processPanelActions.match(action, {
RESET_PROCESS_PANEL: () => initialState,
@@ -49,12 +54,12 @@ export const processPanelReducer = (state = initialState, action: ProcessPanelAc
return state;
}
},
- SET_OUTPUT_RAW: (data: any) => {
+ SET_OUTPUT_DATA: (update: OutputDataUpdate) => {
//never set output to {} unless initializing
- if (state.outputRaw?.rawOutputs && Object.keys(state.outputRaw?.rawOutputs).length && state.containerRequestUuid === data.uuid) {
+ if (state.outputData?.raw && Object.keys(state.outputData?.raw).length && state.containerRequestUuid === update.uuid) {
return state;
}
- return { ...state, outputRaw: data.outputRaw };
+ return { ...state, outputData: update.payload };
},
SET_NODE_INFO: ({ nodeInfo }) => {
return { ...state, nodeInfo };
diff --git a/services/workbench2/src/store/process-panel/process-panel.ts b/services/workbench2/src/store/process-panel/process-panel.ts
index 1ec60ff54c..35d776edc7 100644
--- a/services/workbench2/src/store/process-panel/process-panel.ts
+++ b/services/workbench2/src/store/process-panel/process-panel.ts
@@ -9,7 +9,7 @@ import { ProcessIOParameter } from "views/process-panel/process-io-card";
import { CommandOutputParameter } from 'cwlts/mappings/v1.0/CommandOutputParameter';
export type OutputDetails = {
- rawOutputs?: any;
+ raw?: any;
pdh?: string;
}
@@ -41,7 +41,7 @@ export interface ProcessPanel {
filters: { [status: string]: boolean };
inputRaw: WorkflowInputsData | null;
inputParams: ProcessIOParameter[] | null;
- outputRaw: OutputDetails | null;
+ outputData: OutputDetails | null;
outputDefinitions: CommandOutputParameter[];
outputParams: ProcessIOParameter[] | null;
nodeInfo: NodeInstanceType | null;
diff --git a/services/workbench2/src/views/process-panel/process-panel-root.tsx b/services/workbench2/src/views/process-panel/process-panel-root.tsx
index c972c0a6cf..30d72dfd56 100644
--- a/services/workbench2/src/views/process-panel/process-panel-root.tsx
+++ b/services/workbench2/src/views/process-panel/process-panel-root.tsx
@@ -41,7 +41,7 @@ export interface ProcessPanelRootDataProps {
auth: AuthState;
inputRaw: WorkflowInputsData | null;
inputParams: ProcessIOParameter[] | null;
- outputRaw: OutputDetails | null;
+ outputData: OutputDetails | null;
outputDefinitions: CommandOutputParameter[];
outputParams: ProcessIOParameter[] | null;
nodeInfo: NodeInstanceType | null;
@@ -83,7 +83,7 @@ export const ProcessPanelRoot = withStyles(styles)(
processLogsPanel,
inputRaw,
inputParams,
- outputRaw,
+ outputData,
outputDefinitions,
outputParams,
nodeInfo,
@@ -115,7 +115,7 @@ export const ProcessPanelRoot = withStyles(styles)(
// Trigger processing output params when raw or definitions change
React.useEffect(() => {
updateOutputParams();
- }, [outputRaw, outputDefinitions, updateOutputParams]);
+ }, [outputData, outputDefinitions, updateOutputParams]);
return process ? (
<MPVContainer
@@ -187,7 +187,7 @@ export const ProcessPanelRoot = withStyles(styles)(
label={ProcessIOCardType.OUTPUT}
process={process}
params={outputParams}
- raw={outputRaw?.rawOutputs}
+ raw={outputData?.raw}
outputUuid={outputUuid || ""}
/>
</MPVPanelContent>
diff --git a/services/workbench2/src/views/process-panel/process-panel.tsx b/services/workbench2/src/views/process-panel/process-panel.tsx
index 4a6b5fd333..7e175c4799 100644
--- a/services/workbench2/src/views/process-panel/process-panel.tsx
+++ b/services/workbench2/src/views/process-panel/process-panel.tsx
@@ -33,7 +33,7 @@ const mapStateToProps = ({ router, auth, resources, processPanel, processLogsPan
auth: auth,
inputRaw: processPanel.inputRaw,
inputParams: processPanel.inputParams,
- outputRaw: processPanel.outputRaw,
+ outputData: processPanel.outputData,
outputDefinitions: processPanel.outputDefinitions,
outputParams: processPanel.outputParams,
nodeInfo: processPanel.nodeInfo,
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list