refactor(frontend): centralize subdirectory URL prefixing behind nav helpers (#39925)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Evan <evan@preset.io>
This commit is contained in:
Joe Li
2026-07-01 11:20:13 -07:00
committed by GitHub
co-authored by Claude Opus 4.7 Evan
parent b7d5de8e52
commit bed1034c2f
200 changed files with 9884 additions and 657 deletions
@@ -41,7 +41,7 @@ import TextControl from 'src/explore/components/controls/TextControl';
import CheckboxControl from 'src/explore/components/controls/CheckboxControl';
import PopoverSection from '@superset-ui/core/components/PopoverSection';
import ControlHeader from 'src/explore/components/ControlHeader';
import { ensureAppRoot } from 'src/utils/pathUtils';
import { ensureAppRoot } from 'src/utils/navigationUtils';
import {
ANNOTATION_SOURCE_TYPES,
ANNOTATION_TYPES,
@@ -119,7 +119,13 @@ const NotFoundContent = () => (
<span>
{t('Add an annotation layer')}{' '}
<a
href={ensureAppRoot('/annotationlayer/list')}
// encodeURI wraps the DOM-derived application-root prefix so
// CodeQL's `js/html-injection` sees a recognised through-function
// sanitiser between `applicationRoot()` (reads `data-bootstrap`
// from the DOM) and the `<a href>` sink. The string fed in is a
// URL-normalised path (`/seg/seg`) so encodeURI is idempotent in
// practice — it does not alter the navigation target.
href={encodeURI(ensureAppRoot('/annotationlayer/list'))}
target="_blank"
rel="noopener noreferrer"
>