Skip to content

Commit

Permalink
MAT-7792: partial save
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmcphillips committed Dec 5, 2024
1 parent dc8fcec commit 0d8fd2b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export interface FunctionProps {
handleFunctionEdit?: Function;
funct?: Funct;
onClose?: Function;
operation?: string;
cqlFunction?: any;
}

export default function FunctionBuilder({
Expand All @@ -39,6 +41,8 @@ export default function FunctionBuilder({
onClose,
funct,
cqlBuilderLookupsTypes,
operation,
cqlFunction,
}: FunctionProps) {
const [argumentsEditorOpen, setArgumentsEditorOpen] =
useState<boolean>(false);
Expand Down Expand Up @@ -187,10 +191,40 @@ export default function FunctionBuilder({
</Button>
<Button
data-testid={`function-apply-btn`}
disabled={!formik.values.functionName || !canEdit || !formik.dirty}
onClick={() => {}}
// disabled={!formik.values.functionName || !canEdit || !formik.dirty}
onClick={() => {
// const functionToApply = {
// functionName: formik.values.functionName,
// comment: formik.values.comment,
// fluentFunction: formik.values.fluentFunction,
// expressionValue: expressionEditorValue,
// };
const functionToApply = {
fluentFunction: false,
functionName: "Function name here",
comment: "I'm a comment about nothing at all",
functionsArguments: [
{ name: "arg1", dataType: "Integer" },
{ name: "arg2", dataType: "Integer" },
],
expression: "true",
};
console.log("functionToApply", functionToApply);

Check failure on line 212 in src/CqlBuilderPanel/functionsSection/functionBuilder/FunctionBuilder.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

Unexpected console statement
resetForm();
setExpressionEditorValue("");
if (operation === "edit") {
formik.setFieldValue("functionName", "");
formik.setFieldValue("comment", "");
formik.setFieldValue("fluentFunction", true);
handleFunctionEdit(cqlFunction, functionToApply);
onClose();
} else {
handleApplyFunction(functionToApply);
}
}}
>
Apply
{operation === "edit" ? "Save" : "Apply"}
</Button>
</div>
<ConfirmationDialog
Expand Down
3 changes: 3 additions & 0 deletions src/cqlEditorWithTerminology/CqlEditorWithTerminology.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
> .MuiTabs-root {
background-color: #ededed;
margin-left: 16px;
> .MuiTabs-scroller {
overflow: auto !important;
}
}
}
> .panel-content {
Expand Down

0 comments on commit 0d8fd2b

Please sign in to comment.