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

Sprint/mewtwo 2024 05 02 hotfix #135

Merged
merged 3 commits into from
May 6, 2024
Merged
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
22 changes: 14 additions & 8 deletions src/components/common/CreateNewLibraryDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
.map((element) => element.name);
setOrganizations(organizationsList);
});
}, []);

Check warning on line 56 in src/components/common/CreateNewLibraryDialog.tsx

View workflow job for this annotation

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

React Hook useEffect has a missing dependency: 'organizationApi'. Either include it or remove the dependency array
async function createCqlLibrary(cqlLibrary: CqlLibrary) {
cqlLibrary.librarySetId = uuidv4();
cqlLibraryServiceApi
Expand Down Expand Up @@ -142,6 +142,19 @@
setFocusedField(field);
};

const getFormikErrorMessage = (() => {
if (
(formik.touched["cqlLibraryName"] || focusedField === "cqlLibraryName") &&
formikErrorHandler("cqlLibraryName")
) {
return formikErrorHandler("cqlLibraryName");
} else {
if (formik.values.model === Model.QDM_5_6) {
return "Library name must start with an upper case letter, followed by alpha-numeric character(s) and must not contain spaces or other special characters except underscore for QDM.";
}
return "Library name must start with an upper case letter, followed by alpha-numeric character(s) and must not contain spaces or other special characters";
}
})();
return (
<div>
<MadieDialog
Expand Down Expand Up @@ -196,14 +209,7 @@
"aria-required": true,
required: true,
}}
helperText={
(formik.touched["cqlLibraryName"] ||
focusedField === "cqlLibraryName") &&
(formikErrorHandler("cqlLibraryName") ||
formik.values.model === Model.QDM_5_6
? "Library name must start with an upper case letter, followed by alpha-numeric character(s) and must not contain spaces or other special characters except of underscore for QDM."
: "Library name must start with an upper case letter, followed by alpha-numeric character(s) and must not contain spaces or other special characters")
}
helperText={getFormikErrorMessage}
size="small"
error={
formik.touched.cqlLibraryName &&
Expand Down
Loading