diff --git a/superset-frontend/src/components/Chart/chartAction.js b/superset-frontend/src/components/Chart/chartAction.js index 0b8bc04feec2c..52908c57fab7e 100644 --- a/superset-frontend/src/components/Chart/chartAction.js +++ b/superset-frontend/src/components/Chart/chartAction.js @@ -41,10 +41,7 @@ import { Logger, LOG_ACTIONS_LOAD_CHART } from 'src/logger/LogUtils'; import { allowCrossDomain as domainShardingEnabled } from 'src/utils/hostNamesConfig'; import { updateDataMask } from 'src/dataMask/actions'; import { waitForAsyncData } from 'src/middleware/asyncEvent'; -import { - ensureAppRootSanitized, - ensureAppRootUnsanitized, -} from 'src/utils/pathUtils'; +import { ensureAppRootUnsanitized } from 'src/utils/pathUtils'; import { safeStringify } from 'src/utils/safeStringify'; import { extendedDayjs } from 'src/utils/dates'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx index 5fa9e8aaefd47..c1203f2d95efc 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx @@ -127,7 +127,7 @@ const publishDataMask = debounce( // double it up. const appRoot = applicationRoot(); let replacement_pathname = window.location.pathname; - if (appRoot != '/' && replacement_pathname.startsWith(appRoot)) { + if (appRoot !== '/' && replacement_pathname.startsWith(appRoot)) { replacement_pathname = replacement_pathname.substring(appRoot.length); } history.location.pathname = replacement_pathname; diff --git a/superset-frontend/src/utils/export.ts b/superset-frontend/src/utils/export.ts index 8cf6da5611bd6..9967b2f7c92c5 100644 --- a/superset-frontend/src/utils/export.ts +++ b/superset-frontend/src/utils/export.ts @@ -17,9 +17,9 @@ * under the License. */ import parseCookie from 'src/utils/parseCookie'; -import { ensureAppRootSanitized } from './pathUtils'; import rison from 'rison'; import { nanoid } from 'nanoid'; +import { ensureAppRootSanitized } from './pathUtils'; export default function handleResourceExport( resource: string, diff --git a/superset-frontend/src/utils/getBootstrapData.ts b/superset-frontend/src/utils/getBootstrapData.ts index 285d400a9eac8..85c31296da70a 100644 --- a/superset-frontend/src/utils/getBootstrapData.ts +++ b/superset-frontend/src/utils/getBootstrapData.ts @@ -28,15 +28,15 @@ export default function getBootstrapData(): BootstrapData { } // eslint-disable-next-line import/no-mutable-exports -const _APPLICATION_ROOT_NO_TRAILING_SLASH = +const APPLICATION_ROOT_NO_TRAILING_SLASH = getBootstrapData().common.application_root.replace(/\/$/, ''); /** * @param dom_sanitize If true, run the application root through dompurify before returning * @returns The configured application root */ -export function applicationRoot(dom_sanitize: boolean = false): string { +export function applicationRoot(dom_sanitize = false): string { return dom_sanitize - ? DOMPurify.sanitize(_APPLICATION_ROOT_NO_TRAILING_SLASH) - : _APPLICATION_ROOT_NO_TRAILING_SLASH; + ? DOMPurify.sanitize(APPLICATION_ROOT_NO_TRAILING_SLASH) + : APPLICATION_ROOT_NO_TRAILING_SLASH; }