Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mat 7795 delete function #414

Merged
merged 5 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},
"dependencies": {
"@madie/cql-antlr-parser": "^1.0.9",
"@madie/madie-design-system": "^1.2.37",
"@madie/madie-design-system": "^1.2.39",
"@material-ui/core": "^4.12.4",
"@mui/icons-material": "^5.5.1",
"@mui/lab": "^5.0.0-alpha.73",
Expand Down
1 change: 1 addition & 0 deletions src/AceEditor/madie-ace-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
) => void;
handleDeleteLibrary?: (lib: SelectedLibrary) => void;
handleApplyFunction?: (funct: Funct) => void;
handleFunctionDelete?: (funct: any) => void;
parseDebounceTime?: number;
inboundAnnotations?: Ace.Annotation[];
inboundErrorMarkers?: Ace.MarkerLike[];
Expand Down Expand Up @@ -480,7 +481,7 @@
console.warn("Editor is not set! Cannot set annotations!", editor);
}
}
}, [parserAnnotations, inboundAnnotations, editor]);

Check warning on line 484 in src/AceEditor/madie-ace-editor.tsx

View workflow job for this annotation

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

React Hook useEffect has missing dependencies: 'customSetAnnotations' and 'validationsEnabled'. Either include them or remove the dependency array
const toggleSearchBox = () => {
// given the searchBox has not been instantiated we execCommand which also triggers show
//@ts-ignore
Expand Down Expand Up @@ -522,7 +523,7 @@
toggleSearchBox as EventListener
);
};
}, [editor, parseErrorMarkers, inboundErrorMarkers]);

Check warning on line 526 in src/AceEditor/madie-ace-editor.tsx

View workflow job for this annotation

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

React Hook useEffect has missing dependencies: 'toggleSearchBox' and 'validationsEnabled'. Either include them or remove the dependency array

useEffect(() => {
const cqlMode = new CqlMode();
Expand All @@ -534,14 +535,14 @@
debouncedParse.cancel();
}
};
}, [debouncedParse]);

Check warning on line 538 in src/AceEditor/madie-ace-editor.tsx

View workflow job for this annotation

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

React Hook useEffect has a missing dependency: 'validationsEnabled'. Either include it or remove the dependency array

useEffect(() => {
if (!_.isNil(value) && editor && validationsEnabled) {
setParsing(true);
debouncedParse(value, editor);
}
}, [value, editor, debouncedParse]);

Check warning on line 545 in src/AceEditor/madie-ace-editor.tsx

View workflow job for this annotation

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

React Hook useEffect has a missing dependency: 'validationsEnabled'. Either include it or remove the dependency array

useEffect(() => {
// This is to set aria-label on textarea for accessibility
Expand Down
2 changes: 2 additions & 0 deletions src/CqlBuilderPanel/CqlBuilderPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
handleDefinitionEdit,
handleDefinitionDelete,
handleApplyFunction,
handleFunctionDelete,
resetCql,
getCqlDefinitionReturnTypes,
makeExpanded,
Expand Down Expand Up @@ -125,7 +126,7 @@
} else {
setLoading(false);
}
}, [measureModel, measureStoreCql]);

Check warning on line 129 in src/CqlBuilderPanel/CqlBuilderPanel.tsx

View workflow job for this annotation

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

React Hook useEffect has missing dependencies: 'fhirElmTranslationServiceApi' and 'qdmElmTranslationServiceApi'. Either include them or remove the dependency array

return (
<div className="right-panel">
Expand Down Expand Up @@ -244,6 +245,7 @@
cqlBuilderLookupsTypes={cqlBuilderLookupsTypes}
canEdit={canEdit}
handleApplyFunction={handleApplyFunction}
handleFunctionDelete={handleFunctionDelete}
loading={loading}
cql={measureStoreCql}
isCQLUnchanged={isCQLUnchanged}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe("FunctionsSection", () => {
const editButon0 = screen.getByTestId("edit-button-0");
userEvent.click(editButon0);
expect(screen.getByTestId("discard-dialog")).toBeInTheDocument();
expect(screen.getByText("Discard Changes?")).toBeInTheDocument();
expect(screen.getByText("You have unsaved changes.")).toBeInTheDocument();
const cancelBtn = screen.getByTestId("discard-dialog-cancel-button");
const discardBtn = screen.getByTestId("discard-dialog-continue-button");
expect(cancelBtn).toBeInTheDocument();
Expand Down Expand Up @@ -139,7 +139,7 @@ describe("FunctionsSection", () => {
const editButon0 = screen.getByTestId("edit-button-0");
userEvent.click(editButon0);
expect(screen.getByTestId("discard-dialog")).toBeInTheDocument();
expect(screen.getByText("Discard Changes?")).toBeInTheDocument();
expect(screen.getByText("You have unsaved changes.")).toBeInTheDocument();
const cancelBtn = screen.getByTestId("discard-dialog-cancel-button");
expect(cancelBtn).toBeInTheDocument();
userEvent.click(cancelBtn);
Expand Down
5 changes: 4 additions & 1 deletion src/CqlBuilderPanel/functionsSection/FunctionsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import { CqlAntlr } from "@madie/cql-antlr-parser/dist/src";
export interface FunctionProps {
canEdit: boolean;
handleApplyFunction?: Function;
handleFunctionDelete?: Function;
loading: boolean;
cqlBuilderLookupsTypes?: CqlBuilderLookup;
cql: string;
isCQLUnchanged: boolean;
functions?: FunctionLookup[];
resetCql?: Function;
resetCql: Function;
}

const getArgumentNames = (logic: string) => {
Expand All @@ -30,6 +31,7 @@ export default function FunctionsSection({
isCQLUnchanged,
cqlBuilderLookupsTypes,
resetCql,
handleFunctionDelete,
loading,
}: FunctionProps) {
const [activeTab, setActiveTab] = useState<string>("function");
Expand Down Expand Up @@ -96,6 +98,7 @@ export default function FunctionsSection({
cql={cql}
resetCql={resetCql}
handleApplyFunction={handleApplyFunction}
handleFunctionDelete={handleFunctionDelete}
/>
)}
</div>
Expand Down
Loading
Loading