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(explore): Time picker enhancement follow up #12208

Merged
merged 10 commits into from
Jan 5, 2021

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented Dec 26, 2020

SUMMARY

follow up PR
UI Design

  • Break down control to child components
  • Extract frontend utilities to a separate module and add unit tests(unit test to be added soon)
  • Change modal to popover
  • Improve typescript typing
  • Remove the validate button
  • refactor code smells / fix cosmetic issue
  • added cypress

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before

image

After

Last

image

Previous

image

Custom

image

Advanced

image

No filter

image

TEST PLAN

Added cypress for the time picker

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-io
Copy link

codecov-io commented Dec 26, 2020

Codecov Report

Merging #12208 (4e7a391) into master (811e1b2) will increase coverage by 4.17%.
The diff coverage is 59.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12208      +/-   ##
==========================================
+ Coverage   63.00%   67.18%   +4.17%     
==========================================
  Files         996     1002       +6     
  Lines       49192    49229      +37     
  Branches     4993     5000       +7     
==========================================
+ Hits        30995    33074    +2079     
+ Misses      17997    16032    -1965     
+ Partials      200      123      -77     
Flag Coverage Δ
cypress 51.41% <53.43%> (?)
javascript 61.26% <25.42%> (+0.09%) ⬆️
python 64.20% <ø> (ø)

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

Impacted Files Coverage Δ
...ore/components/controls/DateFilterControl/types.ts 80.00% <ø> (ø)
...s/controls/DateFilterControl/frame/CustomFrame.tsx 39.28% <39.28%> (ø)
...controls/DateFilterControl/frame/AdvancedFrame.tsx 47.61% <47.61%> (ø)
...ore/components/controls/DateFilterControl/utils.ts 47.82% <47.82%> (ø)
...s/controls/DateFilterControl/DateFilterControl.tsx 84.84% <79.59%> (+69.19%) ⬆️
...s/controls/DateFilterControl/frame/CommonFrame.tsx 83.33% <83.33%> (ø)
...controls/DateFilterControl/frame/CalendarFrame.tsx 84.61% <84.61%> (ø)
...components/controls/DateFilterControl/constants.ts 100.00% <100.00%> (ø)
...mponents/controls/DateFilterControl/frame/index.ts 100.00% <100.00%> (ø)
...et-frontend/src/SqlLab/components/LimitControl.tsx 89.36% <0.00%> (-1.95%) ⬇️
... and 197 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 811e1b2...4e7a391. Read the comment docs.

@adam-stasiak
Copy link
Contributor

Please take a care of flaky tests
image
You can see more at link

Copy link
Member

@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.

Mostly LGTM. A couple of more suggestions on code structure.

Do you plan to add backend validation back in any shape or form? E.g., add a loading state when clicking on "Apply" and block the popover from closing when validation fails.

const iso8601 = String.raw`\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d+)?(?:(?:[+-]\d\d:\d\d)|Z)?`;
const datetimeConstant = String.raw`TODAY|NOW`;
const grainValue = String.raw`[+-]?[1-9][0-9]*`;
const grain = String.raw`YEAR|QUARTER|MONTH|WEEK|DAY|HOUR|MINUTE|SECOND`;
Copy link
Member

@ktmud ktmud Jan 4, 2021

Choose a reason for hiding this comment

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

Any reason to not use UPPER_CASE for these constants?

Copy link
Member Author

Choose a reason for hiding this comment

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

Use UPPER CASE just for constant looks well. In fact, case insensitive in python datetime expression parser, in other words 'YEAR' == 'year' == 'YEAR' for backend datetime parser.

@zhaoyongjie
Copy link
Member Author

Please take a care of flaky tests
image
You can see more at link

I will keep an eye on this flaky test

@junlincc junlincc merged commit b349ede into apache:master Jan 5, 2021
villebro pushed a commit to preset-io/superset that referenced this pull request Jan 7, 2021
* refactor layout

* WIP

* fix typing

* styling

* fix lint

* frontend IT

* rename variable

* added quarter

* typos

* refine code structure
villebro pushed a commit to preset-io/superset that referenced this pull request Jan 7, 2021
* refactor layout

* WIP

* fix typing

* styling

* fix lint

* frontend IT

* rename variable

* added quarter

* typos

* refine code structure
@junlincc junlincc added the explore:time Related to the time filters in Explore label Jan 8, 2021
@zhaoyongjie zhaoyongjie deleted the improvement_time_picker branch January 16, 2021 04:17
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.0.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 explore:time Related to the time filters in Explore size/XXL 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants