Fix Interactive embedding dashboard with multiple tabs and parameter header=false will not load #39005
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
This fix is required in order to work on #38429
Closes #39002
Description
The problem came from the way we use
header=false
.metabase/frontend/src/metabase/dashboard/components/Dashboard/Dashboard.tsx
Lines 487 to 492 in ac37348
Here we see that we don't render
DashboardHeader
when!isHeaderVisible
and this property is read from theheader
parameter.metabase/frontend/src/metabase/dashboard/selectors.ts
Lines 415 to 418 in 02be470
Inside
DashboardHeader
it callsuseDashboardTabs
metabase/frontend/src/metabase/dashboard/components/DashboardTabs/DashboardTabs.tsx
Line 36 in 02be470
which will initiate the Redux state
dashboard.selectedTabId
, without this value, the dashboard card will never load.metabase/frontend/src/metabase/dashboard/components/Dashboard/Dashboard.tsx
Lines 373 to 377 in 02be470
How to verify
header=false
will not load #39002e2e/test/scenarios/embedding/interactive-embedding.cy.spec.js
'sshould hide the dashboard with multiple tabs header by a param (metabase#39002)
test.Demo
Before
The dashboard card will never start loading
After
Checklist