Skip to content

Commit

Permalink
24456 Updated "disable non BEN corps" functionality (new FF) (#706)
Browse files Browse the repository at this point in the history
- app version = 7.4.8
- changed isDisableNonBenCorps computation
- added FF 'businesses-to-manage-in-colin'
- deleted FF 'enable-non-ben-corps'
- updated unit test

Co-authored-by: Severin Beauvais <[email protected]>
  • Loading branch information
severinbeauvais and Severin Beauvais authored Nov 18, 2024
1 parent 3a907d9 commit 754f72a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 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.4.7",
"version": "7.4.8",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand Down
13 changes: 4 additions & 9 deletions src/stores/businessStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,18 +280,13 @@ export const useBusinessStore = defineStore('business', {
},

/**
* Is True for non-BEN corps if FF is disabled.
* Is False for BENs and other entity types.
* Is True for any business in the FF list, else False.
* Used to apply special pre-go-live functionality.
*/
isDisableNonBenCorps (): boolean {
if (
this.isEntityBcCompany || this.isEntityBcCcc || this.isEntityBcUlcCompany ||
this.isEntityContinueIn || this.isEntityCccContinueIn || this.isEntityUlcContinueIn
) {
return !GetFeatureFlag('enable-non-ben-corps')
}
return false
// initially, this was True for all non-BEN corps (when FF was off)
// now, this is True for the specified businesses only
return !!GetFeatureFlag('businesses-to-manage-in-colin')?.includes(this.getIdentifier)
},

//
Expand Down
2 changes: 1 addition & 1 deletion src/utils/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ declare const window: any
*/
const defaultFlagSet: LDFlagSet = {
'banner-text': '', // by default, there is no banner text
'businesses-to-manage-in-colin': [],
'enable-digital-credentials': false,
'enable-legal-name-fix': false,
'enable-non-ben-corps': false,
'sentry-enable': false, // by default, no sentry logs
'show-alert-phone-numbers-firm': false,
'supported-agm-extension-entities': [],
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/CorporateOnline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ describe('Corporate Online alert', () => {
beforeAll(() => {
businessStore.$state.businessInfo.goodStanding = true
businessStore.$state.businessInfo.legalType = CorpTypeCd.BC_COMPANY
businessStore.$state.businessInfo.identifier = 'BC1234567'

vi.spyOn(utils, 'GetFeatureFlag').mockImplementation(flag => {
if (flag === 'enable-non-ben-corps') return false
return null
if (flag === 'businesses-to-manage-in-colin') return ['BC1234567']
return []
})
})

Expand Down

0 comments on commit 754f72a

Please sign in to comment.