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

Explore: Fix timepicker when browsing back after switching datasource #21454

Merged
merged 10 commits into from
Jan 14, 2020

Conversation

ivanahuckova
Copy link
Member

@ivanahuckova ivanahuckova commented Jan 12, 2020

What this PR does / why we need it:
Browsing back after switching datasource used to change time picker (see issue).

This issue was caused by suppling incorrect argument in initializeExplore function used in refreshExplore. This function requires rawRange, but range was supplied which resulted in the above mentioned bug. This PR fixes this.

ezgif com-video-to-gif (20)

Which issue(s) this PR fixes:
Fixes #20933

@ivanahuckova ivanahuckova requested review from a team and davkal and removed request for a team January 12, 2020 18:03
@ivanahuckova ivanahuckova self-assigned this Jan 12, 2020
Copy link

@Estrax Estrax left a comment

Choose a reason for hiding this comment

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

went out to be just a small change - LGTM.

Copy link
Contributor

@davkal davkal left a comment

Choose a reason for hiding this comment

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

Yup works great!

Since this is a bug fix, I would have liked to see some sort of improvement to make this less likely from happening again, either via stricter types or a test case.

@ivanahuckova
Copy link
Member Author

ivanahuckova commented Jan 14, 2020

@davkal @Estrax I have added stronger typing for RawTimeRange which prevents this from happening again.

@davkal
Copy link
Contributor

davkal commented Jan 14, 2020

Since the fix uses the raw time range, should the payload types not change? See

@ivanahuckova
Copy link
Member Author

Since the fix uses the raw time range, should the payload types not change?

InitializeExplorePayload with range: TimeRange was used in InitializeExploreAction. However, InitializeExplore that dispatched InitializeExploreAction expected rawRange: RawTimeRange. After discussion and guidance from @aocenas, I have changed InitializeExplore prop from rawRange to range to keep it consistent.

This resulted in change in Explore.ts where instead of supplying rawRange as initialRange, we supply range.

@ivanahuckova ivanahuckova added this to the 6.6.0-beta1 milestone Jan 14, 2020
@ivanahuckova ivanahuckova merged commit ba7d8c1 into master Jan 14, 2020
@ivanahuckova ivanahuckova deleted the ivanah/explore-fix-timepicker-when-going-back branch January 14, 2020 18:20
ryantxu added a commit that referenced this pull request Jan 15, 2020
…ation

* origin/master:
  Explore: Fix timepicker when browsing back after switching datasource (#21454)
  Add disabled option for cookie samesite attribute (#21472)
  Chore: Adds basic alerting notification service tests (#21467)
  ImportDashboardCommand: Validate JSON fields (#21350)
  Docs: add test for website build (#21364)
  Fix: when clicking a plot on a touch device we won't display the annotation menu (#21479)
  Backend Plugins: add a common implementation (#21408)
  Alerting: new min_interval_seconds options to enforce a minimum eval frequency  (#21188)
  Panel: Use Tabs in panel inspector (#21468)
ryantxu added a commit that referenced this pull request Jan 15, 2020
* origin/master:
  Explore: Fix timepicker when browsing back after switching datasource (#21454)
  Add disabled option for cookie samesite attribute (#21472)
  Chore: Adds basic alerting notification service tests (#21467)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explore: Browsing back after switching datasource changes time picker
3 participants