From ac56a71dd8c7166b584f0d88c718d9ad92e04888 Mon Sep 17 00:00:00 2001 From: Prateek Keerthi Date: Tue, 3 Dec 2024 13:17:43 -0500 Subject: [PATCH 1/4] MAT-7969 fixed deleting code after editing the code --- .../savedCodesSubSection/SavedCodesSubSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CqlBuilderPanel/codesSection/codesSubSection/savedCodesSubSection/SavedCodesSubSection.tsx b/src/CqlBuilderPanel/codesSection/codesSubSection/savedCodesSubSection/SavedCodesSubSection.tsx index 64f99ec1..38b630f9 100644 --- a/src/CqlBuilderPanel/codesSection/codesSubSection/savedCodesSubSection/SavedCodesSubSection.tsx +++ b/src/CqlBuilderPanel/codesSection/codesSubSection/savedCodesSubSection/SavedCodesSubSection.tsx @@ -267,7 +267,7 @@ export default function SavedCodesSubSection({ ), }, ], - [] + [isCQLUnchanged] ); const table = useReactTable({ From 8d99200b27c74251d8f752601e3076bebcc51a16 Mon Sep 17 00:00:00 2001 From: Prateek Keerthi Date: Tue, 3 Dec 2024 13:53:49 -0500 Subject: [PATCH 2/4] MAT-7987 fixed applying the code --- src/CqlBuilderPanel/CqlBuilderPanel.tsx | 2 ++ src/CqlBuilderPanel/codesSection/CodesSection.tsx | 3 +++ .../codesSubSection/codeSubSection/CodeSubSection.tsx | 3 +++ .../codesSubSection/codeSubSection/ResultsSection.tsx | 4 +++- src/cqlEditorWithTerminology/CqlEditorWithTerminology.tsx | 1 + 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/CqlBuilderPanel/CqlBuilderPanel.tsx b/src/CqlBuilderPanel/CqlBuilderPanel.tsx index 99ce7634..a5007995 100644 --- a/src/CqlBuilderPanel/CqlBuilderPanel.tsx +++ b/src/CqlBuilderPanel/CqlBuilderPanel.tsx @@ -21,6 +21,7 @@ export default function CqlBuilderPanel({ cqlMetaData, measureModel, handleCodeDelete, + editorVal, setEditorVal, setIsCQLUnchanged, isCQLUnchanged, @@ -215,6 +216,7 @@ export default function CqlBuilderPanel({ cqlMetaData={cqlMetaData} measureModel={measureModel} handleCodeDelete={handleCodeDelete} + editorVal={editorVal} setEditorVal={setEditorVal} setIsCQLUnchanged={setIsCQLUnchanged} isCQLUnchanged={isCQLUnchanged} diff --git a/src/CqlBuilderPanel/codesSection/CodesSection.tsx b/src/CqlBuilderPanel/codesSection/CodesSection.tsx index ef286f94..30634080 100644 --- a/src/CqlBuilderPanel/codesSection/CodesSection.tsx +++ b/src/CqlBuilderPanel/codesSection/CodesSection.tsx @@ -19,6 +19,7 @@ interface CodesSectionProps { cqlMetaData: CqlMetaData; measureModel: string; handleCodeDelete; + editorVal: string; setEditorVal: Function; setIsCQLUnchanged: Function; isCQLUnchanged: boolean; @@ -31,6 +32,7 @@ export default function CodesSection({ cqlMetaData, measureModel, handleCodeDelete, + editorVal, setEditorVal, setIsCQLUnchanged, isCQLUnchanged, @@ -87,6 +89,7 @@ export default function CodesSection({ canEdit={canEdit} handleApplyCode={handleApplyCode} measureModel={measureModel} + editorVal={editorVal} /> )} {activeTab === "savedCodes" && ( diff --git a/src/CqlBuilderPanel/codesSection/codesSubSection/codeSubSection/CodeSubSection.tsx b/src/CqlBuilderPanel/codesSection/codesSubSection/codeSubSection/CodeSubSection.tsx index 73aaa7d6..db885e14 100644 --- a/src/CqlBuilderPanel/codesSection/codesSubSection/codeSubSection/CodeSubSection.tsx +++ b/src/CqlBuilderPanel/codesSection/codesSubSection/codeSubSection/CodeSubSection.tsx @@ -13,6 +13,7 @@ interface CodeSectionProps { allCodeSystems: CodeSystem[]; handleApplyCode: string; measureModel: string; + editorVal: string; } export default function CodeSubSection({ @@ -20,6 +21,7 @@ export default function CodeSubSection({ allCodeSystems, handleApplyCode, measureModel, + editorVal, }: CodeSectionProps) { const [code, setCode] = useState(); const [showResultsTable, setShowResultsTable] = useState(false); @@ -73,6 +75,7 @@ export default function CodeSubSection({ showResultsTable={showResultsTable} setShowResultsTable={setShowResultsTable} code={code} + editorVal={editorVal} handleApplyCode={handleApplyCode} /> (null); @@ -116,7 +118,7 @@ export default function ResultsSection({ ), }, ], - [] + [editorVal] ); const table = useReactTable({ diff --git a/src/cqlEditorWithTerminology/CqlEditorWithTerminology.tsx b/src/cqlEditorWithTerminology/CqlEditorWithTerminology.tsx index 3d4404ec..136ea762 100644 --- a/src/cqlEditorWithTerminology/CqlEditorWithTerminology.tsx +++ b/src/cqlEditorWithTerminology/CqlEditorWithTerminology.tsx @@ -110,6 +110,7 @@ const CqlEditorWithTerminology = ({ setEditorVal={setEditorVal} setIsCQLUnchanged={setIsCQLUnchanged} isCQLUnchanged={isCQLUnchanged} + editorVal={value} handleApplyCode={handleApplyCode} handleApplyParameter={handleApplyParameter} handleParameterEdit={handleParameterEdit} From 970c76a14d5876076a6923edb093d28fa3afee3b Mon Sep 17 00:00:00 2001 From: Prateek Keerthi Date: Wed, 4 Dec 2024 10:13:24 -0500 Subject: [PATCH 3/4] MAT-7989 display library versions in descending order --- src/CqlBuilderPanel/Includes/CqlLibraryDetailsDialog.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/CqlBuilderPanel/Includes/CqlLibraryDetailsDialog.tsx b/src/CqlBuilderPanel/Includes/CqlLibraryDetailsDialog.tsx index 6f0e56a3..92425f71 100644 --- a/src/CqlBuilderPanel/Includes/CqlLibraryDetailsDialog.tsx +++ b/src/CqlBuilderPanel/Includes/CqlLibraryDetailsDialog.tsx @@ -143,8 +143,10 @@ const CqlLibraryDetailsDialog = ({ }} size="small" onChange={(evt) => handleVersionChange(evt.target.value)} - options={library?.otherVersions?.map((version) => { - return ( + options={library?.otherVersions + ?.filter((version) => /^\d+(\.\d+)*$/.test(version)) // filtering valid version strings + .sort((a, b) => b.localeCompare(a, undefined, { numeric: true })) // sort in descending numeric order + .map((version) => ( {version} - ); - })} + ))} /> ); } else { From ce4efe610c2cfc77b15490e852a7a61da7256821 Mon Sep 17 00:00:00 2001 From: Prateek Keerthi Date: Wed, 4 Dec 2024 10:46:42 -0500 Subject: [PATCH 4/4] MAT-7989 removed unwanted check --- src/CqlBuilderPanel/Includes/CqlLibraryDetailsDialog.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/CqlBuilderPanel/Includes/CqlLibraryDetailsDialog.tsx b/src/CqlBuilderPanel/Includes/CqlLibraryDetailsDialog.tsx index 92425f71..72d83e2f 100644 --- a/src/CqlBuilderPanel/Includes/CqlLibraryDetailsDialog.tsx +++ b/src/CqlBuilderPanel/Includes/CqlLibraryDetailsDialog.tsx @@ -144,8 +144,7 @@ const CqlLibraryDetailsDialog = ({ size="small" onChange={(evt) => handleVersionChange(evt.target.value)} options={library?.otherVersions - ?.filter((version) => /^\d+(\.\d+)*$/.test(version)) // filtering valid version strings - .sort((a, b) => b.localeCompare(a, undefined, { numeric: true })) // sort in descending numeric order + .sort((a, b) => b.localeCompare(a, undefined, { numeric: true })) .map((version) => (