From 8c16a17b452fbd23af34a7464a02c98898cc1471 Mon Sep 17 00:00:00 2001 From: Salam Dalloul Date: Fri, 9 Jun 2023 13:42:17 +0200 Subject: [PATCH] #57 add the modals layout component --- .../components/common/CondaSelectionDialog.js | 12 +- src/client/components/common/Layout.js | 2 +- src/client/components/common/ModalsLayout.js | 11 ++ .../components/common/RunModalDialog.js | 183 ++++++------------ 4 files changed, 84 insertions(+), 124 deletions(-) diff --git a/src/client/components/common/CondaSelectionDialog.js b/src/client/components/common/CondaSelectionDialog.js index 79e838d4..c517648f 100644 --- a/src/client/components/common/CondaSelectionDialog.js +++ b/src/client/components/common/CondaSelectionDialog.js @@ -11,6 +11,9 @@ const { } = vars; export const CondaSelectionDialog = ({state, setState, getMenuItems}) => { + const onSelectChange = (event) => { + setState({condaEnv: event.target.value}) + } return ( @@ -24,7 +27,14 @@ export const CondaSelectionDialog = ({state, setState, getMenuItems}) => { > {'Select conda environment:'} - setState(val)} getMenuItems={getMenuItems} /> + setState(val)} + getMenuItems={getMenuItems} + placeholder="Conda environment" + value={state.condaEnv} + options={state.condaEnvs} + onSelectChange={(val) => onSelectChange(val)} + /> + } + { + state.modalDialogValue === selectModalOptions.python_object_name && + onInputChange(e, 'python_object_name')} /> - { - state.modalDialogValue === selectModalOptions.PNL_input && - onInputChange(e, 'PNL_input')} - /> - } - { - state.modalDialogValue === selectModalOptions.file_path && - - } - { - state.modalDialogValue === selectModalOptions.python_object_name && - onInputChange(e, 'python_object_name')} - /> - } - + } + - - - + ) }