X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/424f5418a6fd9f49baa1cc79bf0b51f9ab65ac58..42db83a0075f9704dcbfb2cd29821c97ff0fe34b:/src/views/run-process-panel/run-process-second-step.tsx diff --git a/src/views/run-process-panel/run-process-second-step.tsx b/src/views/run-process-panel/run-process-second-step.tsx index d66576c2..0b856382 100644 --- a/src/views/run-process-panel/run-process-second-step.tsx +++ b/src/views/run-process-panel/run-process-second-step.tsx @@ -11,6 +11,8 @@ import { connect } from 'react-redux'; import { RootState } from '~/store/store'; import { isValid } from 'redux-form'; import { RUN_PROCESS_INPUTS_FORM } from './run-process-inputs-form'; +import { RunProcessAdvancedForm } from './run-process-advanced-form'; +import { createSelector, createStructuredSelector } from 'reselect'; export interface RunProcessSecondStepFormDataProps { inputs: CommandInputParameter[]; @@ -22,10 +24,15 @@ export interface RunProcessSecondStepFormActionProps { runProcess: () => void; } -const mapStateToProps = (state: RootState): RunProcessSecondStepFormDataProps => ({ - inputs: state.runProcessPanel.inputs, - valid: isValid(RUN_PROCESS_BASIC_FORM)(state) && - isValid(RUN_PROCESS_INPUTS_FORM)(state), +const inputsSelector = (state: RootState) => + state.runProcessPanel.inputs; + +const validSelector = (state: RootState) => + isValid(RUN_PROCESS_BASIC_FORM)(state) && isValid(RUN_PROCESS_INPUTS_FORM)(state); + +const mapStateToProps = createStructuredSelector({ + inputs: inputsSelector, + valid: validSelector, }); export type RunProcessSecondStepFormProps = RunProcessSecondStepFormDataProps & RunProcessSecondStepFormActionProps; @@ -35,6 +42,7 @@ export const RunProcessSecondStepForm = connect(mapStateToProps)( +