mui / toolpad

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

Remove routing pages to "id", use page name #1905

Open Janpot opened 1 year ago

Janpot commented 1 year ago

Duplicates

Latest version

Summary 💡

Use the page name as the url sement instead of the id. i.e. if a page is name "page1" you can navigate to it with the route "/pages/page1".

To stay backwards compatible and not break existing urls of the embeds in notion, we'll keep the optional id property in the page.yml, and automatically add a redirect from /pages/<pageId> to /pages/page1

We should probably fail the build step if two pages have the same id

Examples 🌈

No response

Motivation 🔦

No response

prakhargupta1 commented 1 year ago

This will fix: https://github.com/mui/mui-toolpad/issues/2324 Also, a bit related to: https://github.com/mui/mui-toolpad/issues/388 and https://github.com/mui/mui-toolpad/issues/1824

Kirera-Wainaina commented 1 year ago

@Janpot Hello, I'd like to see if I can manage tackling this issue if that's okay.

Janpot commented 1 year ago

I believe the preview, production and the editor should follow the same routing semantics. The preview/production is easy to switch to routes that are based on page names. The editor is less straightforward to do that with. As this is not a high priority issue, don't expect this to get reviewed and merged very soon should you still want to take this on.

Kirera-Wainaina commented 1 year ago

Thanks for the clarification