Skip to content

Commit

Permalink
fix: DBC feature should be available for historical companies (bcgov#587
Browse files Browse the repository at this point in the history
)

* refactor: CredentialsLanding component: add heading card

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: CredentialsLanding component: add supplemental cards

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: CredentialsLanding component: add image and word wrapping

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: CredentialsLanding component: link styling

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: CredentialsStepper component: deprecate routes

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: CredentialsStepper component: function naming

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: DigitalCredentials component: split into sub components

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: DigitalCredentials component: add web socket component

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: DigitalCredentials component: re-add credential table

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: DigitalCredentials component: update types and imports

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: DigitalCredentials component: add revocation dialogs

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: DigitalCredentials component: add replacement dialogs

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: devcontainer config

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix linting errors

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: bump version number

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: rename route for specificity

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: ran linter and fixed linting errors

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: make interface field optional

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: revert auto-formatting

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: contain dialogs for DigitalCredentials component

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix code smells

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: address code review comments

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: revert autoformatting

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: update wording and styling to align with UX

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix styling

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: feature flag credentials feature with mixin

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: add TOU dialog

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix test failiures and code comments

* chore: cleaup

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: mixin to access digital credential feature

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: entity menu styling

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: add loading indicators to digital credential route pages

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: reset dialog and functions

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: returl null if undefined

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: beef up conditional checks

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: spelling error

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: spelling error

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* 18284: digital business card (bcgov#552)

* refactor: CredentialsLanding component: add heading card

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: CredentialsLanding component: add supplemental cards

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: CredentialsLanding component: add image and word wrapping

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: CredentialsLanding component: link styling

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: CredentialsStepper component: deprecate routes

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: CredentialsStepper component: function naming

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: DigitalCredentials component: split into sub components

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: DigitalCredentials component: add web socket component

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: DigitalCredentials component: re-add credential table

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: DigitalCredentials component: update types and imports

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: DigitalCredentials component: add revocation dialogs

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: DigitalCredentials component: add replacement dialogs

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: devcontainer config

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix linting errors

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: bump version number

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: rename route for specificity

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: ran linter and fixed linting errors

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: make interface field optional

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: revert auto-formatting

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: contain dialogs for DigitalCredentials component

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix code smells

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: address code review comments

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: revert autoformatting

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: update wording and styling to align with UX

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix styling

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: feature flag credentials feature with mixin

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: add TOU dialog

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix test failiures and code comments

* chore: cleaup

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: mixin to access digital credential feature

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: entity menu styling

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: add loading indicators to digital credential route pages

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: reset dialog and functions

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: returl null if undefined

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: beef up conditional checks

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: spelling error

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: spelling error

Signed-off-by: Akiff Manji <amanji@petridish.dev>

---------

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: cleanup spelling and handle edge cases

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: failing tests

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: entity menu logic

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* 18284 Updated CSP (bcgov#561)

- added wss://*.gov.bc.ca to connect-src

* refactor: remove websocket support in favour of interval polling

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: remove console log

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: address PR comments

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: remove unused import

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: build and test failures

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: digital business card (bcgov#562)

* refactor: CredentialsLanding component: add heading card

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: CredentialsLanding component: add supplemental cards

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: CredentialsLanding component: add image and word wrapping

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: CredentialsLanding component: link styling

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: CredentialsStepper component: deprecate routes

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: CredentialsStepper component: function naming

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: DigitalCredentials component: split into sub components

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: DigitalCredentials component: add web socket component

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: DigitalCredentials component: re-add credential table

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: DigitalCredentials component: update types and imports

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: DigitalCredentials component: add revocation dialogs

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: DigitalCredentials component: add replacement dialogs

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: devcontainer config

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix linting errors

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: bump version number

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: rename route for specificity

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: ran linter and fixed linting errors

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: make interface field optional

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: revert auto-formatting

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: contain dialogs for DigitalCredentials component

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix code smells

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: address code review comments

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: revert autoformatting

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: update wording and styling to align with UX

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix styling

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: feature flag credentials feature with mixin

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: add TOU dialog

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix test failiures and code comments

* chore: cleaup

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: mixin to access digital credential feature

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: entity menu styling

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: add loading indicators to digital credential route pages

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: reset dialog and functions

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: returl null if undefined

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: beef up conditional checks

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: spelling error

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: spelling error

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: cleanup spelling and handle edge cases

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: failing tests

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: entity menu logic

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: remove websocket support in favour of interval polling

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: remove console log

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: address PR comments

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: remove unused import

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: build and test failures

Signed-off-by: Akiff Manji <amanji@petridish.dev>

---------

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* Update EntityMenu.spec.ts

* chore: remove web socket references

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: fix spacing

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: some cleanup

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* feat: credential detailed instructions

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: add tags to components

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: minor content updates

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: update package version

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: DBC feature should be available for historical organization

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* refactor: move logic into getter

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* fix: DBC feature should only be available to BCSC user

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: update package version

Signed-off-by: Akiff Manji <amanji@petridish.dev>

* chore: update package lock file

Signed-off-by: Akiff Manji <amanji@petridish.dev>

---------

Signed-off-by: Akiff Manji <amanji@petridish.dev>
Co-authored-by: Séverin Beauvais <severinbeauvais@users.noreply.github.com>
  • Loading branch information
2 people authored and JazzarKarim committed Jan 27, 2024
1 parent 71a04be commit 7b929e3
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 89 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.15",
"version": "7.0.16",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand Down
2 changes: 1 addition & 1 deletion src/components/DigitalCredentials/CredentialsMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</v-list-item-title>
</v-list-item>
<v-list-item
:disabled="issuedCredential.isRevoked"
:disabled="!issuedCredential.isIssued || issuedCredential.isRevoked"
@click="handleConfirmRevokeCredential()"
>
<v-list-item-title>
Expand Down
175 changes: 92 additions & 83 deletions src/components/EntityInfo/EntityMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</span>

<!-- More Actions -->
<span v-if="isBusiness && !isHistorical">
<span v-if="isBusiness && areMoreActionsAvailable">
<v-menu
v-model="expand"
offset-y
Expand Down Expand Up @@ -119,94 +119,96 @@
</v-tooltip>
</span>

<!-- Dissolve Business -->
<v-tooltip
right
content-class="right-tooltip"
>
<template #activator="{ on }">
<v-list-item
id="dissolution-list-item"
:disabled="!isAllowed(AllowableActions.VOLUNTARY_DISSOLUTION)"
v-on="on"
@click="promptDissolve()"
>
<v-list-item-title>
<span class="app-blue">Dissolve this Business</span>
</v-list-item-title>
</v-list-item>
</template>
Dissolving the business will make this business historical
and it will be struck from the corporate registry.
</v-tooltip>

<!-- Consent to Continue Out -->
<v-tooltip
right
content-class="right-tooltip"
>
<template #activator="{ on }">
<v-list-item
v-if="isBenBcCccUlc || isCoop"
id="cco-list-item"
:disabled="!isAllowed(AllowableActions.CONSENT_CONTINUATION_OUT)"
v-on="on"
@click="goToConsentContinuationOutFiling()"
>
<v-list-item-title>
<span class="app-blue">Consent to Continue Out</span>
</v-list-item-title>
</v-list-item>
</template>
Submit a Consent to Continue Out of the province of B.C.
</v-tooltip>

<!-- Request AGM Extension -->
<v-tooltip
right
content-class="right-tooltip"
>
<template #activator="{ on }">
<v-list-item
v-if="enableAgmExtension"
id="agm-ext-list-item"
:disabled="!isAllowed(AllowableActions.AGM_EXTENSION)"
v-on="on"
@click="goToAgmExtensionFiling()"
>
<v-list-item-title>
<span class="app-blue">Request AGM Extension</span>
</v-list-item-title>
</v-list-item>
</template>
<span>{{ agmExtensionToolTipText }}</span>
</v-tooltip>

<!-- Request AGM Location Change -->
<v-tooltip
right
content-class="right-tooltip"
>
<template #activator="{ on }">
<div
v-if="enableAgmLocationChg"
class="d-inline-block"
v-on="on"
>
<span v-if="!isHistorical">
<!-- Dissolve Business -->
<v-tooltip
right
content-class="right-tooltip"
>
<template #activator="{ on }">
<v-list-item
id="dissolution-list-item"
:disabled="!isAllowed(AllowableActions.VOLUNTARY_DISSOLUTION)"
v-on="on"
@click="promptDissolve()"
>
<v-list-item-title>
<span class="app-blue">Dissolve this Business</span>
</v-list-item-title>
</v-list-item>
</template>
Dissolving the business will make this business historical
and it will be struck from the corporate registry.
</v-tooltip>

<!-- Consent to Continue Out -->
<v-tooltip
right
content-class="right-tooltip"
>
<template #activator="{ on }">
<v-list-item
v-if="isBenBcCccUlc || isCoop"
id="cco-list-item"
:disabled="!isAllowed(AllowableActions.CONSENT_CONTINUATION_OUT)"
v-on="on"
@click="goToConsentContinuationOutFiling()"
>
<v-list-item-title>
<span class="app-blue">Consent to Continue Out</span>
</v-list-item-title>
</v-list-item>
</template>
Submit a Consent to Continue Out of the province of B.C.
</v-tooltip>

<!-- Request AGM Extension -->
<v-tooltip
right
content-class="right-tooltip"
>
<template #activator="{ on }">
<v-list-item
id="agm-loc-chg-list-item"
:disabled="!isAllowed(AllowableActions.AGM_LOCATION_CHANGE)"
v-if="enableAgmExtension"
id="agm-ext-list-item"
:disabled="!isAllowed(AllowableActions.AGM_EXTENSION)"
v-on="on"
@click="goToAgmLocationChgFiling()"
@click="goToAgmExtensionFiling()"
>
<v-list-item-title>
<span class="app-blue">Request AGM Location Change</span>
<span class="app-blue">Request AGM Extension</span>
</v-list-item-title>
</v-list-item>
</div>
</template>
<span>{{ agmLocationChgToolTipText }}</span>
</v-tooltip>
</template>
<span>{{ agmExtensionToolTipText }}</span>
</v-tooltip>

<!-- Request AGM Location Change -->
<v-tooltip
right
content-class="right-tooltip"
>
<template #activator="{ on }">
<div
v-if="enableAgmLocationChg"
class="d-inline-block"
v-on="on"
>
<v-list-item
id="agm-loc-chg-list-item"
:disabled="!isAllowed(AllowableActions.AGM_LOCATION_CHANGE)"
v-on="on"
@click="goToAgmLocationChgFiling()"
>
<v-list-item-title>
<span class="app-blue">Request AGM Location Change</span>
</v-list-item-title>
</v-list-item>
</div>
</template>
<span>{{ agmLocationChgToolTipText }}</span>
</v-tooltip>
</span>
</v-list-item-group>
</v-list>
</v-menu>
Expand Down Expand Up @@ -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)
}
Expand Down
10 changes: 9 additions & 1 deletion src/mixins/allowable-actions-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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.
Expand Down Expand Up @@ -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: {
Expand Down
14 changes: 13 additions & 1 deletion tests/unit/EntityMenu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 7b929e3

Please sign in to comment.