diff --git a/packages/grafana-data/src/types/app.ts b/packages/grafana-data/src/types/app.ts index a400b53dbbe..ed76f8be9e6 100644 --- a/packages/grafana-data/src/types/app.ts +++ b/packages/grafana-data/src/types/app.ts @@ -42,6 +42,10 @@ export class AppPlugin extends GrafanaPlugin> { /** * Set the component displayed under: * /a/${plugin-id}/* + * + * If the NavModel is configured, the page will have a managed frame, otheriwse it has full control. + * + * NOTE: this structure will change in 7.2+ so that it is managed with a normal react router */ setRootPage(root: ComponentClass>, rootNav?: NavModel) { this.root = root; diff --git a/public/app/features/plugins/AppRootPage.tsx b/public/app/features/plugins/AppRootPage.tsx index 9858827313e..82558405768 100644 --- a/public/app/features/plugins/AppRootPage.tsx +++ b/public/app/features/plugins/AppRootPage.tsx @@ -9,9 +9,9 @@ import { AppEvents, AppPlugin, AppPluginMeta, NavModel, PluginType, UrlQueryMap import Page from 'app/core/components/Page/Page'; import { getPluginSettings } from './PluginSettingsCache'; import { importAppPlugin } from './plugin_loader'; -import { getLoadingNav } from './PluginPage'; import { getNotFoundNav, getWarningNav } from 'app/core/nav_model_srv'; import { appEvents } from 'app/core/core'; +import PageLoader from 'app/core/components/PageLoader/PageLoader'; interface Props { pluginId: string; // From the angular router @@ -23,7 +23,7 @@ interface Props { interface State { loading: boolean; plugin?: AppPlugin; - nav: NavModel; + nav?: NavModel; } export function getAppPluginPageError(meta: AppPluginMeta) { @@ -44,7 +44,6 @@ class AppRootPage extends Component { super(props); this.state = { loading: true, - nav: getLoadingNav(), }; } @@ -80,6 +79,14 @@ class AppRootPage extends Component { return
No Root App
; } + // When no naviagion is set, give full control to the app plugin + if (!nav) { + if (plugin && plugin.root) { + return ; + } + return ; + } + return (