diff --git a/package-lock.json b/package-lock.json index 5064dc7ff..9979d1bd8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-filings-ui", - "version": "7.0.15", + "version": "7.0.16", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-filings-ui", - "version": "7.0.15", + "version": "7.0.16", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/base-address": "2.0.9", diff --git a/package.json b/package.json index 8f50aafed..d975c82c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-filings-ui", - "version": "7.0.15", + "version": "7.0.16", "private": true, "appName": "Filings UI", "sbcName": "SBC Common Components", diff --git a/src/components/DigitalCredentials/CredentialsMenu.vue b/src/components/DigitalCredentials/CredentialsMenu.vue index 7ccbdd722..ef722ca39 100644 --- a/src/components/DigitalCredentials/CredentialsMenu.vue +++ b/src/components/DigitalCredentials/CredentialsMenu.vue @@ -40,7 +40,7 @@ diff --git a/src/components/EntityInfo/EntityMenu.vue b/src/components/EntityInfo/EntityMenu.vue index 8cf3c8ed5..1f9234ed5 100644 --- a/src/components/EntityInfo/EntityMenu.vue +++ b/src/components/EntityInfo/EntityMenu.vue @@ -70,7 +70,7 @@ - + - - - - Dissolving the business will make this business historical - and it will be struck from the corporate registry. - - - - - - Submit a Consent to Continue Out of the province of B.C. - - - - - - {{ agmExtensionToolTipText }} - - - - - + {{ agmExtensionToolTipText }} + + + + + + {{ agmLocationChgToolTipText }} + + @@ -247,6 +249,13 @@ export default class EntityMenu extends Mixins(AllowableActionsMixin) { return !!this.businessId } + /** + * More actions should only display if an entity is not historical or if the Digital Credentials + * feature is available, otherwise an empty menu will display for historical entities. */ + get areMoreActionsAvailable (): boolean { + return !this.isHistorical || this.isAllowed(AllowableActions.DIGITAL_CREDENTIALS) + } + get enableAgmExtension (): boolean { return !!GetFeatureFlag('supported-agm-extension-entities').includes(this.getLegalType) } diff --git a/src/mixins/allowable-actions-mixin.ts b/src/mixins/allowable-actions-mixin.ts index a11917fd5..13d2d2eaa 100644 --- a/src/mixins/allowable-actions-mixin.ts +++ b/src/mixins/allowable-actions-mixin.ts @@ -4,6 +4,7 @@ import { GetFeatureFlag } from '@/utils' import { AllowableActions, CorpTypeCd, FilingSubTypes, FilingTypes } from '@/enums' import { AllowedActionsIF } from '@/interfaces' import { useBusinessStore, useRootStore } from '@/stores' +import { LoginSource } from 'sbc-common-components/src/util/constants' @Component({}) export default class AllowableActionsMixin extends Vue { @@ -14,6 +15,7 @@ export default class AllowableActionsMixin extends Vue { @Getter(useBusinessStore) isSoleProp!: boolean @Getter(useBusinessStore) isGoodStanding!: boolean @Getter(useRootStore) isRoleStaff!: boolean + @Getter(useRootStore) getUserInfo!: any /** * Returns True if the specified action is allowed, else False. @@ -89,10 +91,16 @@ export default class AllowableActionsMixin extends Vue { return (isBusiness && this.isRoleStaff) } + /** + * DBC feature is only available to self-registered owners of an SP + * who are logged in via BCSC. + */ case AllowableActions.DIGITAL_CREDENTIALS: { // NB: this feature is targeted via LaunchDarkly const ff = !!GetFeatureFlag('enable-digital-credentials') - return (ff && this.isSoleProp && !this.isRoleStaff) + const { loginSource } = this.getUserInfo + const isLoginSourceBCSC = loginSource === LoginSource.BCSC + return (ff && isLoginSourceBCSC && this.isSoleProp && !this.isRoleStaff) } case AllowableActions.DIRECTOR_CHANGE: { diff --git a/tests/unit/EntityMenu.spec.ts b/tests/unit/EntityMenu.spec.ts index 23cf35fee..4e8818343 100644 --- a/tests/unit/EntityMenu.spec.ts +++ b/tests/unit/EntityMenu.spec.ts @@ -410,7 +410,6 @@ describe('Entity Menu - Digital Business Cards click tests', () => { await wrapper.find('.menu-btn').trigger('click') const button = wrapper.find('#view-add-digital-credentials-button') - console.log(button) expect(button.exists()).toBe(true) expect(button.text()).toBe('Digital Business Cards') @@ -478,6 +477,19 @@ describe('Entity Menu - More actions click tests', () => { }) }) +it('renders More actions if historical and digital credential feature is allowed', async () => { + businessStore.setState(EntityState.HISTORICAL) + + const wrapper = mount(EntityMenu, { + vuetify, + mixins: [{ methods: { isAllowed: () => true } }], + propsData: { businessId: 'BC1234567' } + }) + + expect(wrapper.find('.menu-btn').exists()).toBe(true) + wrapper.destroy() +}) + describe('Entity Menu - Consent to Continuation click tests', () => { const router = mockRouter.mock()