diff --git a/packages/grafana-ui/src/themes/GlobalStyles/page.ts b/packages/grafana-ui/src/themes/GlobalStyles/page.ts index 53739143a9f..1be34dcb752 100644 --- a/packages/grafana-ui/src/themes/GlobalStyles/page.ts +++ b/packages/grafana-ui/src/themes/GlobalStyles/page.ts @@ -18,14 +18,18 @@ export function getPageStyles(theme: GrafanaTheme2) { .main-view { position: relative; + display: flex; + flex-direction: column; flex-grow: 1; + height: 100%; + flex: 1 1 0; } .page-scrollbar-wrapper { - position: absolute; - top: 0; - bottom: 0; width: 100%; + flex-grow: 1; + width: 100%; + min-height: 0; } .page-scrollbar-content { diff --git a/public/app/AppWrapper.tsx b/public/app/AppWrapper.tsx index 89c1b48eab2..2e3f2bbc705 100644 --- a/public/app/AppWrapper.tsx +++ b/public/app/AppWrapper.tsx @@ -25,11 +25,15 @@ interface AppWrapperState { /** Used by enterprise */ let bodyRenderHooks: ComponentType[] = []; +let pageBanners: ComponentType[] = []; export function addBodyRenderHook(fn: ComponentType) { bodyRenderHooks.push(fn); } +export function addPageBanner(fn: ComponentType) { + pageBanners.push(fn); +} export class AppWrapper extends React.Component { container = React.createRef(); @@ -98,6 +102,9 @@ export class AppWrapper extends React.Component
+ {pageBanners.map((Banner, index) => ( + + ))}
({ wrapper: css` - bottom: 0; - position: absolute; - top: 0; width: 100%; + flex-grow: 1; + width: 100%; + min-height: 0; `, }); diff --git a/public/app/features/dashboard/containers/DashboardPage.tsx b/public/app/features/dashboard/containers/DashboardPage.tsx index 577b4d01e5a..c1f076eaacd 100644 --- a/public/app/features/dashboard/containers/DashboardPage.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.tsx @@ -395,14 +395,12 @@ export const getStyles = stylesFactory((theme: GrafanaTheme2, kioskMode) => { const contentPadding = kioskMode !== KioskMode.Full ? theme.spacing(0, 2, 2) : theme.spacing(2); return { dashboardContainer: css` - position: absolute; - top: 0; - bottom: 0; width: 100%; height: 100%; display: flex; flex: 1 1 0; flex-direction: column; + min-height: 0; `, dashboardScroll: css` width: 100%; diff --git a/public/sass/pages/_explore.scss b/public/sass/pages/_explore.scss index 78704925e2d..37f468d8070 100644 --- a/public/sass/pages/_explore.scss +++ b/public/sass/pages/_explore.scss @@ -141,7 +141,6 @@ display: flex; flex: 1 1 auto; flex-direction: column; - height: 100vh; width: 100%; } @@ -166,6 +165,7 @@ .explore-wrapper { display: flex; + height: 100%; > .explore-split { width: 50%;