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 the time filter for 'Last Year' option in explore #10829

Merged
merged 5 commits into from
Sep 21, 2020

Conversation

riahk
Copy link
Contributor

@riahk riahk commented Sep 10, 2020

SUMMARY

Currently in the explore > time > defaults > LAST YEAR filter, relative time is used, resulting in a filter that shows the past 365 days from the current date. We want it to apply to the full previous year (in this case, 01/01/2019-01/01/2020).

  • Update moment logic in DateFilterControl for years unit

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
Screen Shot 2020-09-09 at 11 17 34 AM
After:
Screen Shot 2020-09-09 at 11 33 53 AM

TEST PLAN

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@codecov-commenter
Copy link

codecov-commenter commented Sep 10, 2020

Codecov Report

Merging #10829 into master will increase coverage by 4.24%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10829      +/-   ##
==========================================
+ Coverage   61.23%   65.47%   +4.24%     
==========================================
  Files         802      803       +1     
  Lines       37815    37930     +115     
  Branches     3557     3559       +2     
==========================================
+ Hits        23155    24836    +1681     
+ Misses      14474    12988    -1486     
+ Partials      186      106      -80     
Flag Coverage Δ
#cypress 55.82% <100.00%> (?)
#javascript 61.58% <100.00%> (-0.05%) ⬇️
#python 61.16% <ø> (+0.17%) ⬆️

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

Impacted Files Coverage Δ
.../explore/components/controls/DateFilterControl.jsx 65.47% <100.00%> (+12.78%) ⬆️
...ontend/src/components/CertifiedIconWithTooltip.tsx 66.66% <0.00%> (-3.34%) ⬇️
superset/databases/api.py 89.36% <0.00%> (-3.06%) ⬇️
...nd/src/views/CRUD/data/dataset/AddDatasetModal.tsx 57.57% <0.00%> (-2.43%) ⬇️
...rontend/src/components/ErrorMessage/ErrorAlert.tsx 20.83% <0.00%> (-1.62%) ⬇️
...tend/src/views/CRUD/data/database/DatabaseList.tsx 86.95% <0.00%> (-1.38%) ⬇️
...end/src/views/CRUD/data/database/DatabaseModal.tsx 53.70% <0.00%> (-0.85%) ⬇️
superset/db_engine_specs/presto.py 81.61% <0.00%> (-0.68%) ⬇️
...frontend/src/views/CRUD/welcome/DashboardTable.tsx 78.37% <0.00%> (-0.57%) ⬇️
...src/components/FilterableTable/FilterableTable.tsx 81.68% <0.00%> (-0.50%) ⬇️
... and 196 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 3ae80d3...b63167c. Read the comment docs.

@willbarrett
Copy link
Member

Let's get some tests around this. Date functionality is weird enough :)

@riahk riahk force-pushed the moriah/explore-last-year branch from b63167c to 601cd5f Compare September 18, 2020 19:13
@pull-request-size pull-request-size bot added size/L and removed size/S labels Sep 18, 2020
Copy link
Member

@nytai nytai left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for adding some tests

@willbarrett willbarrett merged commit 4aa5324 into apache:master Sep 21, 2020
@willbarrett willbarrett deleted the moriah/explore-last-year branch September 21, 2020 18:39
amitmiran137 pushed a commit to ofekisr/incubator-superset that referenced this pull request Sep 22, 2020
…l_access/dashboard_by_id_endpoints

* upstream/master: (29 commits)
  fix(presto): default unknown types to string type (apache#10753)
  feat(row-level-security): add base filter type and filter grouping (apache#10946)
  docs: add gallery screenshot & link in README (apache#10988)
  docs: add a "Gallery" page (apache#10968)
  build: add PR lint action (apache#10990)
  adding filters back that caused issues (apache#10989)
  chore: selectors refactor in SQLLab test suite (Cypress) (apache#10944)
  ESLint: Remove ts-ignore comments (apache#10933)
  style: fix checkbox color (apache#10970)
  fix: changed disabled rules in datasets module (apache#10979)
  fix: update the time filter for 'Last Year' option in explore (apache#10829)
  fix: use nullpool even for user lookup in the celery (apache#10938)
  Allow empty observations in alerting (apache#10939)
  fix: re-enabling several globally disabled lint rules (apache#10957)
  fix: setting specific exceptions common/query_context.py (apache#10942)
  Pylint disabled rule `pointless-string-statement` is not raising warining anymore - removing (apache#10975)
  fix: pylint disabled rules in dashboard/api.py (apache#10976)
  fix: removed disabled lint rule `too-many-locals` in connectors/base/models.py (apache#10958)
  ESLint: Re-enable rule no-access-state-in-setstate (apache#10870)
  fix: simply is_adhoc_metric (apache#10964)
  ...
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
…#10829)

* Update explore time filter ranges

* rm console statements

* only update moment calculation for years

* tests

* add open/close test
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 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 size/L 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants