Frontend Routing: Always render standalone plugin pages using the <AppRootPage> (#57771)

* chore: fix go lint issues

* feat(Routing): route standalone plugin pages to the `AppRoutePage`

* feat(plugin.json): introduce a new field called `isCorePage` for `includes`

* chore: add explanatory comments for types

* refactor(AppRootPage): receive the `pluginId` and `pluginSection` through the props

Now we are able to receive these as props as the pluginId is defined on navLinks
that are registered by plugins.

* chore: update teests for AppRootPage

* fix: remove rebase issue

* tests(applinks): add a test for checking isCorePage plugin page setting

* refactor(applinks): update tests to use FindById() and be more resilient to changes

* fix: Go lint issues

* refactor(routes): use cleaner types when working with plugin nav nodes

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* chore: fix linting issues

* t: remove `isCorePage` field from includes

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
This commit is contained in:
Levente Balogh
2022-11-07 15:19:31 +01:00
committed by GitHub
co-authored by Marcus Andersson
parent f9c88e72ae
commit eb3ee35e1c
10 changed files with 249 additions and 176 deletions
+5 -2
View File
@@ -110,8 +110,11 @@ export interface PluginInclude {
path?: string;
icon?: string;
role?: string; // "Viewer", Admin, editor???
addToNav?: boolean; // Show in the sidebar... only if type=page?
// "Admin", "Editor" or "Viewer". If set then the include will only show up in the navigation if the user has the required roles.
role?: string;
// Adds the "page" or "dashboard" type includes to the navigation if set to `true`.
addToNav?: boolean;
// Angular app pages
component?: string;