[TSVB] Error when selecting * for override index_pattern field on the string mode (#114450)
* Add condition so that preselect first timefield from the list if we use * as index pattern * Add default timefield for string index pattern mode * Add comment for condition * Fix lint Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
4d3644030a
commit
262d0cdafd
|
@ -24,10 +24,15 @@ export function getIntervalAndTimefield(
|
|||
{ min, max, maxBuckets }: IntervalParams,
|
||||
series?: Series
|
||||
) {
|
||||
const timeField =
|
||||
let timeField =
|
||||
(series?.override_index_pattern ? series.series_time_field : panel.time_field) ||
|
||||
index.indexPattern?.timeFieldName;
|
||||
|
||||
// should use @timestamp as default timeField for es indeces if user doesn't provide timeField
|
||||
if (!panel.use_kibana_indexes && !timeField) {
|
||||
timeField = '@timestamp';
|
||||
}
|
||||
|
||||
if (panel.use_kibana_indexes) {
|
||||
validateField(timeField!, index);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue