-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
fix: time grain can't be removed in explore #21644
fix: time grain can't be removed in explore #21644
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21644 +/- ##
=======================================
Coverage 66.83% 66.83%
=======================================
Files 1798 1798
Lines 68823 68823
Branches 7333 7333
=======================================
Hits 45996 45996
+ Misses 20949 20948 -1
- Partials 1878 1879 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
1b10fc8
to
61eaa87
Compare
61eaa87
to
d9c2575
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this annoying but pretty major bug - minor nit, LGTM
// If a chart is a new one that isn't saved, the 'time_grain_sqla' isn't in the form_data. | ||
return 'time_grain_sqla' in (state?.form_data ?? {}) | ||
? state.form_data?.time_grain_sqla | ||
: 'P1D'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some reason we're not just doing state.form_data?.time_grain_sqla || 'P1D'
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When Time Grain control
be set to "Original value" or just removal, the time_grain_sqla
in the form_data will be null
. If time_grain_sqla
get a null value, the 'P1D' will always be set to control, in this case, the chart will never use an empty time grain value.
For instance:
- make a Line Chart and set
Original value
toTime Grain
, and then save it; next, go to chart list; then, reopen the chart. - if use
state.form_data?.time_grain_sqla || 'P1D'
the Time Grain will returnP1D
SUMMARY
There is a long-term issue in the
Time Grain
control that it can't be cleared time grain value even though remove it or selectOriginal value
.This PR intends to fix it.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
time.grain.-.before.mov
After
time.grain.after.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION