Open prakhargupta1 opened 1 year ago
When copying, I would expect all bindings and styling to be copied
When copying something that has bindings to say query or other components, should we also copy over all the things that it's bound to?
When copying something that has bindings to say query or other components, should we also copy over all the things that it's bound to?
No, not other queries or components. Basically all text information that a user wrote in that component props, should be copied. Then they would manually change component names, queries, styling according to the new page construct.
I'm also wondering how we'd deal with bindings.
So suppose I'm copying a Grid
component which is currently bound to some query - does the row
prop simply become empty or should we copy whatever data is set as value right now and use it as default? (1st option is obviously more straight forward and predictable IMO, and to make things simpler I would propose doing that)
I meant something like this: The text gets copied with error.
And when there was blank query with the name employee_1. It didn't throw any error and just binded both.
I'd propose to make matters simpler in the first iteration do a simple copy/paste which would drop all bindings and use whatever value is assigned 🤔 seeing how it works in toolpad, we can iterate after that and figure out how we would deal with bindings (if we wanted to)
Duplicates
Latest version
Summary 💡
Problem: I have 2 pages, both well-built. Now I want to merge them but don't want to start building the component from scratch. Currently, there is no option but to start from scratch.
Solution: Allow, copying components from 1 page to the other. When copying, I would expect all bindings and styling to be copied. I should then manually be able to create a query to make the component work. But copying the query separately would also help here.
Examples 🌈
No response
Motivation 🔦
No response