-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
refactor: Replace usages of reactable in TimeTable #11239
Conversation
@michellethomas Can you please verify if the issue you described in #11142 doesn't occur on this branch? |
Codecov Report
@@ Coverage Diff @@
## master #11239 +/- ##
==========================================
- Coverage 65.79% 61.83% -3.96%
==========================================
Files 838 841 +3
Lines 39903 40159 +256
Branches 3662 3684 +22
==========================================
- Hits 26253 24832 -1421
- Misses 13549 15146 +1597
- Partials 101 181 +80
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Hi @kgabryje it may take me a bit to set up my dev environment to be able to test and I don't want to block you (I'm working on a different project at the moment). Were you unable to reproduce the issue? If you add a time series table chart to a dashboard and add a filter that applies to the chart, and then you set/change the filter value, the chart often won't update the data in the chart (you can confirm this by going to explore to see the data with the filter). If you aren't able to reproduce the issue, I can set up my environment and test in a few days. |
940891e
to
29e4161
Compare
@michellethomas let us know if this small test is enough validation, or whether you still want to run more test in your environment. |
@mistercrunch Thanks for validating that! |
@mistercrunch just to double check you set a filter, removed it, and tried to set another filter and saw the data change each time? Do we know what the issue was with the previous change that caused this issue? If we know what led to the issue and that it was resolved, a simple test should be fine. I'll just do a double check in our weekly release whenever this gets in just to be sure. |
class TimeTable extends React.PureComponent { | ||
memoizedColumns = memoize(columnConfigs => [ |
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.
While this memoized function only takes one parameter, and thus is not subject to that particular pitfall of lodash/memoize, it might be worth using memoize-one
instead, or refactoring to a function component and using useMemo
for safety.
})), | ||
]); | ||
|
||
memoizedRows = memoize((data, rows, columnConfigs) => { |
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.
oh... this one is going to have issues, from the look of it... we should definitely not be using lodash/memoize
for this.
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.
Let's replace lodash/memoize here, as I strongly suspect that'll cause issues.
@rusackas Can you take a look? I've done the changes you requested |
@kgabryje I'm still seeing |
29e4161
to
6080950
Compare
@rusackas 🤦♂️ 🤦♂️ Sorry about that, I was sure that I pushed these changes. Now it should be alright - I refactored the Timetable into functional component and used |
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!
* Refactor TimeTable to use react-table * Fix import * Refactor TimeTable into functional component
SUMMARY
This PR refactors TimeTable to use TableView, based on
react-table
library. The goal was to get rid ofreactable
.This PR replaces #11046, which was reverted due to the issue #11142.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
ADDITIONAL INFORMATION