rusackas opened a new pull request, #40687:
URL: https://github.com/apache/superset/pull/40687

   ### SUMMARY
   
   Embedded dashboards (rendered via the Embedded SDK) authenticate with a 
guest token, so they have no logged-in `userId`. The dashboard header already 
derives embedded state from this (`isEmbedded = !dashboardInfo?.userId`, used 
elsewhere e.g. to hide the metadata bar), but the **Edit dashboard** button was 
gated only on `userCanEdit`. As a result it rendered inside embedded 
dashboards, where editing isn't a supported flow.
   
   Per #30893, clicking **Edit dashboard** → **Discard** in an embedded 
dashboard leaves the iframe stuck on a perpetual loading screen (the discard 
navigation can't resolve in the embedded context). Hiding the Edit button 
removes that broken entry point.
   
   This gates the Edit button on `!isEmbedded` in addition to `userCanEdit`. No 
behavior change for normal (logged-in) dashboards.
   
   Closes #30893
   
   ### BEFORE/AFTER
   
   Before: embedded dashboards with edit permission show the **Edit dashboard** 
button → entering edit mode and discarding hangs the iframe.
   After: the **Edit dashboard** button is not rendered in embedded dashboards.
   
   ### TESTING INSTRUCTIONS
   
   1. Embed a dashboard via the Embedded SDK with a guest token whose role has 
edit permission.
   2. Confirm the **Edit dashboard** button no longer appears.
   3. Confirm a normal (logged-in) dashboard with edit permission still shows 
the button and can enter edit mode.
   
   Unit test added: `Header.test.tsx` → "should NOT render the Edit dashboard 
button when embedded" (asserts the button is absent when `userId` is undefined 
even with `dash_edit_perm: true`).
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to