-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 for ui:options label & description #2537
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 tasks
newt10
added
awaiting review
labelOrDescription
Relating to labels and descriptions of fields in the form
labels
Sep 3, 2021
epicfaace
reviewed
Sep 3, 2021
@epicfaace I have made the changes based on your review. Let me know if you need anything else in order to merge this. |
LGTM |
newt10
force-pushed
the
fix/displayLabel
branch
from
September 11, 2021 00:19
93c278b
to
c6104cf
Compare
@newt10 With the conversion to typescript in v5, I was wondering if you had time to refactor this onto the latest changes in master? |
heath-freenome
added
awaiting changes
v5 refactor
Needs refactor due to v5 breaking changes
and removed
awaiting review
labels
Sep 7, 2022
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this pull request
Oct 10, 2022
…rray description and title Fix rjsf-team#2535 by reimplementing rjsf-team#2537 - In `@rjsf/utils`, updated the props for the description and title templates to add `schema` - Also made the `title` and `description` for the array field description and title props as optional - In all of the themes, ensured that the `schema` is now passed to the all the calls to the description and title templates - With the exception of the `antd` theme, removed the logic for conditionally rendering the `ArrayFieldDescriptionTemplate` since that template already handles the condition - In `@rjsf/core`, updated the `ArrayFieldDescriptionTemplate` and `ArrayFieldTitleTemplate` to not render the template when `ui:label` is false - Updated the tests to verify this change - Updated the `custom-templates.md` file to document the new `schema` prop and add the `uiSchema` prop docs where missing - Updated the `contributing.md` file to improve developer documentation - Updated the `CHANGELOG.md` file accordingly
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this pull request
Oct 10, 2022
…rray description and title Fix rjsf-team#2535 by reimplementing rjsf-team#2537 - In `@rjsf/utils`, updated the props for the description and title templates to add `schema` - Also made the `title` and `description` for the array field description and title props as optional - In all of the themes, ensured that the `schema` is now passed to the all the calls to the description and title templates - With the exception of the `antd` theme, removed the logic for conditionally rendering the `ArrayFieldDescriptionTemplate` since that template already handles the condition - Deleted the tests for `DescriptionField` and `TitleField` in the `bootstrap-4` theme because they broke, and are redundant anyway given the other tests - In `@rjsf/core`, updated the `ArrayFieldDescriptionTemplate` and `ArrayFieldTitleTemplate` to not render the template when `ui:label` is false - Updated the tests to verify this change - Updated the `custom-templates.md` file to document the new `schema` prop and add the `uiSchema` prop docs where missing - Updated the `contributing.md` file to improve developer documentation - Updated the `CHANGELOG.md` file accordingly
8 tasks
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this pull request
Oct 10, 2022
…rray description and title Fix rjsf-team#2535 by reimplementing rjsf-team#2537. Also fixes rjsf-team#3176 by passing uiSchema and schema to the description and title templates. - In `@rjsf/utils`, updated the props for the description and title templates to add `schema` - Also made the `title` and `description` for the array field description and title props as optional - In all of the themes, ensured that the `schema` is now passed to the all the calls to the description and title templates - With the exception of the `antd` theme, removed the logic for conditionally rendering the `ArrayFieldDescriptionTemplate` since that template already handles the condition - Deleted the tests for `DescriptionField` and `TitleField` in the `bootstrap-4` theme because they broke, and are redundant anyway given the other tests - In `@rjsf/core`, updated the `ArrayFieldDescriptionTemplate` and `ArrayFieldTitleTemplate` to not render the template when `ui:label` is false - Updated the tests to verify this change - Updated the `custom-templates.md` file to document the new `schema` prop and add the `uiSchema` prop docs where missing - Updated the `contributing.md` file to improve developer documentation - Updated the `CHANGELOG.md` file accordingly
heath-freenome
added a commit
that referenced
this pull request
Oct 10, 2022
…ription and title (#3191) Fix #2535 by reimplementing #2537. Also fixes #3176 by passing uiSchema and schema to the description and title templates. - In `@rjsf/utils`, updated the props for the description and title templates to add `schema` - Also made the `title` and `description` for the array field description and title props as optional - In all of the themes, ensured that the `schema` is now passed to the all the calls to the description and title templates - With the exception of the `antd` theme, removed the logic for conditionally rendering the `ArrayFieldDescriptionTemplate` since that template already handles the condition - Deleted the tests for `DescriptionField` and `TitleField` in the `bootstrap-4` theme because they broke, and are redundant anyway given the other tests - In `@rjsf/core`, updated the `ArrayFieldDescriptionTemplate` and `ArrayFieldTitleTemplate` to not render the template when `ui:label` is false - Updated the tests to verify this change - Updated the `custom-templates.md` file to document the new `schema` prop and add the `uiSchema` prop docs where missing - Updated the `contributing.md` file to improve developer documentation - Updated the `CHANGELOG.md` file accordingly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
awaiting changes
bug
core
labelOrDescription
Relating to labels and descriptions of fields in the form
p1
Important to fix soon
uiSchema
v5 refactor
Needs refactor due to v5 breaking changes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reasons for making this change
There are many bugs describing the problem with the current code ignoring some settings from uiSchema; namely
This changeset fixes above problems for all fields, array fields and object fields. Labels are hidden when the ui:options {label: false} is provided as well as title and description fields from ui:options are applied as per the documentation.
If this is related to existing tickets, include links to them as well. Use the syntax fixes #2535 .
Checklist
Note
Screenshots
Tests passing after the code change
Tests failing before code change
https://pastebin.com/QE2a9jqv