mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Maps] Show create filter button for top-term tooltip property (#62461)
* [Maps] Show create filter button top-term tooltip property * add missing imports * update import for NP migration Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
56fa9a5776
commit
bfdccfdbc5
2 changed files with 18 additions and 2 deletions
|
@ -90,7 +90,7 @@ export class ESAggField implements IESAggField {
|
|||
async createTooltipProperty(value: string | undefined): Promise<ITooltipProperty> {
|
||||
const indexPattern = await this._source.getIndexPattern();
|
||||
const tooltipProperty = new TooltipProperty(this.getName(), await this.getLabel(), value);
|
||||
return new ESAggTooltipProperty(tooltipProperty, indexPattern, this);
|
||||
return new ESAggTooltipProperty(tooltipProperty, indexPattern, this, this.getAggType());
|
||||
}
|
||||
|
||||
getValueAggDsl(indexPattern: IndexPattern): unknown | null {
|
||||
|
|
|
@ -4,9 +4,25 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import { ESTooltipProperty } from './es_tooltip_property';
|
||||
import { AGG_TYPE } from '../../../common/constants';
|
||||
import { ITooltipProperty } from './tooltip_property';
|
||||
import { IField } from '../fields/field';
|
||||
import { IndexPattern } from '../../../../../../src/plugins/data/public';
|
||||
|
||||
export class ESAggTooltipProperty extends ESTooltipProperty {
|
||||
private readonly _aggType: AGG_TYPE;
|
||||
|
||||
constructor(
|
||||
tooltipProperty: ITooltipProperty,
|
||||
indexPattern: IndexPattern,
|
||||
field: IField,
|
||||
aggType: AGG_TYPE
|
||||
) {
|
||||
super(tooltipProperty, indexPattern, field);
|
||||
this._aggType = aggType;
|
||||
}
|
||||
|
||||
isFilterable(): boolean {
|
||||
return false;
|
||||
return this._aggType === AGG_TYPE.TERMS;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue