mirror of
https://github.com/apache/superset.git
synced 2026-09-04 22:41:36 +00:00
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:
co-authored by
Claude Opus 4.7
Evan
parent
b7d5de8e52
commit
bed1034c2f
+8
-2
@@ -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"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user