generated from bcgov/bcrs-template-ui
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
25218 Redirect FF and code cleanup (#713)
- app version = 7.4.15 - moved breadcumb functions to a mixin - saved "noRedirect" to store per initial URL parameter - deleted unneeded router condition for Digital Credentials (already checked elsewhere) - ignored errors if getting credentials fails (there is no other error handling for this) - renamed credential event + function to match button label - changed Breadcrumb Resources to a mixin so store getters all work - updated navigateToBusinessDashboard() to use store variable instead of FF - cleaned up Digital Credentials routes - don't show error in console if credentials are unauthorized - fixed getters in configuration store - deleted "use-business-dashboard" FF - updated misc code to call navigateToBusinessDashboard() - updated unit tests Co-authored-by: Severin Beauvais <severin.beauvais@gov.bc.ca>
- Loading branch information
1 parent
5cf66ef
commit 0a43154
Showing
25 changed files
with
278 additions
and
212 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { Component, Vue } from 'vue-property-decorator' | ||
import { Getter } from 'pinia-class' | ||
import { BreadcrumbIF } from '@bcrs-shared-components/interfaces' | ||
import { CurrentAccountIF } from '@/interfaces' | ||
import { Routes } from '@/enums' | ||
import { useAuthenticationStore, useBusinessStore, useConfigurationStore, useRootStore } from '@/stores' | ||
|
||
/** | ||
* Mixin that provides some useful Name Request utilities. | ||
*/ | ||
@Component({}) | ||
export default class BreadcrumbMixin extends Vue { | ||
@Getter(useAuthenticationStore) getCurrentAccount!: CurrentAccountIF | ||
|
||
@Getter(useBusinessStore) getEntityName!: string | ||
@Getter(useBusinessStore) getIdentifier!: string | ||
|
||
@Getter(useConfigurationStore) getBusinessesUrl!: string | ||
@Getter(useConfigurationStore) getDashboardUrl!: string | ||
@Getter(useConfigurationStore) getRegHomeUrl!: string | ||
|
||
@Getter(useRootStore) isNoRedirect!: boolean | ||
|
||
/** Returns the breadcrumb to the BC Registries Dashboard. */ | ||
getBcRegistriesDashboardBreadcrumb (): BreadcrumbIF { | ||
const accountId = this.getCurrentAccount?.id || 0 | ||
const params = accountId ? `?accountid=${accountId}` : '' | ||
return { | ||
text: 'BC Registries Dashboard', | ||
href: `${this.getRegHomeUrl}dashboard/${params}` | ||
} | ||
} | ||
|
||
/** Returns the breadcrumb to the My Business Registry page. */ | ||
getMyBusinessRegistryBreadcrumb (): BreadcrumbIF { | ||
const accountId = this.getCurrentAccount?.id || 0 | ||
return { | ||
text: 'My Business Registry', | ||
href: `${this.getBusinessesUrl}account/${accountId}/business` | ||
} | ||
} | ||
|
||
/** Returns the breadcrumb to the Staff Dashboard. */ | ||
getStaffDashboardBreadcrumb (): BreadcrumbIF { | ||
return { | ||
text: 'Staff Dashboard', | ||
href: `${this.getBusinessesUrl}staff/dashboard/active` | ||
} | ||
} | ||
|
||
/** Returns the breadcrumb to the Business Dashboard. */ | ||
getDashboardBreadcrumb (): BreadcrumbIF { | ||
if (!this.isNoRedirect) { | ||
// redirect to new Business Dashboard | ||
return { | ||
text: this.getEntityName || 'Unknown Name', | ||
href: `${this.getDashboardUrl}${this.getIdentifier}` | ||
} | ||
} else { | ||
// route to old Entity Dashboard | ||
return { | ||
text: this.getEntityName || 'Unknown Name', | ||
to: { name: Routes.DASHBOARD } | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.