fix(plugin-chart-table): sort and search time column #669
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/superset/superset-ui/lfpneol1e |
Codecov Report
@@ Coverage Diff @@
## master #669 +/- ##
==========================================
+ Coverage 23.91% 24.71% +0.80%
==========================================
Files 336 340 +4
Lines 7661 7748 +87
Branches 948 981 +33
==========================================
+ Hits 1832 1915 +83
- Misses 5742 5743 +1
- Partials 87 90 +3
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.
a couple questions
|
||
toString(): string { | ||
if (this.formatter === String) { | ||
return String(this.input); |
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.
maybe this should be return this.formatter(this.input);
?
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.
It's basically the same thing?
|
||
// force UTC time for timestamps without a timezone | ||
if (forceUTC && typeof value === 'string' && REGEXP_TIMESTAMP_NO_TIMEZONE.test(value)) { | ||
value = `${value}Z`; |
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 this correct? I thought you needed to replace the T
with a Z
to convert the string to UTC time
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.
T
is the separator between date and time. I don't think I've ever seen timestamps like 2020-07-07Z18:20:02.495
.
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.
I am not sure about extending Date
but seems like ok for the requirement.
Yeah, I wanted (or had) to use |
🐛 Bug Fix
Fix
getTime
undefined error when sorting a time column in table chart. Also refactors how datetime is handled forreact-table
search, sort and render methods.Fix spacing issue for table pagination in dashboards
Before:
After:
Test Plan
Unit test in superset-ui and E2E test in superset-frontend.
cc @serenajiang @kristw