-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed staff account id redirection (#45)
* fix: fixed staff account id redirection * removed commented code * changed page titles based on if staff or not * fixed unit tests * fixed lint + typing issue * added comments * moved to /account/[orgId] + added middleware * fixed comment * fixed isStaffOrSbcStaff check * fixed unit tests by using the computed property * DRY * removed unnecessary div * handle intermittent page 404 not found
- Loading branch information
1 parent
4605151
commit 13897c7
Showing
15 changed files
with
97 additions
and
23 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
business-registry-dashboard/app/components/DashboardContent.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template> | ||
<div> | ||
<BusinessLookup class="-mt-4" /> | ||
<TableAffiliatedEntity class="mt-6" /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
business-registry-dashboard/app/middleware/01.account-link.global.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export default defineNuxtRouteMiddleware((to) => { | ||
// Check if the route is an account link without locale prefix | ||
if (to.path.startsWith('/account')) { | ||
// Construct the full URL with the en-CA locale prefix | ||
const newUrl = `/en-CA${to.path}` | ||
// Force a full page reload with the new URL to ensure proper locale handling | ||
window.location.href = newUrl | ||
|
||
// Prevent Nuxt from handling the navigation since we're doing a full page reload | ||
return abortNavigation() | ||
} | ||
}) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script setup lang="ts"> | ||
// This is a catch-all route that will handle any undefined routes | ||
// This will handle the intermittent page 404 not found until the middleware is loaded | ||
</script> | ||
|
||
<template> | ||
<NuxtLayout name="dashboard"> | ||
<DashboardContent /> | ||
</NuxtLayout> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<template> | ||
<NuxtLayout name="dashboard"> | ||
<DashboardContent /> | ||
</NuxtLayout> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters