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

Add RadioGroupControl support for "oneOf" enums #1654

Merged
merged 1 commit into from
Nov 21, 2020

Conversation

AlexandraBuzila
Copy link
Member

  • the radio group control can now handle 'oneOf' schemas as well. If the
    oneOf item has a title, it will be shown as the label for the option
  • update Radio Group example with a oneOf demo
  • add test

@AlexandraBuzila AlexandraBuzila linked an issue Oct 29, 2020 that may be closed by this pull request
@coveralls
Copy link

coveralls commented Oct 29, 2020

Coverage Status

Coverage increased (+0.05%) to 88.481% when pulling 088b531 on AlexandraBuzila:oneof-radio into 46376f9 on eclipsesource:master.

Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

I would prefer when we could use the same approach as with the regular enum renderers, i.e. use withJsonFormsEnumProps for the MaterialRadioGroupControl and withJsonFormsOneOfEnumProps for the MaterialOneOfRadioGroupControl, both of them using the same control.

@AlexandraBuzila
Copy link
Member Author

I rebased the branch and added a dedicated control MaterialOneOfRadioGroupControl for the oneof enums. The code looks a lot cleaner now, thank you for the review!

- add new MaterialOneOfRadioGroupControl that can render oneOf radio
groups
- extract MaterialRadioGroup component that is shared by the new
renderer and radio group control for enums
- update Radio Group example with a oneOf demo
- add tests
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

LGTM

@sdirix sdirix merged commit a51e373 into eclipsesource:master Nov 21, 2020
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.

RadioControl for "oneOf" enums
3 participants