mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
clone the aggConfigParams to avoid the Cannot assign to read only property schema of object
This commit is contained in:
parent
ee4a1c11b0
commit
c4931aad06
1 changed files with 3 additions and 3 deletions
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { cloneDeep, uniqWith } from 'lodash';
|
||||
import { Datatable } from '@kbn/expressions-plugin/public';
|
||||
import { compareFilters, COMPARE_ALL_OPTIONS, Filter, toggleFilterNegated } from '@kbn/es-query';
|
||||
import { getIndexPatterns, getSearchService } from '../../services';
|
||||
|
@ -91,7 +91,7 @@ const createFilter = async (
|
|||
.sourceParams as any;
|
||||
const aggConfigsInstance = getSearchService().aggs.createAggConfigs(
|
||||
await getIndexPatterns().get(indexPatternId),
|
||||
[aggConfigParams as AggConfigSerialized]
|
||||
[cloneDeep(aggConfigParams) as AggConfigSerialized]
|
||||
);
|
||||
const aggConfig = aggConfigsInstance.aggs[0];
|
||||
let filter: Filter[] = [];
|
||||
|
@ -144,7 +144,7 @@ export const createFiltersFromValueClickAction = async ({
|
|||
})
|
||||
);
|
||||
|
||||
return _.uniqWith(mapAndFlattenFilters(filters), (a, b) =>
|
||||
return uniqWith(mapAndFlattenFilters(filters), (a, b) =>
|
||||
compareFilters(a, b, COMPARE_ALL_OPTIONS)
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue