-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat(dashboard): ability to locate new admin route under existing route #10587
Changes from 1 commit
3bc1a52
8bbc242
c4ece3e
be915c1
fa79525
e85c982
2c6ed68
71525ff
4efe68e
902bc18
680065e
66d08de
add9062
d63c986
a2a87f2
6eb8ed6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,6 +117,7 @@ export class DashboardExtensionManager { | |
to: item.path, | ||
icon: item.icon ? <item.icon /> : undefined, | ||
items: [], | ||
nested: item.nested, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here it would be good to log a warning if the item has a If you create a nested route for
The nested MenuItem is created, but never used. So when looping over the items, it would be great to explicitly warn the user why this item is not being used. We need to keep track of items that have a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. But I find out some challange here. The new parameter Possible solution: locate a new route under existing route by path:
In this case What do you think about that? Or maybe you have a better solution for that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found a more easy solution. We have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added warning |
||
} | ||
|
||
if (parentPath !== "/" && tempRegistry[parentPath]) { | ||
|
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.
It would be good to move this to the admin-shared package both as a const:
And as a type:
We should then use the const to validate that the user has passed a valid
nested
value ingenerate-menu-items.ts
. And use the type in this file, and in the dashboard project.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.
Really good point 🚀. Added type.