From 141e3954891bfea90e5bddaa46db6ffec909c0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 4 Dec 2015 09:20:29 +0100 Subject: [PATCH 01/19] polish(influxdb): minor improvements to influxdb editor raw query editor --- .../plugins/datasource/influxdb/partials/query.editor.html | 6 +++--- public/app/plugins/datasource/influxdb/query_ctrl.js | 1 - public/less/tightform.less | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/app/plugins/datasource/influxdb/partials/query.editor.html b/public/app/plugins/datasource/influxdb/partials/query.editor.html index 2b9f7e1a620..bec7c92b20a 100644 --- a/public/app/plugins/datasource/influxdb/partials/query.editor.html +++ b/public/app/plugins/datasource/influxdb/partials/query.editor.html @@ -55,12 +55,12 @@ -
-
- +
+
+
diff --git a/public/app/plugins/datasource/influxdb/query_ctrl.js b/public/app/plugins/datasource/influxdb/query_ctrl.js index 52b7e7f1b7a..c3fd9f2db11 100644 --- a/public/app/plugins/datasource/influxdb/query_ctrl.js +++ b/public/app/plugins/datasource/influxdb/query_ctrl.js @@ -23,7 +23,6 @@ function (angular, _, InfluxQueryBuilder, InfluxQuery, queryPart) { $scope.resultFormats = [ {text: 'Time series', value: 'time_series'}, {text: 'Table', value: 'table'}, - {text: 'JSON field', value: 'json_field'}, ]; if (!$scope.target.measurement) { diff --git a/public/less/tightform.less b/public/less/tightform.less index 494497653ed..757ef2b973c 100644 --- a/public/less/tightform.less +++ b/public/less/tightform.less @@ -59,6 +59,11 @@ } } +.tight-form-flex-wrapper { + display: flex; + flex-direction: row; +} + .grafana-metric-options { margin-top: 25px; } From 2345b41a74f919ceaad7e9063aaca2f4cc026202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 4 Dec 2015 10:06:44 +0100 Subject: [PATCH 02/19] feat(elasticsearch): added min_doc_count option for date histogram, closes #3416 --- CHANGELOG.md | 1 + .../panels/table/specs/table_model_specs.ts | 1 + .../datasource/elasticsearch/bucket_agg.js | 2 ++ .../elasticsearch/partials/bucketAgg.html | 15 +++++++-- .../datasource/elasticsearch/query_builder.js | 31 ++++++++++--------- .../influxdb/specs/influx_series_specs.ts | 2 +- 6 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 public/app/panels/table/specs/table_model_specs.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d6fa247b59..f91ebd2fe1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Enhancements * **CloudWatch**: Support for multiple AWS Credentials, closes [#3053](https://github.com/grafana/grafana/issues/3053), [#3080](https://github.com/grafana/grafana/issues/3080) * **Elasticsearch**: Support for dynamic daily indices for annotations, closes [#3061](https://github.com/grafana/grafana/issues/3061) +* **Elasticsearch**: Support for setting min_doc_count for date histogram, closes [#3416](https://github.com/grafana/grafana/issues/3416) * **Graph Panel**: Option to hide series with all zeroes from legend and tooltip, closes [#1381](https://github.com/grafana/grafana/issues/1381), [#3336](https://github.com/grafana/grafana/issues/3336) ### Bug Fixes diff --git a/public/app/panels/table/specs/table_model_specs.ts b/public/app/panels/table/specs/table_model_specs.ts new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/public/app/panels/table/specs/table_model_specs.ts @@ -0,0 +1 @@ + diff --git a/public/app/plugins/datasource/elasticsearch/bucket_agg.js b/public/app/plugins/datasource/elasticsearch/bucket_agg.js index 014761da7f2..2a21bc17960 100644 --- a/public/app/plugins/datasource/elasticsearch/bucket_agg.js +++ b/public/app/plugins/datasource/elasticsearch/bucket_agg.js @@ -92,8 +92,10 @@ function (angular, _, queryDef) { } case 'date_histogram': { settings.interval = settings.interval || 'auto'; + settings.min_doc_count = settings.min_doc_count || 0; $scope.agg.field = $scope.target.timeField; settingsLinkText = 'Interval: ' + settings.interval; + settingsLinkText += ', Min Doc Count: ' + settings.min_doc_count; } } diff --git a/public/app/plugins/datasource/elasticsearch/partials/bucketAgg.html b/public/app/plugins/datasource/elasticsearch/partials/bucketAgg.html index f6ff3f6cd93..48e9a1322e1 100644 --- a/public/app/plugins/datasource/elasticsearch/partials/bucketAgg.html +++ b/public/app/plugins/datasource/elasticsearch/partials/bucketAgg.html @@ -35,9 +35,9 @@
-
+
    -
  • +
  • Interval
  • @@ -46,6 +46,17 @@
+
+
    +
  • + Min Doc Count +
  • +
  • + +
  • +
+
+
diff --git a/public/app/plugins/datasource/elasticsearch/query_builder.js b/public/app/plugins/datasource/elasticsearch/query_builder.js index de4e52a8e81..d736966285c 100644 --- a/public/app/plugins/datasource/elasticsearch/query_builder.js +++ b/public/app/plugins/datasource/elasticsearch/query_builder.js @@ -50,12 +50,23 @@ function () { return queryNode; }; - ElasticQueryBuilder.prototype.getInterval = function(agg) { - if (agg.settings && agg.settings.interval !== 'auto') { - return agg.settings.interval; - } else { - return '$interval'; + ElasticQueryBuilder.prototype.getDateHistogramAgg = function(aggDef) { + var esAgg = {}; + var settings = aggDef.settings || {}; + esAgg.interval = settings.interval; + esAgg.field = this.timeField; + esAgg.min_doc_count = settings.min_doc_count || 0; + esAgg.extended_bounds = {min: "$timeFrom", max: "$timeTo"}; + + if (esAgg.interval === 'auto') { + esAgg.interval = "$interval"; } + + if (this.esVersion >= 2) { + esAgg.format = "epoch_millis"; + } + + return esAgg; }; ElasticQueryBuilder.prototype.getFiltersAgg = function(aggDef) { @@ -130,15 +141,7 @@ function () { switch(aggDef.type) { case 'date_histogram': { - esAgg["date_histogram"] = { - "interval": this.getInterval(aggDef), - "field": this.timeField, - "min_doc_count": 0, - "extended_bounds": { "min": "$timeFrom", "max": "$timeTo" } - }; - if (this.esVersion >= 2) { - esAgg["date_histogram"]["format"] = "epoch_millis"; - } + esAgg["date_histogram"] = this.getDateHistogramAgg(aggDef); break; } case 'filters': { diff --git a/public/app/plugins/datasource/influxdb/specs/influx_series_specs.ts b/public/app/plugins/datasource/influxdb/specs/influx_series_specs.ts index 8352e41d99a..0e8e16a6114 100644 --- a/public/app/plugins/datasource/influxdb/specs/influx_series_specs.ts +++ b/public/app/plugins/datasource/influxdb/specs/influx_series_specs.ts @@ -205,7 +205,7 @@ describe('when generating timeseries from influxdb response', function() { expect(table.type).to.be('table'); expect(table.columns.length).to.be(3); - expect(table.rows[0]).to.eql([1431946625000, 'America', 10]);; + expect(table.rows[0]).to.eql([1431946625000, 'America', 10]); }); }); From 0b4552a8e71f1773363297a5974fecf87b1325e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 4 Dec 2015 10:32:23 +0100 Subject: [PATCH 03/19] fix(timerange): fix handling of invalid dates in from/to url parameters, fixes #3345 --- public/app/features/dashboard/timeSrv.js | 6 ++++-- public/test/mocks/dashboard-mock.js | 2 +- public/test/specs/time_srv_specs.js | 8 ++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/public/app/features/dashboard/timeSrv.js b/public/app/features/dashboard/timeSrv.js index 691bfd07904..3fa0abf508e 100644 --- a/public/app/features/dashboard/timeSrv.js +++ b/public/app/features/dashboard/timeSrv.js @@ -21,6 +21,7 @@ define([ this._initTimeFromUrl(); this._parseTime(); + console.log(dashboard.time); if(this.dashboard.refresh) { this.setAutoRefresh(this.dashboard.refresh); @@ -47,8 +48,9 @@ define([ if (value.length === 15) { return moment.utc(value, 'YYYYMMDDTHHmmss'); } - var epoch = parseInt(value); - if (!_.isNaN(epoch)) { + + if (!isNaN(value)) { + var epoch = parseInt(value); return moment(epoch); } diff --git a/public/test/mocks/dashboard-mock.js b/public/test/mocks/dashboard-mock.js index 6367093bd36..9b61108728e 100644 --- a/public/test/mocks/dashboard-mock.js +++ b/public/test/mocks/dashboard-mock.js @@ -15,7 +15,7 @@ define([], rows: [], pulldowns: [ { type: 'templating' }, { type: 'annotations' } ], nav: [ { type: 'timepicker' } ], - time: {from: '1h', to: 'now'}, + time: {from: 'now-6h', to: 'now'}, templating: { list: [] }, diff --git a/public/test/specs/time_srv_specs.js b/public/test/specs/time_srv_specs.js index 9943aae6cc3..60bdd1a4c5b 100644 --- a/public/test/specs/time_srv_specs.js +++ b/public/test/specs/time_srv_specs.js @@ -75,6 +75,14 @@ define([ expect(time.to.valueOf()).to.equal(1410337665699); }); + it('should handle bad dates', function() { + ctx.$routeParams.from = '20151126T00010%3C%2Fp%3E%3Cspan%20class'; + ctx.$routeParams.to = 'now'; + _dashboard.time.from = 'now-6h'; + ctx.service.init(_dashboard); + expect(ctx.service.time.from).to.equal('now-6h'); + expect(ctx.service.time.to).to.equal('now'); + }); }); describe('setTime', function() { From 67dc761344bcea35c707ea0da1400be324ae8b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 4 Dec 2015 10:38:27 +0100 Subject: [PATCH 04/19] fix(security): do not print ENV config values when they are passwords, fixes #3337 --- pkg/setting/setting.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index d6a853a9cdc..34ed216a4a6 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -174,6 +174,9 @@ func applyEnvVariableOverrides() { if len(envValue) > 0 { key.SetValue(envValue) + if strings.Contains(envKey, "PASSWORD") { + envValue = "*********" + } appliedEnvOverrides = append(appliedEnvOverrides, fmt.Sprintf("%s=%s", envKey, envValue)) } } @@ -188,6 +191,9 @@ func applyCommandLineDefaultProperties(props map[string]string) { value, exists := props[keyString] if exists { key.SetValue(value) + if strings.Contains(keyString, "password") { + value = "*********" + } appliedCommandLineProperties = append(appliedCommandLineProperties, fmt.Sprintf("%s=%s", keyString, value)) } } From df366da721c1d26c5817e4e5f78bccea4d82177b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 4 Dec 2015 10:39:50 +0100 Subject: [PATCH 05/19] updated version to 2.6.0-beta1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 75136e48f1a..c82da556b1e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "company": "Coding Instinct AB" }, "name": "grafana", - "version": "2.6.0-pre1", + "version": "2.6.0-beta1", "repository": { "type": "git", "url": "http://github.com/torkelo/grafana.git" From 36ab8ae19c8f5cf0fb734889a06400bb7f88add7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 4 Dec 2015 10:44:17 +0100 Subject: [PATCH 06/19] fix(table): minor fix for table panel --- public/app/features/dashboard/timeSrv.js | 1 - public/app/panels/table/editor.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/features/dashboard/timeSrv.js b/public/app/features/dashboard/timeSrv.js index 3fa0abf508e..62d7b8c591e 100644 --- a/public/app/features/dashboard/timeSrv.js +++ b/public/app/features/dashboard/timeSrv.js @@ -21,7 +21,6 @@ define([ this._initTimeFromUrl(); this._parseTime(); - console.log(dashboard.time); if(this.dashboard.refresh) { this.setAutoRefresh(this.dashboard.refresh); diff --git a/public/app/panels/table/editor.ts b/public/app/panels/table/editor.ts index e41ff422800..86e3d6be03d 100644 --- a/public/app/panels/table/editor.ts +++ b/public/app/panels/table/editor.ts @@ -50,6 +50,7 @@ export class TablePanelEditorCtrl { var plusButton = uiSegmentSrv.newPlusButton(); $scope.addColumnSegment.html = plusButton.html; + $scope.addColumnSegment.value = plusButton.value; }; $scope.transformChanged = function() { From e9e6ac64bdc8d10894efd4dd89b75cf72098ff8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 4 Dec 2015 11:21:38 +0100 Subject: [PATCH 07/19] minor change to build script --- build.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.go b/build.go index 4a345c5fc73..01089856ce6 100644 --- a/build.go +++ b/build.go @@ -315,6 +315,8 @@ func build(pkg string, tags []string) { args = append(args, "-o", binary) args = append(args, pkg) setBuildEnv() + + runPrint("go", "version") runPrint("go", args...) // Create an md5 checksum of the binary, to be included in the archive for From 002455da07294d46951318a3f2bcb53d09a42aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 4 Dec 2015 12:15:42 +0100 Subject: [PATCH 08/19] fix(table): minor fix to table panel and transform time series to aggregations --- public/app/panels/table/editor.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/app/panels/table/editor.ts b/public/app/panels/table/editor.ts index 86e3d6be03d..b9fc0c3dd63 100644 --- a/public/app/panels/table/editor.ts +++ b/public/app/panels/table/editor.ts @@ -45,8 +45,13 @@ export class TablePanelEditorCtrl { }; $scope.addColumn = function() { - $scope.panel.columns.push({text: $scope.addColumnSegment.value, value: $scope.addColumnSegment.value}); - $scope.render(); + var columns = transformers[$scope.panel.transform].getColumns($scope.dataRaw); + var column = _.findWhere(columns, {text: $scope.addColumnSegment.value}); + + if (column) { + $scope.panel.columns.push(column); + $scope.render(); + } var plusButton = uiSegmentSrv.newPlusButton(); $scope.addColumnSegment.html = plusButton.html; From 573632012ebf46d0d13f4169bd049b8ab30c3c3f Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Fri, 4 Dec 2015 20:16:31 +0900 Subject: [PATCH 09/19] cloudwatch dimension null check --- public/app/plugins/datasource/cloudwatch/datasource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/cloudwatch/datasource.js b/public/app/plugins/datasource/cloudwatch/datasource.js index da95578782e..435d9ef8b4c 100644 --- a/public/app/plugins/datasource/cloudwatch/datasource.js +++ b/public/app/plugins/datasource/cloudwatch/datasource.js @@ -129,7 +129,7 @@ function (angular, _) { .pluck('Dimensions') .flatten() .filter(function(dimension) { - return dimension.Name === dimensionKey; + return dimension !== null && dimension.Name === dimensionKey; }) .pluck('Value') .uniq() From f9b13791deb5487f860d5ec7d6abf2a91669ba36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 4 Dec 2015 15:38:49 +0100 Subject: [PATCH 10/19] change(table panel): changed default transform mode --- public/app/panels/table/controller.ts | 2 +- public/app/panels/table/renderer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/panels/table/controller.ts b/public/app/panels/table/controller.ts index 270e2f65a3d..54deb28b11e 100644 --- a/public/app/panels/table/controller.ts +++ b/public/app/panels/table/controller.ts @@ -26,7 +26,7 @@ export class TablePanelCtrl { var panelDefaults = { targets: [{}], - transform: 'timeseries_to_rows', + transform: 'timeseries_to_columns', pageSize: null, showHeader: true, styles: [ diff --git a/public/app/panels/table/renderer.ts b/public/app/panels/table/renderer.ts index a55a8bf2fac..c782cce3579 100644 --- a/public/app/panels/table/renderer.ts +++ b/public/app/panels/table/renderer.ts @@ -112,7 +112,7 @@ export class TableRenderer { // this hack adds header content to cell (not visible) var widthHack = ''; if (addWidthHack) { - widthHack = '
' + this.table.columns[columnIndex].text + '
'; + widthHack = '
' + this.table.columns[columnIndex].text + '
'; } return '' + value + widthHack + ''; From caa63379528c35d578ea1392c6df6d0b74d15755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 4 Dec 2015 16:48:35 +0100 Subject: [PATCH 11/19] updated appveyor --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 993f8f2882c..5ba13548b31 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ os: Windows Server 2012 R2 clone_folder: c:\gopath\src\github.com\grafana\grafana environment: - nodejs_version: "0.12.2" + nodejs_version: "4.2.3" GOPATH: c:\gopath install: From df0a5cf52f1e4a65d4dbe5356781468c63db359c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 4 Dec 2015 16:56:37 +0100 Subject: [PATCH 12/19] updated appveyor again --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 5ba13548b31..83506312912 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ os: Windows Server 2012 R2 clone_folder: c:\gopath\src\github.com\grafana\grafana environment: - nodejs_version: "4.2.3" + nodejs_version: "4" GOPATH: c:\gopath install: From 477b876a1f94ca15312722af9f3e7b9be78dd9ac Mon Sep 17 00:00:00 2001 From: Trent White Date: Fri, 4 Dec 2015 11:55:20 -0500 Subject: [PATCH 13/19] add variable for codeTagBackground to control look for both themes. Fixes #3399 --- public/less/overrides.less | 6 ++++-- public/less/variables.dark.less | 1 + public/less/variables.light.less | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/public/less/overrides.less b/public/less/overrides.less index fb6544cd99c..e08e7ab30a2 100644 --- a/public/less/overrides.less +++ b/public/less/overrides.less @@ -61,7 +61,7 @@ } code, pre { - background-color: @grayLighter; + background-color: @codeTagBackground; } div.editor-row { @@ -578,8 +578,10 @@ div.flot-text { // pre code, pre { - background-color: @grafanaPanelBackground; + background-color: @codeTagBackground; color: @textColor; + border: 1px solid darken(@codeTagBackground, 15%); + padding: 2px; } .dropdown-menu { diff --git a/public/less/variables.dark.less b/public/less/variables.dark.less index 3324c3f4b86..783304cd32a 100644 --- a/public/less/variables.dark.less +++ b/public/less/variables.dark.less @@ -42,6 +42,7 @@ @grafanaTargetFuncHightlight: #444; @modalBackground: @black; +@codeTagBackground: #444; // Scaffolding // ------------------------- diff --git a/public/less/variables.light.less b/public/less/variables.light.less index f9063c4cd74..827e2c90b3c 100644 --- a/public/less/variables.light.less +++ b/public/less/variables.light.less @@ -55,6 +55,7 @@ @grafanaTargetFuncHightlight: darken(@grafanaTargetBackground, 10%); @modalBackground: @bodyBackground; +@codeTagBackground: #ddd; // Scaffolding // ------------------------- From c9674f84e82118d5a4dac460ae0b6a281136e3fd Mon Sep 17 00:00:00 2001 From: toni-moreno Date: Fri, 4 Dec 2015 22:36:38 +0100 Subject: [PATCH 14/19] add option pkg-rpm and pkg-deb to create separately both packages #3407 --- build.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/build.go b/build.go index 4a345c5fc73..22ba4a29f01 100644 --- a/build.go +++ b/build.go @@ -76,6 +76,14 @@ func main() { grunt("release") createLinuxPackages() + case "pkg-rpm": + grunt("release") + createRpmPackages() + + case "pkg-deb": + grunt("release") + createDebPackages() + case "latest": makeLatestDistCopies() @@ -146,8 +154,7 @@ type linuxPackageOptions struct { depends []string } - -func createLinuxPackages() { +func createDebPackages() { createPackage(linuxPackageOptions{ packageType: "deb", homeDir: "/usr/share/grafana", @@ -167,7 +174,9 @@ func createLinuxPackages() { depends: []string{"adduser", "libfontconfig"}, }) +} +func createRpmPackages() { createPackage(linuxPackageOptions{ packageType: "rpm", homeDir: "/usr/share/grafana", @@ -189,6 +198,11 @@ func createLinuxPackages() { }) } +func createLinuxPackages() { + createDebPackages() + createRpmPackages() +} + func createPackage(options linuxPackageOptions) { packageRoot, _ := ioutil.TempDir("", "grafana-linux-pack") From 7e63978a3f18550cfd3c1ce6dcb35fc9d50176c8 Mon Sep 17 00:00:00 2001 From: toni-moreno Date: Fri, 4 Dec 2015 22:55:23 +0100 Subject: [PATCH 15/19] fix formatting for CircleCI test --- build.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.go b/build.go index 22ba4a29f01..2b0b6069ac7 100644 --- a/build.go +++ b/build.go @@ -79,7 +79,7 @@ func main() { case "pkg-rpm": grunt("release") createRpmPackages() - + case "pkg-deb": grunt("release") createDebPackages() @@ -154,6 +154,7 @@ type linuxPackageOptions struct { depends []string } + func createDebPackages() { createPackage(linuxPackageOptions{ packageType: "deb", From ce584868500e3db741acb25faa3f195b274c6562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sat, 5 Dec 2015 14:22:39 +0100 Subject: [PATCH 16/19] fix(html): removed unneeded tag --- .../plugins/datasource/elasticsearch/partials/bucketAgg.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/elasticsearch/partials/bucketAgg.html b/public/app/plugins/datasource/elasticsearch/partials/bucketAgg.html index 48e9a1322e1..5a84ec8f6cd 100644 --- a/public/app/plugins/datasource/elasticsearch/partials/bucketAgg.html +++ b/public/app/plugins/datasource/elasticsearch/partials/bucketAgg.html @@ -52,7 +52,7 @@ Min Doc Count
  • - +
  • From b6044910ec49f50ec28e219215e4f436ded9560d Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Sat, 5 Dec 2015 06:33:55 -0800 Subject: [PATCH 17/19] Removed if condition to fix 3370 --- public/app/core/directives/value_select_dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/core/directives/value_select_dropdown.js b/public/app/core/directives/value_select_dropdown.js index 4f5076abd2f..873174c6fc6 100644 --- a/public/app/core/directives/value_select_dropdown.js +++ b/public/app/core/directives/value_select_dropdown.js @@ -156,7 +156,7 @@ function (angular, _, coreModule) { vm.selectionsChanged = function(commitChange) { vm.selectedValues = _.filter(vm.options, {selected: true}); - if (vm.selectedValues.length > 1 && vm.selectedValues.length !== vm.options.length) { + if (vm.selectedValues.length > 1) { if (vm.selectedValues[0].text === 'All') { vm.selectedValues[0].selected = false; vm.selectedValues = vm.selectedValues.slice(1, vm.selectedValues.length); From 4c5cfd51d75f2001b688302b81f2fab5737d1a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sun, 6 Dec 2015 10:13:47 +0100 Subject: [PATCH 18/19] fix(metric_editors): Fixes clicking timing issue for typeahead auto dropdown option, fixes #3428 --- CHANGELOG.md | 7 ++++++- public/app/core/directives/metric_segment.js | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f91ebd2fe1d..445fb52289e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -# 2.6.0 (unreleased) +# 2.6.0 (2015-12-04) + +### Bug Fixes +* **metric editors**: Fix for clicking typeahead auto dropdown option, fixes [#3428](https://github.com/grafana/grafana/issues/3428) + +# 2.6.0-Beta1 (2015-12-04) ### New Table Panel * **table**: New powerful and flexible table panel, closes [#215](https://github.com/grafana/grafana/issues/215) diff --git a/public/app/core/directives/metric_segment.js b/public/app/core/directives/metric_segment.js index 1d07544bb2d..bf7f7309b2b 100644 --- a/public/app/core/directives/metric_segment.js +++ b/public/app/core/directives/metric_segment.js @@ -55,8 +55,8 @@ function (_, $, coreModule) { }); }; - $scope.switchToLink = function() { - if (linkMode) { return; } + $scope.switchToLink = function(fromClick) { + if (linkMode && !fromClick) { return; } clearTimeout(cancelBlur); cancelBlur = null; @@ -69,7 +69,7 @@ function (_, $, coreModule) { $scope.inputBlur = function() { // happens long before the click event on the typeahead options // need to have long delay because the blur - cancelBlur = setTimeout($scope.switchToLink, 100); + cancelBlur = setTimeout($scope.switchToLink, 200); }; $scope.source = function(query, callback) { @@ -100,7 +100,7 @@ function (_, $, coreModule) { } $input.val(value); - $scope.switchToLink(); + $scope.switchToLink(true); return value; }; From 217d5df276cb24981aaeca03cbf0fa4ddb3d0201 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Mon, 7 Dec 2015 13:40:54 +0900 Subject: [PATCH 19/19] (cloudwatch) fix period overwrite --- public/app/plugins/datasource/cloudwatch/datasource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/cloudwatch/datasource.js b/public/app/plugins/datasource/cloudwatch/datasource.js index 435d9ef8b4c..e01bdce6096 100644 --- a/public/app/plugins/datasource/cloudwatch/datasource.js +++ b/public/app/plugins/datasource/cloudwatch/datasource.js @@ -25,7 +25,7 @@ function (angular, _) { var end = convertToCloudWatchTime(options.range.to); var queries = []; - options = _.clone(options); + options = angular.copy(options); _.each(options.targets, _.bind(function(target) { if (target.hide || !target.namespace || !target.metricName || _.isEmpty(target.statistics)) { return;