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

fix(ui): Fix segmenter yup validation schema #83

Merged

Conversation

deadlycoconuts
Copy link
Contributor

What this PR does / why we need it:
This PR introduces an additional fix to the yup validation schema, as a follow up from #80. In particular, the fix in this PR addresses this change:

  • When using the same Schema.when function but passing a function directly as an argument instead of the builder object, the signature of the expected function has also been updated from (value, schema)=> Schema): Schema to (values: any[], schema) => Schema): Schema.

    Existing schemas that do not follow this convention now have been updated to reflect the new expected array:

    Example:

    // before
    some_field: yup.string().when("some_other_field", (some_other_field, schema) =>
      some_other_field ? yup.string().required("this is needed") : schema
    ),
    
    // after
    some_field: yup.string().when("some_other_field", ([some_other_field], schema) =>
      some_other_field ? yup.string().required("this is needed") : schema
    ),

Which issue(s) this PR fixes:

Fixes #

@deadlycoconuts deadlycoconuts added the bug Something isn't working label Aug 7, 2024
@deadlycoconuts deadlycoconuts self-assigned this Aug 7, 2024
@deadlycoconuts deadlycoconuts marked this pull request as ready for review August 7, 2024 13:58
Copy link

@tiopramayudi tiopramayudi left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @deadlycoconuts

@deadlycoconuts
Copy link
Contributor Author

Thanks for the quick review @tiopramayudi, I'll merge this after rebasing this branch once the other PR with the CICD fixes is merged!

@deadlycoconuts deadlycoconuts merged commit efc4e48 into caraml-dev:main Aug 8, 2024
7 checks passed
@deadlycoconuts deadlycoconuts deleted the fix_segmenter_yup_validation branch August 8, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants