Added ui:*Template properties#1152
Added ui:*Template properties#1152epicfaace merged 8 commits intorjsf-team:masterfrom loganvolkers:ui-templates
ui:*Template properties#1152Conversation
…CRLF endings to LF to stop Husky complaining.
|
@epicfaace pull request for adding Would be interested in some feedback on the naming convention. Since an array template has both a Instead I opted to follow the naming convention for overriding fields globally:
I found this the most consistent with the current API. In the future it would be handy if the templating system could be consolidated in a way that a single This is I think the best compromise between allowing granular overriding of field templates and respecting existing behaviour and API design. |
| }, | ||
| }).node; | ||
| sharedIts(); | ||
| }); |
There was a problem hiding this comment.
Can you add a test in which a template is globally configured and a template is configured in ui:ObjectFieldTemplate so it has to override?
| }).node; | ||
| }); | ||
| sharedIts(); | ||
| }); |
There was a problem hiding this comment.
Can you add a test in which a template is globally configured and a template is configured in ui:ArrayFieldTemplate so it has to override?
| }).node; | ||
| }); | ||
| sharedIts(); | ||
| }); |
There was a problem hiding this comment.
Can you add a test in which a template is globally configured and a template is configured in ui:ArrayFieldTemplate so it has to override?
@loganvolkers that works. What I'm thinking, though, is what if we have our uiSchema in JSON and want to reference "ui:FieldTemplate", "ui:arrayFieldTemplate", or "ui:ObjectFieldTemplate" through a string, not a React component? The way it's done right now for Is the only way to do this to define Here's my proposal. On the other hand, if we just use Any thoughts? |
I agree with this. e.g. for an object field: <Form
{...props}
templates={{"tabs":MyTabTemplate}}
uiSchema={{"ui:ObjectFieldTemplate":"tabs"}}
/>
This is a non-starter for me. The goal is to provide UI customization and there is a lot of template-related stuff in the FieldTemplate, especially for Object fields with the new |
|
@loganvolkers that sounds good, using |
|
@loganvolkers will you have time to make these changes? I'd like to merge this PR |
|
@loganvolkers just bumping this! |
|
@loganvolkers any update on this? This looks really promising. |
|
Working on wrapping this up. I just made some progress on merging the latest to bring this branch up to speed, but there are still some changes requested for tests and docs. |
|
@epicfaace can you please review? I believe this should meet your requests. |
|
Thanks @loganvolkers looks good -- can you update the docs? |
|
@epicfaace merged latest changes and updated docs. Please take a look. |
|
Looks good -- thanks! |
Was this piece implemented? |
|
No, it was not.
…On Wed, Aug 7, 2019, 11:13 AM Tim Kindberg, ***@***.***> wrote:
I agree with this. templates could be added to the registry and use the
same capabilities that exist for string-referenced widgets and fields.
Was this piece implemented?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1152>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAI2PXQADHOXBR7FODSF7H3QDMGETANCNFSM4GRVX3ZA>
.
|
It's now being tracked in #1387, though. |
Reasons for making this change
Makes customizing templates for a form a more granular experience.
Resolves #1010
Checklist
npm run cs-formaton my branch to conform my code to prettier coding style