Skip to content

Commit

Permalink
Merge pull request #151 from MeasureAuthoringTool/hangouts_hotfix_MAT…
Browse files Browse the repository at this point in the history
…-7431

MAT-7431 incorrect message when library saved with blank cql
  • Loading branch information
adongare authored Jul 8, 2024
2 parents 97aa7f1 + 43541a9 commit 9f4202a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
4 changes: 3 additions & 1 deletion src/components/editCqlLibrary/EditCqlLibrary.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,9 @@ describe("Edit Cql Library Component", () => {
(synchingEditorCqlContent as jest.Mock)
.mockClear()
.mockImplementation(() => {
return "library UpdateName version '1.0.000'";
return {
cql: "library UpdateName version '1.0.000'",
};
});

isUsingEmpty.mockClear().mockImplementation(() => true);
Expand Down
46 changes: 24 additions & 22 deletions src/components/editCqlLibrary/EditCqlLibrary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,28 +242,30 @@ const EditCqlLibrary = () => {
resetForm();
let primaryMessage = "CQL updated successfully";
const secondaryMessages = [];
if (isUsingEmpty(updatedContent.cql)) {
secondaryMessages.push(
"Missing a using statement. Please add in a valid model and version."
);
}
if (updatedContent.isLibraryStatementChanged) {
secondaryMessages.push(
"Library statement was incorrect. MADiE has overwritten it."
);
}
if (updatedContent.isUsingStatementChanged) {
secondaryMessages.push(
"Using statement was incorrect. MADiE has overwritten it."
);
}
if (updatedContent.isValueSetChanged) {
secondaryMessages.push(
"MADiE does not currently support use of value set version directly in library at this time. Your value set versions have been removed. Please use the relevant manifest for value set expansion for testing."
);
}
if (secondaryMessages.length > 0) {
primaryMessage += " but the following issues were found";
if (updatedContent.cql) {
if (isUsingEmpty(updatedContent.cql)) {
secondaryMessages.push(
"Missing a using statement. Please add in a valid model and version."
);
}
if (updatedContent.isLibraryStatementChanged) {
secondaryMessages.push(
"Library statement was incorrect. MADiE has overwritten it."
);
}
if (updatedContent.isUsingStatementChanged) {
secondaryMessages.push(
"Using statement was incorrect. MADiE has overwritten it."
);
}
if (updatedContent.isValueSetChanged) {
secondaryMessages.push(
"MADiE does not currently support use of value set version directly in library at this time. Your value set versions have been removed. Please use the relevant manifest for value set expansion for testing."
);
}
if (secondaryMessages.length > 0) {
primaryMessage += " but the following issues were found";
}
}
setSuccess({
status: "success",
Expand Down

0 comments on commit 9f4202a

Please sign in to comment.