Skip to content

Commit

Permalink
Adhoc fixes 91 (#1912)
Browse files Browse the repository at this point in the history
* updates to validation

* Update health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* updated regex

---------

Co-authored-by: Nipun Arora <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 27, 2024
1 parent 7924f59 commit 3e214a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ const FormulaConfiguration = ({ onSelect, category, customProps, formulas: initi
});
return;
}

if (!(selectedDeletedFormula?.name && /^(?=.*[a-zA-Z])[a-zA-Z0-9]+$/.test(selectedDeletedFormula?.name))) {
if (selectedDeletedFormula?.code === "NEW_FORMULA" && !(selectedDeletedFormula?.name && /^(?=.*[a-zA-Z])[a-zA-Z0-9]+(?: [a-zA-Z0-9]+)*$/.test(selectedDeletedFormula?.name))) {
setShowToast({
key: "error",
label: t("MP_FORMULA_NAME_INVALID") ,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,9 @@ const Hypothesis = ({ category, assumptions: initialAssumptions, setShowToast, a
return;
}


//alphanumeric name of assumption
if (!(selectedDeletedAssumption?.name && /^(?=.*[a-zA-Z])[a-zA-Z0-9]+$/.test(selectedDeletedAssumption?.name))) {
if (selectedDeletedAssumption?.code === "NEW_ASSUMPTION" && !(selectedDeletedAssumption?.name && /^(?=.*[a-zA-Z])[a-zA-Z0-9]+(?: [a-zA-Z0-9]+)*$/.test(selectedDeletedAssumption?.name))) {
setShowToast({
key: "error",
label: t("MP_ASSUMPTION_NAME_INVALID") ,
Expand Down

0 comments on commit 3e214a9

Please sign in to comment.