Skip to content

Commit

Permalink
closes #51, and a bug in the mapping format used by the SavedObject c…
Browse files Browse the repository at this point in the history
…lass
  • Loading branch information
Spencer Alger authored and Rashid Khan committed Apr 11, 2014
1 parent 2e5c920 commit ee751b6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
3 changes: 2 additions & 1 deletion src/kibana/apps/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ define(function (require) {
$scope.openLoad = function () {
var open = toggleConfigTemplate('load');
if (open) {
dashboardSearch($scope.configurable.input.search);
dashboardSearch($scope.input.search || '');
$scope.configSubmit = null;
}
};

$scope.save = function () {
dash.id = dash.title;
dash.panelsJSON = JSON.stringify($scope.gridControl.serializeGrid() || []);

return dash.save()
Expand Down
7 changes: 3 additions & 4 deletions src/kibana/apps/dashboard/partials/load_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
</div>
<ul class="nav nav-pills">
<li
ng-repeat="res in configurable.searchResults | orderBy:'_source.fields.title'"
ng-class="{active: configurable.dashboard.title == res._source.fields.title}">
<pre>{{res}}</pre>
<a ng-href="#/dashboard/{{res._id}}">{{res._source.fields.title}}</a>
ng-repeat="res in configurable.searchResults | orderBy:'_source.title'"
ng-class="{active: configurable.dashboard.id == res._id}">
<a ng-href="#/dashboard/{{res._source.title}}">{{res._id}}</a>
</li>
</ul>
2 changes: 1 addition & 1 deletion src/kibana/apps/discover/controllers/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ define(function (require) {
}
]
}]}]};
return search.onResults(onResults);
return search.onResults().then(onResults);
}).catch(function (err) {
console.log('An error');
});
Expand Down
25 changes: 12 additions & 13 deletions src/kibana/components/saved_object/saved_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,28 @@ define(function (require) {
.type(type)
.id(obj.id);


// check that the mapping for this type is defined
return mappingSetup.isDefined(type)
.then(function (defined) {
// if it is already defined skip this step
if (defined) return true;

// we need to setup the mapping, flesh it out first
var mapping = {
var mapping = _.mapValues(mapping, function (val, prop) {
// allow shortcuts for the field types, by just setting the value
// to the type name
properties: _.mapValues(mapping, function (val, prop) {
if (typeof val !== 'string') return val;
return {
type: val
};
})
};
if (typeof val !== 'string') return val;
return {
type: val
};
});

mapping.properties.kibanaSavedObjectMeta = {
// setup the searchSource mapping, even if it is not used but this type yet
searchSourceJSON: {
type: 'string'
mapping.kibanaSavedObjectMeta = {
properties: {
// setup the searchSource mapping, even if it is not used but this type yet
searchSourceJSON: {
type: 'string'
}
}
};

Expand Down

0 comments on commit ee751b6

Please sign in to comment.