diff --git a/public/app/features/plugins/routes.tsx b/public/app/features/plugins/routes.tsx index c05c0afe7da..6e26112cb68 100644 --- a/public/app/features/plugins/routes.tsx +++ b/public/app/features/plugins/routes.tsx @@ -12,8 +12,7 @@ export function getAppPluginRoutes(): RouteDescriptor[] { const isStandalonePluginPage = (id: string) => id.startsWith('standalone-plugin-page-/'); const isPluginNavModelItem = (model: NavModelItem): model is PluginNavModelItem => 'pluginId' in model && 'id' in model; - - return Object.values(navIndex) + const explicitAppPluginRoutes = Object.values(navIndex) .filter(isPluginNavModelItem) .map((navItem) => { const pluginNavSection = getRootSectionForNode(navItem); @@ -26,6 +25,17 @@ export function getAppPluginRoutes(): RouteDescriptor[] { component: () => , }; }); + + return [ + ...explicitAppPluginRoutes, + + // Fallback route for plugins that don't have any pages under includes + { + path: '/a/:pluginId', + exact: false, // route everything under this path to the plugin, so it can define more routes under this path + component: ({ match }) => , + }, + ]; } interface PluginNavModelItem extends Omit {