fix(superset-frontend): Fixes for broken functionality when an application root is defined#36058
Conversation
The superset/fab_override templates no longer exist but were still referenced. Remove the override classes that reference them and fallback to the FAB templates.
The ReactRouter has basePath set to applicationRoot, therefore all paths must be relative to this
|
Bito Review Skipped - Source Branch Not Found |
There was a problem hiding this comment.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
| Category | Issue | Status |
|---|---|---|
| Empty applicationRoot causes incorrect path stripping ▹ view | ||
| Uncached stripAppRoot call on navigation ▹ view |
Files scanned
| File Path | Reviewed |
|---|---|
| superset-frontend/src/utils/pathUtils.ts | ✅ |
| superset-frontend/src/utils/assetUrl.ts | ✅ |
| superset-frontend/src/features/home/Menu.tsx | ✅ |
| superset-frontend/src/features/home/RightMenu.tsx | ✅ |
| superset-frontend/src/SqlLab/components/ResultSet/index.tsx | ✅ |
| superset/views/base.py | ✅ |
| superset/security/manager.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #36058 +/- ##
===========================================
+ Coverage 0 68.26% +68.26%
===========================================
Files 0 629 +629
Lines 0 46175 +46175
Branches 0 4998 +4998
===========================================
+ Hits 0 31523 +31523
- Misses 0 13402 +13402
- Partials 0 1250 +1250
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2f699f6 to
09fa854
Compare
09fa854 to
97a5ade
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR fixes broken functionality when an application root is defined in Superset's configuration by ensuring proper handling of URL paths throughout the frontend and cleaning up obsolete backend template code.
- Adds
ensureStaticPrefixutility to conditionally apply static asset prefixes to relative paths - Fixes "Create chart" button in SQL Lab to correctly handle app roots when opening in new windows vs navigating in-app
- Removes obsolete FAB template widget classes from backend that were orphaned by a previous PR
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| superset/views/base.py | Removes unused SupersetListWidget class and ListWidget import |
| superset/security/manager.py | Removes unused widget classes (SupersetSecurityListWidget, SupersetRoleListWidget) and their assignments |
| superset-frontend/src/utils/assetUrl.ts | Adds ensureStaticPrefix function to handle static asset URLs |
| superset-frontend/src/utils/assetUrl.test.ts | Adds tests for assetUrl and ensureStaticPrefix functions |
| superset-frontend/src/features/home/RightMenu.tsx | Applies ensureAppRoot to user info URL |
| superset-frontend/src/features/home/Menu.tsx | Applies ensureStaticPrefix to brand images and ensureAppRoot to brand links |
| superset-frontend/src/features/home/Menu.test.tsx | Updates test to verify brand image URLs include static assets prefix |
| superset-frontend/src/explore/exploreUtils/index.js | Adds includeAppRoot parameter to getURIDirectory and mountExploreUrl functions |
| superset-frontend/src/SqlLab/components/ResultSet/index.tsx | Uses includeAppRoot parameter to correctly handle URLs for new window vs in-app navigation |
|
Is there a way I can rerun a single check? I think "[Python-Integration / test-mysql" is flaky? |
|
Looks like CI passed (yay!) but there's a conflict to resolve (dang!). |
Thanks for nudge. Should be fixed now. |
|
@sadpandajoe Do you think it's possible this could make it into v6? |
|
korbit-ai has requested changes but I can't what they are. Their docs link doesn't work to ask for a re-review either. Can anyone help with that? |
|
Thanks for merging :) |
|
@sadpandajoe Could this be included in the v6.0 branch? |
SUMMARY
Fixes for the settings menu:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
Fixes #35027