From 1826bc21a34b983778f6e221b6c4004fdea1ad1d Mon Sep 17 00:00:00 2001 From: Pawel Kowalczyk Date: Thu, 16 May 2019 11:23:57 +0200 Subject: [PATCH] fixed-filling-advanced-values-in-run-process-dialog Feature ##15165 Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk --- src/store/run-process-panel/run-process-panel-actions.ts | 2 +- src/store/workflow-panel/workflow-panel-actions.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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 94759483..c39517fe 100644 --- a/src/store/run-process-panel/run-process-panel-actions.ts +++ b/src/store/run-process-panel/run-process-panel-actions.ts @@ -88,7 +88,7 @@ export const setWorkflow = (workflow: WorkflowResource, isWorkflowChanged = true } }; -const loadPresets = (workflowUuid: string) => +export const loadPresets = (workflowUuid: string) => async (dispatch: Dispatch, _: () => RootState, { workflowService }: ServiceRepository) => { const { items } = await workflowService.presets(workflowUuid); dispatch(runProcessPanelActions.SET_WORKFLOW_PRESETS(items)); diff --git a/src/store/workflow-panel/workflow-panel-actions.ts b/src/store/workflow-panel/workflow-panel-actions.ts index 03ddf341..3f91c102 100644 --- a/src/store/workflow-panel/workflow-panel-actions.ts +++ b/src/store/workflow-panel/workflow-panel-actions.ts @@ -7,12 +7,12 @@ import { RootState } from '~/store/store'; import { ServiceRepository } from '~/services/services'; import { bindDataExplorerActions } from '~/store/data-explorer/data-explorer-action'; import { propertiesActions } from '~/store/properties/properties-actions'; -import { getResource } from '~/store/resources/resources'; import { getProperty } from '~/store/properties/properties'; -import { WorkflowResource } from '~/models/workflow'; import { navigateToRunProcess } from '~/store/navigation/navigation-action'; -import { goToStep, runProcessPanelActions } from '~/store/run-process-panel/run-process-panel-actions'; +import { goToStep, runProcessPanelActions, loadPresets, DEFAULT_ADVANCED_FORM_VALUES } from '~/store/run-process-panel/run-process-panel-actions'; import { snackbarActions } from '~/store/snackbar/snackbar-actions'; +import { initialize } from 'redux-form'; +import { RUN_PROCESS_ADVANCED_FORM } from '~/views/run-process-panel/run-process-advanced-form'; export const WORKFLOW_PANEL_ID = "workflowPanel"; const UUID_PREFIX_PROPERTY_NAME = 'uuidPrefix'; @@ -42,6 +42,8 @@ export const openRunProcess = (uuid: string) => dispatch(goToStep(1)); dispatch(runProcessPanelActions.SET_STEP_CHANGED(true)); dispatch(runProcessPanelActions.SET_SELECTED_WORKFLOW(workflow)); + dispatch(loadPresets(workflow.uuid)); + dispatch(initialize(RUN_PROCESS_ADVANCED_FORM, DEFAULT_ADVANCED_FORM_VALUES)); } else { dispatch(snackbarActions.OPEN_SNACKBAR({ message: `You can't run this process` })); } -- 2.30.2