Skip to content

Overridable DescriptionField in BooleanField#1594

Merged
epicfaace merged 2 commits intorjsf-team:masterfrom
89erik:master
Feb 19, 2020
Merged

Overridable DescriptionField in BooleanField#1594
epicfaace merged 2 commits intorjsf-team:masterfrom
89erik:master

Conversation

@89erik
Copy link
Contributor

@89erik 89erik commented Feb 18, 2020

Reasons for making this change

When supplying the fields-object in Form's props, the normal behavior is to override the fields globally. For example,
<Form fields={{DescriptionField: ()=><div>overriden</div>}}/>
will cause all descriptions to show "overriden". Except for BooleanField, which always uses the built-in implementation of DescriptionField. This commit causes the BooleanField to use the overridden Description, if supplied.

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'm adding a new feature
    • I've updated the playground with an example use of the feature

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.

Thanks! Can you add a test which uses the overriden DescriptionField?

@89erik
Copy link
Contributor Author

89erik commented Feb 19, 2020

Thanks! Can you add a test which uses the overriden DescriptionField?

Done :)

@epicfaace epicfaace merged commit 063af39 into rjsf-team:master Feb 19, 2020
erunion added a commit to readmeio/react-jsonschema-form that referenced this pull request Feb 27, 2020
* update package lock

* v2.0.0-alpha.2

* Overridable DescriptionField in BooleanField (rjsf-team#1594)

* Overridable description field in BooleanField

* Adds test for BooleanField's overridable DescriptionField

* doc: JSON schema version supported versions (rjsf-team#1603)

For rjsf-team#1307 (comment)

* Don't crash when schema property is a non-object - show an error instead (rjsf-team#1582)

* don't throw TypeError: Cannot use 'in' operator to search for

* Update Form_test.js

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>

* Set up CI with Azure Pipelines (rjsf-team#1605)

* Set up CI with Azure Pipelines

[skip ci]

* Update azure-pipelines.yml for Azure Pipelines

* Add npm test to azure pipelines

* Delete .travis.yml

* Combine all themes into a single playground (rjsf-team#1539)

* move playground to new folder

* move playground to packages and standardize playground structure

* don't rely on bootstrap in playground

* fix styling, move share button to top right

* remove footer things

* more fixes

* encode theme in playground hash

* fix: don't switch to default theme when changing tabs

* correct package name is @rjsf/playground

* fix prod config for playground

* fix more configs

* use webpack-dev-server

* render form in a Frame

* add dependencies

* use DemoFrame component to properly fix material-ui styles

* use old bootstrap look and feel for the playground itself

* fix dist

* move netlify toml

* update netlify

* empty commit

* remove npm prepare to speed up travis runs

* fix webpack dist config for playground

* fix import

* disable minicssextractplugin to try to fix netlify

* fix netlify path

* no need to build playground / gh-pages for core package

* add HtmlWebpackPlugin

* Allow references that don't start with #/definitions/ (rjsf-team#1506)

* pass entire rootSchema to findSchemaDefinition, not just definitions

* use jsonpointer to handle non-"#/definitions" definitions

* revert package-lock

* make sure json pointers are URI fragment encoded

* replace "definitions" with "rootSchema"  variable

* Fix getMatchingOption logic

* fix tests

* remove console log

* Fix tests

* prettier

* Remove support for recursive references to deep schema definitions

* update docs for registry and definitions

* add `definitions` back to registry

* Fix mui form tests

* Add a general registry test

* update proptypes of registry

* fix eslint issues

* fix formatting

* Fix local playground for core package (rjsf-team#1607)

* remove scss file from playground

* fix dev playground on @rjsf/core

* fix playground version

* update package-lock

* fix playground "npm start"

* chore: move docs to separate folder (rjsf-team#1604)

* test: adding a github workflow for running tests

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
Co-authored-by: Erik Lothe <eriklot@alumni.ntnu.no>
Co-authored-by: ACoolmanBigHealth <41590234+ACoolmanBigHealth@users.noreply.github.com>
Co-authored-by: Evgeniy Tatarkin <tatarkin.evg@gmail.com>
Co-authored-by: Chancellor Clark <chancellorclark@gmail.com>
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