Skip to content
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

feat: add timezone selector component #15880

Merged
merged 1 commit into from
Jul 26, 2021

Conversation

eschutho
Copy link
Member

SUMMARY

These changes add a new component for choosing timezones client side. It uses the timezone list from moment-timezone which has about 400 entries. To narrow that list for a UI dropdown, I have removed all duplicates (based on their standard and daylight timezone offsets). There is a map that makes some of these selections more readable; for example, "America/Los_Angeles" is a duplicate of Vancouver, so we map it to "Pacific Standard/Daylight Time". In a v2 I may see if there's a simple way to pull that name out of moment, but for now, there's a map of about 7-8 regions that seem to work.
There's a migration and some changes coming next that will implement this into reports. For now these changes should have no UI impact, and just introduce the component and storybook files.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Example from storybook showing "UTC" being mapped to TimezoneSelector_-_Interactive_Timezone_Selector_⋅_Storybook GMT

TESTING INSTRUCTIONS

No visual changes in Superset yet, but you can test by running storybook

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@eschutho eschutho changed the title add timezone selector component feat: add timezone selector component Jul 23, 2021
@codecov
Copy link

codecov bot commented Jul 23, 2021

Codecov Report

Merging #15880 (4f0348a) into master (9c854ff) will increase coverage by 0.00%.
The diff coverage is 97.77%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #15880   +/-   ##
=======================================
  Coverage   77.09%   77.09%           
=======================================
  Files         984      985    +1     
  Lines       51782    51842   +60     
  Branches     7028     7067   +39     
=======================================
+ Hits        39920    39967   +47     
- Misses      11637    11650   +13     
  Partials      225      225           
Flag Coverage Δ
javascript 71.77% <97.77%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...frontend/src/components/TimezoneSelector/index.tsx 97.77% <97.77%> (ø)
...nd/src/explore/components/DataTablesPane/index.tsx 78.12% <0.00%> (-6.15%) ⬇️
...c/components/ErrorMessage/DatabaseErrorMessage.tsx 90.90% <0.00%> (-3.83%) ⬇️
...d/src/explore/components/PropertiesModal/index.tsx 81.94% <0.00%> (-2.35%) ⬇️
superset-frontend/src/dataMask/reducer.ts 65.38% <0.00%> (-1.93%) ⬇️
...src/explore/components/controls/ViewQueryModal.tsx 76.00% <0.00%> (-0.93%) ⬇️
...src/dashboard/components/FiltersBadge/selectors.ts 75.22% <0.00%> (-0.48%) ⬇️
...ontrols/DndColumnSelectControl/DndMetricSelect.tsx 41.04% <0.00%> (-0.44%) ⬇️
.../src/explore/components/DataTableControl/index.tsx 98.00% <0.00%> (-0.04%) ⬇️
...frontend/src/views/CRUD/alert/AlertReportModal.tsx 61.70% <0.00%> (ø)
... and 7 more

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 9c854ff...4f0348a. Read the comment docs.

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

This looks great!

@eschutho eschutho merged commit b81f120 into apache:master Jul 26, 2021
@eschutho eschutho deleted the elizabeth/add-moment-timezone branch July 26, 2021 16:30
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset-io size/L 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants