From f96eb4f60a314f2e5b0a21afd1ab836598d6c91f Mon Sep 17 00:00:00 2001 From: Michal Klobukowski Date: Fri, 7 Dec 2018 16:23:10 +0100 Subject: [PATCH] Add presets actions to run-process-panel Feature #14490 Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski --- src/store/run-process-panel/run-process-panel-actions.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/store/run-process-panel/run-process-panel-actions.ts b/src/store/run-process-panel/run-process-panel-actions.ts index f1d2d2fd55..786dedaa5c 100644 --- a/src/store/run-process-panel/run-process-panel-actions.ts +++ b/src/store/run-process-panel/run-process-panel-actions.ts @@ -25,6 +25,7 @@ export const runProcessPanelActions = unionize({ SET_STEP_CHANGED: ofType(), SET_WORKFLOWS: ofType(), SET_SELECTED_WORKFLOW: ofType(), + SET_WORKFLOW_PRESETS: ofType(), SEARCH_WORKFLOWS: ofType(), RESET_RUN_PROCESS_PANEL: ofType<{}>(), }); @@ -76,12 +77,20 @@ export const setWorkflow = (workflow: WorkflowResource, isWorkflowChanged = true if (isStepChanged && isWorkflowChanged) { dispatch(runProcessPanelActions.SET_STEP_CHANGED(false)); dispatch(runProcessPanelActions.SET_SELECTED_WORKFLOW(workflow)); + dispatch(loadPresets(workflow.uuid)); } if (!isWorkflowChanged) { dispatch(runProcessPanelActions.SET_SELECTED_WORKFLOW(workflow)); } }; +const loadPresets = (workflowUuid: string) => + async (dispatch: Dispatch, _: () => 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) { -- 2.30.2