-
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
Bug Fix empty html useless added by PR #1123 / v1.2.0 #1158
Conversation
…team#1100) Connects to rjsf-team#1098 Change-type: minor Signed-off-by: Lucian <lucian.buzzo@gmail.com>
Infer type from enum if a type is not provided to SelectWidget (rjsf-team#1100)
- Revert some test added by https://github.com/mozilla-services/react-jsonschema-form/pull/1123/files - use new css class for form-additional insted layout css class for test selection
@aerfio are you agree with this change? |
@pieplu I'm just a contributor, not a codeowner, so you don't have to ask for my agreement 😛
I don't know if you can do what I proposed in bootstrap3, but you can certainly do that using flex; I don't know what is the final stance of codeowners considering this matter - it is used here btw: https://github.com/mozilla-services/react-jsonschema-form/blob/174e136af4fe728eb79e92594733ea729f3d659f/src/components/fields/ArrayField.js#L59 |
@aerfio It's because it's a change on your contribution. For the blank space, I think it's not a real problem. It's not the best visual, but we are limited on bootstrap style. Maybe a good option for inline-style, will be to have an api to overwrite the inline-style object, like react-select do. |
@pieplu Could you please modify this PR not to use the |
I push it, but I don't think it will be better. It will insert code duplication. It's a big risk of bugs for all future editing of the component. The reason why I add I will try to explain it: SchemaFields.js part, before the "additional properties feature": <div className={classNames}>
{displayLabel && <Label label={label} required={required} id={id} />}
{displayLabel && description ? description : null}
{children}
{errors}
{help}
</div> PR #1021 and #1123 added some code around that to support the additional properties feature. To be able to support additional properties feature, it will be important to wrap the schema field with some div. It's the problem, the level of complexity had grown up, and if we preserved same render for all other fields, the wrapping div should not be present any time. Maybe a better solution will be to introduce a new field component (like ArrayFieldDo) ? |
@pieplu , thanks for the explanation, I see what you're doing now. To remove code duplication, you could store the duplicated code in a variable as shown here: https://stackoverflow.com/a/33710901 Also, can you please include only the changes that fix the wrapping div's and the col-xs-12 div in this PR? I appreciate the other changes you made, but I think it's best if those are made on another PR so there is a chance to examine and discuss those changes separately. 👍 |
@epicfaace Good point for the other PR. +1 |
@pieplu sounds good, please make that other PR! And, yes, I see your point for using |
@pieplu just a reminder to make the PR when you get a chance! I'd like to start merging your changes. |
I keep it in mind, sorry, I will try to take time this week.
…On févr. 25 2019, at 5:21 pm, Ashwin Ramaswami ***@***.***> wrote:
@pieplu (https://github.com/pieplu) just a reminder to make the PR when you get a chance! I'd like to start merging your changes.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#1158 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/ADG_fSaK2-wLBDUI1XNCZCQ6vFDV-1dfks5vRGHygaJpZM4aWR62).
|
@epicfaace done! I will make an other PR with CSS className change for easy customisation |
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.
One more thing. I believe you don't need parentProps
, so the way I suggested might be cleaner.
@epicfaace Done! |
@epicfaace re Done! |
Great! It looks good. Thanks for the good work! |
…team#1158) * Infer type from enum if a type is not provided to SelectWidget (rjsf-team#1100) Connects to rjsf-team#1098 Change-type: minor Signed-off-by: Lucian <lucian.buzzo@gmail.com> * No more useless div on schema field not additional * Fix tests (remove useles html) - Revert some test added by https://github.com/mozilla-services/react-jsonschema-form/pull/1123/files - use new css class for form-additional insted layout css class for test selection * Don't use WrapIfAdditonal Component to hav a clerer diff, but adding code duplicate * Use a WrapIfAdditional Component to have a cleanner code / diff * Fix tests * Ignore vscode Ide folder * Remove useless parentProps * Fix old test selector for form additional
Reasons for making this change
The merged PR #1123 add useless wrapping html tag (with empty className) for all field, even if they are no additonal field. This PR fix this.
See comment: #1123 (comment)
Some points:
form-additional-*
to help targeting (like for array field)Checklist
npm run cs-format
on my branch to conform my code to prettier coding style