Skip to content

Commit

Permalink
dont use schemas in aggconfigs to output dsl (#26010)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar authored Nov 22, 2018
1 parent 854757c commit 8f88091
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/core_plugins/kibana/public/visualize/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ function VisEditor(
const searchSourceGrandparent = searchSourceParent.getParent();

delete savedVis.savedSearchId;
delete vis.savedSearchId;
searchSourceParent.setField('filter', _.union(searchSource.getOwnField('filter'), searchSourceParent.getOwnField('filter')));

$state.query = searchSourceParent.getField('query');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ uiModules
self.visState
);

self.vis.savedSearchId = self.savedSearchId;

return self.vis;
};

Expand All @@ -150,6 +152,7 @@ uiModules
self.vis.indexPattern = self.searchSource.getField('index');
self.visState.title = self.title;
self.vis.setState(self.visState);
self.vis.savedSearchId = self.savedSearchId;
};

return SavedVis;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/agg_types/__tests__/buckets/_geo_hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('Geohash Agg', () => {

describe('precision parameter', () => {

const PRECISION_PARAM_INDEX = 6;
const PRECISION_PARAM_INDEX = 7;
let precisionParam;
beforeEach(() => {
precisionParam = geoHashBucketAgg.params[PRECISION_PARAM_INDEX];
Expand Down
5 changes: 5 additions & 0 deletions src/ui/public/agg_types/buckets/geo_hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ export const geoHashBucketAgg = new BucketAggType({
default: [0, 0],
write: _.noop
},
{
name: 'mapBounds',
default: null,
write: _.noop
},
{
name: 'precision',
editor: precisionTemplate,
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/vis/agg_configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class AggConfigs extends IndexedArray {

super({
index: ['id'],
group: ['schema.group', 'type.name', 'schema.name'],
group: ['schema.group', 'type.name', 'type.type', 'schema.name'],
});

this.indexPattern = indexPattern;
Expand Down Expand Up @@ -152,7 +152,7 @@ class AggConfigs extends IndexedArray {

if (hierarchical) {
// collect all metrics, and filter out the ones that we won't be copying
nestedMetrics = _(this.bySchemaGroup.metrics)
nestedMetrics = _(this.byTypeType.metrics)
.filter(function (agg) {
return agg.type.name !== 'count';
})
Expand Down

0 comments on commit 8f88091

Please sign in to comment.