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 idPrefix option for oneOf #883

Merged
merged 1 commit into from
Apr 10, 2018
Merged

Add idPrefix option for oneOf #883

merged 1 commit into from
Apr 10, 2018

Conversation

edi9999
Copy link
Collaborator

@edi9999 edi9999 commented Apr 5, 2018

Reasons for making this change

This is the follow up for https://github.com/mozilla-services/react-jsonschema-form/pull/806/files

It now correctly also handles idPrefix when using oneOf in the jsonSchema

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

@edi9999 edi9999 requested review from n1k0 and glasserc April 6, 2018 12:20
@edi9999 edi9999 merged commit e4378c2 into rjsf-team:master Apr 10, 2018
Copy link
Contributor

@glasserc glasserc 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 not getting to this in time...

@@ -1184,7 +1190,7 @@ render((

> Note: Since v0.41.0, the `ui:widget` object API, where a widget and options were specified with `"ui:widget": {component, options}` shape, is deprecated. It will be removed in a future release.

#### Customizing widgets' text input
#### Customizing widgets text input
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the apostrophe here was correct ("the text input belonging to widgets").

@@ -8,17 +8,18 @@
"build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js --optimize-minimize",
"build:playground": "rimraf build && cross-env NODE_ENV=production webpack --config webpack.config.prod.js --optimize-minimize && cp playground/index.prod.html build/index.html",
"cs-check": "prettier -l $npm_package_prettierOptions '{playground,src,test}/**/*.js'",
"cs-format": "prettier $npm_package_prettierOptions '{playground,src,test}/**/*.js' --write",
"cs-format": "prettier --jsx-bracket-same-line --trailing-comma es5 --use-tabs false --semi --tab-width 2 '{playground,src,test}/**/*.js' --write",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change? It seems like this still corresponds to $prettierOptions.

idSchema = mergeObjects(
toIdSchema(schema, null, definitions, formData, idPrefix),
idSchema
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to generate another idSchema at this level? What's wrong with the one that was generated for us at toplevel? That one was generated from the resolved schema, so it should have the oneOf accounted for, shouldn't it?

I'm a little concerned that we're restarting with id=null here -- won't this lose our place in the hierarchy?

Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here, removing this piece of code doesn't seem to break any test.

if (!props.id) {
console.log("No id for", props);
throw new Error(`no id for props ${JSON.stringify(props)}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be better for this code not to come between the comment and the code the comment describes.

jnorris-carecloud added a commit to CareCloud/react-jsonschema-form that referenced this pull request Jul 2, 2018
* Fix rjsf-team#221: No validating but updating errorSchema base on array operation when live validation is off.

* Fix comparing

* Directly update errorSchema in onChange

* Typo fix (rjsf-team#737)

* Make form submission example clearer (rjsf-team#736)

In the example, the `onSubmit` function receives a `formData` obj. However, the actual data is in `formData.formData`. While this is explained in the docs, I propose making it clearer in the example as well.

* Update prettier to v1.8.2 (rjsf-team#756)

* fix: Pass `disabled` prop to `FieldTemplate`. (rjsf-team#741)

If you want to change how your FieldTemplate is rendered based on
ui:disabled, you currently have to check `uiSchema["ui:disabled"]`,
which is unlike the pattern for `readonly` and other known `ui:*`
settings.

* Fix issue rjsf-team#747 (rjsf-team#748)

* 66 enum no type (rjsf-team#668)

* Failing test for enum without type (rjsf-team#66 rjsf-team#611)

* Proposed fix for enum without type (rjsf-team#66 rjsf-team#611)

* PR feedback - getSchemaType function

https://github.com/mozilla-services/react-jsonschema-form/pull/668/files#r133395455

* Fix onAddClick signature in ArrayFieldTemplate (rjsf-team#775)

According to https://github.com/mozilla-services/react-jsonschema-form/blob/master/src/components/fields/ArrayField.js#L224 `onAddClick` is not returning function as specified in the documentation.

* fix typo in css code (rjsf-team#799)

* README: fix code snippet (rjsf-team#785)

* Generating idSchema based on dependency changes Fix rjsf-team#778 , Fix rjsf-team#803

* Add idPrefix option (Fix rjsf-team#796) (rjsf-team#806)

* Make .editorconfig valid (rjsf-team#807)

* typo (rjsf-team#811)

* Add span and class to label required symbol (rjsf-team#765)

* a priori should be italicized for readibility (rjsf-team#825)

* Priori should by prior, I think

* Italicizing a priori based on suggestion

* pass raw errors to  field widgets (rjsf-team#826)

* pass raw errors to  field widgets

* fixed formatting

* fixing line endings

* Pass raw errors into Field at creation; object destructuring; added test for passing of raw errors; removed unused prop from ArrayField.

* fix lineEndings

* Bump 1.0.1

* Move to the 3.x series of react-codemirror2 (rjsf-team#857)

* Move to the 3.x series of react-codemirror2

* Move to the 4.x series of react-codemirror2

See scniro/react-codemirror2#63 for more details.

* Pass formContext to ArrayFieldTemplate when rendering fixed array (rjsf-team#858)

* handle errors to correctly display schema errors in form (rjsf-team#864)

* Bump version 1.0.2

* Link to official JSON Schema site (rjsf-team#873)

* Updated README to mention the support from JSON Schema compliant drop-down enums (rjsf-team#882)

* Add passing of raw errors to ArrayField template and components (rjsf-team#876)

* Fixed multiplicative errors on schema dependencies (rjsf-team#884)

* Add idPrefix option (rjsf-team#883)

* Fix warning on FileWidget (rjsf-team#842)

* Update prettier and fix files (rjsf-team#892)

* Bump 1.0.3
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.

3 participants