SET_STEP_CHANGED: ofType<boolean>(),
SET_WORKFLOWS: ofType<WorkflowResource[]>(),
SET_SELECTED_WORKFLOW: ofType<WorkflowResource>(),
+ SET_WORKFLOW_PRESETS: ofType<WorkflowResource[]>(),
SEARCH_WORKFLOWS: ofType<string>(),
RESET_RUN_PROCESS_PANEL: ofType<{}>(),
});
if (isStepChanged && isWorkflowChanged) {
dispatch(runProcessPanelActions.SET_STEP_CHANGED(false));
dispatch(runProcessPanelActions.SET_SELECTED_WORKFLOW(workflow));
+ dispatch<any>(loadPresets(workflow.uuid));
}
if (!isWorkflowChanged) {
dispatch(runProcessPanelActions.SET_SELECTED_WORKFLOW(workflow));
}
};
+const loadPresets = (workflowUuid: string) =>
+ async (dispatch: Dispatch<any>, _: () => RootState, { workflowService }: ServiceRepository) => {
+ const { items } = await workflowService.presets(workflowUuid);
+ dispatch(runProcessPanelActions.SET_WORKFLOW_PRESETS(items));
+ };
+
+
export const goToStep = (step: number) =>
(dispatch: Dispatch, getState: () => RootState) => {
if (step === 1) {