-
Notifications
You must be signed in to change notification settings - Fork 6
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
Allow passing component name and props hash to data table cells #147
Allow passing component name and props hash to data table cells #147
Conversation
…s hash updates and fix linting error.
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.
Code looks sane here
A few things come to my mind:
- Obviously we should look if we can include the template compiler with the addon
- Does the layout really need to be a CP? Wondering if this will be subject to double rendering issues
- Will this have issues accessing the Ember registry? Like if there's a service injected in the component that's passed in, will that work?
propsString: computed('propNames.[]', function() { | ||
let propNames = this.get('propNames') || []; | ||
return propNames.reduce((propsString, propName) => { | ||
return `${propsString} ${ propName }=${ propName }`; |
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.
some spacing inconsistencies around here
Would be nice, but I'd prefer to avoid adding it unless it's needed... not sure how to handle this really at the moment, if you have any suggestions I'd appreciate it!
I guess it's either a CP or gets explicitly set in
Not entirely sure what you mean... this renders the "proxied" component the same way it'd get rendered by any other template, as far as I can tell. Can also test this before going any further. |
well, if we add this, would be a requirement no? yeah...will try to look into it a bit too
yeah, actually, I think you are right....but yeah, let's test in an app, to be sure |
I think it'd only error if a host app tries to use this new functionality - everything else should still be fine 🤞 |
0b23c4e
to
7513065
Compare
7513065
to
048fd97
Compare
Passing dynamic, data-driven components to
polaris-data-table
cells is currently very difficult owing to the impossibility of generating components for rendering outside template files. This PR aims to solve that issue by adding the ability to pass a hash with acomponentName
and optionalprops
hash as cell data - the table will then render that component with the provided properties. This makes it possible to process e.g. an array of raw cell data in JS-land to instruct the table to render components in particular cells.