-
Notifications
You must be signed in to change notification settings - Fork 317
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 nesting subcomponents like Images inside of Tables, Details, etc. #308
Allow nesting subcomponents like Images inside of Tables, Details, etc. #308
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
@hramezani since you've been doing some work in Table and Details, I'd be curious to hear your thought/feedback on this PR, too. |
Thanks @jimkring for the PR. |
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.
Beyond the philosophy side of things, I'm good with this.
@@ -26,6 +28,28 @@ export const DisplayComp: FC<Display> = (props) => { | |||
} | |||
} | |||
|
|||
// todo: this list should probably be defined in the models file | |||
const nestableSubcomponents = [ |
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 think there are two clean options here in terms of ways forward:
- Something like add
FormattedText
component #29 where we define a subset of components (or maybe they're not even included in regular components) that can be used in buttons and table cells and paragraphs (although I'm already seeing a problem that stuff like images belong in table cells but I think are illegal in paragraphs or buttons) - We allow anything in a table cell, and
DisplayObject
just becomes a component, which I've wanted otherwise anyway. Perhaps we have some logic for the default components for table cells is aDisplayObject
Or maybe route 3 is we merge this to help @jimkring and worry about the ultimately correct solution later?
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.
Awesome work here. Let's go with route 3 as mentioned by @samuelcolvin - merge this now, and refine nestable subcomponents down the line!
Fantastic! Looking forward to 0.7.0! Thanks everyone for reviewing and collaborating on this. |
This PR allows FastUI components to be used as the values of DataModel's passed into Table and Details components. This means that one can have a column in a table that is an Image, Button, etc.
For example, let's say I have an object with a name and an image.
Before this PR:
After this PR:
FYI: @samuelcolvin @sydney-runkle
Note: Implements enhancement request #293
fix #293
fix #267