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

fix: update values for default timezone selector #17124

Merged
merged 3 commits into from
Oct 18, 2021

Conversation

eschutho
Copy link
Member

@eschutho eschutho commented Oct 15, 2021

SUMMARY

There was a bug where if GMT was selected, the value was being passed in as the readable GMT, etc which is not a valid timezone. This PR fixes that issue.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screenshot_10_14_21__5_14_PM

TESTING INSTRUCTIONS

You should be able to select GMT from the timezone dropdown in the alerts/reports modal and it should save properly and run the report with no errors.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • 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

@codecov
Copy link

codecov bot commented Oct 15, 2021

Codecov Report

Merging #17124 (2f1b49b) into master (c2e1ab6) will increase coverage by 0.02%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17124      +/-   ##
==========================================
+ Coverage   76.88%   76.91%   +0.02%     
==========================================
  Files        1031     1034       +3     
  Lines       55183    55398     +215     
  Branches     7505     7554      +49     
==========================================
+ Hits        42430    42608     +178     
- Misses      12501    12540      +39     
+ Partials      252      250       -2     
Flag Coverage Δ
javascript 70.91% <87.50%> (+0.09%) ⬆️

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% <87.50%> (+0.05%) ⬆️
...mponents/nativeFilters/FiltersConfigModal/utils.ts 65.64% <0.00%> (-4.73%) ⬇️
...onfigModal/FiltersConfigForm/FiltersConfigForm.tsx 69.25% <0.00%> (-2.36%) ⬇️
...erset-frontend/src/datasource/DatasourceEditor.jsx 71.91% <0.00%> (-1.94%) ⬇️
...eFilters/FiltersConfigModal/FiltersConfigModal.tsx 87.50% <0.00%> (-1.85%) ⬇️
superset-frontend/src/reduxUtils.ts 69.76% <0.00%> (-1.67%) ⬇️
...-frontend/src/datasource/ChangeDatasourceModal.tsx 86.36% <0.00%> (-1.14%) ⬇️
...frontend/src/dashboard/components/Header/index.jsx 68.71% <0.00%> (-0.78%) ⬇️
...rontend/src/dashboard/containers/DashboardPage.tsx 0.00% <0.00%> (ø)
...src/components/FilterableTable/FilterableTable.tsx 81.86% <0.00%> (ø)
... and 21 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 c2e1ab6...2f1b49b. 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.

A question about using Africa/Abidjan.

const DEFAULT_TIMEZONE = 'GMT Standard Time';
const DEFAULT_TIMEZONE = {
name: 'GMT Standard Time',
value: 'Africa/Abidjan',
Copy link
Member

Choose a reason for hiding this comment

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

Can we use GMT here instead? It's an official IANA time zone identifier.

If not, it might be good to say here that the Africa/Abidjan timezone has no daylight saving, so it will be identical to GMT all year long.

Copy link
Member Author

@eschutho eschutho Oct 15, 2021

Choose a reason for hiding this comment

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

Gotcha, the reason that this value is used is because when we dedupe the time zone list, we choose the first value, which happens to be this one. The user never sees the value, just the label, and it has the same exact time zone match as GMT (no daylight savings time). Do you think this might pose a problem somewhere? Many of the other time zones do the same thing. PT for example is actually Vancouver.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see. I think it's fine. Maybe leave a comment saying that timezones are deduped by the first alphabetical value?


return (
<Select
ariaLabel={t('Timezone')}
ariaLabel={t('Timezone Selector')}
Copy link
Member

Choose a reason for hiding this comment

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

Super nit. I think we agreed that the convention should be Timezone selector

Suggested change
ariaLabel={t('Timezone Selector')}
ariaLabel={t('Timezone selector')}

Copy link
Member Author

@eschutho eschutho Oct 15, 2021

Choose a reason for hiding this comment

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

thank you for pointing that out. 👍

@eschutho
Copy link
Member Author

@yousoph

@eschutho eschutho merged commit ae4ced8 into apache:master Oct 18, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* update values for default timezone selector

* fix casing and comment

* Update TimezoneSelector.test.tsx
@eschutho eschutho added the v1.4 label Nov 22, 2021
eschutho added a commit that referenced this pull request Nov 22, 2021
* update values for default timezone selector

* fix casing and comment

* Update TimezoneSelector.test.tsx

(cherry picked from commit ae4ced8)
@eschutho eschutho deleted the elizabeth/fix-timezone-utc branch December 2, 2021 18:06
@mistercrunch mistercrunch added 🍒 1.4.0 🍒 1.4.1 🍒 1.4.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.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/M v1.4 🍒 1.4.0 🍒 1.4.1 🍒 1.4.2 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants