From e76655df43c59f43fc1d4f38ef9170281c20d25f Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Sun, 24 Feb 2019 21:55:17 +0100 Subject: [PATCH] graph: fixes click after scroll in series override menu Makes changes to dropdown-typeahead2 so that a css class for the button can be passed in. Means it can be used instead of dropdown-typeahead. Switches to using dropdown-typeahead2 for series_overrides directive and for the influxdb, mysql and postgres datasources as it already contains a fix for this issue. This commit also fixes the index property which was set using an incorrectly spelled length property in the series_overrides directive. Closes #15621 --- .../app/core/directives/dropdown_typeahead.ts | 8 +- .../influxdb/partials/query.editor.html | 226 +++++++++----- .../mysql/partials/query.editor.html | 6 +- .../postgres/partials/query.editor.html | 6 +- .../panel/graph/series_overrides_ctrl.ts | 2 +- .../app/plugins/panel/graph/tab_display.html | 294 +++++++++++------- 6 files changed, 356 insertions(+), 186 deletions(-) diff --git a/public/app/core/directives/dropdown_typeahead.ts b/public/app/core/directives/dropdown_typeahead.ts index 8bd2d4a3af6..7456df8de53 100644 --- a/public/app/core/directives/dropdown_typeahead.ts +++ b/public/app/core/directives/dropdown_typeahead.ts @@ -128,7 +128,7 @@ export function dropdownTypeahead2($compile) { ''; const buttonTemplate = - ''; @@ -137,9 +137,15 @@ export function dropdownTypeahead2($compile) { menuItems: '=dropdownTypeahead2', dropdownTypeaheadOnSelect: '&dropdownTypeaheadOnSelect', model: '=ngModel', + buttonTemplateClass: '@', }, link: ($scope, elem, attrs) => { const $input = $(inputTemplate); + + if (!$scope.buttonTemplateClass) { + $scope.buttonTemplateClass = 'gf-form-input'; + } + const $button = $(buttonTemplate); const timeoutId = { blur: null, diff --git a/public/app/plugins/datasource/influxdb/partials/query.editor.html b/public/app/plugins/datasource/influxdb/partials/query.editor.html index 658cf18daee..ba99b396e6e 100644 --- a/public/app/plugins/datasource/influxdb/partials/query.editor.html +++ b/public/app/plugins/datasource/influxdb/partials/query.editor.html @@ -1,19 +1,38 @@ - -
+
- +
- +
-
+
- +
@@ -21,108 +40,154 @@
-
+
+
+
+ -
-
- + + +
- - -
+
+ +
-
- -
+
+ +
-
- -
+
+
+
+
-
-
-
-
+
+
+ +
-
-
- -
+
+ + +
-
- - -
+
+ +
-
- -
+
+
+
+
-
-
-
-
+
+
+ -
-
- + + +
- - -
+
+ +
-
- -
- -
-
-
-
+
+
+
+
- +
-
-
+
+
- +
-
-
+
+
- +
-
-
+
+
- +
@@ -133,7 +198,12 @@
- +
@@ -141,15 +211,21 @@
-
+
- +
- diff --git a/public/app/plugins/datasource/mysql/partials/query.editor.html b/public/app/plugins/datasource/mysql/partials/query.editor.html index 0cb47061a9e..25f33b6a534 100644 --- a/public/app/plugins/datasource/mysql/partials/query.editor.html +++ b/public/app/plugins/datasource/mysql/partials/query.editor.html @@ -45,8 +45,10 @@
diff --git a/public/app/plugins/datasource/postgres/partials/query.editor.html b/public/app/plugins/datasource/postgres/partials/query.editor.html index b5e2b5d87ed..5411427cfe6 100644 --- a/public/app/plugins/datasource/postgres/partials/query.editor.html +++ b/public/app/plugins/datasource/postgres/partials/query.editor.html @@ -45,8 +45,10 @@
diff --git a/public/app/plugins/panel/graph/series_overrides_ctrl.ts b/public/app/plugins/panel/graph/series_overrides_ctrl.ts index 90d61a362ab..fdb8f06c270 100644 --- a/public/app/plugins/panel/graph/series_overrides_ctrl.ts +++ b/public/app/plugins/panel/graph/series_overrides_ctrl.ts @@ -11,7 +11,7 @@ export function SeriesOverridesCtrl($scope, $element, popoverSrv) { const option = { text: name, propertyName: propertyName, - index: $scope.overrideMenu.lenght, + index: $scope.overrideMenu.length, values: values, submenu: _.map(values, value => { return { text: String(value), value: value }; diff --git a/public/app/plugins/panel/graph/tab_display.html b/public/app/plugins/panel/graph/tab_display.html index 976b9bcc940..a6287922cfe 100644 --- a/public/app/plugins/panel/graph/tab_display.html +++ b/public/app/plugins/panel/graph/tab_display.html @@ -1,110 +1,194 @@ +
+
+
Draw Modes
+ + + +
+
+
Mode Options
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
+
+
Hover tooltip
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
-
-
-
Draw Modes
- - - -
-
-
Mode Options
-
- -
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
-
-
Hover tooltip
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
+
+
Stacking & Null value
+ + + + +
+ +
+ +
+
+
+
-
-
Stacking & Null value
- - - - -
- -
- -
-
-
-
+
+
+
+ +
+
+ +
+
+ +
-
-
-
- -
-
- -
-
- -
+
+ + +
-
- - -
- -
-
-
- -
- -
-
-
- -
-
+
+
+
+
+ +
+
+
+ +
+