Skip to content

Commit

Permalink
Removed Config-Helper from Resource (#1889)
Browse files Browse the repository at this point in the history
* removed config helper in resource

* fixed session assignment
  • Loading branch information
cameron-eyds authored Jan 24, 2022
1 parent 8b33d42 commit e68bae4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 4 additions & 5 deletions auth-web/src/resources/BreadcrumbResources.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import { BreadcrumbIF } from '@bcrs-shared-components/interfaces'
import ConfigHelper from '@/util/config-helper'

export const RegistryHomeBreadcrumb: BreadcrumbIF = {
text: 'BC Registries and Online Services',
href: `${ConfigHelper.getValue('REGISTRY_HOME_URL')}`
href: `${sessionStorage.getItem('REGISTRY_HOME_URL')}`
}

export const RegistryDashboardBreadcrumb: BreadcrumbIF = {
text: 'BC Registries Dashboard',
href: `${ConfigHelper.getValue('REGISTRY_HOME_URL')}dashboard`
href: `${sessionStorage.getItem('REGISTRY_HOME_URL')}dashboard`
}

export const MyBusinessRegistryBreadcrumb: BreadcrumbIF = {
text: 'My Business Registry',
to: { name: 'business' },
href: `${ConfigHelper.getValue('AUTH_WEB_URL')}/business`
href: `${sessionStorage.getItem('AUTH_WEB_URL')}/business`
}

export const StaffDashboardBreadcrumb: BreadcrumbIF = {
text: 'Staff Dashboard',
href: `${ConfigHelper.getValue('AUTH_WEB_URL')}/staff/dashboard/active`
href: `${sessionStorage.getItem('AUTH_WEB_URL')}/staff/dashboard/active`
}
5 changes: 5 additions & 0 deletions auth-web/src/util/config-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default class ConfigHelper {
sessionStorage.setItem(SessionStorageKeys.StatusApiUrl, ConfigHelper.getStatusAPIUrl())
sessionStorage.setItem(SessionStorageKeys.AuthWebUrl, ConfigHelper.getSelfURL())
sessionStorage.setItem(SessionStorageKeys.FasWebUrl, ConfigHelper.getFasWebUrl())
sessionStorage.setItem(SessionStorageKeys.RegistryHomeUrl, ConfigHelper.getRegistryHomeURL())
}

/**
Expand All @@ -36,6 +37,10 @@ export default class ConfigHelper {
return `${window.location.origin}/business/`
}

static getRegistryHomeURL () {
return `${ConfigHelper.getValue('REGISTRY_HOME_URL')}`
}

static getBcrosDashboardURL () {
return `${ConfigHelper.getValue('REGISTRY_HOME_URL')}dashboard`
}
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 @@ -13,6 +13,7 @@ export enum SessionStorageKeys {
OrgSearchFilter = 'ORG_SEARCH_FILTER',
AuthApiUrl = 'AUTH_API_URL',
AuthWebUrl = 'AUTH_WEB_URL',
RegistryHomeUrl = 'REGISTRY_HOME_URL',
StatusApiUrl = 'STATUS_API_URL',
FasWebUrl = 'FAS_WEB_URL',
AffidavitNeeded = 'AFFIDAVIT_NEEDED',
Expand Down

0 comments on commit e68bae4

Please sign in to comment.