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

[DUOS-2738][risk=no] Refactor dataset submission form validation #2358

Merged
merged 18 commits into from
Oct 23, 2023

Conversation

rushtong
Copy link
Contributor

@rushtong rushtong commented Oct 17, 2023

Addresses

https://broadworkbench.atlassian.net/browse/DUOS-2738

Summary

  • Refactor dataset submission form validation
  • Remove pre-compilation of schema
    • Precompiled validation functions from ajv-cli are buggy and difficult to debug
  • Move page components to pages directory

Note that this does not add the same kind of consent group name unique checks to the Study Update page. Will tackle that in a separate story.


Have you read Terra's Contributing Guide lately? If not, do that first.

  • Label PR with a Jira ticket number and include a link to the ticket
  • Label PR with a security risk modifier [no, low, medium, high]
  • PR describes scope of changes
  • Get a minimum of one thumbs worth of review, preferably two if enough team members are available
  • Get PO sign-off for all non-trivial UI or workflow changes
  • Verify all tests go green
  • Test this change deployed correctly and works on dev environment after deployment

@rushtong rushtong changed the title [DUOS-TODO][risk=no] Refactor dataset registration form validation [DUOS-2738][risk=no] Refactor dataset registration form validation Oct 17, 2023
@rushtong rushtong changed the title [DUOS-2738][risk=no] Refactor dataset registration form validation [DUOS-2738][risk=no] Refactor dataset submission form validation Oct 17, 2023
* @param errors Schema validation errors from Ajv
* @returns {{}}
*/
function errorsToValidation(errors) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code, and below, is essentially lifted from the deleted JsonSchemaUtils.js. This way, there are no changes to how dependent UI components handle validation.

@rushtong rushtong marked this pull request as ready for review October 20, 2023 15:07
@rushtong rushtong requested a review from a team as a code owner October 20, 2023 15:07
@rushtong rushtong marked this pull request as draft October 20, 2023 17:14
@rushtong rushtong marked this pull request as ready for review October 22, 2023 16:20
Copy link
Contributor

@fboulnois fboulnois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactor lgtm 👍

Copy link
Contributor

@hams7504 hams7504 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! 👍

@rushtong rushtong merged commit 647d255 into develop Oct 23, 2023
10 checks passed
@rushtong rushtong deleted the gr-ds-form-validation branch October 23, 2023 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants