Plugins: Move AppChrome extension point to top of stack (#109015)

* Plugins: Move AppChrome extension point to top of stack

* Plugins: Switch AppChrome extension gating to chromeless flag
This commit is contained in:
Matt Cowley
2025-08-08 16:58:48 +02:00
committed by GitHub
parent 992d189c0f
commit bd2f14e01b
2 changed files with 5 additions and 14 deletions
@@ -1,25 +1,16 @@
import { useLocation } from 'react-router-dom';
import { PluginExtensionPoints } from '@grafana/data';
import { config, renderLimitedComponents, usePluginComponents } from '@grafana/runtime';
const excludedRoutes: Record<string, boolean> = {
'/login': true,
'/signup': true,
'/verify': true,
'/user/password/send-reset-email': true,
'/user/password/reset': true,
'/sandbox/benchmarks': true,
};
import { useGrafana } from 'app/core/context/GrafanaContext';
export function AppChromeExtensionPoint(): JSX.Element | null {
const location = useLocation();
const { chrome } = useGrafana();
const state = chrome.useState();
if (config.featureToggles.enableAppChromeExtensions !== true) {
return null;
}
if (excludedRoutes[location.pathname]) {
if (state.chromeless) {
return null;
}
+1 -1
View File
@@ -34,6 +34,7 @@ export function RouterWrapper(props: RouterWrapperProps) {
<AppChrome>
<AppNotificationList />
<Stack gap={0} grow={1} direction="column">
<AppChromeExtensionPoint />
{props.pageBanners.map((Banner, index) => (
<Banner key={index.toString()} />
))}
@@ -42,7 +43,6 @@ export function RouterWrapper(props: RouterWrapperProps) {
{props.bodyRenderHooks.map((Hook, index) => (
<Hook key={index.toString()} />
))}
<AppChromeExtensionPoint />
</AppChrome>
<ModalRoot />
</ModalsContextProvider>