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

title for oneOf only renders in default theme #2399

Closed
3 tasks done
Morriz opened this issue May 26, 2021 · 1 comment
Closed
3 tasks done

title for oneOf only renders in default theme #2399

Morriz opened this issue May 26, 2021 · 1 comment
Labels

Comments

@Morriz
Copy link

Morriz commented May 26, 2021

Prerequisites

  • I have read the documentation;
  • In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
  • I'm providing a shared playground link demonstrating the issue.

Description

Only the default theme shows the title of a schema with a oneOf. When changing to any of the other themes the title is not rendered.

Steps to Reproduce

  1. check the sample
  2. change theme

Expected behavior

The title to be rendered.

Version

2.5.1

@Morriz
Copy link
Author

Morriz commented May 26, 2021

And the description on that same level is rendered underneath without styling, as if it was also not taken into account. It is rendered inconsistently for the themes as well, I will create a separate bug report for that.

@jacqueswho jacqueswho added the bug label Feb 22, 2022
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Mar 22, 2023
…layed correctly

Fixes rjsf-team#827, rjsf-team#2636, rjsf-team#2399, rjsf-team#2791, rjsf-team#3231, and rjsf-team#3531 so that titles, descriptions and labels are picked up from uiSchema then schema and are hidden correctly when `label` in uiSchema is false
- Updated `@rjsf/utils` to add `displayLabel` to `WidgetProps`
- Updated `@rjsf/core` to fix the bugs as follows:
  - Updated `ArrayField`, `MultiSchemaField`, `StringField` to pass the label as `uiOptions.title || schema.title || name` as well as passing `displayLabel` from the `uiOptions`
  - Updated `ObjectField` to not pass `title` or `description` when `displayLabel` is false and `ObjectTitleTemplate` to only check `title` and `description`
  - Updated `ArrayFieldDescriptionTemplate` and `ArrayFieldTitleTemplate` to pass `globalUiOptions` into `getUiOptions` to pick up the global `label`
  - Updated `CheckboxWidget` to not show description when `displayLabel` is false
- Updated `@rjsf/antd` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
- Updated `@rjsf/bootstrap-4` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `RangeWidget` to only pass `label` in the `extraProps` when `displayLabel` is true
- Updated `@rjsf/chakra-ui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget`, `TextareaWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated test snapshots due to fixed bugs
- Updated `@rjsf/fluent-ui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `ColorWidget`, `DateWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated `FieldTemplate` to hide description when `displayLabel` is false
  - Updated test snapshots due to fixed bugs
- Updated `@rjsf/material-ui` and `@rjsf/mui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget` and `SelectWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated test snapshots due to fixed bugs
- Updated `@rjsf/semantic-ui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `SelectWidget` and `TextareaWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated test snapshots due to fixed bugs
- Updated the `widget` documentation for the new `displayLabel` prop
- Updated the `CHANGELOG.md` file accordingly
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Mar 22, 2023
…layed correctly

Fixes rjsf-team#827, rjsf-team#2636, rjsf-team#2399, rjsf-team#2791, rjsf-team#3231, and rjsf-team#3531 so that titles, descriptions and labels are picked up from uiSchema then schema and are hidden correctly when `label` in uiSchema is false
- Updated `@rjsf/utils` to add `displayLabel` to `WidgetProps`
- Updated `@rjsf/core` to fix the bugs as follows:
  - Updated `ArrayField`, `MultiSchemaField`, `StringField` to pass the label as `uiOptions.title || schema.title || name` as well as passing `displayLabel` from the `uiOptions`
  - Updated `ObjectField` to not pass `title` or `description` when `displayLabel` is false and `ObjectTitleTemplate` to only check `title` and `description`
  - Updated `ArrayFieldDescriptionTemplate` and `ArrayFieldTitleTemplate` to pass `globalUiOptions` into `getUiOptions` to pick up the global `label`
  - Updated `CheckboxWidget` to not show description when `displayLabel` is false
- Updated `@rjsf/antd` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
- Updated `@rjsf/bootstrap-4` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `RangeWidget` to only pass `label` in the `extraProps` when `displayLabel` is true
- Updated `@rjsf/chakra-ui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget`, `TextareaWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated test snapshots due to fixed bugs
- Updated `@rjsf/fluent-ui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `ColorWidget`, `DateWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated `FieldTemplate` to hide description when `displayLabel` is false
  - Updated test snapshots due to fixed bugs
- Updated `@rjsf/material-ui` and `@rjsf/mui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget` and `SelectWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated test snapshots due to fixed bugs
- Updated `@rjsf/semantic-ui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `SelectWidget` and `TextareaWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated test snapshots due to fixed bugs
- Updated the `widget` documentation for the new `displayLabel` prop
- Updated the `CHANGELOG.md` file accordingly
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Mar 22, 2023
…layed correctly

