Commit 39cdf857 by Torkel Ödegaard

small refactoring for search result and dashboard id/title handling

parent 1bc85266
......@@ -45,7 +45,7 @@
</span>
</div>
<h6 ng-hide="results.dashboards.length || results.metrics.length">No dashboards or metrics matching your query found</h6>
<h6 ng-hide="results.dashboards.length">No dashboards matching your query were found.</h6>
<div class="search-results-container" ng-if="tagsOnly">
<div ng-repeat="tag in results.tags"
......@@ -81,7 +81,7 @@
<a class="search-result-link">
<i class="icon icon-th-large"></i>
<span bo-text="row.id"></span>
<span bo-text="row.title"></span>
</a>
</div>
......
......@@ -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' });
......
......@@ -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
});
}
......
......@@ -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 : [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment