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

   ### SUMMARY
   
   Non-admin users see an infinite loading spinner on dashboards with a Theme 
applied because `CrudThemeProvider` made a separate `GET /api/v1/theme/{id}` 
API call requiring `("can_read", "Theme")` permission.
   
   The dashboard API already returns the full theme object (`id`, `theme_name`, 
`json_data`). This PR:
   - Rewrites `CrudThemeProvider` to accept the full theme object instead of 
just `themeId`
   - Creates the theme synchronously via `Theme.fromConfig()` from the inline 
`json_data`
   - Falls back gracefully to the global theme on invalid/missing data (no more 
infinite spinner)
   - Removes the unused `dashboardTheme` Redux selector from `DashboardPage`
   
   **Known limitation:** In-session theme switching from the Dashboard 
Properties modal does not update live. This was also broken before for 
non-admin users (the re-fetch would 403). Deferred to a follow-up PR.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   **Before:** Non-admin user sees infinite loading spinner on themed dashboard 
(403 on `/api/v1/theme/{id}`)
   **After:** Dashboard loads normally with the theme applied — no separate API 
call needed
   
   ### TESTING INSTRUCTIONS
   
   1. Create a dashboard with a Theme applied
   2. Log in as a non-admin user who has dashboard view permission but **not** 
`("can_read", "Theme")`
   3. Navigate to the themed dashboard
   4. **Expected:** Dashboard loads with the theme applied (no infinite spinner)
   5. Also verify: dashboard without a theme still works unchanged
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   
   🤖 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