diff --git a/cypress/e2e/components/tombstone/digital-credentials.cy.ts b/cypress/e2e/components/tombstone/digital-credentials.cy.ts deleted file mode 100644 index adec609b..00000000 --- a/cypress/e2e/components/tombstone/digital-credentials.cy.ts +++ /dev/null @@ -1,32 +0,0 @@ -context('Business tombstone - Digital Business Cards button', () => { - it('Verify the Digital Business Cards button works', () => { - // Intercept the GET request for the digital business card page - cy.intercept('GET', '**/**/digital-credentials/**').as('getDigitalCredentials') - - cy.visitBusinessDashFor('businessInfo/sp/withDigitalCredential.json') - - cy.get('[data-cy="button.moreActions"]') - .click() - .find('[id^="headlessui-menu-item-"]') - .eq(0) - .should('have.text', 'Digital Business Cards') - .as('digitalBusinessCardsButton') - - cy.fixture('businessInfo/sp/withDigitalCredential.json').then((businessInfo) => { - cy.get('@digitalBusinessCardsButton') - .click() - .wait('@getDigitalCredentials') - .its('request.url').should('include', `/${businessInfo.business.identifier}/digital-credentials/`) - }) - }) - - it('The button should be hidden when allowedActions.digitalBusinessCard === false', () => { - cy.visitBusinessDashFor('businessInfo/sp/active.json') - - cy.get('[data-cy="button.moreActions"]') - .click() - .find('[id^="headlessui-menu-item-"]') - .eq(0) - .should('not.have.text', 'Digital Business Cards') - }) -}) diff --git a/cypress/e2e/components/tombstone/menu-options.cy.ts b/cypress/e2e/components/tombstone/menu-options.cy.ts new file mode 100644 index 00000000..8c5754fd --- /dev/null +++ b/cypress/e2e/components/tombstone/menu-options.cy.ts @@ -0,0 +1,95 @@ +context('Business tombstone - action buttons in the dropdown menu', () => { + it('Verify the Digital Business Cards button works', () => { + // Intercept the GET request for the digital business card page + cy.intercept('GET', '**/**/digital-credentials/**').as('getDigitalCredentials') + + cy.visitBusinessDashFor('businessInfo/sp/withDigitalCredential.json') + + cy.get('[data-cy="button.moreActions"]') + .click() + .find('[data-cy="button.digitalCredentials"]') + .should('have.text', 'Digital Business Cards') + .as('digitalBusinessCardsButton') + + cy.fixture('businessInfo/sp/withDigitalCredential.json').then((businessInfo) => { + cy.get('@digitalBusinessCardsButton') + .click() + .wait('@getDigitalCredentials') + .its('request.url').should('include', `/${businessInfo.business.identifier}/digital-credentials/`) + }) + }) + + it('The button should be hidden when allowedActions.digitalBusinessCard === false', () => { + cy.visitBusinessDashFor('businessInfo/sp/active.json') + + cy.get('[data-cy="button.moreActions"]') + .click() + .find('[data-cy="button.digitalCredentials"]') + .should('not.exist') + }) + + it('Verify the action buttons in the dropdown menu', () => { + // Intercept the request for Continuation Out, Request AGM Extension, Request AGM Location Change, and Amalgamate + cy.intercept('GET', '**/**/consent-continuation-out?**filingId=0**').as('goToContinuationOut') + cy.intercept('GET', '**/**/agm-extension?**filingId=0**').as('goToAgmExtension') + cy.intercept('GET', '**/**/agm-location-chg?**filingId=0**').as('goToAgmLocationChange') + cy.intercept('GET', '**/**/amalgamation-selection?**').as('goToAmalgamation') + + cy.visitBusinessDashFor('businessInfo/ben/active.json') + .get('[data-cy="button.moreActions"]').as('moreActionsButton') + .click() + .find('[data-cy="button.consentToContinueOut"]') + .should('have.text', 'Consent to Continue Out') + .click() + .wait('@goToContinuationOut') + + cy.visitBusinessDashFor('businessInfo/ben/active.json') + .get('@moreActionsButton') + .click() + .find('[data-cy="button.requestAgmExtension"]') + .should('have.text', 'Request AGM Extension') + .click() + .wait('@goToAgmExtension') + + cy.visitBusinessDashFor('businessInfo/ben/active.json') + .get('@moreActionsButton') + .click() + .find('[data-cy="button.requestAgmLocationChange"]') + .should('have.text', 'Request AGM Location Change') + .click() + .wait('@goToAgmLocationChange') + + cy.visitBusinessDashFor('businessInfo/ben/active.json') + .get('@moreActionsButton') + .click() + .find('[data-cy="button.amalgamate"]') + .should('have.text', 'Amalgamate') + .click() + .wait('@goToAmalgamation') + }) + + it('Verify the dissolve business button works', () => { + // open the dissolution confirm dialog for 'Voluntary Dissolution' for a BEN company + cy.visitBusinessDashFor('businessInfo/ben/active.json') + .get('[data-cy="button.moreActions"]') + .click() + .find('[data-cy="button.dissolveBusiness"]') + .should('have.text', 'Dissolve this Business') + .click() + .get('[data-cy="bcros-dialog-confirmDissolution"]') + .find('[data-cy="bcros-dialog-title"]') + .should('have.text', 'Voluntary Dissolution') + + // open the dissolution confirm dialog for 'Dissolution' for a SP company + cy.visitBusinessDashFor('businessInfo/sp/active.json') + .get('[data-cy="button.moreActions"]') + .click() + .find('[data-cy="button.dissolveBusiness"]') + .click() + .get('[data-cy="bcros-dialog-confirmDissolution"]') + .find('[data-cy="bcros-dialog-title"]') + .should('have.text', 'Dissolution') + + // TO-DO: test the buttons and redirections in ticket #23467 + }) +}) diff --git a/src/components/bcros/LegalObligation.vue b/src/components/bcros/LegalObligation.vue index 511dfe98..be694d66 100644 --- a/src/components/bcros/LegalObligation.vue +++ b/src/components/bcros/LegalObligation.vue @@ -28,7 +28,7 @@ const hasNoMaintenanceFilings = computed(() => // - it is an active business (no temp business) // - it has no tasks in todo section and no maintenance filings in the filing history const showLegalObligation = computed(() => { - return !dismissed.value && !!obligations && isActive && prop.noTasks && hasNoMaintenanceFilings.value + return !dismissed.value && !!obligations.value && isActive && prop.noTasks && hasNoMaintenanceFilings.value }) const readMore = ref(false) diff --git a/src/components/bcros/businessDetails/LinkActions.vue b/src/components/bcros/businessDetails/LinkActions.vue index c85a18d8..5862eff1 100644 --- a/src/components/bcros/businessDetails/LinkActions.vue +++ b/src/components/bcros/businessDetails/LinkActions.vue @@ -5,17 +5,22 @@ import { FilingTypes } from '@bcrs-shared-components/enums' import { FilingSubTypeE } from '~/enums/filing-sub-type-e' const { currentBusiness } = storeToRefs(useBcrosBusiness()) -const { goToDigitalCredentialsPage } = useBcrosNavigate() +const { goToDigitalCredentialsPage, goToBusinessDashboard } = useBcrosNavigate() const { isAllowedToFile } = useBcrosBusiness() const { getStoredFlag } = useBcrosLaunchdarkly() const t = useNuxtApp().$i18n.t +const emit = defineEmits(['dissolve']) + interface MenuActionItem extends DropdownItem { showButton: boolean tooltip?: string + name?: string } +const param = { filingId: '0' } + const allActions: ComputedRef> = computed(() => { return [ { // @@ -26,7 +31,8 @@ const allActions: ComputedRef> = computed(() => { click: () => { goToDigitalCredentialsPage() }, - tooltip: t('tooltip.tombstone.menuAction.digitalCredentials') + tooltip: t('tooltip.tombstone.menuAction.digitalCredentials'), + name: 'digitalCredentials' }, { // showButton: currentBusiness.value.state !== BusinessStateE.HISTORICAL, @@ -35,64 +41,70 @@ const allActions: ComputedRef> = computed(() => { !isAllowedToFile(FilingTypes.DISSOLUTION, FilingSubTypeE.DISSOLUTION_VOLUNTARY), label: t('button.tombstone.menuAction.dissolveBusiness'), click: () => { - // TO-DO: open a dialog to confirm dissolution; then redirect to the dissolution page, e.g. - // https://dev.create.business.bcregistry.gov.bc.ca/dissolution-define-dissolution?id=BC0883549&accountid=3040 + // open a dialog to confirm dissolution + emit('dissolve') }, - tooltip: t('tooltip.tombstone.menuAction.dissolveBusiness') + tooltip: t('tooltip.tombstone.menuAction.dissolveBusiness'), + name: 'dissolveBusiness' }, { // showButton: currentBusiness.value.state !== BusinessStateE.HISTORICAL, disabled: !isAllowedToFile(FilingTypes.CONSENT_AMALGAMATION_OUT), label: t('button.tombstone.menuAction.consentToAmalgamateOut'), click: () => { - // TO-DO: redirect to the filing page (URL to be confirmed) + goToBusinessDashboard(`/${currentBusiness.value.identifier}/consent-amalgamation-out'`, param) }, - tooltip: t('tooltip.tombstone.menuAction.consentToAmalgamateOut') + tooltip: t('tooltip.tombstone.menuAction.consentToAmalgamateOut'), + name: 'consentToAmalgamateOut' }, { // showButton: currentBusiness.value.state !== BusinessStateE.HISTORICAL, disabled: !isAllowedToFile(FilingTypes.CONSENT_CONTINUATION_OUT), label: t('button.tombstone.menuAction.consentToContinueOut'), click: () => { - // TO-DO: redirect to https://dev.business.bcregistry.gov.bc.ca/{identifier}/consent-continuation-out + goToBusinessDashboard(`/${currentBusiness.value.identifier}/consent-continuation-out`, param) }, - tooltip: t('tooltip.tombstone.menuAction.consentToContinueOut') + tooltip: t('tooltip.tombstone.menuAction.consentToContinueOut'), + name: 'consentToContinueOut' }, { // showButton: currentBusiness.value.state !== BusinessStateE.HISTORICAL, disabled: !isAllowedToFile(FilingTypes.AGM_EXTENSION), label: t('button.tombstone.menuAction.requestAgmExtension'), click: () => { - // TO-DO: redirect to https://dev.business.bcregistry.gov.bc.ca/{identifier}/agm-extension + goToBusinessDashboard(`/${currentBusiness.value.identifier}/agm-extension`, param) }, tooltip: !isAllowedToFile(FilingTypes.AGM_EXTENSION) ? t('tooltip.tombstone.menuAction.requirementsForRequestAgmExtension') - : t('tooltip.tombstone.menuAction.requestAgmExtension') + : t('tooltip.tombstone.menuAction.requestAgmExtension'), + name: 'requestAgmExtension' }, { // showButton: currentBusiness.value.state !== BusinessStateE.HISTORICAL, disabled: !isAllowedToFile(FilingTypes.AGM_LOCATION_CHANGE), label: t('button.tombstone.menuAction.requestAgmLocationChange'), click: () => { - // TO-DO: redirect to https://dev.business.bcregistry.gov.bc.ca/{identifier}/agm-location-chg + goToBusinessDashboard(`/${currentBusiness.value.identifier}/agm-location-chg`, param) }, tooltip: !isAllowedToFile(FilingTypes.AGM_EXTENSION) ? t('tooltip.tombstone.menuAction.requirementsForRequestAgmLocationChange') - : t('tooltip.tombstone.menuAction.requestAgmLocationChange') + : t('tooltip.tombstone.menuAction.requestAgmLocationChange'), + name: 'requestAgmLocationChange' }, { // showButton: currentBusiness.value.state !== BusinessStateE.HISTORICAL, disabled: !isAllowedToFile(FilingTypes.AGM_LOCATION_CHANGE), label: t('button.tombstone.menuAction.amalgamate'), click: () => { - // TO-DO: redirect to https://dev.business.bcregistry.gov.bc.ca/{identifier}/amalgamation-selection + goToBusinessDashboard(`/${currentBusiness.value.identifier}/amalgamation-selection`) }, tooltip: currentBusiness.value.adminFreeze ? t('tooltip.tombstone.menuAction.isNotFrozenForAmalgamate') - : t('tooltip.tombstone.menuAction.amalgamate') + : t('tooltip.tombstone.menuAction.amalgamate'), + name: 'amalgamate' }] }) @@ -109,7 +121,7 @@ const actions: ComputedRef>> = computed(() => { :items="actions" :popper="{ placement: 'bottom-start' }" :ui="{ - container: 'bg-blue-500 w-auto' + container: 'w-auto' }" padding="p3" data-cy="button.moreActions" @@ -130,7 +142,13 @@ const actions: ComputedRef>> = computed(() => { arrow: true }" > - +
diff --git a/src/components/bcros/businessDetails/Links.vue b/src/components/bcros/businessDetails/Links.vue index 40fa0ded..8a4f9c48 100644 --- a/src/components/bcros/businessDetails/Links.vue +++ b/src/components/bcros/businessDetails/Links.vue @@ -4,11 +4,12 @@ import type { DocumentI } from '~/interfaces/document-i' import { BusinessStateE } from '~/enums/business-state-e' import { fetchDocuments, saveBlob } from '~/utils/download-file' -const { currentBusiness, comments, currentBusinessIdentifier, isFirm } = storeToRefs(useBcrosBusiness()) +const { currentBusiness, comments, currentBusinessIdentifier, isFirm, businessConfig } = storeToRefs(useBcrosBusiness()) const { getStoredFlag } = useBcrosLaunchdarkly() const { hasRoleStaff } = useBcrosKeycloak() const { isAllowedToFile, isDisableNonBenCorps } = useBcrosBusiness() const isCommentOpen = ref(false) +const isDissolutionDialogOpen = ref(false) const isAllowedBusinessSummary = computed(() => !!currentBusinessIdentifier.value && @@ -41,10 +42,50 @@ const isChangeBusinessInfoDisabled = computed(() => { return !isAllowed }) +const legalName = computed(() => currentBusiness.value?.legalName) +// TO-DO: in the old codebase, the legalName is returned by the getLegalName() function. +// Need to investigate the logic and implement it in business store in ticket #23493 + +// /** The legal name or alternate name if is firm. */ +// getLegalName (state: BusinessStateIF): string { +// const rootStore = useRootStore() + +// if (!GetFeatureFlag('enable-legal-name-fix')) { +// return state.businessInfo.legalName +// } +// if (this.isEntityFirm && !rootStore.isRegistrationTodo && !rootStore.isRegistrationFiling) { +// return this.getAlternateName +// } else { +// return state.businessInfo.legalName +// } +// }, + +// /** The alternate name. */ +// getAlternateName (state: BusinessStateIF): string { +// const { alternateNames, identifier } = state.businessInfo +// const name = alternateNames?.find((x) => x.identifier === identifier)?.name +// return name || null +// }, + const showCommentDialog = (show: boolean) => { isCommentOpen.value = show } +const showDissolutionDialog = (show: boolean) => { + isDissolutionDialogOpen.value = show +} + +const dissolutionDialogOptions = computed(() => { + const title = businessConfig.value?.dissolutionConfirmation.modalTitle + return { + title, + text: '', // content slot is used + hideClose: false, + buttons: [], // button slot is used + alertIcon: true + } +}) + /** * If business is Not In Good Standing and user isn't staff, emits an event to display NIGS dialog. * Otherwise, navigates to Edit UI to create a Special Resolution or Change or Alteration filing. @@ -82,10 +123,54 @@ const downloadBusinessSummary = async (): Promise => { saveBlob(blob, summaryDocument.filename) } } + +/** Creates a draft filing and navigates to the Create UI to file a company dissolution filing. */ +const dissolveBusiness = async (): Promise => { + // To be implemented in ticket #23467 + await new Promise((resolve) => { resolve() }) +} diff --git a/src/components/bcros/dialog/Index.vue b/src/components/bcros/dialog/Index.vue index b3b57a04..ef6f2d42 100644 --- a/src/components/bcros/dialog/Index.vue +++ b/src/components/bcros/dialog/Index.vue @@ -5,8 +5,9 @@ :data-cy="'bcros-dialog' + (name ? `-${name}` : '')" >
-
-
+
+
+

{{ options.title }}

@@ -14,6 +15,7 @@ { :warnings="item.warnings" /> diff --git a/src/composables/useBcrosNavigate.ts b/src/composables/useBcrosNavigate.ts index 80b16822..cf550335 100644 --- a/src/composables/useBcrosNavigate.ts +++ b/src/composables/useBcrosNavigate.ts @@ -41,10 +41,22 @@ export const useBcrosNavigate = () => { function goToSetupAccount () { redirect(config.public.authWebURL + 'setup-account') } - const goToDigitalCredentialsPage = () => { + function goToDigitalCredentialsPage () { redirect(config.public.dashboardOldUrl + `/${business.currentBusiness.identifier}/digital-credentials/`) } + function goToCreatePage (path: string, params?: { [key: string]: string }) { + redirect(config.public.createURL + path, params) + } + + function goToBusinessDashboard (path: string, params?: { [key: string]: string }) { + redirect(config.public.dashboardOldUrl + path, params) + } + + function goToEditPage (path: string, params?: { [key: string]: string }) { + redirect(config.public.editApiURL + path, params) + } + return { redirect, goToBcrosDashboard, @@ -56,6 +68,9 @@ export const useBcrosNavigate = () => { goToSetupAccount, goToTeamMembers, goToTransactions, - goToDigitalCredentialsPage + goToDigitalCredentialsPage, + goToCreatePage, + goToBusinessDashboard, + goToEditPage } } diff --git a/src/interfaces/dialog-options-i.ts b/src/interfaces/dialog-options-i.ts index 7eb3da67..7cd71520 100644 --- a/src/interfaces/dialog-options-i.ts +++ b/src/interfaces/dialog-options-i.ts @@ -8,4 +8,5 @@ export interface DialogOptionsI { text: string textExtra?: string[] title: string + alertIcon?: boolean } diff --git a/src/lang/en.json b/src/lang/en.json index 4b97673a..335a5335 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -46,7 +46,8 @@ "general": { "ok": "OK", "change": "Change", - "dismiss": "Dismiss" + "dismiss": "Dismiss", + "cancel": "Cancel" }, "dialog": { "delete": "Delete", diff --git a/src/utils/todo/action-functions.ts b/src/utils/todo/action-functions.ts index 5c8b4652..beaec5e2 100644 --- a/src/utils/todo/action-functions.ts +++ b/src/utils/todo/action-functions.ts @@ -5,18 +5,18 @@ import { FilingTypes } from '@bcrs-shared-components/enums' /** Files a new filing (todo item). */ export const doFileNow = (item: TodoItemI) => { const business = useBcrosBusiness() - const runtimeConfig = useRuntimeConfig() - const { redirect } = useBcrosNavigate() + const { goToBusinessDashboard, goToEditPage } = useBcrosNavigate() switch (item.name) { case FilingTypes.ANNUAL_REPORT: { // file the subject Annual Report - const url = `${runtimeConfig.public.dashboardOldUrl}/${business.currentBusiness.identifier}/annual-report` - redirect(url, { filingId: '0', arFilingYear: item.ARFilingYear.toString() }) // 0 means "new AR" + const path = `/${business.currentBusiness.identifier}/annual-report` + const param = { filingId: '0', arFilingYear: item.ARFilingYear.toString() } + goToBusinessDashboard(path, param) break } case FilingTypes.CONVERSION: { - const url = `${runtimeConfig.public.editApiURL}/${business.currentBusiness.identifier}/conversion` - redirect(url) + const path = `/${business.currentBusiness.identifier}/conversion` + goToEditPage(path) break } default: @@ -41,112 +41,127 @@ export const doResumePayment = (item: TodoItemI): boolean => { export const doResumeFiling = (item: TodoItemI): void => { const { currentBusinessIdentifier } = useBcrosBusiness() const { bootstrapIdentifier } = useBcrosBusinessBootstrap() - const { redirect } = useBcrosNavigate() - const runtimeConfig = useRuntimeConfig() + const { goToBusinessDashboard, goToCreatePage, goToEditPage } = useBcrosNavigate() - let url: string | undefined + let navigateFn: Function | undefined + let path = '' let params: { [key: string]: string } | undefined switch (item.name) { case FilingTypes.AMALGAMATION_APPLICATION: // navigate to Create UI to resume this Amalgamation - url = `${runtimeConfig.public.createURL}` + navigateFn = goToCreatePage params = { id: bootstrapIdentifier } break case FilingTypes.ANNUAL_REPORT: // navigate to the Annual Report page of the old dashboard - url = `${runtimeConfig.public.dashboardOldUrl}/${currentBusinessIdentifier}/annual-report` + navigateFn = goToBusinessDashboard + path = `/${currentBusinessIdentifier}/annual-report` params = { filingId: item.filingId.toString(), arFilingYear: item.ARFilingYear.toString() } break case FilingTypes.CHANGE_OF_DIRECTORS: // navigate to Change of Directors page of the old dashboard - url = `${runtimeConfig.public.dashboardOldUrl}/${currentBusinessIdentifier}/standalone-directors` + navigateFn = goToBusinessDashboard + path = `/${currentBusinessIdentifier}/standalone-directors` params = { filingId: item.filingId.toString() } break case FilingTypes.CHANGE_OF_ADDRESS: // navigate to Change of Address page of the old dashboard - url = `${runtimeConfig.public.dashboardOldUrl}/${currentBusinessIdentifier}/standalone-addresses` + navigateFn = goToBusinessDashboard + path = `/${currentBusinessIdentifier}/standalone-addresses` params = { filingId: item.filingId.toString() } break case FilingTypes.CONSENT_CONTINUATION_OUT: // navigate to Consent Continuation Out page of the old dashboard - url = `${runtimeConfig.public.dashboardOldUrl}/${currentBusinessIdentifier}/consent-continuation-out` + navigateFn = goToBusinessDashboard + path = `/${currentBusinessIdentifier}/consent-continuation-out` params = { filingId: item.filingId.toString() } break case FilingTypes.CONTINUATION_IN: // navigate to Create UI to resume this Continuation In - url = `${runtimeConfig.public.createURL}/continuation-in-business-home` + navigateFn = goToCreatePage + path = '/continuation-in-business-home' params = { id: bootstrapIdentifier } break case FilingTypes.CONTINUATION_OUT: // navigate to Continuation Out page of the old dashboard - url = `${runtimeConfig.public.dashboardOldUrl}/${currentBusinessIdentifier}/continuation-out` + navigateFn = goToBusinessDashboard + path = `/${currentBusinessIdentifier}/continuation-out` params = { filingId: item.filingId.toString() } break case FilingTypes.CORRECTION: // nagivate to Edit UI to resume correction - url = `${runtimeConfig.public.editApiURL}/${currentBusinessIdentifier}/correction/` + navigateFn = goToEditPage + path = `/${currentBusinessIdentifier}/correction/` params = { 'correction-id': item.filingId.toString() } break case FilingTypes.INCORPORATION_APPLICATION: // navigate to Create UI to resume this Incorporation application - url = `${runtimeConfig.public.createURL}/incorporation-define-company` + navigateFn = goToCreatePage + path = '/incorporation-define-company' params = { id: bootstrapIdentifier } break case FilingTypes.REGISTRATION: // navigate to Create UI to resume this Registration - url = `${runtimeConfig.public.createURL}/define-registration` + navigateFn = goToCreatePage + path = 'define-registration' params = { id: bootstrapIdentifier } break case FilingTypes.ALTERATION: // navigate to Edit UI to resume this Alteration - url = `${runtimeConfig.public.editApiURL}/${currentBusinessIdentifier}/alteration/` + navigateFn = goToEditPage + path = `/${currentBusinessIdentifier}/alteration/` params = { 'alteration-id': item.filingId.toString() } break case FilingTypes.DISSOLUTION: // navigate to Create UI to resume this Dissolution - url = `${runtimeConfig.public.createURL}/define-dissolution` + navigateFn = goToCreatePage + path = '/define-dissolution' params = { id: bootstrapIdentifier } break case FilingTypes.CHANGE_OF_REGISTRATION: // navigate to Edit UI to resume this Change of Registration - url = `${runtimeConfig.public.editApiURL}/${currentBusinessIdentifier}/change/` + navigateFn = goToEditPage + path = `/${currentBusinessIdentifier}/change/` params = { 'change-id': item.filingId.toString() } break case FilingTypes.CONVERSION: // navigate to Edit UI to resume this Conversion -- only available for staff account - url = `${runtimeConfig.public.editApiURL}/${currentBusinessIdentifier}/conversion/` + navigateFn = goToEditPage + path = `/${currentBusinessIdentifier}/conversion/` params = { 'conversion-id': item.filingId.toString() } break case FilingTypes.SPECIAL_RESOLUTION: // navigate to Edit UI to resume this Special Resolution - url = `${runtimeConfig.public.editApiURL}/${currentBusinessIdentifier}/special-resolution/` + navigateFn = goToEditPage + path = `/${currentBusinessIdentifier}/special-resolution/` params = { 'special-resolution': item.filingId.toString() } break case FilingTypes.RESTORATION: if ([FilingSubTypeE.FULL_RESTORATION, FilingSubTypeE.LIMITED_RESTORATION].includes(item.filingSubType)) { // navigate to Create UI - url = `${runtimeConfig.public.createURL}` + navigateFn = goToCreatePage params = { id: currentBusinessIdentifier } } else if ([FilingSubTypeE.LIMITED_RESTORATION_EXTENSION, FilingSubTypeE.LIMITED_RESTORATION_TO_FULL] .includes(item.filingSubType)) { // navigate to Edit UI - url = `${runtimeConfig.public.editApiURL}/${currentBusinessIdentifier}/${item.filingSubType}` + navigateFn = goToEditPage + path = `/${currentBusinessIdentifier}/${item.filingSubType}` params = { 'restoration-id': item.filingId.toString() } } break @@ -155,8 +170,8 @@ export const doResumeFiling = (item: TodoItemI): void => { break } - if (url && params) { - redirect(url, params) + if (navigateFn) { + navigateFn(path, params) } else { console.error('doResumeFiling(), invalid filing type =', item) }