Get rid of click-to-change-title in dashboard. Make searching better. Closes #48

This commit is contained in:
Rashid Khan 2014-04-15 10:20:53 -07:00
parent 571e5af0ad
commit b469f140e2
4 changed files with 7 additions and 11 deletions

View file

@ -2,14 +2,9 @@
<nav class="navbar navbar-default navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<span class="navbar-brand pull-left" ng-click="editingTitle = true" ng-hide="editingTitle">
<span class="navbar-brand pull-left">
{{dash.title}}
</span>
<span class="pull-left" ng-show="editingTitle">
<form class="navbar-form" ng-submit="editingTitle = false">
<input type="text" ng-model="dash.title" class="form-control"/>
</form>
</span>
</div>
<ul class="nav navbar-nav pull-left">

View file

@ -80,7 +80,7 @@ define(function (require) {
if (query === void 0) return;
if (_.isString(query) && query.length > 0) {
query = {wildcard: {title: query + '*'}};
query = {wildcard: {title: '*' + query + '*'}};
} else {
query = {match_all: {}};
}
@ -125,13 +125,12 @@ define(function (require) {
.type('dashboard')
.id($scope.dash.title);
// TODO: If a dashboard is deleted from kibana4-int, and we try to save another dashboard with
// the same name later, it fails due to a version conflict.
doc.doIndex({
title: dash.title,
panelsJSON: JSON.stringify($scope.gridControl.serializeGrid())
})
.then(function () {
notify.info('Saved Dashboard as "' + $scope.dash.title + '"');
if ($scope.dash.title !== $routeParams.id) {
$location.url('/dashboard/' + encodeURIComponent($scope.dash.title));
}

View file

@ -2,7 +2,7 @@
<label>Filter Dashboards</label>
<input type="text" ng-model="configurable.input.search" class="form-control"/>
</div>
<ul class="nav nav-pills">
<ul class="nav nav-pills container-fluid">
<li
ng-repeat="res in configurable.searchResults | orderBy:'_source.title'"
ng-class="{active: configurable.dashboard.id == res._id}">

View file

@ -22,7 +22,9 @@ define(function (require) {
}
return array;
},
flattenWith: function (dot, nestedObj) {
// NOTE: The flatten behavior here works if you don't need to keep a reference to the
// original value
flattenWith: function (dot, nestedObj, keepArrays) {
var key; // original key
var stack = []; // track key stack
var flatObj = {};