From acc0a52158479da934cf5828702f3a244d0130cd Mon Sep 17 00:00:00 2001 From: Karim El Jazzar <122301442+JazzarKarim@users.noreply.github.com> Date: Wed, 8 Jan 2025 17:12:53 -0500 Subject: [PATCH] 25147 - Changed the redirection link of the new BRD (#3197) --- auth-web/package-lock.json | 4 ++-- auth-web/package.json | 2 +- auth-web/src/routes/router.ts | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/auth-web/package-lock.json b/auth-web/package-lock.json index cbb19b2f8..ef9d7679d 100644 --- a/auth-web/package-lock.json +++ b/auth-web/package-lock.json @@ -1,12 +1,12 @@ { "name": "auth-web", - "version": "2.7.1", + "version": "2.7.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "auth-web", - "version": "2.7.1", + "version": "2.7.2", "dependencies": { "@bcrs-shared-components/base-address": "2.0.3", "@bcrs-shared-components/bread-crumb": "1.0.8", diff --git a/auth-web/package.json b/auth-web/package.json index 26ec6f8c5..ac386571e 100644 --- a/auth-web/package.json +++ b/auth-web/package.json @@ -1,6 +1,6 @@ { "name": "auth-web", - "version": "2.7.1", + "version": "2.7.2", "appName": "Auth Web", "sbcName": "SBC Common Components", "private": true, diff --git a/auth-web/src/routes/router.ts b/auth-web/src/routes/router.ts index 0ef45ce30..e19e2c838 100644 --- a/auth-web/src/routes/router.ts +++ b/auth-web/src/routes/router.ts @@ -231,8 +231,14 @@ export function getRoutes (): RouteConfig[] { path: '/account/:orgId', name: 'account', beforeEnter: (to, from, next) => { + // redirect to new business registry dashboard if (LaunchDarklyService.getFlag(LDFlags.EnableBusinessRegistryDashboard) && !to.query.noRedirect) { - window.location.href = ConfigHelper.getNewBusinessRegistryDashboardUrl() + const baseUrl = ConfigHelper.getNewBusinessRegistryDashboardUrl() + '/account/' + to.params.orgId + // Preserve query parameters when redirecting + const queryString = new URLSearchParams(to.query as Record).toString() + const redirectUrl = queryString ? `${baseUrl}?${queryString}` : baseUrl + + window.location.href = redirectUrl } else { next() }