Skip to content

Conversation

@martyngigg
Copy link
Contributor

SUMMARY

Fixes for the settings menu:

  • includes app root in the link to the user information
  • removes old superset/fab_overrides template references. The templates were removed in chore: clean up more flask/jinja html views #34093.
  • fixes 'Create chart' button on SQL lab interface in the presence of a non-empty application root

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

Fixes #35027

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

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-code-review
Copy link
Contributor

bito-code-review bot commented Nov 10, 2025

Bito Review Skipped - Source Branch Not Found

Bito didn’t review this change because the pull request is no longer valid. It may have been merged, or the source/target branch may no longer exist.

@dosubot dosubot bot added the change:frontend Requires changing the frontend label Nov 10, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Functionality Empty applicationRoot causes incorrect path stripping ▹ view
Performance 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.

Loving Korbit!? Share us on LinkedIn Reddit and X

@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.70%. Comparing base (c42e3c6) to head (97a5ade).
⚠️ Report is 12 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #36058       +/-   ##
===========================================
+ Coverage        0   68.70%   +68.70%     
===========================================
  Files           0      622      +622     
  Lines           0    45743    +45743     
  Branches        0     4979     +4979     
===========================================
+ Hits            0    31427    +31427     
- Misses          0    13070    +13070     
- Partials        0     1246     +1246     
Flag Coverage Δ
hive 44.15% <ø> (?)
mysql 67.78% <ø> (?)
postgres 67.83% <ø> (?)
presto 47.71% <ø> (?)
python 68.67% <ø> (?)
sqlite 67.44% <ø> (?)
unit 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@martyngigg martyngigg force-pushed the non-empty-app-root-fixes branch 2 times, most recently from 2f699f6 to 09fa854 Compare November 11, 2025 11:29
@martyngigg martyngigg force-pushed the non-empty-app-root-fixes branch from 09fa854 to 97a5ade Compare November 11, 2025 12:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ensureStaticPrefix utility 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

Comment on lines +38 to +40
expect(assetUrl(absoluteResourcePath)).toBe(
`${app_root}/${absoluteResourcePath}`,
);
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test for assetUrl with an absolute URL (line 38-40) expects it to prepend the app root and a slash, which would produce invalid URLs like /myapp/https://cdn.domain.com/static/endpoint/img.png. The assetUrl function is designed for relative paths only. This test case should either be removed or moved to a separate test that validates assetUrl should not be used with absolute URLs.

Suggested change
expect(assetUrl(absoluteResourcePath)).toBe(
`${app_root}/${absoluteResourcePath}`,
);

Copilot uses AI. Check for mistakes.
const absoluteResourcePath = `https://cdn.domain.com/static${resourcePath}`;

beforeEach(() => {
// Clear app root
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says "Clear app root" but the code is actually clearing the static assets prefix mock. The comment should be updated to "Clear static assets prefix" to accurately reflect what the code is doing.

Suggested change
// Clear app root
// Clear static assets prefix

Copilot uses AI. Check for mistakes.
beforeEach(() => {
// setup a DOM element as a render target
useSelectorMock.mockClear();
// By default use empty app root
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says "By default use empty app root" but the code is actually setting the static assets prefix mock to an empty string. The comment should be updated to "By default use empty static assets prefix" to accurately reflect what the code is doing.

Suggested change
// By default use empty app root
// By default use empty static assets prefix

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid UI URL's with SUPERSET_APP_ROOT

2 participants