Skip to content

Commit

Permalink
[TSVB] Chart with override index pattern and last_value are migrated …
Browse files Browse the repository at this point in the history
…with entire_time_range from 7.13+ (elastic#115041)

* Move logic about default time range mode inside index pattern component

* Fix lint

* Fix types

* Cover case with override_index_pattern

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
2 people authored and shivindera committed Oct 25, 2021
1 parent ae489b7 commit 265c042
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ export class VisEditor extends Component<TimeseriesEditorProps, TimeseriesEditor
? TIME_RANGE_DATA_MODES.LAST_VALUE
: TIME_RANGE_DATA_MODES.ENTIRE_TIME_RANGE,
...this.props.vis.params,
series: this.props.vis.params.series.map((val) => ({
[TIME_RANGE_MODE_KEY]:
this.props.vis.title &&
this.props.vis.params.type !== 'timeseries' &&
val.override_index_pattern
? TIME_RANGE_DATA_MODES.LAST_VALUE
: TIME_RANGE_DATA_MODES.ENTIRE_TIME_RANGE,
...val,
})),
},
extractedIndexPatterns: [''],
};
Expand Down

0 comments on commit 265c042

Please sign in to comment.