codeant-ai-for-open-source[bot] commented on PR #38384:
URL: https://github.com/apache/superset/pull/38384#issuecomment-4008706583
## **Sequence Diagram**
The PR stops CrudThemeProvider from fetching a theme by ID (which could 403
for non-admins) by using the full theme object returned in the dashboard API
response. The provider now creates the Theme synchronously from inline
json_data (merges with base theme and injects fonts) and falls back to the
global theme on invalid data.
```mermaid
sequenceDiagram
participant Client
participant Backend
participant DashboardPage
participant CrudThemeProvider
participant ThemeLib as Theme.fromConfig
participant GlobalTheme
Client->>Backend: GET /dashboard/{id}
Backend-->>Client: 200 OK (dashboard + theme {id, theme_name, json_data})
Client->>DashboardPage: render with dashboard (includes theme object)
DashboardPage->>CrudThemeProvider: provide inline theme object
CrudThemeProvider->>ThemeLib: Theme.fromConfig(json_data + baseTheme)
(sync)
alt valid theme
ThemeLib-->>CrudThemeProvider: Theme provider
CrudThemeProvider-->>DashboardPage: render children wrapped in
dashboard theme (also inject fonts)
else invalid/missing theme
CrudThemeProvider-->>GlobalTheme: use global theme
CrudThemeProvider-->>DashboardPage: render children with global theme
(no spinner)
```
---
*Generated by [CodeAnt AI](https://codeant.ai)*
--
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]