Skip to content

Commit

Permalink
18736 Fix error fetching NR after application is filed (#593)
Browse files Browse the repository at this point in the history
* - app version = 7.0.16a
- only fetch NR if this is a draft app (not filed app)
- updated display name to match usual IA filing
- deleted obsolete unit tests

* fixed typo
  • Loading branch information
severinbeauvais authored Nov 24, 2023
1 parent c9fda7c commit cd8ea97
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
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": "business-filings-ui",
"version": "7.0.16",
"version": "7.0.16a",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand Down
18 changes: 11 additions & 7 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ import {
TaskTodoIF
} from '@/interfaces'
import {
CorpTypeCd,
EntityStatus,
FilingStatus,
FilingTypes,
NameRequestStates,
NigsMessage,
Routes
} from '@/enums'
import { CorpTypeCd, GetCorpFullDescription } from '@bcrs-shared-components/corp-type-module'
import { SessionStorageKeys } from 'sbc-common-components/src/util/constants'
import { useBusinessStore, useConfigurationStore, useFilingHistoryListStore, useRootStore } from './stores'
Expand Down Expand Up @@ -245,6 +245,7 @@ export default {
...mapState(useRootStore,
[
'getKeycloakRoles',
'isAppTask',
'isRoleStaff',
'showFetchingDataSpinner'
]),
Expand Down Expand Up @@ -525,11 +526,11 @@ export default {
const draft = await LegalServices.fetchDraftApp(this.tempRegNumber)
// Handle Draft filings
// handle draft application
this.storeDraftApp(draft)
// if the draft has a NR, load it
if (this.localNrNumber) {
// if this app is a task (not a filing), and it has a NR, load it
if (this.isAppTask && this.localNrNumber) {
const nr = await LegalServices.fetchNameRequest(this.localNrNumber)
this.storeNrData(nr, draft)
}
Expand Down Expand Up @@ -668,7 +669,7 @@ export default {
case FilingStatus.PAID:
// this is a filed application
this.setEntityStatus(EntityStatus.FILED_APP)
this.storeFiledApp(application)
this.storeDraftAppFiling(application)
break
default:
Expand All @@ -688,7 +689,7 @@ export default {
},
/** Stores filed application as a filing in the Filing History List. */
storeFiledApp (filedApplication: any): void {
storeDraftAppFiling (filedApplication: any): void {
const filing = filedApplication.filing as TaskTodoIF
// NB: these were already validated in storeDraftApp()
const header = filing.header
Expand All @@ -700,13 +701,16 @@ export default {
// Set parties
this.storeParties({ data: { parties: application.parties || [] } })
const description = GetCorpFullDescription(this.getLegalType)
const name = EnumUtilities.filingTypeToName(header.name)
// add this as a filing (for Filing History List)
const filingItem = {
availableOnPaperOnly: header.availableOnPaperOnly,
businessIdentifier: this.getIdentifier,
commentsCount: filedApplication.commentsCount,
commentsLink: filedApplication.commentsLink,
displayName: EnumUtilities.filingTypeToName(header.name),
displayName: `${description} ${name}`,
documentsLink: filedApplication.documentsLink,
effectiveDate: this.apiToUtcString(header.effectiveDate),
filingId: header.filingId,
Expand Down
10 changes: 0 additions & 10 deletions tests/unit/App.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1416,11 +1416,6 @@ describe('App as a PAID (pending) Incorporation Application', () => {
wrapper.destroy()
})

it('fetches NR data properly', () => {
expect(rootStore.getNameRequest.nrNum).toBe('NR 1234567')
expect(businessStore.getLegalName).toBe('My Name Request')
})

it.skip('fetches IA filing properly', () => {
expect(businessStore.getIdentifier).toBe('T123456789')
expect(businessStore.getLegalType).toBe('BEN')
Expand Down Expand Up @@ -1563,11 +1558,6 @@ describe('App as a COMPLETED Incorporation Application', () => {
wrapper.destroy()
})

it('fetches NR data properly', () => {
expect(rootStore.getNameRequest.nrNum).toBe('NR 1234567')
expect(businessStore.getLegalName).toBe('My Name Request')
})

it.skip('fetches IA filing properly', () => {
expect(businessStore.getIdentifier).toBe('T123456789')
expect(businessStore.getLegalType).toBe('BEN')
Expand Down

0 comments on commit cd8ea97

Please sign in to comment.