Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24920 - Redirect to new BRD based on FF and Query Param #3192

Merged
merged 5 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions auth-web/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ VUE_APP_CORPORATE_ONLINE_URL="https://www.corporateonline.gov.bc.ca"
VUE_APP_NRO_URL="https://dev.bcregistrynames.gov.bc.ca/nro/"
VUE_APP_REGISTRY_SEARCH_URL="https://dev.search.business.bcregistry.gov.bc.ca/"
VUE_APP_NAMEX_WEB_URL="https://dev.namex.bcregistry.gov.bc.ca/"
VUE_APP_BUSINESS_REGISTRY_URL="https://business-registry-dev.web.app/"

#vaults API
VUE_APP_AUTH_API_URL="https://auth-api-dev.apps.silver.devops.gov.bc.ca"
Expand Down
1 change: 1 addition & 0 deletions auth-web/devops/vaults.env
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ VUE_APP_LLP_FORMS_URL="op://web-url/$APP_ENV/bcregistry/LLP_FORMS_URL"
VUE_APP_LP_FORMS_URL="op://web-url/$APP_ENV/bcregistry/LP_FORMS_URL"
VUE_APP_XLP_FORMS_URL="op://web-url/$APP_ENV/bcregistry/XLP_FORMS_URL"
VUE_APP_NAMEX_WEB_URL="op://web-url/$APP_ENV/auth-web/NAMEX_WEB_URL"
VUE_APP_BUSINESS_REGISTRY_URL="op://web-url/$APP_ENV/business-registry-ui/BUSINESS_REGISTRY_URL"

#vaults API
VUE_APP_AUTH_API_URL="op://API/$APP_ENV/auth-api/AUTH_API_URL"
Expand Down
4 changes: 2 additions & 2 deletions auth-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auth-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auth-web",
"version": "2.6.128",
"version": "2.7.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WOOHOO!

"appName": "Auth Web",
"sbcName": "SBC Common Components",
"private": true,
Expand Down
10 changes: 9 additions & 1 deletion auth-web/src/routes/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
StaffBusinessRegistryBreadcrumb,
StaffDashboardBreadcrumb
} from '@/resources/BreadcrumbResources'
import { Pages, Role, SessionStorageKeys } from '@/util/constants'
import { LDFlags, Pages, Role, SessionStorageKeys } from '@/util/constants'

import AcceptInviteLandingView from '@/views/auth/AcceptInviteLandingView.vue'
import AcceptInviteView from '@/views/auth/AcceptInviteView.vue'
Expand Down Expand Up @@ -46,6 +46,7 @@ import HomeView from '@/views/auth/home/HomeView.vue'
import IncorpOrRegisterView from '@/views/auth/home/IncorpOrRegisterView.vue'
import InvoluntaryDissolution from '@/views/auth/staff/InvoluntaryDissolution.vue'
import KeyCloakService from 'sbc-common-components/src/services/keycloak.services'
import LaunchDarklyService from 'sbc-common-components/src/services/launchdarkly.services'
import LeaveTeamLandingView from '@/views/auth/LeaveTeamLandingView.vue'
import LoginView from '@/views/auth/LoginView.vue'
import MaintainBusinessView from '@/views/auth/home/MaintainBusinessView.vue'
Expand Down Expand Up @@ -229,6 +230,13 @@ export function getRoutes (): RouteConfig[] {
{
path: '/account/:orgId',
name: 'account',
beforeEnter: (to, from, next) => {
if (LaunchDarklyService.getFlag(LDFlags.EnableBusinessRegistryDashboard) && to.query.newbrd === 'true') {
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
window.location.href = ConfigHelper.getNewBusinessRegistryDashboardUrl()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should return a new route (instead of hard-overwriting the URL like this)? That way, it could maybe retain the URL query parameters (eg, account id)...?

Ref: https://router.vuejs.org/guide/advanced/navigation-guards.html#Per-Route-Guard

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the plan 👍

} else {
next()
}
},
component: DashboardView,
meta: { requiresAuth: true, requiresProfile: true },
redirect: '/account/:orgId/business',
Expand Down
4 changes: 4 additions & 0 deletions auth-web/src/util/config-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ export default class ConfigHelper {
return `${import.meta.env.VUE_APP_NAMEX_WEB_URL}`
}

static getNewBusinessRegistryDashboardUrl () {
return `${import.meta.env.VUE_APP_BUSINESS_REGISTRY_URL}`
}

static getBceIdOsdLink () {
return `${import.meta.env.VUE_APP_BCEID_OSD_LINK}`
}
Expand Down
1 change: 1 addition & 0 deletions auth-web/src/util/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ export enum LDFlags {
BusSearchLink = 'bus-search-staff-link',
EnableBcCccUlc = 'enable-bc-ccc-ulc',
EnableBusinessNrSearch = 'enable-business-nr-search',
EnableBusinessRegistryDashboard = 'enable-business-registry-dashboard',
EnableDetailsFilter = 'enable-transactions-detail-filter',
EnableEFTPaymentMethod = 'enable-eft-payment-method',
EnablePaymentChangeFromEFT = 'enable-payment-change-from-eft',
Expand Down
Loading