From 7c3046e0111bb11874d4daca53af55b33960a29c Mon Sep 17 00:00:00 2001 From: Torkel Odegaard Date: Thu, 21 Aug 2014 10:36:18 +0200 Subject: [PATCH 1/2] Fix for reloadOnSearch missing on all dashboard routes, caused dashboard to be reloaded when entering/exiting edit mode (settings were lost), related to recent fullscreen/edit state present in url, #672, #425 --- src/app/routes/dashboard-from-db.js | 2 ++ src/app/routes/dashboard-from-file.js | 1 + 2 files changed, 3 insertions(+) diff --git a/src/app/routes/dashboard-from-db.js b/src/app/routes/dashboard-from-db.js index dfbcf3af3b1..d2c274fc57a 100644 --- a/src/app/routes/dashboard-from-db.js +++ b/src/app/routes/dashboard-from-db.js @@ -16,10 +16,12 @@ function (angular) { .when('/dashboard/elasticsearch/:id', { templateUrl: 'app/partials/dashboard.html', controller : 'DashFromDBProvider', + reloadOnSearch: false, }) .when('/dashboard/temp/:id', { templateUrl: 'app/partials/dashboard.html', controller : 'DashFromDBProvider', + reloadOnSearch: false, }); }); diff --git a/src/app/routes/dashboard-from-file.js b/src/app/routes/dashboard-from-file.js index 61d5817d294..dc54eaddaf6 100644 --- a/src/app/routes/dashboard-from-file.js +++ b/src/app/routes/dashboard-from-file.js @@ -14,6 +14,7 @@ function (angular, $, config, _) { .when('/dashboard/file/:jsonFile', { templateUrl: 'app/partials/dashboard.html', controller : 'DashFromFileProvider', + reloadOnSearch: false, }); }); From 39cdf857882b1bac10999f31d4f051f5e8327093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 21 Aug 2014 21:59:23 +0200 Subject: [PATCH 2/2] small refactoring for search result and dashboard id/title handling --- src/app/partials/search.html | 4 ++-- src/app/services/dashboard/dashboardSrv.js | 3 ++- src/app/services/elasticsearch/es-datasource.js | 1 + src/app/services/influxdb/influxdbDatasource.js | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/partials/search.html b/src/app/partials/search.html index ffe3ac54e95..d149b5a9970 100644 --- a/src/app/partials/search.html +++ b/src/app/partials/search.html @@ -45,7 +45,7 @@ -
No dashboards or metrics matching your query found
+
No dashboards matching your query were found.
diff --git a/src/app/services/dashboard/dashboardSrv.js b/src/app/services/dashboard/dashboardSrv.js index f2d67bf1839..6a363837bc3 100644 --- a/src/app/services/dashboard/dashboardSrv.js +++ b/src/app/services/dashboard/dashboardSrv.js @@ -19,7 +19,9 @@ function (angular, $, kbn, _, moment) { data = {}; } + this.id = data.id || null; this.title = data.title || 'No Title'; + this.originalTitle = this.title; this.tags = data.tags || []; this.style = data.style || "dark"; this.timezone = data.timezone || 'browser'; @@ -31,7 +33,6 @@ function (angular, $, kbn, _, moment) { this.templating = data.templating || { list: [] }; this.refresh = data.refresh; this.version = data.version || 0; - this.$state = data.$state; if (this.nav.length === 0) { this.nav.push({ type: 'timepicker' }); diff --git a/src/app/services/elasticsearch/es-datasource.js b/src/app/services/elasticsearch/es-datasource.js index 10fa1f00245..8b499c75af1 100644 --- a/src/app/services/elasticsearch/es-datasource.js +++ b/src/app/services/elasticsearch/es-datasource.js @@ -216,6 +216,7 @@ function (angular, _, $, config, kbn, moment) { for (var i = 0; i < results.hits.hits.length; i++) { hits.dashboards.push({ id: results.hits.hits[i]._id, + title: results.hits.hits[i]._id, tags: results.hits.hits[i]._source.tags }); } diff --git a/src/app/services/influxdb/influxdbDatasource.js b/src/app/services/influxdb/influxdbDatasource.js index 91ffdd12429..4dafd9d7388 100644 --- a/src/app/services/influxdb/influxdbDatasource.js +++ b/src/app/services/influxdb/influxdbDatasource.js @@ -358,6 +358,7 @@ function (angular, _, kbn, InfluxSeries) { for (var i = 0; i < results.length; i++) { var hit = { id: results[i].points[0][dashCol], + title: results[i].points[0][dashCol], tags: results[i].points[0][tagsCol].split(",") }; hit.tags = hit.tags[0] ? hit.tags : [];