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(explore): Datepicker glitch on hover outside the modal #15033

Merged
merged 1 commit into from
Jun 8, 2021

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Jun 8, 2021

SUMMARY

When user selects a date in antd datepicker and hovers outside of Modal before saving the changes, the date gets reverted to it's initial value. I fixed it by passing initial date to datepicker with defaultValue prop instead of value.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: see linked issue
After:
https://user-images.githubusercontent.com/15073128/121126292-3ba75080-c828-11eb-9a7e-475012c4c6db.mov

TESTING INSTRUCTIONS

  1. Open time selection modal in "Time range" section in Explore.
  2. Select "Range type: Custom" and "Start/End: Specific Date/Time".
  3. Open a datepicker and select some date.
  4. Before you save, hover outside of time range modal and verify that the date didn't reset to the initial value.
  5. Save and verify that the date has changed correctly

ADDITIONAL INFORMATION

  • Has associated issue: closes [Explore]timepicker calendar glitch on hover outside the modal #15028
  • 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

CC: @junlincc @zhaoyongjie @villebro

@junlincc junlincc added bash! rush! Requires immediate attention #bug:blocking! Blocking issues with high priority labels Jun 8, 2021
@apache apache deleted a comment from github-actions bot Jun 8, 2021
@apache apache deleted a comment from github-actions bot Jun 8, 2021
@junlincc
Copy link
Member

junlincc commented Jun 8, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2021

@junlincc Container image not yet published for this PR. Please try again when build is complete.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2021

@junlincc Ephemeral environment creation failed. Please check the Actions logs for details.

@kgabryje
Copy link
Member Author

kgabryje commented Jun 8, 2021

/testenv up

@junlincc
Copy link
Member

junlincc commented Jun 8, 2021

Thank you @kgabryje for the quick fix!!
Small issue. Expected initially the date was 7th, then i changed it to 11th, i clicked OK, 11th was saved as new initial date, which should has a blue frame around.
Current behavior, no matter how many times i change to a new date, it's always showing the first date 7th.

Screen.Recording.2021-06-07.at.10.27.27.PM.mov

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2021

@kgabryje Container image not yet published for this PR. Please try again when build is complete.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2021

@kgabryje Ephemeral environment creation failed. Please check the Actions logs for details.

@codecov
Copy link

codecov bot commented Jun 8, 2021

Codecov Report

Merging #15033 (7a3f7ce) into master (61a438a) will increase coverage by 0.12%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15033      +/-   ##
==========================================
+ Coverage   77.53%   77.66%   +0.12%     
==========================================
  Files         965      966       +1     
  Lines       49504    49613     +109     
  Branches     6259     6311      +52     
==========================================
+ Hits        38384    38532     +148     
+ Misses      10920    10880      -40     
- Partials      200      201       +1     
Flag Coverage Δ
javascript 72.78% <ø> (+0.29%) ⬆️

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

Impacted Files Coverage Δ
...trols/DateFilterControl/components/CustomFrame.tsx 92.15% <ø> (ø)
...nfigModal/FiltersConfigForm/getControlItemsMap.tsx 91.89% <0.00%> (-5.17%) ⬇️
...hboard/components/nativeFilters/FilterBar/state.ts 85.41% <0.00%> (-3.22%) ⬇️
...c/filters/components/Select/SelectFilterPlugin.tsx 78.64% <0.00%> (-3.08%) ⬇️
...rontend/src/SqlLab/components/QueryTable/index.jsx 61.64% <0.00%> (-2.65%) ⬇️
...onfigModal/FiltersConfigForm/FiltersConfigForm.tsx 70.03% <0.00%> (-0.55%) ⬇️
...mponents/nativeFilters/FiltersConfigModal/utils.ts 67.50% <0.00%> (-0.45%) ⬇️
...-frontend/src/explore/components/ControlHeader.jsx 85.71% <0.00%> (ø)
...rontend/src/dashboard/containers/DashboardPage.tsx 0.00% <0.00%> (ø)
...ontend/src/filters/components/Select/buildQuery.ts 100.00% <0.00%> (ø)
... and 14 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 61a438a...7a3f7ce. Read the comment docs.

@kgabryje
Copy link
Member Author

kgabryje commented Jun 8, 2021

@junlincc I think it works as expected. The blue frame simply shows today's date, it's not related to past selections 🙂 Check out antd's examples
https://user-images.githubusercontent.com/15073128/121129058-a9ee1200-c82c-11eb-9f87-6f17c4f2d3f2.mov

https://ant.design/components/date-picker/

@junlincc
Copy link
Member

junlincc commented Jun 8, 2021

😅 you are right, please disregard my silly comment. LGTM. @rusackas can you approve if code looks right?

@junlincc junlincc self-requested a review June 8, 2021 05:42
Copy link
Member

@rusackas rusackas 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 the quick fix!

Copy link
Member

@junlincc junlincc left a comment

Choose a reason for hiding this comment

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

product sign-off

@kgabryje kgabryje merged commit 0e07a5c into apache:master Jun 8, 2021
amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request Jun 8, 2021
* upstream/master:
  fix(explore): Datepicker glitch on hover outside the modal (apache#15033)
  Add ming-height to empty tab (apache#14878)
  Remove nowrap (apache#14954)
  display all metric results in editor (apache#15031)
  feat: Add "is_select_query" method to base engine spec to make it possible to override it (apache#15013)
  fix(dashboard): custom css should be removed on unmount (apache#15025)
  feat(filter-box): hide druid options if druid not enabled (apache#14921)
  fix: adding additional configs and colors for queryHistory (apache#14995)
  chore: rename 'Source' to 'Database' for consistency (apache#15021)
  chore(ci): fix ci conflict (apache#15016)
  fix(native-filters): avoid double load on initialization (apache#15012)
  feat(native-filters): Support default to first value in select filter (apache#14869)
  docs: required information for OAuth2 configuration (apache#15010)
  Update index.mdx (apache#14990)
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 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 #bug:blocking! Blocking issues with high priority rush! Requires immediate attention size/XS 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants