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 popovers issues #11428

Merged
merged 14 commits into from
Oct 28, 2020
Merged

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Oct 26, 2020

SUMMARY

Fixes issues #11388 and #11404.
Changes in AdhocFilterOption might be in conflict with #11412 by @mistercrunch - unfortunately it seems that mutating a adhocFilter.isNew prop is necessary until we do a deeper refactor. Simply making that prop a part of the state leads to various issues regarding auto-opening the popup when new filter is added - particularly when there are multiple unsaved filters.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

As shown on the gif, the popup opens automatically and typing spaces and comas works properly.
ezgif com-gif-maker (2)

TEST PLAN

ADDITIONAL INFORMATION

@kgabryje
Copy link
Member Author

@mistercrunch Can you take a look?

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.

One nit, but not losing any sleep over it!

@codecov-io
Copy link

codecov-io commented Oct 26, 2020

Codecov Report

Merging #11428 into master will decrease coverage by 9.63%.
The diff coverage is 93.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11428      +/-   ##
==========================================
- Coverage   66.59%   56.96%   -9.64%     
==========================================
  Files         863      408     -455     
  Lines       40986    13656   -27330     
  Branches     3694     3478     -216     
==========================================
- Hits        27295     7779   -19516     
+ Misses      13594     5715    -7879     
- Partials       97      162      +65     
Flag Coverage Δ
#cypress 56.96% <93.54%> (+0.05%) ⬆️
#javascript ?
#python ?

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

Impacted Files Coverage Δ
...explore/components/controls/AdhocFilterControl.jsx 68.93% <ø> (-8.74%) ⬇️
...ntend/src/explore/components/AdhocFilterOption.jsx 89.28% <88.23%> (+8.64%) ⬆️
...uperset-frontend/src/common/components/Popover.tsx 100.00% <100.00%> (ø)
...ntend/src/explore/components/AdhocMetricOption.jsx 93.75% <100.00%> (+3.12%) ⬆️
...uperset-frontend/src/dashboard/util/dnd-reorder.js 0.00% <0.00%> (-100.00%) ⬇️
...rset-frontend/src/dashboard/util/getEmptyLayout.js 0.00% <0.00%> (-100.00%) ⬇️
...et-frontend/src/components/Menu/LanguagePicker.tsx 0.00% <0.00%> (-100.00%) ⬇️
...dashboard/components/resizable/ResizableHandle.jsx 0.00% <0.00%> (-100.00%) ⬇️
.../src/dashboard/util/getFilterScopeFromNodesTree.js 0.00% <0.00%> (-93.48%) ⬇️
...uperset-frontend/src/utils/getClientErrorObject.ts 0.00% <0.00%> (-89.19%) ⬇️
... and 685 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 eecabf9...4ecf5ee. Read the comment docs.

@ktmud ktmud force-pushed the fix/explore-popovers branch 3 times, most recently from 2bd75da to 7ab7a53 Compare October 27, 2020 19:13
@ktmud
Copy link
Member

ktmud commented Oct 27, 2020

Not sure if it was the original behavior, but while testing this, I noticed that selecting saved metrics (such as count in the energy_usage example dataset) did not auto-open the popover. So I pushed a fix: 7ab7a53

@ktmud
Copy link
Member

ktmud commented Oct 27, 2020

Some unrelated tests are failing. I've reran the tests two times.


    1) chart card view
         should edit correctly:
       AssertionError: Timed out retrying: Expected to find element: `[data-test="properties-name-input"]`, but never found it.
        at Context.eval (http://localhost:8081/__cypress/tests?p=cypress/integration/chart_list/card_view.test.ts:199:55)
  

@kgabryje @nytai could you take a look?

@rusackas
Copy link
Member

Some unrelated tests are failing. I've reran the tests two times.


    1) chart card view
         should edit correctly:
       AssertionError: Timed out retrying: Expected to find element: `[data-test="properties-name-input"]`, but never found it.
        at Context.eval (http://localhost:8081/__cypress/tests?p=cypress/integration/chart_list/card_view.test.ts:199:55)
  

@kgabryje @nytai could you take a look?

Seeing that same test causing issues on another PR. We're going to skip it for now in another PR, and then circle back to fix it separately.

@ktmud
Copy link
Member

ktmud commented Oct 28, 2020

I noticed that the popover for adhoc metrics are not fixed. So I pushed another fix.


const SupersetPopover = styled(AntdPopover)``;
const SupersetPopover = AntdPopover;
Copy link
Member

Choose a reason for hiding this comment

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

Let's add it back when we do need overrides.

@rusackas
Copy link
Member

A rebase should fix that failing unit test now.

@kgabryje
Copy link
Member Author

@ktmud Thank you for your fixes! openPopover method wasn't used anywhere so I removed it. I also fixed that failing E2E test.

@ktmud ktmud merged commit b2636f0 into apache:master Oct 28, 2020
mistercrunch pushed a commit to preset-io/superset that referenced this pull request Oct 31, 2020
* Fix spaces and comas not working in filter popover

* Fix popup not opening automatically

* Add e2e test

* Remove only from test

* Remove redundant test, add checking label content

* Add comments to e2e test

* Fix unit test

* Use destructuring

* Always open popup for functions and saved metrics, too

* Fix popover for adhoc metrics too

* Small refactor to consistency

* Refactor for consistency

* Remove redundant functions

* Test fix

Co-authored-by: Jesse Yang <jesse.yang@airbnb.com>
(cherry picked from commit b2636f0)
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* Fix spaces and comas not working in filter popover

* Fix popup not opening automatically

* Add e2e test

* Remove only from test

* Remove redundant test, add checking label content

* Add comments to e2e test

* Fix unit test

* Use destructuring

* Always open popup for functions and saved metrics, too

* Fix popover for adhoc metrics too

* Small refactor to consistency

* Refactor for consistency

* Remove redundant functions

* Test fix

Co-authored-by: Jesse Yang <jesse.yang@airbnb.com>
@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 size/L 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants