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

feat: prioritize override values in initialValues #1166

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

roryscot
Copy link

@roryscot roryscot commented Jul 26, 2024

  • feat: prioritize override values in initialValues
  • chore(release): v3.0.0

Problem

Generated forms currently require manual editing to incorporate override values, which makes them less scalable and limits their out-of-the-box usability.

Solution

Implement a mechanism to pass override properties as default values for the form's modelFields or initialValues. This approach will enable most custom logic to be handled externally, enhancing the versatility and out-of-the-box usability of the generated forms.

Additional Notes

Links

Ticket

GitHub issue:

#1165

Verification

Manual tests

Automated tests

  • Unit tests added/updated
  • E2E tests added/updated
  • N/A - (provide a reason)
  • deferred - (provide GitHub issue for tracking)

Housekeeping

  • No non-essential console logs
  • All new files contain license notice

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@roryscot roryscot requested a review from a team as a code owner July 26, 2024 19:26
@roryscot roryscot changed the title 1165 override initialValues form generation #1165 feat: prioritize override values in initialValues Jul 26, 2024
@roryscot
Copy link
Author

Closes #1165

@roryscot roryscot changed the title #1165 feat: prioritize override values in initialValues feat: prioritize override values in initialValues Jul 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.87%. Comparing base (8d8ecbe) to head (9d5d309).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1166   +/-   ##
=======================================
  Coverage   93.86%   93.87%           
=======================================
  Files         150      150           
  Lines        6114     6118    +4     
  Branches     1838     1841    +3     
=======================================
+ Hits         5739     5743    +4     
  Misses        357      357           
  Partials       18       18           
Files Coverage Δ
...react/lib/forms/form-renderer-helper/form-state.ts 98.96% <100.00%> (+0.02%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d8ecbe...9d5d309. Read the comment docs.

roryscot added 2 commits July 26, 2024 16:08
Update `initialValues` to check for values in `overrides` before default values.
This ensures that override values take precedence when available.
@roryscot roryscot force-pushed the 1165-override-initialValues-form-generation branch 2 times, most recently from 9d5d309 to f076d46 Compare July 26, 2024 23:45
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.

2 participants