diff --git a/packages/grafana-ui/src/components/Layout/Layout.tsx b/packages/grafana-ui/src/components/Layout/Layout.tsx index 586ea4f9348..d0c6448eba4 100644 --- a/packages/grafana-ui/src/components/Layout/Layout.tsx +++ b/packages/grafana-ui/src/components/Layout/Layout.tsx @@ -33,7 +33,7 @@ export const Layout: React.FC = ({ justify = 'flex-start', align = 'normal', wrap = false, - width = 'auto', + width = '100%', ...rest }) => { const theme = useTheme(); diff --git a/public/app/core/components/QueryOperationRow/QueryOperationRow.tsx b/public/app/core/components/QueryOperationRow/QueryOperationRow.tsx index 35041c210a1..20e38e28840 100644 --- a/public/app/core/components/QueryOperationRow/QueryOperationRow.tsx +++ b/public/app/core/components/QueryOperationRow/QueryOperationRow.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { renderOrCallToRender, Icon, stylesFactory, useTheme } from '@grafana/ui'; +import { renderOrCallToRender, Icon, stylesFactory, useTheme, HorizontalGroup } from '@grafana/ui'; import { GrafanaTheme } from '@grafana/data'; import { css } from 'emotion'; import { useUpdateEffect } from 'react-use'; @@ -54,17 +54,19 @@ export const QueryOperationRow: React.FC = ({ return (
-
{ - setIsContentVisible(!isContentVisible); - }} - aria-label="Query operation row title" - > - - {title && {titleElement}} -
- {actions && actionsElement} + +
{ + setIsContentVisible(!isContentVisible); + }} + aria-label="Query operation row title" + > + + {title && {titleElement}} +
+ {actions && actionsElement} +
{isContentVisible &&
{children}
}
diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx index b9978f6a3aa..916a9af4f58 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react'; import { FieldConfigSource, GrafanaTheme, PanelData, PanelPlugin } from '@grafana/data'; -import { Button, Icon, RadioButtonGroup, stylesFactory } from '@grafana/ui'; +import { Button, HorizontalGroup, Icon, RadioButtonGroup, stylesFactory } from '@grafana/ui'; import { css, cx } from 'emotion'; import config from 'app/core/config'; import AutoSizer from 'react-virtualized-auto-sizer'; @@ -221,25 +221,26 @@ export class PanelEditorUnconnected extends PureComponent { } renderPanelToolbar(styles: EditorStyles) { - const { dashboard, location, uiState } = this.props; - + const { dashboard, location, uiState, variables } = this.props; return (
- {this.renderTemplateVariables(styles)} -
-
- -
-
- -
- {!uiState.isPanelOptionsVisible && ( -
- - Show options - -
- )} + 0 ? 'space-between' : 'flex-end'} align="flex-start"> + {this.renderTemplateVariables(styles)} + + + + + {!uiState.isPanelOptionsVisible && ( + + Show options + + )} + +
); } @@ -249,35 +250,34 @@ export class PanelEditorUnconnected extends PureComponent { return (
-
- - {dashboard.title} / Edit Panel -
-
-
- -
-
- -
-
- -
-
+ + + + + + + + +
); } @@ -429,7 +429,10 @@ export const getStyles = stylesFactory((theme: GrafanaTheme, props: Props) => { padding-bottom: ${paneSpacing}; `, variablesWrapper: css` + label: variablesWrapper; display: flex; + flex-grow: 1; + flex-wrap: wrap; `, panelWrapper: css` flex: 1 1 0; @@ -477,15 +480,6 @@ export const getStyles = stylesFactory((theme: GrafanaTheme, props: Props) => { `, toolbarLeft: css` padding-left: ${theme.spacing.sm}; - display: flex; - align-items: center; - `, - toolbarItem: css` - margin-right: ${theme.spacing.sm}; - - &:last-child { - margin-right: 0; - } `, centeringContainer: css` display: flex; diff --git a/public/sass/components/_submenu.scss b/public/sass/components/_submenu.scss index 576883413e4..1f280fc6691 100644 --- a/public/sass/components/_submenu.scss +++ b/public/sass/components/_submenu.scss @@ -31,7 +31,7 @@ padding-left: 8px; } - .gf-form { + .gf-form-inline .gf-form { margin-bottom: 0; } }