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

18023 incorrect name in breadcrumb #725

Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions 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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "name-request",
"version": "5.2.7",
"version": "5.2.8",
"private": true,
"appName": "Name Request UI",
"sbcName": "SBC Common Components",
Expand Down
13 changes: 9 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ import { Routes } from '@/enums'
import { BreadcrumbIF } from '@/interfaces'
import {
getRegistryDashboardBreadcrumb,
getStaffDashboardBreadcrumb
getStaffDashboardBreadcrumb,
getUserDashboardBreadcrumb
} from '@/resources'
import axios from 'axios'

Expand Down Expand Up @@ -172,6 +173,7 @@ export default class App extends Mixins(
@Getter getNrId!: number
@Getter isRoleStaff!: boolean
@Getter isMobile!: boolean
@Getter isAuthenticated!: boolean

// Global actions
@Action resetAnalyzeName!: ActionBindingIF
Expand Down Expand Up @@ -225,9 +227,12 @@ export default class App extends Mixins(

// Set base crumbs based on user role
// Staff don't want the home landing page and they can't access the Manage Business Dashboard
if (this.isRoleStaff) {
// If staff, set StaffDashboard as home crumb
crumbs.unshift(getStaffDashboardBreadcrumb())
if (this.isAuthenticated) {
if (this.isRoleStaff) {
crumbs.unshift(getStaffDashboardBreadcrumb())
} else {
crumbs.unshift(getUserDashboardBreadcrumb())
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
}
} else {
// For non-staff, set Home crumb
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
crumbs.unshift(getRegistryDashboardBreadcrumb())
Expand Down
8 changes: 7 additions & 1 deletion src/resources/breadcrumb-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ export function getRegistryDashboardBreadcrumb (): BreadcrumbIF {
const registryHomeUrl = sessionStorage.getItem('REGISTRY_HOME_URL')
return {
text: 'BC Registries and Online Services',
href: `${registryHomeUrl}`
}
}
export function getUserDashboardBreadcrumb (): BreadcrumbIF {
const registryHomeUrl = sessionStorage.getItem('REGISTRY_HOME_URL')
return {
text: 'BC Registries Dashboard',
href: `${registryHomeUrl}dashboard/${getParams()}`
}
}

severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
export function getStaffDashboardBreadcrumb (): BreadcrumbIF {
const businessUrl = sessionStorage.getItem('BUSINESSES_URL')
return {
Expand Down
Loading