Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Single Metric Viewer: ensures chart displays correctly when opening from a job annotation #182176

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,8 @@ export class TimeSeriesExplorer extends React.Component {
if (
// If the user's focus range is not defined (i.e. no 'zoom' parameter restored from the appState URL),
// then calculate the default focus range to use
zoom === undefined &&
(focusRange === undefined ||
this.previousSelectedForecastId !== this.props.selectedForecastId)
zoom === undefined ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixing the bug when coming in from an annotation, but the issue fixed by #176969 is happening again where the zoom is not restored if the URL contains a forecastId and zoom parameters.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed this is fixed by d614c66

focusRange === undefined
) {
focusRange = this.mlTimeSeriesExplorer.calculateDefaultFocusRange(
autoZoomDuration,
Expand All @@ -476,10 +475,12 @@ export class TimeSeriesExplorer extends React.Component {
this.previousSelectedForecastId = this.props.selectedForecastId;
}

this.contextChartSelected({
from: focusRange[0],
to: focusRange[1],
});
if (focusRange !== undefined) {
this.contextChartSelected({
from: focusRange[0],
to: focusRange[1],
});
}
}

this.setState(stateUpdate);
Expand Down