-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
[annotation] Only allow override whole time_range #6286
[annotation] Only allow override whole time_range #6286
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6286 +/- ##
==========================================
+ Coverage 77.01% 77.03% +0.01%
==========================================
Files 64 64
Lines 9508 9505 -3
==========================================
- Hits 7323 7322 -1
+ Misses 2185 2183 -2
Continue to review full report at Codecov.
|
369364b
to
6f277c4
Compare
6f277c4
to
430f937
Compare
if (fd.time_range) { | ||
[fd.since, fd.until] = fd.time_range.split(TIME_RANGE_SEPARATOR); | ||
const overridesKeys = Object.keys(annotation.overrides); | ||
if (overridesKeys.includes('since') || overridesKeys.includes('until')) { |
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.
this line is to backward compatible with old override options: since or until. now we only allow override whole time_range, so either since or until will be treated as override whole time_range.
@@ -97,6 +97,14 @@ export default class AnnotationLayer extends React.PureComponent { | |||
timeColumn, | |||
intervalEndColumn, | |||
} = props; | |||
|
|||
const overridesKeys = Object.keys(overrides); |
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.
render checkbox UI. try to be backward compatible when user select override since
or override until
before.
@betodealmeida please 👀 ^ |
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.
LGTM... thanks for fixing this, Grace!
(cherry picked from commit ede5c71) (cherry picked from commit ad83b06)
This PR is related with #6251.
Before
time_range
we usedsince
,until
parameters. And in annotation layer UI we allow user to override since, or until, or both. But after we introducedtime_range
, it offers many framed time range string likeLast day
,Last 3 month
etc. in #6251, i tried to merge old since until into time_range, but today we found there are so many cases that no simple solution to cover all. So @michellethomas and me are thinking about simplify the override feature in annotation layer: instead of allow since or until or both, now we only allow override time_range as a whole.in airbnb we don't have many cases where user want to override only since or until. if @fabianmenges feel this solution is not good enough, we can think about more possible solutions.
@fabianmenges @betodealmeida @mistercrunch @michellethomas