-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Added ui:*Template
properties
#1152
Conversation
…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. |
DescriptionField, | ||
}, | ||
}).node; | ||
sharedIts(); | ||
}); |
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.
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?
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.
Added
uiSchema, | ||
}).node; | ||
}); | ||
sharedIts(); | ||
}); |
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.
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?
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.
Added
uiSchema, | ||
}).node; | ||
}); | ||
sharedIts(); | ||
}); |
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.
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?
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.
Added
@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-format
on my branch to conform my code to prettier coding style