mui / toolpad

Toolpad: Full stack components and low-code builder for dashboards and internal apps.
https://mui.com/toolpad/
MIT License
964 stars 243 forks source link

Issues faced when copying an app directly to yaml #1875

Closed prakhargupta1 closed 1 year ago

prakhargupta1 commented 1 year ago

Duplicates

Latest version

Summary 💡

So, I picked an app from master--toolpad and converted the JSON DOM to yaml. And copied a page to my localhost > toolpad.yaml. Initially it was a struggle, but later when I understood the indexing and parent, child mapping. It was quick. Some observations:

  1. pageRow was not visible on canvas but was there in the yaml. It made it difficult to copy and correctly map the child parent ids, indexing.

  2. Page Id is not there in the right panel anymore, had to pick from the URL. Not sure if we removed it in a previous task or is it regression.

  3. Order of items (for an element) in master--toolpad was sometimes a bit random. I mean all key:value pairs should follow the same order in all elements. Like 1. id 2. name: 3 type:

Examples 🌈

No response

Motivation 🔦

No response

Janpot commented 1 year ago

Latest version contains PR https://github.com/mui/mui-toolpad/pull/1831 Which should improve this process. After upgrading to this version, your application will be migrated to the new structure where there will be 1 file per page, and the content will be a hierarchical structure that doesn't contain the ids and should be more readable.

To migrate an app from master--toolpad I'd recommend the following:

pageRow is not visible in canvas because the this element is managed automatically (i.e. you never have to create, update or remove this element manually).

apedroferreira commented 1 year ago

There might be a regression in 1: I have to recheck, but I think that right now it's not possible to hover over the container of the selected element to see the borders, so I'll still take a look at that.

prakhargupta1 commented 1 year ago

Followed the instructions and the migration experience is a lot smoother now! It worked fine when moving an app from master--toolpad.

But there were 2 issues in the other case when I was upgrading the version of mui-public to v.0.1.5.

  1. Pages with UI queries were working fine but the code queries couldn't run because of this error:
Screenshot 2023-04-13 at 4 16 02 PM Screenshot 2023-04-13 at 4 19 23 PM
  1. Pages came in an alphabetic order. (So it is due to the hierarchical structure!) But the order is reverse in editor. Screenshot 2023-04-13 at 4 24 36 PM

How can I fix the broken pages?

prakhargupta1 commented 1 year ago

Update: 1) I just had to manually move the other queries to the resources folder. The pages are working now!

Janpot commented 1 year ago
  1. I just noticed this as well, just move the ./bundleSizeQueries.ts file inside of the resources folder
  2. Looks like we order differently than the file system.
Janpot commented 1 year ago

I'm also noticing an issue with the theme: https://tools-public-pr-96.onrender.com/prod/pages/9r8fshsf

Janpot commented 1 year ago

Splitting into separate issues

  1. https://github.com/mui/mui-toolpad/issues/1904
  2. https://github.com/mui/mui-toolpad/issues/1905
  3. Not an issue as per last grooming call
prakhargupta1 commented 1 year ago

Closing it, as the issues are being tackled separately.