diff --git a/src/AceEditor/madie-ace-editor.tsx b/src/AceEditor/madie-ace-editor.tsx index a81a9078..4b756e9d 100644 --- a/src/AceEditor/madie-ace-editor.tsx +++ b/src/AceEditor/madie-ace-editor.tsx @@ -31,6 +31,10 @@ export interface EditorPropsType { onChange?: (value: string) => void; handleApplyCode?: (code: string) => void; handleApplyParameter?: (parameter: Parameter) => void; + handleParameterEdit?: ( + parameter: Parameter, + parameterToApply: Parameter + ) => void; handleApplyValueSet?: (vs: ValueSetForSearch) => void; handleApplyDefinition?: (def: Definition) => void; handleDefinitionEdit?: (lib: SelectedLibrary, def: Definition) => void; diff --git a/src/CqlBuilderPanel/CqlBuilderPanel.tsx b/src/CqlBuilderPanel/CqlBuilderPanel.tsx index f6ea9c7a..63d864d9 100644 --- a/src/CqlBuilderPanel/CqlBuilderPanel.tsx +++ b/src/CqlBuilderPanel/CqlBuilderPanel.tsx @@ -28,6 +28,7 @@ export default function CqlBuilderPanel({ handleEditLibrary, handleApplyCode, handleApplyParameter, + handleParameterEdit, handleApplyValueSet, handleApplyDefinition, handleDefinitionEdit, @@ -211,6 +212,7 @@ export default function CqlBuilderPanel({ { const updatedParameter = { parameterName: parameter?.name, - expressionValue: parameter?.logic, + expression: + parameter?.logic?.slice(0, 1).toUpperCase() + + parameter?.logic?.slice(1, parameter?.logic?.length), } as Parameter; return ( diff --git a/src/CqlBuilderPanel/Parameters/ParameterBuilder.tsx b/src/CqlBuilderPanel/Parameters/ParameterBuilder.tsx index 749fe37a..0a28e228 100644 --- a/src/CqlBuilderPanel/Parameters/ParameterBuilder.tsx +++ b/src/CqlBuilderPanel/Parameters/ParameterBuilder.tsx @@ -9,7 +9,7 @@ import AceEditor from "react-ace"; export interface Parameter { parameterName?: string; - expressionValue?: string; + expression?: string; } export interface ParameterProps { @@ -27,16 +27,13 @@ export default function ParameterBuilder({ parameter, setOpenParameterDialog, }: ParameterProps) { - const [editorHeight, setEditorHeight] = useState("50px"); + const [editorHeight, setEditorHeight] = useState("180px"); const textAreaRef = useRef(null); - const [expressionEditorValue, setExpressionEditorValue] = useState( - parameter?.expressionValue || "" - ); const formik = useFormik({ initialValues: { parameterName: parameter?.parameterName || "", - expression: parameter?.expressionValue || "", + expression: parameter?.expression || "", }, validationSchema: ParameterSchemaValidator, enableReinitialize: true, @@ -44,13 +41,6 @@ export default function ParameterBuilder({ }); const { resetForm } = formik; - const isEditDialogFormDirty = () => { - if (parameter?.expressionValue !== expressionEditorValue || formik.dirty) { - return false; - } - return true; - }; - return (
@@ -103,12 +93,7 @@ export default function ParameterBuilder({