Skip to content

Commit

Permalink
Add nonOptional property to typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
amitbadala committed Nov 3, 2023
1 parent b879cdf commit ae369cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/for-tests/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ function getFormFields() {

function getSignInFormFields() {
let showDefaultFields = localStorage.getItem("SHOW_SIGNIN_DEFAULT_FIELDS");
let showFieldsWithNonOptionalErrMsg = localStorage.getItem("SHOW_SIGNIN_WITH_NON_OPTIONAL_ERROR_MESSAGE");
if (showDefaultFields === "YES") {
return {
formFields: [
Expand All @@ -738,6 +739,15 @@ function getSignInFormFields() {
},
],
};
} else if (showFieldsWithNonOptionalErrMsg === "YES") {
return {
formFields: [
{
id: "email",
nonOptionalErrorMsg: "Please add email",
},
],
};
}
return {};
}
Expand Down
1 change: 1 addition & 0 deletions test/with-typescript/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ function getEmailPasswordConfigs() {
id: "terms",
label: "",
optional: false,
nonOptionalErrorMsg: "Please check Terms and conditions",
getDefaultValue: () => "true",
inputComponent: (inputProps) => (
<div
Expand Down

0 comments on commit ae369cb

Please sign in to comment.