mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[TSVB] Enable brush for visualizations created with no index patterns (#96727)
* [TSVB] Enable brush for visualizations created with no index patterns * Fix comments typo Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
f4f49bc32e
commit
23e18b93eb
1 changed files with 36 additions and 14 deletions
|
@ -59,22 +59,44 @@ function TimeseriesVisualization({
|
|||
const indexPatternValue = model.index_pattern || '';
|
||||
const { indexPatterns } = getDataStart();
|
||||
const { indexPattern } = await fetchIndexPattern(indexPatternValue, indexPatterns);
|
||||
let event;
|
||||
// trigger applyFilter if no index pattern found, url drilldowns are supported only
|
||||
// for the index pattern mode
|
||||
if (indexPattern) {
|
||||
const tables = indexPattern
|
||||
? await convertSeriesToDataTable(model, series, indexPattern)
|
||||
: null;
|
||||
const table = tables?.[model.series[0].id];
|
||||
|
||||
const tables = indexPattern
|
||||
? await convertSeriesToDataTable(model, series, indexPattern)
|
||||
: null;
|
||||
const table = tables?.[model.series[0].id];
|
||||
const range: [number, number] = [parseInt(gte, 10), parseInt(lte, 10)];
|
||||
event = {
|
||||
data: {
|
||||
table,
|
||||
column: X_ACCESSOR_INDEX,
|
||||
range,
|
||||
timeFieldName: indexPattern?.timeFieldName,
|
||||
},
|
||||
name: 'brush',
|
||||
};
|
||||
} else {
|
||||
event = {
|
||||
name: 'applyFilter',
|
||||
data: {
|
||||
timeFieldName: '*',
|
||||
filters: [
|
||||
{
|
||||
range: {
|
||||
'*': {
|
||||
gte,
|
||||
lte,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const range: [number, number] = [parseInt(gte, 10), parseInt(lte, 10)];
|
||||
const event = {
|
||||
data: {
|
||||
table,
|
||||
column: X_ACCESSOR_INDEX,
|
||||
range,
|
||||
timeFieldName: indexPattern?.timeFieldName,
|
||||
},
|
||||
name: 'brush',
|
||||
};
|
||||
handlers.event(event);
|
||||
},
|
||||
[handlers, model]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue