Skip to content

Commit

Permalink
Merge pull request #394 from MeasureAuthoringTool/MAT-7969/fixingDele…
Browse files Browse the repository at this point in the history
…tingTheCodeAfterEditing

MAT-7969, 7987, 7989 fixed deleting code, applying code bug, displaying versions in libraries
  • Loading branch information
sb-prateekkeerthi authored Dec 4, 2024
2 parents e8c59ec + ce4efe6 commit e2ac37b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/CqlBuilderPanel/CqlBuilderPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default function CqlBuilderPanel({
cqlMetaData,
measureModel,
handleCodeDelete,
editorVal,
setEditorVal,
setIsCQLUnchanged,
isCQLUnchanged,
Expand Down Expand Up @@ -215,6 +216,7 @@ export default function CqlBuilderPanel({
cqlMetaData={cqlMetaData}
measureModel={measureModel}
handleCodeDelete={handleCodeDelete}
editorVal={editorVal}
setEditorVal={setEditorVal}
setIsCQLUnchanged={setIsCQLUnchanged}
isCQLUnchanged={isCQLUnchanged}
Expand Down
8 changes: 4 additions & 4 deletions src/CqlBuilderPanel/Includes/CqlLibraryDetailsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,17 @@ const CqlLibraryDetailsDialog = ({
}}
size="small"
onChange={(evt) => handleVersionChange(evt.target.value)}
options={library?.otherVersions?.map((version) => {
return (
options={library?.otherVersions
.sort((a, b) => b.localeCompare(a, undefined, { numeric: true }))
.map((version) => (
<MenuItem
key={version}
value={version}
data-testid={`option-${version}`}
>
{version}
</MenuItem>
);
})}
))}
/>
);
} else {
Expand Down
3 changes: 3 additions & 0 deletions src/CqlBuilderPanel/codesSection/CodesSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface CodesSectionProps {
cqlMetaData: CqlMetaData;
measureModel: string;
handleCodeDelete;
editorVal: string;
setEditorVal: Function;
setIsCQLUnchanged: Function;
isCQLUnchanged: boolean;
Expand All @@ -31,6 +32,7 @@ export default function CodesSection({
cqlMetaData,
measureModel,
handleCodeDelete,
editorVal,
setEditorVal,
setIsCQLUnchanged,
isCQLUnchanged,
Expand Down Expand Up @@ -87,6 +89,7 @@ export default function CodesSection({
canEdit={canEdit}
handleApplyCode={handleApplyCode}
measureModel={measureModel}
editorVal={editorVal}
/>
)}
{activeTab === "savedCodes" && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ interface CodeSectionProps {
allCodeSystems: CodeSystem[];
handleApplyCode: string;
measureModel: string;
editorVal: string;
}

export default function CodeSubSection({
canEdit,
allCodeSystems,
handleApplyCode,
measureModel,
editorVal,
}: CodeSectionProps) {
const [code, setCode] = useState<Code>();
const [showResultsTable, setShowResultsTable] = useState(false);
Expand Down Expand Up @@ -73,6 +75,7 @@ export default function CodeSubSection({
showResultsTable={showResultsTable}
setShowResultsTable={setShowResultsTable}
code={code}
editorVal={editorVal}
handleApplyCode={handleApplyCode}
/>
<Toast
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type ResultSectionProps = {
setShowResultsTable: any;
code: Code;
handleApplyCode;
editorVal: string;
};

type ResultsColumnRow = {
Expand All @@ -41,6 +42,7 @@ export default function ResultsSection({
setShowResultsTable,
code,
handleApplyCode,
editorVal,
}: ResultSectionProps) {
const [selectedCodeDetails, setSelectedCodeDetails] =
useState<ResultsColumnRow>(null);
Expand Down Expand Up @@ -116,7 +118,7 @@ export default function ResultsSection({
),
},
],
[]
[editorVal]
);

const table = useReactTable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export default function SavedCodesSubSection({
),
},
],
[]
[isCQLUnchanged]
);

const table = useReactTable({
Expand Down
1 change: 1 addition & 0 deletions src/cqlEditorWithTerminology/CqlEditorWithTerminology.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const CqlEditorWithTerminology = ({
setEditorVal={setEditorVal}
setIsCQLUnchanged={setIsCQLUnchanged}
isCQLUnchanged={isCQLUnchanged}
editorVal={value}
handleApplyCode={handleApplyCode}
handleApplyParameter={handleApplyParameter}
handleParameterEdit={handleParameterEdit}
Expand Down

0 comments on commit e2ac37b

Please sign in to comment.