From 6dad4cce07471a1547e2e5a4fdee55e36f617ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 29 Jan 2019 08:14:07 +0100 Subject: [PATCH 1/2] Updated Explore query styles to align them to other query editor to make them fit in better --- public/app/features/explore/QueryRow.tsx | 26 ++++++----- .../loki/components/LokiQueryField.tsx | 44 ++++++++++--------- .../prometheus/components/PromQueryField.tsx | 44 ++++++++++--------- public/sass/components/_gf-form.scss | 6 +++ public/sass/components/_slate_editor.scss | 3 +- public/sass/pages/_explore.scss | 15 ++----- 6 files changed, 75 insertions(+), 63 deletions(-) diff --git a/public/app/features/explore/QueryRow.tsx b/public/app/features/explore/QueryRow.tsx index 3bc2b556a63..682bb22d348 100644 --- a/public/app/features/explore/QueryRow.tsx +++ b/public/app/features/explore/QueryRow.tsx @@ -131,16 +131,22 @@ export class QueryRow extends PureComponent { /> )} -
- - - +
+
+ +
+
+ +
+
+ +
); diff --git a/public/app/plugins/datasource/loki/components/LokiQueryField.tsx b/public/app/plugins/datasource/loki/components/LokiQueryField.tsx index febb322acca..1c4243375fe 100644 --- a/public/app/plugins/datasource/loki/components/LokiQueryField.tsx +++ b/public/app/plugins/datasource/loki/components/LokiQueryField.tsx @@ -212,26 +212,30 @@ class LokiQueryField extends React.PureComponent -
- - - + <> +
+
+ + + +
+
+ +
-
- +
{error ?
{error}
: null} {hint ? (
@@ -244,7 +248,7 @@ class LokiQueryField extends React.PureComponent ) : null}
-
+ ); } } diff --git a/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx b/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx index f5b5b311b2a..1c07be0d3ac 100644 --- a/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx +++ b/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx @@ -235,26 +235,28 @@ class PromQueryField extends React.PureComponent -
- - - -
-
- + <> +
+
+ + + +
+
+ +
{error ?
{error}
: null} {hint ? (
@@ -267,7 +269,7 @@ class PromQueryField extends React.PureComponent ) : null}
-
+ ); } } diff --git a/public/sass/components/_gf-form.scss b/public/sass/components/_gf-form.scss index e86b901bb79..b81cccd7ab7 100644 --- a/public/sass/components/_gf-form.scss +++ b/public/sass/components/_gf-form.scss @@ -129,6 +129,11 @@ $input-border: 1px solid $input-border-color; &:hover { background: $list-item-hover-bg; + color: $link-color; + } + + .fa-caret-down { + padding-left: 4px; } } @@ -137,6 +142,7 @@ $input-border: 1px solid $input-border-color; } } + .gf-form-label + .gf-form-label { margin-right: $gf-form-margin; } diff --git a/public/sass/components/_slate_editor.scss b/public/sass/components/_slate_editor.scss index 200f102d69a..f8796a8f260 100644 --- a/public/sass/components/_slate_editor.scss +++ b/public/sass/components/_slate_editor.scss @@ -8,7 +8,8 @@ .slate-query-field__wrapper { position: relative; display: inline-block; - padding: 6px 7px 4px; + padding: $input-padding-y $input-padding-x; + height: $gf-form-input-height; width: 100%; cursor: text; line-height: $line-height-base; diff --git a/public/sass/pages/_explore.scss b/public/sass/pages/_explore.scss index dce944dc7b2..151130a69e2 100644 --- a/public/sass/pages/_explore.scss +++ b/public/sass/pages/_explore.scss @@ -322,6 +322,7 @@ .query-row { display: flex; position: relative; + align-items: flex-start; & + & { margin-top: 0.5rem; @@ -335,17 +336,17 @@ .query-row-status { position: absolute; top: 0; - right: 90px; + right: 105px; z-index: 1015; display: flex; flex-direction: column; justify-content: center; - height: 34px; + height: $input-height; } .query-row-field { margin-right: 3px; - width: 100%; + flex-grow: 1; } .query-transactions { @@ -382,14 +383,6 @@ // Prometheus-specifics, to be extracted to datasource soon .explore { - .prom-query-field { - display: flex; - } - - .prom-query-field-wrapper { - width: 100%; - } - .prom-query-field-info { margin: 0.25em 0.5em 0.5em; display: flex; From 8b70a8dd504520be5347add61876b814ddabe176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 29 Jan 2019 14:36:09 +0100 Subject: [PATCH 2/2] Fixed explore query editor styling issues --- .../prometheus/components/PromQueryField.tsx | 22 +++++++++---------- public/sass/components/_gf-form.scss | 2 +- public/sass/components/_slate_editor.scss | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx b/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx index 1c07be0d3ac..7ba18111297 100644 --- a/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx +++ b/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx @@ -257,18 +257,18 @@ class PromQueryField extends React.PureComponent
- {error ?
{error}
: null} - {hint ? ( -
- {hint.label}{' '} - {hint.fix ? ( - - {hint.fix.label} - - ) : null} -
- ) : null}
+ {error ?
{error}
: null} + {hint ? ( +
+ {hint.label}{' '} + {hint.fix ? ( + + {hint.fix.label} + + ) : null} +
+ ) : null} ); } diff --git a/public/sass/components/_gf-form.scss b/public/sass/components/_gf-form.scss index b81cccd7ab7..08ca2193ea0 100644 --- a/public/sass/components/_gf-form.scss +++ b/public/sass/components/_gf-form.scss @@ -5,7 +5,7 @@ $input-border: 1px solid $input-border-color; margin-bottom: $gf-form-margin; display: flex; flex-direction: row; - align-items: center; + align-items: flex-start; text-align: left; position: relative; diff --git a/public/sass/components/_slate_editor.scss b/public/sass/components/_slate_editor.scss index f8796a8f260..7608f071e78 100644 --- a/public/sass/components/_slate_editor.scss +++ b/public/sass/components/_slate_editor.scss @@ -9,7 +9,7 @@ position: relative; display: inline-block; padding: $input-padding-y $input-padding-x; - height: $gf-form-input-height; + min-height: $gf-form-input-height; width: 100%; cursor: text; line-height: $line-height-base;