-
Notifications
You must be signed in to change notification settings - Fork 84
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
fix: correct date validation for disabled fields #7240
Conversation
console.log('disable validaton', disableRequiredValidation) | ||
const validationRules = useMemo( | ||
() => createDateValidationRules(schema, disableRequiredValidation), | ||
[schema, disableRequiredValidation], | ||
) | ||
|
||
console.log('validation rules', validationRules) | ||
const { submissionId } = useParams() | ||
console.log('submission id', submissionId) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this section needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
omg, sorry! 😔 thanks for pointing this out! 🙏🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
We should open a ticket to investigate this since this behavior is a bit different from other fields
In other field types, we disable the validation only for required-ness, but if an answer exists it must pass the other field validations. Now for the date field, we are disabling all validation completely. I think this is actually okay for all other fields too, since we have backend validation that the non-editable fields were not modified from the backend. we can consider doing this for all the other field types as well.
* chore(deps-dev): bump @types/express from 4.17.17 to 4.17.21 (#7233) Bumps [@types/express](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express) from 4.17.17 to 4.17.21. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/express) --- updated-dependencies: - dependency-name: "@types/express" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(deps): bump nan from 2.17.0 to 2.19.0 (#7212) Bumps [nan](https://github.com/nodejs/nan) from 2.17.0 to 2.19.0. - [Changelog](https://github.com/nodejs/nan/blob/main/CHANGELOG.md) - [Commits](nodejs/nan@v2.17.0...v2.19.0) --- updated-dependencies: - dependency-name: nan dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @types/json-stringify-safe from 5.0.0 to 5.0.3 (#7235) Bumps [@types/json-stringify-safe](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/json-stringify-safe) from 5.0.0 to 5.0.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/json-stringify-safe) --- updated-dependencies: - dependency-name: "@types/json-stringify-safe" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(mrf): handling for incorrect submission secret key in url query params (#7219) * fix: add secret key input mask (#7227) * fix: add secret key input mask * fix: add testid to allow storybook to capture inputfield with password type * fix(mrf): workflow email UI cleanup (#7215) * fix: mrf workflow email UI cleanup * chore: update button formatting * fix: more fixes * chore: change port for react-email-preview to 4242 * chore: add comment on email defaults * fix: potentially unsafe external url * chore(mrf): remove flags (#7230) chore: remove mrf flag checks * chore(mrf): add announcement content (#7229) * chore: add mrf announcement content * chore: update mrf guide links * chore: update date to 04-04 * chore: remove exclamation mark after url link * fix: correct date validation for disabled fields (#7240) * fix: correct date validation for disabled fields * fix: removing console logs * chore: bump version to v6.115.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Justyn Oh <justynoh@gmail.com> Co-authored-by: Kathleen Koh <89055608+kathleenkhy@users.noreply.github.com>
Problem
There is a bug in the validation for dates where if a date field had been input by Respondent 1, and the date violates the validation when it reaches Respondent 2+ (and the fields are disabled), there is still a validation in place that could prevent Respondent 2 onwards from submitting the form
Closes FRM-1706
Solution
To remove the validation for disabled fields for Respondent 2 onwards
Breaking Changes
Tests