From 521c8f34f7ba8f3d503746f7faba2f49f8205d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 18 Jan 2019 15:29:58 +0100 Subject: [PATCH] Moved add query button to the right --- .../dashboard/panel_editor/EditorTabBody.tsx | 13 +++++-------- .../dashboard/panel_editor/QueriesTab.tsx | 17 ++++++++--------- public/sass/components/_toolbar.scss | 6 ++++++ 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/public/app/features/dashboard/panel_editor/EditorTabBody.tsx b/public/app/features/dashboard/panel_editor/EditorTabBody.tsx index 59cdf6c1215..0413cae8a7b 100644 --- a/public/app/features/dashboard/panel_editor/EditorTabBody.tsx +++ b/public/app/features/dashboard/panel_editor/EditorTabBody.tsx @@ -111,14 +111,11 @@ export class EditorTabBody extends PureComponent { return ( <>
-
{heading}
- {renderToolbar && renderToolbar()} - {toolbarItems.length > 0 && ( - <> -
- {toolbarItems.map(item => this.renderButton(item))} - - )} +
+
{heading}
+ {renderToolbar && renderToolbar()} +
+ {toolbarItems.map(item => this.renderButton(item))}
diff --git a/public/app/features/dashboard/panel_editor/QueriesTab.tsx b/public/app/features/dashboard/panel_editor/QueriesTab.tsx index 5e90187d171..ca06098debd 100644 --- a/public/app/features/dashboard/panel_editor/QueriesTab.tsx +++ b/public/app/features/dashboard/panel_editor/QueriesTab.tsx @@ -18,7 +18,7 @@ import config from 'app/core/config'; // Types import { PanelModel } from '../panel_model'; import { DashboardModel } from '../dashboard_model'; -import { DataQuery, DataSourceSelectItem } from '@grafana/ui/src/types'; +import { DataQuery, DataSourceSelectItem } from '@grafana/ui/src/types'; import { PluginHelp } from 'app/core/components/PluginHelp/PluginHelp'; interface Props { @@ -133,14 +133,13 @@ export class QueriesTab extends PureComponent { return ( <> -
- {!isAddingMixed && ( - - )} - {isAddingMixed && this.renderMixedPicker()} -
+
+ {!isAddingMixed && ( + + )} + {isAddingMixed && this.renderMixedPicker()} ); }; diff --git a/public/sass/components/_toolbar.scss b/public/sass/components/_toolbar.scss index 5f557f89cad..14db85f7e65 100644 --- a/public/sass/components/_toolbar.scss +++ b/public/sass/components/_toolbar.scss @@ -16,6 +16,12 @@ padding-right: 20px; } +.toolbar__left { + display: flex; + flex-grow: 1; + align-items: center; +} + .toolbar__main { padding: 0 $input-padding-x; font-size: $font-size-md;