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: Adds more customization properties to DropdownContainer #22031

Conversation

michael-s-molina
Copy link
Member

SUMMARY

Adds more customization properties to DropdownContainer:

  • popoverRef to enable additional behaviors such as scrolling to a position when opening
  • popoverTriggerCount to modify the default counting behavior
  • Custom ref with an open function to programmatically open the popover

Follow-up of #21974

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2022-11-03.at.3.36.32.PM.mov

TESTING INSTRUCTIONS

Check the video for instructions.

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 Nov 3, 2022

Codecov Report

Merging #22031 (8fa18de) into master (97e3e79) will increase coverage by 0.00%.
The diff coverage is 34.02%.

❗ Current head 8fa18de differs from pull request most recent head 5fae326. Consider uploading reports for the commit 5fae326 to get more accurate results

@@           Coverage Diff           @@
##           master   #22031   +/-   ##
=======================================
  Coverage   66.99%   66.99%           
=======================================
  Files        1814     1815    +1     
  Lines       69485    69528   +43     
  Branches     7473     7480    +7     
=======================================
+ Hits        46549    46579   +30     
- Misses      21012    21019    +7     
- Partials     1924     1930    +6     
Flag Coverage Δ
javascript 53.45% <33.33%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...rontend/src/components/DropdownContainer/index.tsx 0.00% <0.00%> (ø)
...t-frontend/src/dashboard/actions/dashboardState.js 37.09% <ø> (ø)
superset-frontend/src/dashboard/actions/hydrate.js 1.78% <ø> (ø)
...omponents/nativeFilters/FilterBar/Header/index.tsx 95.45% <0.00%> (+4.15%) ⬆️
...set-frontend/src/dashboard/util/permissionUtils.ts 90.00% <ø> (ø)
...et-frontend/src/dashboard/actions/dashboardInfo.ts 59.18% <69.56%> (+9.18%) ⬆️
...ilters/FilterBar/FilterBarLocationSelect/index.tsx 92.85% <92.85%> (ø)
...ackages/superset-ui-core/src/utils/featureFlags.ts 100.00% <100.00%> (ø)
...t-frontend/src/dashboard/reducers/dashboardInfo.js 80.00% <100.00%> (+5.00%) ⬆️
superset/dashboards/schemas.py 99.46% <100.00%> (+<0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

/**
* Displayed count in the popover trigger.
*/
popoverTriggerCount?: number;
Copy link
Member

Choose a reason for hiding this comment

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

I think that we need to display the number of active filters in the dropdown. Since I don't think that the outside components now which filters are in the dropdown, I think that popoverTriggerCount needs to be a function that takes the elements in popover as an argument and returns a number. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

External components will know which filters are in the dropdown using onOverflowingStateChange 😉

Copy link
Member

Choose a reason for hiding this comment

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

Oh nice!

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

LGTM

@michael-s-molina michael-s-molina merged commit b040211 into apache:master Nov 4, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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 size/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants