Commit a352af5b by utkarshcmu

Fixed broken tags search

parent 13d993a8
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<span ng-if="ctrl.query.tag.length"> <span ng-if="ctrl.query.tag.length">
| |
<span ng-repeat="tagName in ctrl.query.tag"> <span ng-repeat="tagName in ctrl.query.tag">
<a ng-click="ctrl.removeTag(tagName, $event)" tag-color-from-name="ctrl.tagName" class="label label-tag"> <a ng-click="ctrl.removeTag(tagName, $event)" tag-color-from-name="tagName" class="label label-tag">
<i class="fa fa-remove"></i> <i class="fa fa-remove"></i>
{{tagName}} {{tagName}}
</a> </a>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div class="search-results-container" ng-if="ctrl.tagsMode"> <div class="search-results-container" ng-if="ctrl.tagsMode">
<div class="row"> <div class="row">
<div class="span6 offset1"> <div class="span6 offset1">
<div ng-repeat="tag in results" class="pointer" style="width: 180px; float: left;" <div ng-repeat="tag in ctrl.results" class="pointer" style="width: 180px; float: left;"
ng-class="{'selected': $index === selectedIndex }" ng-class="{'selected': $index === selectedIndex }"
ng-click="ctrl.filterByTag(tag.term, $event)"> ng-click="ctrl.filterByTag(tag.term, $event)">
<a class="search-result-tag label label-tag" tag-color-from-name="tag.term"> <a class="search-result-tag label label-tag" tag-color-from-name="tag.term">
......
...@@ -108,9 +108,12 @@ export class SearchCtrl { ...@@ -108,9 +108,12 @@ export class SearchCtrl {
getTags() { getTags() {
return this.backendSrv.get('/api/dashboards/tags').then((results) => { return this.backendSrv.get('/api/dashboards/tags').then((results) => {
this.tagsMode = true; this.tagsMode = !this.tagsMode;
this.results = results; this.results = results;
this.giveSearchFocus = this.giveSearchFocus + 1; this.giveSearchFocus = this.giveSearchFocus + 1;
if ( !this.tagsMode ) {
this.search();
}
}); });
}; };
......
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