Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

feat: make time formatter handle number and fix formatters type warnings #358

Merged
merged 5 commits into from
Apr 13, 2020

Conversation

kristw
Copy link
Contributor

@kristw kristw commented Apr 11, 2020

✨ Enhancement

Add support for time formatter to handle number, it will treat the number as timestamp and convert to Date. This is consistent with how d3-time-format usually works.

🐛 Bug Fix

Fix this warning for NumberFormatter and TimeFormatter via type augmentation.

warning  Unsafe call of an any typed value  @typescript-eslint/no-unsafe-call

@kristw kristw requested a review from a team as a code owner April 11, 2020 07:45
@vercel
Copy link

vercel bot commented Apr 11, 2020

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/superset/superset-ui/la9j0u5gi
✅ Preview: https://superset-ui-git-kristw-format.superset.now.sh

@codecov
Copy link

codecov bot commented Apr 13, 2020

Codecov Report

Merging #358 into master will increase coverage by 0.90%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #358      +/-   ##
==========================================
+ Coverage   51.78%   52.69%   +0.90%     
==========================================
  Files         122      122              
  Lines        2636     2693      +57     
  Branches      388      417      +29     
==========================================
+ Hits         1365     1419      +54     
+ Misses       1242     1241       -1     
- Partials       29       33       +4     
Impacted Files Coverage Δ
...s/superset-ui-number-format/src/NumberFormatter.ts 100.00% <ø> (ø)
...kages/superset-ui-time-format/src/TimeFormatter.ts 100.00% <100.00%> (ø)
plugins/table/test/testData.ts 100.00% <0.00%> (ø)
plugins/table/src/ReactDataTable.tsx 84.42% <0.00%> (+3.93%) ⬆️
plugins/table/src/transformProps.ts 70.27% <0.00%> (+16.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a45c1a...45accb2. Read the comment docs.

@kristw kristw changed the title fix: type warnings for formatters feat: make time formatter handle number and fix formatters type warnings Apr 13, 2020
@pull-request-size pull-request-size bot added size/M and removed size/S labels Apr 13, 2020
Copy link
Contributor

@ktmud ktmud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Didn't know you can mix interface and class definition like this. A new trick learned!

@ktmud ktmud merged commit aaf17ac into master Apr 13, 2020
@delete-merged-branch delete-merged-branch bot deleted the kristw--format branch April 13, 2020 21:48
kristw pushed a commit that referenced this pull request Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants