-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix(@rjsf/core): use name for additional properties #2878
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
fix(@rjsf/core): use name for additional properties #2878
Conversation
label = uiSchema["ui:title"] || props.schema.title || schema.title || name; | ||
label = schema.hasOwnProperty(ADDITIONAL_PROPERTY_FLAG) | ||
? name | ||
: uiSchema["ui:title"] || props.schema.title || schema.title || name; |
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'm not sure quite what this is fixing. Can you add a test -- which should make it clearer the expected behavior?
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.
You can see in the demo that the key input field contains the title of the field instead of the key of the addition property. I'll add some tests but I wanted to make sure that it makes sense first
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.
Sorry about the late reply. Going to add some tests now, but to clarify the diff:
Notice that the key is is propTitle
which is the title of the field instead of the actual key fsdf
This is the demo playground
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 I finally added the test. Sorry about the delay again
@ranihorev Please refactor this change onto the Typescript conversion of |
@ranihorev Did you have any questions or issues related to the refactor? If so I can be reached on discord |
13cd7e6
to
1ecd13a
Compare
@heath-freenome I updated the PR. I've been struggling with running the playground locally ( |
Hmmm, if you run |
That's what I did :) btw, I'm also seeing these errors when I run
|
Odd... Try running core in watch mode. Usually, I'm doing all the builds then starting playground. |
How do you run all the builds? using
And I'm getting a bunch of errors:
It looks like lerna tried running the playground build before the other builds were finished. Not sure why that is. At least you figured out how to get by it. |
1ecd13a
to
07f8f00
Compare
Does using the updated build command in this PR solve your issues? |
07f8f00
to
f28d61f
Compare
@heath-freenome no, I still can't run the playground locally. I have no idea why... |
Hmmm, so it started breaking for me just now too?! |
Interesting... by switching back to main (yes, sorry master was renamed, but Github tells you how to fix that) and running |
I think that I'm surprised it's working for everyone else though. The next challenge, making the playground reload when updating core |
Yes, the
|
@ranihorev Also, please update the |
80d556f
to
d4cd15f
Compare
d4cd15f
to
473ce84
Compare
@heath-freenome I think that this PR is good to go :) |
Reasons for making this change
When rendering additional properties with title, the key of all properties appears to be the title of the property instead of the actual value of the key. Instead, we should first take the key in this case
Is there a reason to add a test for this?
Playground demo
TODO: fix tests if this looks like a reasonable solution