Fixes rjsf-team#827, rjsf-team#2636, rjsf-team#2399, rjsf-team#2791, rjsf-team#3231, and rjsf-team#3531 so that titles, descriptions and labels are picked up from uiSchema then schema and are hidden correctly when `label` in uiSchema is false
- Updated `@rjsf/utils` to add `displayLabel` to `WidgetProps`
- Updated `@rjsf/core` to fix the bugs as follows:
  - Updated `ArrayField`, `MultiSchemaField`, `StringField` to pass the label as `uiOptions.title || schema.title || name` as well as passing `displayLabel` from the `uiOptions`
  - Updated `ObjectField` to not pass `title` or `description` when `displayLabel` is false and `ObjectTitleTemplate` to only check `title` and `description`
  - Updated `ArrayFieldDescriptionTemplate` and `ArrayFieldTitleTemplate` to pass `globalUiOptions` into `getUiOptions` to pick up the global `label`
  - Updated `CheckboxWidget` to not show description when `displayLabel` is false
- Updated `@rjsf/antd` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
- Updated `@rjsf/bootstrap-4` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `RangeWidget` to only pass `label` in the `extraProps` when `displayLabel` is true
- Updated `@rjsf/chakra-ui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget`, `TextareaWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated test snapshots due to fixed bugs
- Updated `@rjsf/fluent-ui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `ColorWidget`, `DateWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated `FieldTemplate` to hide description when `displayLabel` is false
  - Updated test snapshots due to fixed bugs
- Updated `@rjsf/material-ui` and `@rjsf/mui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget` and `SelectWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated test snapshots due to fixed bugs
- Updated `@rjsf/semantic-ui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `SelectWidget` and `TextareaWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated test snapshots due to fixed bugs
- Updated the `widget` documentation for the new `displayLabel` prop
- Updated the `CHANGELOG.md` file accordingly
heath-freenome added a commit that referenced this issue Mar 24, 2023
…layed correctly (#3533)

* fix: many bugs related to titles, descriptions, labels not being displayed correctly
Fixes #827, #2636, #2399, #2791, #3231, and #3531 so that titles, descriptions and labels are picked up from uiSchema then schema and are hidden correctly when `label` in uiSchema is false
- Updated `@rjsf/utils` to add `displayLabel` to `WidgetProps`
- Updated `@rjsf/core` to fix the bugs as follows:
  - Updated `ArrayField`, `MultiSchemaField`, `StringField` to pass the label as `uiOptions.title || schema.title || name` as well as passing `displayLabel` from the `uiOptions`
  - Updated `ObjectField` to not pass `title` or `description` when `displayLabel` is false and `ObjectTitleTemplate` to only check `title` and `description`
  - Updated `ArrayFieldDescriptionTemplate` and `ArrayFieldTitleTemplate` to pass `globalUiOptions` into `getUiOptions` to pick up the global `label`
  - Updated `CheckboxWidget` to not show description when `displayLabel` is false
- Updated `@rjsf/antd` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
- Updated `@rjsf/bootstrap-4` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `RangeWidget` to only pass `label` in the `extraProps` when `displayLabel` is true
- Updated `@rjsf/chakra-ui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget`, `TextareaWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated test snapshots due to fixed bugs
- Updated `@rjsf/fluent-ui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `ColorWidget`, `DateWidget`, `RadioWidget`, `RangeWidget`, `SelectWidget` and `UpDownWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated `FieldTemplate` to hide description when `displayLabel` is false
  - Updated test snapshots due to fixed bugs
- Updated `@rjsf/material-ui` and `@rjsf/mui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `RadioWidget`, `RangeWidget` and `SelectWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated test snapshots due to fixed bugs
- Updated `@rjsf/semantic-ui` to fix the bugs as follows:
  - Updated `ObjectTitleTemplate` to only check `title` and `description` since they will be falsey from `ObjectField` when `displayLabel` is false
  - Updated `CheckboxWidget` to render the description using the `DescriptionFieldTemplate`, except when `displayLabel` is false
  - Updated `BaseInputTemplate`, `CheckboxesWidget`, `SelectWidget` and `TextareaWidget` to hide `label` when `displayLabel` and `label` are falsy
  - Updated test snapshots due to fixed bugs
- Updated the `widget` documentation for the new `displayLabel` prop
- Updated the `CHANGELOG.md` file accordingly

* - Added a new `labelValue()` function to `@rjsf/utils`
- Updated all ui packages to use `labelValue()` as appropriate, in some cases replacing the `schema.title` with `undefined` which is the real value of `schema.title` when label is an empty string
- Added a new `FluentLabel` component by refactoring common code out of `CheckboxesWidget`, `ColorWidget`, `RangeWidget` and `UpDownWidget`

* - Missed one `labelValue()` usage

* Apply suggestions from code review

Fix bug links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants