-
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
[SIP-5] Refactor filterbox #5789
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5789 +/- ##
==========================================
- Coverage 63.73% 63.71% -0.02%
==========================================
Files 366 366
Lines 23132 23139 +7
Branches 2598 2597 -1
==========================================
Hits 14744 14744
- Misses 8373 8380 +7
Partials 15 15
Continue to review full report at Codecov.
|
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! I had 2 nit comments and then one possibly more significant one.
@@ -1,5 +1,3 @@ | |||
// JS | |||
import d3 from 'd3'; |
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.
🔥
label={t('Time range')} | ||
description={t('Select start and end date')} | ||
onChange={this.changeFilter.bind(this, timeRange)} | ||
value={this.state.selectedValues[timeRange]} | ||
onChange={this.changeFilter.bind(this, TIME_RANGE)} |
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.
nit -- could we bind this in the constructor?
<OnPasteSelect | ||
placeholder={t('Select [%s]', filter)} | ||
key={filter} | ||
placeholder={t('Select [%s]', key)} |
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.
should this one use label
instead of key
?
@@ -195,21 +218,26 @@ class FilterBox extends React.Component { | |||
}; | |||
return { value: opt.id, label: opt.id, style }; | |||
})} | |||
onChange={this.changeFilter.bind(this, filter)} | |||
onChange={this.changeFilter.bind(this, key)} |
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.
nit -- could we bind this in the constructor?
6fe6528
to
c5d5066
Compare
c5d5066
to
a6bd8c0
Compare
* reorganize variables * bring back datasource * refactor filter box * rename constants to all caps and update prop types * bind this.changeFilter * update event handler
* reorganize variables * bring back datasource * refactor filter box * rename constants to all caps and update prop types * bind this.changeFilter * update event handler
d3
.PropTypes