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(dashboard): Add edit button to dashboard native filters filter cards #22364

Merged
merged 11 commits into from
Dec 9, 2022

Conversation

codyml
Copy link
Member

@codyml codyml commented Dec 7, 2022

SUMMARY

This PR adds an Edit button (pencil icon next to title) to the filter cards that appear when hovering over a native filter in either vertical or horizontal mode. The Edit button only appears in situations when the primary Add/Edit Filters button appears (when the user has edit dashboard permissions for the current dashboard). Clicking the Edit button opens the Add/Edit Filters dashboard with the specified filter already selected.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before, admin/owner:
Screen Shot 2022-12-07 at 2 45 13 PM

Before, viewer:
Screen Shot 2022-12-07 at 2 45 29 PM

After, admin/owner:
Screen Shot 2022-12-07 at 2 44 49 PM

After, viewer:
Screen Shot 2022-12-07 at 2 44 57 PM

TESTING INSTRUCTIONS

  • Confirm that for a user with dashboard edit preferences (admin or dashboard owner), the edit button is visible and clicking it opens the Add/Edit Filters with the specified filter selected.
  • Confirm that for a user without dashboard edit preferences, the card does not have an edit button.

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

@kgabryje
Copy link
Member

kgabryje commented Dec 8, 2022

/testenv up FEATURE_HORIZONTAL_FILTER_BAR=true

@kgabryje kgabryje requested review from kgabryje and geido and removed request for kgabryje December 8, 2022 09:57
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2022

@kgabryje Ephemeral environment spinning up at http://34.219.222.117:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@codyml codyml force-pushed the pr-21985 branch 2 times, most recently from 21ae71f to a3ec2a3 Compare December 8, 2022 15:44
@codecov
Copy link

codecov bot commented Dec 8, 2022

Codecov Report

Merging #22364 (ad1f8d5) into master (2731cba) will decrease coverage by 0.09%.
The diff coverage is 68.75%.

❗ Current head ad1f8d5 differs from pull request most recent head a611f6f. Consider uploading reports for the commit a611f6f to get more accurate results

@@            Coverage Diff             @@
##           master   #22364      +/-   ##
==========================================
- Coverage   66.86%   66.76%   -0.10%     
==========================================
  Files        1847     1847              
  Lines       70559    70573      +14     
  Branches     7736     7744       +8     
==========================================
- Hits        47180    47119      -61     
- Misses      21378    21453      +75     
  Partials     2001     2001              
Flag Coverage Δ
hive ?
javascript 53.83% <67.39%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...Filters/FilterBar/FiltersDropdownContent/index.tsx 25.00% <ø> (ø)
...s/FilterBar/FiltersOutOfScopeCollapsible/index.tsx 20.00% <ø> (ø)
...nents/nativeFilters/FilterCard/DependenciesRow.tsx 80.00% <ø> (ø)
...oard/components/nativeFilters/FilterCard/index.tsx 8.33% <0.00%> (-1.67%) ⬇️
...ore/components/controls/DateFilterControl/types.ts 100.00% <ø> (ø)
...ols/DndColumnSelectControl/ColumnSelectPopover.tsx 3.37% <0.00%> (ø)
...d/src/filters/components/Time/TimeFilterPlugin.tsx 0.00% <0.00%> (ø)
...tend/src/filters/components/Time/transformProps.ts 0.00% <ø> (ø)
...rset-frontend/src/filters/components/Time/types.ts 100.00% <ø> (ø)
...rontend/src/views/CRUD/dashboard/DashboardList.tsx 56.60% <ø> (ø)
... and 23 more

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

@@ -204,6 +205,13 @@ jest.mock('@superset-ui/core', () => ({
}),
}));

jest.mock(
Copy link
Member

Choose a reason for hiding this comment

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

do we need that? I think that testing icons didnt require hacks before

Copy link
Member Author

@codyml codyml Dec 8, 2022

Choose a reason for hiding this comment

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

I thought this is what you had to add to avoid act warnings when running tests – without it all of the tests output a bunch of act icon errors. @michael-s-molina I know you worked on this, is this still the best solution to avoiding those test warnings?

Copy link
Member

Choose a reason for hiding this comment

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

Given that our icons load asynchronously, you can either mock the icons as you did or wait for them to render. We generally mock them when they're not the focus of the tests.

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.

2 tiny non-blocking nits, otherwise looks great!

@codyml
Copy link
Member Author

codyml commented Dec 9, 2022

@kasiazjc Fixed icon size:

Screen Shot 2022-12-08 at 6 28 34 PM

@kasiazjc
Copy link
Contributor

kasiazjc commented Dec 9, 2022

@kasiazjc Fixed icon size:

Screen Shot 2022-12-08 at 6 28 34 PM

Perfect, thank you! 😌

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!

@kgabryje kgabryje merged commit 3b45ad8 into apache:master Dec 9, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2022

Ephemeral environment shutdown and build artifacts deleted.

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

5 participants