-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix 2280 by moving the bootstrap 3 classes out of SchemaField #4579
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
Conversation
@heath-freenome Should we keep the |
Fixed #2280 by moving marker classes from `SchemaField` to `WrapIfAdditionalTemplate` - In `@rjsf/utils`, updated `WrapIfAdditionalTemplateProps` to pick up the `hideError` and `rawErrors` props from `FieldTemplateProps` - In `@rjsf/core`, updated `SchemaField` to move the `form-group` and `field` marker classes to the `WrapIfAdditionalTemplate` - Also moved the `field-error`, `has-error` and `has-danger` error marker classes - Updated the grid snapshot due to the change - Updated the snapshots in other themes due to the removed marker classes - Updated the `CHANGELOG_v6.md` and `v6x upgrade guide.md` to reflect these changes
0533113
to
10c6efd
Compare
@nickgros Hmmm, probably... I wonder if I should also keep the |
icon='copy' | ||
/> | ||
); | ||
return <IconButton title={translateString(TranslatableString.CopyButton)} {...props} icon='copy' />; |
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.
These are added in the ArrayFieldItemButtonsTemplate
@@ -68,7 +76,7 @@ export default function WrapIfAdditionalTemplate< | |||
<div className='col-xs-2'> | |||
<RemoveButton | |||
id={buttonId<T>(id, 'remove')} | |||
className='array-item-remove btn-block' | |||
className='rjsf-object-property-remove btn-block' |
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.
This one was wrong, it's for an object not array
@@ -79,7 +79,7 @@ export default function RatingWidget< | |||
}; | |||
|
|||
return ( | |||
<div className='field field-array'> | |||
<> |
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.
We didn't need these
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.
Looks like the fragment can be removed
const validateFns = superSchemaFns as unknown as ValidatorFunctions; | ||
const validateOptionsFns = superSchemaOptionsFns as unknown as ValidatorFunctions; |
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.
Fixed a build error in chakra-ui
with 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.
Looks great, nice migration guide
Reasons for making this change
Fixed #2280 by moving marker classes from
SchemaField
toWrapIfAdditionalTemplate
@rjsf/utils
, updatedWrapIfAdditionalTemplateProps
to pick up thehideError
andrawErrors
props fromFieldTemplateProps
@rjsf/core
, updatedSchemaField
to move theform-group
class to theWrapIfAdditionalTemplate
has-error
andhas-danger
error classesrjsf-
CHANGELOG_v6.md
andv6x upgrade guide.md
to reflect these changesChecklist
npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update
to update snapshots, if needed.