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+ (#115041) (#115930)

* 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>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
VladLasitsa and kibanamachine authored Oct 21, 2021
1 parent a100416 commit 9cb1307
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 9cb1307

Please sign in to comment.