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: Hide FilterBar for Reports #23543

Merged
merged 2 commits into from
Apr 1, 2023
Merged

Conversation

geido
Copy link
Member

@geido geido commented Mar 31, 2023

SUMMARY

This PR #22614 introduced an issue for which the reports would not be able to execute when a filter of the FilterBar required immediate execution (see for example filters with first filter value selected by default). The reason is that the logics that run the filters are often encapsulated within the rendering of the component. By removing the rendering of the FilterBar those filters failed to execute causing the reports to fail.

This PR introduces an additional way to hide the FilterBar through the hidden property, which effectively only hides the FilterBar with CSS while still rendering it. While not an optimal solution, this will unblock the reports. A more in-depth refactor is required to decouple the logics of the filters from the rendering of the component.

TESTING INSTRUCTIONS

  1. Visit a Dashboard with a filter having first filter value selected by default
  2. Enter reports standalone mode with standalone=3 in the url
  3. Make sure the Dashboard loads while the FilterBar is hidden

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 Mar 31, 2023

Codecov Report

Merging #23543 (44c95b2) into master (bc2ec04) will decrease coverage by 0.01%.
The diff coverage is 40.00%.

❗ Current head 44c95b2 differs from pull request most recent head 9aa9410. Consider uploading reports for the commit 9aa9410 to get more accurate results

@@            Coverage Diff             @@
##           master   #23543      +/-   ##
==========================================
- Coverage   67.68%   67.68%   -0.01%     
==========================================
  Files        1914     1914              
  Lines       73958    73947      -11     
  Branches     8029     8030       +1     
==========================================
- Hits        50060    50048      -12     
  Misses      21852    21852              
- Partials     2046     2047       +1     
Flag Coverage Δ
javascript 53.90% <40.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...d/components/DashboardBuilder/DashboardBuilder.tsx 74.00% <ø> (-0.26%) ⬇️
superset/connectors/sqla/models.py 89.43% <ø> (-0.13%) ⬇️
superset/utils/pandas_postprocessing/pivot.py 88.46% <ø> (-0.43%) ⬇️
...board/components/nativeFilters/FilterBar/index.tsx 50.53% <40.00%> (+0.53%) ⬆️

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

@@ -655,18 +658,17 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {
>
<StickyPanel ref={containerRef} width={filterBarWidth}>
<ErrorBoundary>
{!isReport && (
Copy link
Member

Choose a reason for hiding this comment

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

We have a few places where we set margins for dashboard so that filter bar fits nicely (such as lines 541 or 628). Should we set them to 0 for reports? Or are they not visible when filter bar is hidden?

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

@geido geido merged commit a18e33b into master Apr 1, 2023
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Apr 10, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the fix/dashboard-report-hidden-filterbar branch March 26, 2024 18:03
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/M 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants