[feature][dashboard] Show/hide filter indicator on the applicable charts when filter options are open/close#8166
Conversation
There was a problem hiding this comment.
this css class naming seems inconsistent, is there anything wrong with just adding on the class active along with filter-indicator? Or at least using dash case to match filter-indicator
There was a problem hiding this comment.
instead of adding a new UNSAFE function, can we use one of the other recommendations here? https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops
There was a problem hiding this comment.
now use getDerivedStateFromProps(props, state). Thanks!
There was a problem hiding this comment.
looks like this comment didn't get finished?
There was a problem hiding this comment.
😓 fixed, and added more comments.
There was a problem hiding this comment.
You could destructure these two handlers along with onAddFilter on line 30 above.
There was a problem hiding this comment.
can make style constant outside of class so it won't create new object every time.
There was a problem hiding this comment.
i fixed one place. there are quite a few inline css in this file and in the code base. we probably need to find a rule or consistent way to style component.
432ba0f to
956cb9f
Compare
Codecov Report
@@ Coverage Diff @@
## master #8166 +/- ##
==========================================
- Coverage 66.16% 66.14% -0.02%
==========================================
Files 479 480 +1
Lines 22920 23002 +82
Branches 2524 2549 +25
==========================================
+ Hits 15164 15214 +50
- Misses 7622 7653 +31
- Partials 134 135 +1
Continue to review full report at Codecov.
|
d0e4d38 to
4fc48e5
Compare
c1ae6d4 to
eff509c
Compare
There was a problem hiding this comment.
not sure if this is super clear, might prefer unsetFocusedFilterField or perhaps setFocusedFilterField(null)?
There was a problem hiding this comment.
the purpose of empty parameter here is to clear/unset focused filter field state. Reducer function expects to handle this case.
I thought we prefer no params than explicitly null params? I rarely see any example in our code that explicitly pass a null to function.
There was a problem hiding this comment.
updated: added unsetFocusedFilterField action creator.
There was a problem hiding this comment.
Why is it again that we need to add inline style elements to the react element?
There was a problem hiding this comment.
As an alternative, I can pass the selected filter field as prop to filter_box component. But first, it is deeply nested inside Chart component. And since it is a data visualization component, its props needs to be validated from superset-ui chart props. Overall it will be 100 times more troublesome than 2 lines of inline css. :)
by the way this is update existed inline style, not adding new.
There was a problem hiding this comment.
what type is timer? It's not apparent to me that this should be an array
There was a problem hiding this comment.
not necessary to keep an instance variable for timer. removed.
eff509c to
8894641
Compare
8894641 to
af5e299
Compare
etr2460
left a comment
There was a problem hiding this comment.
lgtm, thanks for addressing all the comments!
CATEGORY
Choose one
SUMMARY
This is part of dashboard filter indicator design:
This PR also fixed a couple of issue after #7908 is released:
TEST PLAN
ADDITIONAL INFORMATION
REVIEWERS
@kristw @etr2460 @kenchendesign