-
Notifications
You must be signed in to change notification settings - Fork 649
x-schema-form should accept all formats for titleMaps #889
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
Comments
Thanks @donalmurtagh I will be able to make a test out of this to avoid it happening again once fixed, there's so many scenarios that don't have tests still, good to have someone using the framework in a way I don't, I appreciate you taking the time to report them :) |
I checked in an old version and the same behaviour exists, the only supported version of titleMap within x-schema-form is an object list like the below: titleMap: {
{ "value": "married", "name": "Married" },
{ "value": "single", "name": "Single / separated / divorced / widow(er)" },
{ "value": "cohabitating", "name": "Living with a partner" }
} I can certainly see why it would help if this had of been documented! It was before my time so the best I can offer is to update the documentation to indicate the requirement for now and keep this issue as an enhancement. I would accept a PR on it, but I can't see myself having the time to fix it given how little time I have unfortunately. |
that seems like a reasonable interim measure |
@Anthropic I can confirm that the following successfully works around this issue 'x-schema-form': {
titleMap: [
{value: 'married', name: 'Married'},
{value: 'single', name: 'Single / separated / divorced / widow(er)'},
{value: 'cohabitating', name: 'Living with a partner'}
]
} Notice that in your code snippet, you proposed assigning an object rather than an array to |
Oh sorry, my being lazy I just copied your one from above and altered it to objects for each option and didn't alter the parent brackets :) |
Steps to reproduce
x-schema-form
attributes are removed from the schema and moved to the form definition, it works. In other words, you can workaround the issue by changing the schema to:and changing the form definition to:
The Plunker demo is using the latest code from the dev branches of angular-schema-form and angular-schema-form-bootstrap.
@json-schema-form/angular-schema-form-lead
The text was updated successfully, but these errors were encountered: