Skip to content

Commit

Permalink
24464 - fix: iron out discrepancies in use of FF between current and …
Browse files Browse the repository at this point in the history
…new (this) dashboard. (#85)

* 24464 - fix: iron out discrpancies i use of FF between current and new (this) dashboard.

* 24464 - fix: eslint

* 24464 - tests: updates

* 24464 - tests: fix ?
  • Loading branch information
hfekete authored Nov 28, 2024
1 parent 975e0ed commit a42fca0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/components/filings/correctionFilings.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ context('Correction Filings', () => {
cy.get('[data-cy="correctionForm.submit"]').should('exist')
cy.get('[data-cy="correctionForm.submit"]').click()
cy.wait('@correctionFilingsPost')

//can't check that it has navigated away without hard checking origin
cy.origin(devBCReg, () => {
cy.get('body').should('contain', 'BC Registries Account Login')
})
})

it('Staff shouldn\'t be able to file a correction against an invalid type', () => {
it("Staff shouldn't be able to file a correction against an invalid type", () => {
cy.visitBusinessDashFor('businessInfo/ben/active.json', undefined, false, false, undefined, allFilings, true)
cy.intercept('POST', '**/api/v2/businesses/**/filings', {}).as('correctionFilingsPost')

Expand Down
3 changes: 2 additions & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,15 @@ Cypress.Commands.add('visitTempBusinessDash', (draftFiling = undefined, asStaff
'GET',
`**/api/v2/businesses/${tempBusiness.identifier}/filings`,
bootstrapFiling
)
).as('tempFilings')
cy.interceptAuthorizations(tempBusiness.identifier).as('authorizations')

// go !
cy.visit(`/${tempBusiness.identifier}`)
cy.wait([
'@authorizations',
'@getSettings',
'@tempFilings',
'@getProducts'
])
cy.injectAxe()
Expand Down
2 changes: 1 addition & 1 deletion src/components/bcros/businessDetails/Links.vue
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ const contacts = getContactInfo('registries')
</BcrosDialog>

<!-- Staff Comments -->
<div v-if="hasRoleStaff && currentBusiness">
<div v-if="hasRoleStaff && currentBusiness && !isDisableNonBenCorps()">
<UModal v-model="isCommentOpen" :ui="{base: 'absolute left-10 top-5 bottom-5'}">
<BcrosComment :comments="comments" :business="currentBusiness.identifier" @close="showCommentDialog(false)" />
</UModal>
Expand Down
6 changes: 5 additions & 1 deletion src/components/bcros/filing/addStaffFiling/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface MenuActionItem extends DropdownItem {
const filings = useBcrosFilings()
const business = useBcrosBusiness()
const { getStoredFlag } = useBcrosLaunchdarkly()
const { isActionVisible } = useBcrosDashboardActions()
const { currentBusiness } = storeToRefs(business)
const { goToBusinessDashboard, goToEditPage, goToCreatePage } = useBcrosNavigate()
Expand Down Expand Up @@ -131,7 +132,10 @@ const allActions: ComputedRef<Array<MenuActionItem>> = computed(() => {
}
},
{ // <!-- Consent to Continue Out -->
showButton: isActionVisible(AllowableActionE.CONSENT_CONTINUATION_OUT),
showButton: currentBusiness?.value?.legalType &&
!!getStoredFlag('supported-consent-continuation-out-entities')?.includes(
currentBusiness?.value?.legalType) &&
isActionVisible(AllowableActionE.CONSENT_CONTINUATION_OUT),
disabled: !business.isAllowed(AllowableActionE.CONSENT_CONTINUATION_OUT),
datacy: 'consent-to-continue-out',
label: t('label.filing.staffFilingOptions.consentToContinueOut'),
Expand Down
15 changes: 5 additions & 10 deletions src/stores/business.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,19 +448,14 @@ export const useBcrosBusiness = defineStore('bcros/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.
*/
function isDisableNonBenCorps (): boolean {
if (
isLegalType([CorpTypeCd.BC_COMPANY, CorpTypeCd.BC_CCC, CorpTypeCd.BC_ULC_COMPANY, CorpTypeCd.CONTINUE_IN,
CorpTypeCd.CCC_CONTINUE_IN, CorpTypeCd.ULC_CONTINUE_IN
])
) {
return !launchdarklyStore.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 currentBusiness?.value?.identifier && !!launchdarklyStore
.getFeatureFlag('businesses-to-manage-in-colin')?.includes(currentBusiness.value.identifier)
}

/**
Expand Down

0 comments on commit a42fca0

Please sign in to comment.