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 all 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
10 changes: 7 additions & 3 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,
getRegistryHomeBreadcrumb
} 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 isRoleBasic!: boolean

// Global actions
@Action resetAnalyzeName!: ActionBindingIF
Expand Down Expand Up @@ -225,11 +227,13 @@ 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())
} else if (this.isRoleBasic) {
crumbs.unshift(getRegistryHomeBreadcrumb())
} else {
// For non-staff, set Home crumb
// If not logged in, set Registry Home Breadcrumb
crumbs.unshift(getRegistryDashboardBreadcrumb())
}
return crumbs
Expand Down
8 changes: 8 additions & 0 deletions src/resources/breadcrumb-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ export function getRegistryDashboardBreadcrumb (): BreadcrumbIF {
const registryHomeUrl = sessionStorage.getItem('REGISTRY_HOME_URL')
return {
text: 'BC Registries and Online Services',
href: `${registryHomeUrl}`
}
}

export function getRegistryHomeBreadcrumb (): BreadcrumbIF {
const registryHomeUrl = sessionStorage.getItem('REGISTRY_HOME_URL')
return {
text: 'BC Registries Dashboard',
href: `${registryHomeUrl}dashboard/${getParams()}`
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/store/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,11 @@ export const isRoleStaff = (state: StateIF): boolean => {
return state.stateModel.common.keycloakRoles.includes('staff')
}

/** Whether the user has "staff" keycloak role. */
export const isRoleBasic = (state: StateIF): boolean => {
return state.stateModel.common.keycloakRoles.includes('basic') || state.stateModel.common.keycloakRoles.includes('premium')
}

/** The staff payment. */
export const getStaffPayment = (state: StateIF): StaffPaymentIF => {
return state.stateModel.staffPayment
Expand Down