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: Reimplement #2548 to fix #2262 #3399

Merged

Conversation

heath-freenome
Copy link
Member

@heath-freenome heath-freenome commented Jan 25, 2023

Reasons for making this change

Fixes: #2262 by reimplementing #2548

  • Updated @rjsf/utils to update the toPathSchema() method to pick the closest matching option for oneOf/anyOf choices to render a path schema for it
    • Updated test to maintain 100% coverage
  • Updated @rjsf/core to cache retrieved options in state for use in the rest of the component
    • Also improved enumOptions to output better labels for options without them when a title is available in either the schema or uiSchema
    • Added tests to validate both fixes
  • Updated the CHANGELOG.md accordingly

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

Fixes: rjsf-team#2262
- Updated `@rjsf/utils` to update the `toPathSchema()` method to pick the closest matching option for `oneOf`/`anyOf` choices to render a path schema for it
  - Updated test to maintain 100% coverage
- Updated `@rjsf/core` to cache retrieved options in state for use in the rest of the component
  - Also improved enumOptions to output better labels for options without them when a title is available in either the `schema` or `uiSchema`
  - Added tests to validate both fixes
- Updated the `CHANGELOG.md` accordingly
@nickgros nickgros changed the title fix: Reimplement 2548 to fix 2262 fix: Reimplement #2548 to fix #2262 Jan 25, 2023
packages/core/src/components/fields/MultiSchemaField.tsx Outdated Show resolved Hide resolved
packages/core/src/components/fields/MultiSchemaField.tsx Outdated Show resolved Hide resolved
packages/core/src/components/fields/MultiSchemaField.tsx Outdated Show resolved Hide resolved
packages/core/src/components/fields/MultiSchemaField.tsx Outdated Show resolved Hide resolved
packages/core/src/components/fields/MultiSchemaField.tsx Outdated Show resolved Hide resolved
packages/core/src/components/fields/MultiSchemaField.tsx Outdated Show resolved Hide resolved
packages/core/src/components/fields/MultiSchemaField.tsx Outdated Show resolved Hide resolved
packages/core/src/components/fields/MultiSchemaField.tsx Outdated Show resolved Hide resolved
packages/core/src/components/fields/MultiSchemaField.tsx Outdated Show resolved Hide resolved
packages/core/src/components/fields/MultiSchemaField.tsx Outdated Show resolved Hide resolved
- Accepted reviewer suggestions

Co-authored-by: Nick Grosenbacher <nickgrosenbacher@gmail.com>
@heath-freenome heath-freenome merged commit 766dae4 into rjsf-team:main Jan 25, 2023
@heath-freenome heath-freenome deleted the fix-2262-by-reimplementing-2548 branch January 25, 2023 21:59
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.

Unable to input formData for oneOf while omitExtraData and liveOmit is set to true
2 participants