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

Options disable feature added #582

Closed
wants to merge 2 commits into from
Closed

Options disable feature added #582

wants to merge 2 commits into from

Conversation

Viijay-Kr
Copy link

@Viijay-Kr Viijay-Kr commented May 18, 2017

Reasons for making this change

Selection widget option elements currently does not have the ability to disable an option/options through schema.I had to deal with a use case in my project where I needed to disable some parent option elements so that they become non selectable.I went through the code and I found that a extra attribute must be added.

So this PR introduces a feature to disable a StringField.UiWidget options through schema

{ "type":"string", "enum":["foo","bar"], "enumNames":["Foo","Bar"], "enumDisabled":["bar"] }

Checklist

  • I'm updating documentation
    • I've checked the rendering of the Markdown text I've added
    • If I'm adding a new section, I've updated the Table of Content
  • I'm adding or updating code
    • I've added and/or updated tests
    • I've updated docs if needed
    • I've run npm run cs-format on my branch to conform my code to prettier coding style
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@glasserc
Copy link
Contributor

glasserc commented Jun 9, 2017

Hi, thanks for your contribution! I'm not crazy about the use of enumDisabled in the schema. enumNames are already nonstandard (see #532), and disabling of an option seems like something that belongs in the uiSchema.

Also, can you add tests when you add a feature like this? Thanks!

@Viijay-Kr Viijay-Kr closed this Sep 27, 2017
@glasserc
Copy link
Contributor

glasserc commented Oct 5, 2017

This PR was superseded by #708.

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