From 09a05b31229dfd0b963aef36105436b199736dd3 Mon Sep 17 00:00:00 2001 From: Martyn Gigg Date: Tue, 15 Oct 2024 13:43:12 +0100 Subject: [PATCH] Fix SliceAdder create new chart link --- superset-frontend/src/dashboard/components/SliceAdder.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/superset-frontend/src/dashboard/components/SliceAdder.jsx b/superset-frontend/src/dashboard/components/SliceAdder.jsx index b610fe152ce13..a9f12ea07e865 100644 --- a/superset-frontend/src/dashboard/components/SliceAdder.jsx +++ b/superset-frontend/src/dashboard/components/SliceAdder.jsx @@ -28,6 +28,7 @@ import { Select } from 'src/components'; import Loading from 'src/components/Loading'; import Button from 'src/components/Button'; import Icons from 'src/components/Icons'; +import { ensureBasePath } from 'src/utils/pathUtils'; import { LocalStorageKeys, getItem, @@ -202,8 +203,8 @@ class SliceAdder extends Component { .filter(slice => showOnlyMyCharts ? (slice.owners && - slice.owners.find(owner => owner.id === this.props.userId)) || - (slice.created_by && slice.created_by.id === this.props.userId) + slice.owners.find(owner => owner.id === this.props.userId)) || + (slice.created_by && slice.created_by.id === this.props.userId) : true, ) .filter(createFilter(searchTerm, KEYS_TO_FILTERS)) @@ -330,7 +331,7 @@ class SliceAdder extends Component { buttonSize="xsmall" onClick={() => window.open( - `/chart/add?dashboard_id=${this.props.dashboardId}`, + ensureBasePath(`/chart/add?dashboard_id=${this.props.dashboardId}`), '_blank', 'noopener noreferrer', )