-
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
Use schema title attribute where appropriate #1335
Conversation
588120a
to
cbda110
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.
Looks good, than you. Just a small question.
if (schemaElement && typeof schemaElement.title === 'string') { | ||
return schemaElement.title; | ||
} | ||
if (typeof controlElement.scope === 'string') { |
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.
why do we need this check?
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 did it because the check was already in the previous code as controlElement.scope !== undefined
. I can remove it if you want.
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.
No, its fine. I missed the check that was there.
The label utility will now return the schema title if no other label was defined via the ui schema. Within the ui schema a label can be optionally defined for each control. Previously if there was none, we fell back to auto-generating a label from the given control scope. Now we will check the schema title beforehand and return that if no label was defined for the control. This also affects the ui schema generation which will no longer auto-generate labels based on each control's scope. Includes testcases.
Rebased on |
The label utility will now return the schema title if no other label was
defined via the ui schema.
Within the ui schema a label can be optionally defined for each control.
Previously if there was none, we fell back to auto-generating a label
from the given control scope. Now we will check the schema title
beforehand and return that if no label was defined for the control.
This also affects the ui schema generation which will no longer
auto-generate labels based on each control's scope.
Includes testcases.
Implements #1240