From 2f4081f217e1c5d906ed8789e09a3377ddc15121 Mon Sep 17 00:00:00 2001 From: Ashish Baravaliya <49753983+AshishBarvaliya@users.noreply.github.com> Date: Sun, 18 Feb 2024 07:14:16 -0500 Subject: [PATCH] fix: Open pointer in new tab in data browser not working when mount path is not root (#2527) --- 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}`; }