-
Notifications
You must be signed in to change notification settings - Fork 373
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
Enhancement/2122 add description to array renderer #2227
Enhancement/2122 add description to array renderer #2227
Conversation
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @SaSteffen, thanks for the contribution ❤️ We will take a look very soon |
8bd14c2
to
e9946ef
Compare
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.
Thanks for the contribution! The PR looks good overall.
I have two change requests:
- Make sure to not render the
FormHelperText
at all if there is no description - Add a test case for the existence of the description when given
@sdirix Sure. Added the conditional rendering and the two tests. |
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 need to use &&
instead of ??
as ??
short circuits and will use the description
as is and not with the FormHelperText
.
Is it possible to search for the FormHelperText
element in the tests too?
Co-authored-by: Stefan Dirix <sdirix@eclipsesource.com>
Co-authored-by: Stefan Dirix <sdirix@eclipsesource.com>
Sorry, of course.
I checked the DOM and it does not generate any element around it, even if the FormHelperText has an id attribute. If you prefer, I can put it in a div and use that one in the tests. |
I used nested selectors to check for the respective elements. I also added tests checking for the non-existence of them in case there is no description. |
That leaves nothing else to be done, right? Thank you for the support. |
Thanks for the contribution ❤️ |
As discussed in #2122: This is a minimal change that renders a description for primitive and object array renderers in React MUI.
The Primitive example looks like this:
The other one looks like this:
As discussed, I just used a FormHelperText. We could achieve similar results using custom typography elements probably.