diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ea7c7b9d4a..ad344321fae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,3 @@ - # 8.1.3 (2021-09-08) diff --git a/docs/sources/release-notes/release-notes-8-1-3.md b/docs/sources/release-notes/release-notes-8-1-3.md index 11e84d29856..d77d458c7af 100644 --- a/docs/sources/release-notes/release-notes-8-1-3.md +++ b/docs/sources/release-notes/release-notes-8-1-3.md @@ -24,4 +24,3 @@ list = false - **Plugins:** Track signed files + add warn log for plugin assets which are not signed. [#38938](https://github.com/grafana/grafana/pull/38938), [@wbrowne](https://github.com/wbrowne) - **Postgres/MySQL/MSSQL:** Fix region annotations not displayed correctly. [#38936](https://github.com/grafana/grafana/pull/38936), [@marefr](https://github.com/marefr) - **Prometheus:** Fix validate selector in metrics browser. [#38921](https://github.com/grafana/grafana/pull/38921), [@ivanahuckova](https://github.com/ivanahuckova) - diff --git a/public/app/core/components/sidemenu/BottomSection.test.tsx b/public/app/core/components/sidemenu/BottomSection.test.tsx index 891c59b4937..8cd6273c5b2 100644 --- a/public/app/core/components/sidemenu/BottomSection.test.tsx +++ b/public/app/core/components/sidemenu/BottomSection.test.tsx @@ -60,7 +60,9 @@ describe('BottomSection', () => { it('creates the correct children for the help link', () => { render( - +
+ +
); diff --git a/public/app/core/components/sidemenu/BottomSection.tsx b/public/app/core/components/sidemenu/BottomSection.tsx index d094df99b4b..4379c31652f 100644 --- a/public/app/core/components/sidemenu/BottomSection.tsx +++ b/public/app/core/components/sidemenu/BottomSection.tsx @@ -1,19 +1,22 @@ import React, { useState } from 'react'; -import { cloneDeep } from 'lodash'; -import { NavModelItem } from '@grafana/data'; -import { Icon, IconName } from '@grafana/ui'; -import appEvents from '../../app_events'; import { useLocation } from 'react-router-dom'; -import SideMenuItem from './SideMenuItem'; -import { ShowModalReactEvent } from '../../../types/events'; +import { cloneDeep } from 'lodash'; +import { css } from '@emotion/css'; +import { GrafanaTheme2, NavModelItem } from '@grafana/data'; +import { Icon, IconName, styleMixins, useTheme2 } from '@grafana/ui'; import { contextSrv } from 'app/core/services/context_srv'; +import appEvents from '../../app_events'; +import { ShowModalReactEvent } from '../../../types/events'; +import config from '../../config'; import { OrgSwitcher } from '../OrgSwitcher'; import { getFooterLinks } from '../Footer/Footer'; import { HelpModal } from '../help/HelpModal'; -import config from '../../config'; +import SideMenuItem from './SideMenuItem'; import { getForcedLoginUrl } from './utils'; export default function BottomSection() { + const theme = useTheme2(); + const styles = getStyles(theme); const navTree: NavModelItem[] = cloneDeep(config.bootData.navTree); const bottomNav = navTree.filter((item) => item.hideFromMenu); const isSignedIn = contextSrv.isSignedIn; @@ -39,7 +42,7 @@ export default function BottomSection() { } return ( -
+
{!isSignedIn && ( @@ -90,3 +93,18 @@ export default function BottomSection() {
); } + +const getStyles = (theme: GrafanaTheme2) => ({ + container: css` + display: none; + + @media ${styleMixins.mediaUp(`${theme.breakpoints.values.md}px`)} { + display: block; + margin-bottom: ${theme.spacing(2)}; + } + + .sidemenu-open--xs & { + display: block; + } + `, +}); diff --git a/public/app/core/components/sidemenu/DropDownChild.tsx b/public/app/core/components/sidemenu/DropDownChild.tsx index c8ec712c198..b69f4b233fe 100644 --- a/public/app/core/components/sidemenu/DropDownChild.tsx +++ b/public/app/core/components/sidemenu/DropDownChild.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { css } from '@emotion/css'; +import { GrafanaTheme2 } from '@grafana/data'; import { Icon, IconName, Link, useTheme2 } from '@grafana/ui'; export interface Props { @@ -13,35 +14,28 @@ export interface Props { const DropDownChild = ({ isDivider = false, icon, onClick, target, text, url }: Props) => { const theme = useTheme2(); - const iconClassName = css` - margin-right: ${theme.spacing(1)}; - `; - const resetButtonStyles = css` - background-color: transparent; - border: none; - width: 100%; - `; + const styles = getStyles(theme); const linkContent = ( <> - {icon && } + {icon && } {text} ); let element = ( - ); if (url) { element = !target && url.startsWith('/') ? ( - + {linkContent} ) : ( - + {linkContent} ); @@ -51,3 +45,15 @@ const DropDownChild = ({ isDivider = false, icon, onClick, target, text, url }: }; export default DropDownChild; + +const getStyles = (theme: GrafanaTheme2) => ({ + element: css` + background-color: transparent; + border: none; + display: flex; + width: 100%; + `, + icon: css` + margin-right: ${theme.spacing(1)}; + `, +}); diff --git a/public/app/core/components/sidemenu/SideMenu.tsx b/public/app/core/components/sidemenu/SideMenu.tsx index 316ed7425c9..b61afe334f8 100644 --- a/public/app/core/components/sidemenu/SideMenu.tsx +++ b/public/app/core/components/sidemenu/SideMenu.tsx @@ -1,16 +1,20 @@ import React, { FC, useCallback } from 'react'; +import { useLocation } from 'react-router-dom'; +import { css, cx } from '@emotion/css'; +import { GrafanaTheme2 } from '@grafana/data'; +import { Icon, styleMixins, useTheme2 } from '@grafana/ui'; import appEvents from '../../app_events'; -import TopSection from './TopSection'; -import BottomSection from './BottomSection'; +import { Branding } from 'app/core/components/Branding/Branding'; import config from 'app/core/config'; import { CoreEvents, KioskMode } from 'app/types'; -import { Branding } from 'app/core/components/Branding/Branding'; -import { Icon } from '@grafana/ui'; -import { useLocation } from 'react-router-dom'; +import TopSection from './TopSection'; +import BottomSection from './BottomSection'; const homeUrl = config.appSubUrl || '/'; export const SideMenu: FC = React.memo(() => { + const theme = useTheme2(); + const styles = getStyles(theme); const location = useLocation(); const query = new URLSearchParams(location.search); const kiosk = query.get('kiosk') as KioskMode; @@ -24,21 +28,87 @@ export const SideMenu: FC = React.memo(() => { } return ( -