From e1cb9d4f12a612ad0acfb947810d1b22727cd4b1 Mon Sep 17 00:00:00 2001 From: Ashish Baravaliya Date: Sat, 17 Feb 2024 20:12:21 -0500 Subject: [PATCH] fix: 'Open pointer in new tab' redirecting to wrong path --- src/dashboard/Data/Browser/Browser.react.js | 2 +- src/lib/generatePath.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/dashboard/Data/Browser/Browser.react.js b/src/dashboard/Data/Browser/Browser.react.js index 55c3603791..ad5ec9238b 100644 --- a/src/dashboard/Data/Browser/Browser.react.js +++ b/src/dashboard/Data/Browser/Browser.react.js @@ -1030,7 +1030,7 @@ class Browser extends DashboardView { }, ]); window.open( - generatePath(this.context, `browser/${className}?filters=${encodeURIComponent(filters)}`), + generatePath(this.context, `browser/${className}?filters=${encodeURIComponent(filters)}`, true), '_blank' ); } diff --git a/src/lib/generatePath.js b/src/lib/generatePath.js index f01c14f891..208245f1da 100644 --- a/src/lib/generatePath.js +++ b/src/lib/generatePath.js @@ -1,3 +1,8 @@ -export default function generatePath(currentApp, path) { +const MOUNT_PATH = window.PARSE_DASHBOARD_PATH; + +export default function generatePath(currentApp, path, prependMountPath = false) { + if (prependMountPath && MOUNT_PATH) { + return `${MOUNT_PATH}apps/${currentApp.slug}/${path}`; + } return `/apps/${currentApp.slug}/${path}`; }