-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Update typescript definition of toIdSchema(), and passed the new idSeparator
prop through to the AnyOfField
and OneOfField
inside of SchemaField
#2743
Conversation
- Add the new `idSeparator` prop to the `index.d.ts` file for the `toIdSchema()` function definition - Also fixed the spelling of `idPrefix` parameter
2643b4e
to
e7babd6
Compare
…ld` in the `SchemaField` code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the PR description / changelog as per this latest change?
Done |
idSeparator
prop through to the AnyOfField
and OneOfField
inside of SchemaField
Do we need to update the documentation at all (maybe where the AnyOfField / OneOfField props are documented)? |
I just scanned the docs for |
… through to the inner `SchemaField` used for array field items - Updated `CHANGELOG` again - Reverted `package-lock.json` added in previous commit
@epicfaace one more little fix... Isn't it interesting how we missed these in the original PR? |
… from props instead of passing them through (following the pattern of `readonly` et al)
@@ -819,6 +819,8 @@ class ArrayField extends Component { | |||
uiSchema={itemUiSchema} | |||
formData={itemData} | |||
errorSchema={itemErrorSchema} | |||
idPrefix={this.props.idPrefix} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an optimization or a bug fix? If the latter, maybe let's add a test to ensure it doesn't regress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is closer to a bug fix as the props weren't being propagated all the way down... I can add a test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@epicfaace Test pushed... Did you want to reapprove or shall I merge?
CHANGELOG.md
Outdated
|
||
## @rjsf/core | ||
|
||
- To improve performance, skip validating subschemas in oneOf / anyOf if formData is undefined (#2676) | ||
- Fixed the `toIdSchema()` typescript definition to add new `idSeparator` prop | ||
- Also passed the new `idSeparator` prop through to the `AnyOfField` and `OneOfField` inside of `SchemaField` | ||
- Updated `ArrayField` in `@rjsf/core` to pass `idSeparator` and `idPrefix` through to `SchemaField` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update this line to make it clearer that a bug was fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heath-freenome I think you forgot to do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heath-freenome I think you forgot to do this
It is there... the idPrefix={this.props.idPrefix}
and idSeparator={this.props.idSeparator}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant, "update this line to make it clearer that a bug was fixed"
|
||
## @rjsf/core | ||
|
||
- To improve performance, skip validating subschemas in oneOf / anyOf if formData is undefined (#2676) | ||
- Fixed the `toIdSchema()` typescript definition to add new `idSeparator` prop | ||
- Also passed the new `idSeparator` prop through to the `AnyOfField` and `OneOfField` inside of `SchemaField` | ||
- Updated `ArrayField` in `@rjsf/core` to pass `idSeparator` and `idPrefix` through to `SchemaField` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also update the PR title to note the 3 things that were changed?
Reasons for making this change
Follow-up fix to #2628
idSeparator
prop to theindex.d.ts
file for thetoIdSchema()
function definitionidPrefix
parameteridSeparator
through to theAnyOfField
andOneOfField
in theSchemaField
codeArrayField
to also passidPrefix
andidSeparator
down through to the innerSchemaField
used for array field itemsChecklist