From 0814b89817d05c689e0381b049f32f52258b7629 Mon Sep 17 00:00:00 2001 From: Salam Dalloul Date: Mon, 5 Jun 2023 17:59:07 +0200 Subject: [PATCH] #57 implement open modal dialog --- src/client/assets/styles/variables.js | 4 +- .../components/common/CondaSelectionDialog.js | 12 +- src/client/components/common/CustomSelect.js | 26 +-- src/client/components/common/Layout.js | 54 +++++- .../components/common/RunModalDialog.js | 183 ++++++++++++++++++ src/theme.js | 12 +- 6 files changed, 268 insertions(+), 23 deletions(-) create mode 100644 src/client/components/common/RunModalDialog.js diff --git a/src/client/assets/styles/variables.js b/src/client/assets/styles/variables.js index 228d4126..4a400c77 100644 --- a/src/client/assets/styles/variables.js +++ b/src/client/assets/styles/variables.js @@ -110,7 +110,9 @@ const vars = { lightBlack: 'rgba(0, 0, 0, 0.8)', lightgray: "#F4F4F4", - optionTextColor: '#1A1A1A' + optionTextColor: '#1A1A1A', + + disabledButtonBG: 'rgba(0, 122, 255, 0.2)' }; export default vars; diff --git a/src/client/components/common/CondaSelectionDialog.js b/src/client/components/common/CondaSelectionDialog.js index 5085aab2..552a5ef7 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 { > {'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')} + /> + } + + + + + + +} diff --git a/src/theme.js b/src/theme.js index 2b1f8163..05228958 100644 --- a/src/theme.js +++ b/src/theme.js @@ -51,7 +51,8 @@ const { elementBorderColor, elementBgColor, tabDividerBgColor, - lightgray + lightgray, + disabledButtonBG } = vars; const theme = { @@ -149,13 +150,18 @@ const theme = { containedPrimary: { backgroundColor: buttonPrimaryBgColor, '&.Mui-disabled': { - background: buttonPrimaryDisabledBgColor, color: textWhite, + background: disabledButtonBG, + border: '2px solid rgba(0, 0, 0, 0.02)', }, '&:hover': { backgroundColor: buttonPrimaryBgHoverColor, }, }, + + "& .Mui-disabled": { + background: 'red' + } }, }, @@ -675,7 +681,7 @@ const theme = { "& .MuiMenuItem-root": { "&.Mui-selected": { - backgroundColor: lightgray + backgroundColor: `${lightgray} !important` } } }