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

#226 - Restrict accepted mimetypes in file widget #1246

Merged

Conversation

gr8pathik
Copy link
Contributor

Reasons for making this change

  • Added a feature to support accepted mime type in file widget

If this is related to existing tickets, include links to them as well.
#226 - Restrict accepted mime types in file widget

Checklist

  • I'm updating documentation
  • 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

@epicfaace
Copy link
Member

@gr8pathik looks good, can you add a test?

@gr8pathik
Copy link
Contributor Author

@gr8pathik looks good, can you add a test?

@epicfaace I don't think this can have any test. Because we cannot use the accept attribute as a validation tool. It is just used to hint to browsers to only show files that are allowed for the current input.

@epicfaace
Copy link
Member

@gr8pathik I just meant that you could make a test like the one here -- https://github.com/mozilla-services/react-jsonschema-form/blob/679b38115eeb0e808ced6d39fcf3da3b9721b69c/test/ObjectField_test.js#L185 -- just to see if the widget with the proper attribute is rendered.

Also, I believe the uiSchema in the playground should be changed from "ui:accept": ".pdf" to "ui:options": {"accept": ".pdf"}

@gr8pathik
Copy link
Contributor Author

@epicfaace Added the test cases.

@epicfaace
Copy link
Member

@gr8pathik thanks! Can you add a section for documentation of this option over here: https://react-jsonschema-form.readthedocs.io/en/latest/form-customization/#file-widgets

@gr8pathik
Copy link
Contributor Author

@epicfaace I have updated the documentation.

@epicfaace
Copy link
Member

Thanks! Can you accept my suggestion -- and then we should be good to go.

@epicfaace
Copy link
Member

Thanks! Can you accept my suggestion -- and then we should be good to go.

@gr8pathik ?

@gr8pathik
Copy link
Contributor Author

@epicfaace is there any issue with this PR or we are good to merge?

Copy link
Member

@epicfaace epicfaace left a comment

Choose a reason for hiding this comment

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

Sorry for the delay -- I missed your commit. Just one more grammatical thing to add.

docs/form-customization.md Outdated Show resolved Hide resolved
@epicfaace epicfaace merged commit beee02f into rjsf-team:master Jul 26, 2019
@solomontang
Copy link
Contributor

When should we expect the next release to land with this added?

@epicfaace
Copy link
Member

Once #1419 is merged

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

Successfully merging this pull request may close these issues.

3 participants