Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18532 - AM Button Implementation #748

25 changes: 19 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "name-request",
"version": "5.3.9",
"version": "5.3.10",
"private": true,
"appName": "Name Request UI",
"sbcName": "SBC Common Components",
Expand All @@ -16,7 +16,7 @@
"@babel/compat-data": "^7.21.5",
"@bcrs-shared-components/breadcrumb": "2.1.24",
"@bcrs-shared-components/corp-type-module": "1.0.13",
"@bcrs-shared-components/enums": "1.0.44",
"@bcrs-shared-components/enums": "1.1.1",
"@bcrs-shared-components/genesys-web-message": "1.0.0",
"@bcrs-shared-components/interfaces": "1.0.67",
"@bcrs-shared-components/staff-payment": "1.0.29",
Expand Down
33 changes: 28 additions & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
:dialog="getIncorporateNowErrorStatus"
@close="closeIncorporateNowErrorDialog()"
/>
<AmalgamateNowErrorDialog
attach="#app"
:dialog="getAmalgamateNowErrorStatus"
@close="closeAmalgamateNowErrorDialog()"
/>
<MrasSearchInfoDialog />
<NrNotRequiredDialog />
<PaymentCompleteDialog />
Expand Down Expand Up @@ -121,8 +126,8 @@ import { Breadcrumb } from '@/components/common'
import GenesysWebMessage from '@bcrs-shared-components/genesys-web-message/GenesysWebMessage.vue'
import { WebChat as ChatPopup } from '@bcrs-shared-components/web-chat'
import {
AffiliationErrorDialog, CancelDialog, ConditionsDialog, ErrorDialog, ExitDialog, HelpMeChooseDialog,
IncorporateNowErrorDialog, MrasSearchInfoDialog, NrNotRequiredDialog, ConfirmNrDialog,
AffiliationErrorDialog, AmalgamateNowErrorDialog, CancelDialog, ConditionsDialog, ErrorDialog, ExitDialog,
HelpMeChooseDialog, IncorporateNowErrorDialog, MrasSearchInfoDialog, NrNotRequiredDialog, ConfirmNrDialog,
PaymentCompleteDialog, PickEntityOrConversionDialog, RenewDialog, ReceiptsDialog,
RefundDialog, ResubmitDialog, RetryDialog, StaffPaymentErrorDialog, UpgradeDialog, ExitIncompletePaymentDialog
} from '@/components/dialogs'
Expand All @@ -137,10 +142,11 @@ import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module'

@Component({
components: {
ChatPopup,
AffiliationErrorDialog,
AmalgamateNowErrorDialog,
Breadcrumb,
CancelDialog,
ChatPopup,
ConditionsDialog,
ConfirmNrDialog,
ErrorDialog,
Expand Down Expand Up @@ -168,12 +174,14 @@ export default class App extends Mixins(
DateMixin, LoadKeycloakRolesMixin, NrAffiliationMixin, UpdateUserMixin
) {
// Global getters
@Getter getAmalgamateNowErrorStatus!: boolean
@Getter getDisplayedComponent!: string
@Getter getIncorporateNowErrorStatus!: boolean
@Getter getNrId!: number
@Getter isAuthenticated!: boolean
@Getter isRoleStaff!: boolean
@Getter isMobile!: boolean
@Getter isNewBusiness!: boolean

// Global actions
@Action resetAnalyzeName!: ActionBindingIF
Expand Down Expand Up @@ -267,13 +275,22 @@ export default class App extends Mixins(

// if there is stored legal type for an IA then incorporate/register it now
const legaltype = sessionStorage.getItem('LEGAL_TYPE')

if (legaltype) {
try {
await this.incorporateNow(legaltype as CorpTypeCd)
if (this.isNewBusiness) {
await this.incorporateNow(legaltype as CorpTypeCd)
} else {
await this.amalgamateNow(legaltype as CorpTypeCd)
}
// clear the legal type data
sessionStorage.removeItem('LEGAL_TYPE')
} catch (error) {
this.setIncorporateNowErrorStatus(true)
if (this.isNewBusiness) {
this.setIncorporateNowErrorStatus(true)
} else {
this.setAmalgamateNowErrorStatus(true)
}
console.error(error)
}
}
Expand Down Expand Up @@ -348,6 +365,12 @@ export default class App extends Mixins(
sessionStorage.removeItem('LEGAL_TYPE')
this.setIncorporateNowErrorStatus(false)
}

/** Close AmalgamateNowErrorDialog and clear session storage. */
closeAmalgamateNowErrorDialog (): void {
sessionStorage.removeItem('LEGAL_TYPE')
this.setAmalgamateNowErrorStatus(false)
}
}
</script>

Expand Down
96 changes: 96 additions & 0 deletions src/components/dialogs/amalgamate-now-error.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<template>
<v-dialog
v-model="dialog"
width="45rem"
persistent
:attach="attach"
>
<v-card>
<v-card-title id="dialog-title">
Unable to Amalgamate Now
</v-card-title>

<v-card-text id="dialog-text">
<!-- display message -->
<div class="general-error">
<p>Unable to amalgamate now. Please cancel or try again.</p>
</div>
</v-card-text>

<v-divider class="my-0" />

<v-card-actions>
<v-spacer />
<v-btn
id="dialog-cancel-button"
class="dialog-close"
text
@click="close()"
>
Cancel
</v-btn>
<v-btn
id="dialog-try-again-button"
class="dialog-close"
text
@click="tryAgain()"
>
Try Again
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>

<script lang="ts">
import { Component, Vue, Prop, Emit } from 'vue-property-decorator'

@Component({})
export default class AmalgamateNowErrorDialog extends Vue {
/** Prop to display the dialog. */
@Prop() readonly dialog: boolean

/** Prop to provide attachment selector. */
@Prop() readonly attach: string

/** Pass click event to parent. */
@Emit() close () { }

/** Try again button clicked. Refresh the page. */
tryAgain () {
window.location.reload()
}
}
</script>

<style lang="scss" scoped>
@import "@/assets/styles/theme.scss";

.v-dialog {
margin: 2rem;

.v-card {
padding: 0;

.v-card__title {
padding: 1.25rem 1.5rem;
color: $BCgovFontColorInverted;
background: $BCgovBlue5;
font-size: $px-18;
font-weight: bold;
margin: 0;
}

.v-card__text {
padding: 1.5rem !important;
font-weight: 300;
color: $gray7 !important;
font-size: $px-16;
}

.v-card__actions {
padding: 1rem;
}
}
}
</style>
1 change: 1 addition & 0 deletions src/components/dialogs/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { default as AffiliationErrorDialog } from './affiliation-error.vue'
export { default as AmalgamateNowErrorDialog } from './amalgamate-now-error.vue'
export { default as CancelDialog } from './cancel.vue'
export { default as ConditionsDialog } from './conditions.vue'
export { default as ConfirmNrDialog } from './confirm-name-request.vue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
:approvedName="approvedName && approvedName.name"
:emailAddress="nr && nr.applicants && nr.applicants.emailAddress"
:disabled="disableUnfurnished"
@incorporateRegisterYourBusiness="incorporateRegisterYourBusiness()"
@affiliateYourBusiness="affiliateYourBusiness()"
@goToSocietiesOnline="goToSocietiesOnline()"
@goToCorpOnline="goToCorpOnline()"
@goToEntityDashboard="goToEntityDashboard(nr.corpNum)"
Expand Down Expand Up @@ -368,7 +368,6 @@ export default class ExistingRequestDisplay extends Mixins(
@Getter getNrId!: number
@Getter getNrState!: NrState
@Getter isMobile!: boolean

// Global actions
@Action editExistingRequest!: ActionBindingIF
@Action setDisplayedComponent!: ActionBindingIF
Expand Down Expand Up @@ -773,8 +772,8 @@ export default class ExistingRequestDisplay extends Mixins(
this.setConditionsModalVisible(true)
}

/** Called to incorporate/register the business. */
async incorporateRegisterYourBusiness (): Promise<void> {
/** Called to incorporate/register/amalgamate the business. */
async affiliateYourBusiness (): Promise<void> {
// safety check
if (!this.isNrApprovedOrConditional) return

Expand Down
8 changes: 4 additions & 4 deletions src/components/existing-request/nr-approved-gray-box.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class="register-btn mt-30"
min-width="20rem"
:disabled="disabled"
@click="$emit('incorporateRegisterYourBusiness')"
@click="$emit('affiliateYourBusiness')"
>
<strong>Register Your Business</strong>
</v-btn>
Expand All @@ -26,7 +26,7 @@
class="incorporate-now-btn mt-30"
min-width="20rem"
:disabled="disabled"
@click="$emit('incorporateRegisterYourBusiness')"
@click="$emit('affiliateYourBusiness')"
>
<strong>Incorporate Your Business</strong>
</v-btn>
Expand Down Expand Up @@ -72,7 +72,7 @@
class="amalgamate-now-btn mt-30"
min-width="20rem"
:disabled="disabled"
@click="$emit('goToEntityDashboard')"
@click="$emit('affiliateYourBusiness')"
>
<strong>Amalgamate Now</strong>
</v-btn>
Expand Down Expand Up @@ -225,7 +225,7 @@ export default class NrApprovedGrayBox extends Mixins(CommonMixin) {
}

get showOpenExternalIcon (): boolean {
if (this.showAmalgamateNowButton && !this.isSupportedAmalgamation(this.getNr.requestTypeCd)) return true
if (this.showAmalgamateNowButton && !this.isSupportedAmalgamation(this.getNr.entity_type_cd)) return true
if (this.showAlterNowButton && !this.isSupportedAlteration(this.getNr.requestTypeCd)) return true
return false
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/new-request/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@
// We should show the name input field if the named radio button was used,
// or with some special cases that if it is a coop(CP), or a credit union(FI).
// Also, if it is a extrapros company, we should also have name input field when it is not a Canada Federal.
const isPromptNameInput = (this.isNamedCompany || this.isCooperative || this.isCreditUnion || this.isSelectedXproAndRestorable)

Check warning on line 507 in src/components/new-request/search.vue

View workflow job for this annotation

GitHub Actions / linting (20.5.1)

This line has a length of 131. Maximum allowed is 120
return (
this.isRestorable && isPromptNameInput && !this.isFederal
)
Expand Down Expand Up @@ -628,7 +628,7 @@
/** Retrieve text based on selected action/flow */
get actionNowButtonText (): string {
if (this.isContinuationIn) return 'Continue In Now'
if (this.isAmalgamation) return null // should never happen
if (this.isAmalgamation) return 'Amalgamate Now'
if (this.isConversion) return 'Alter Now'
if (this.isRestoration) return 'Restore Now'
if (this.isChangeName) return 'Change Name Now'
Expand Down Expand Up @@ -707,6 +707,8 @@
if (this.isAuthenticated) {
if (this.isConversion || this.isRestoration || this.isChangeName) {
this.goToEntityDashboard(this.getSearchBusiness.identifier)
} else if (this.isAmalgamation) {
await this.amalgamateNow(legalType)
} else {
await this.incorporateNow(legalType)
}
Expand Down
8 changes: 8 additions & 0 deletions src/interfaces/business.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { EntityStates, EntityTypes } from '@/enums'
import { AmalgamationTypes } from '@bcrs-shared-components/enums'

export interface BusinessRequest {
filing: {
Expand All @@ -15,6 +16,13 @@ export interface BusinessRequest {
nrNumber?: string
}
},
amalgamation?: {
nameRequest: {
legalType: string
nrNumber?: string
},
type: AmalgamationTypes
},
registration?: {
business: {
natureOfBusiness: string
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/new-request-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface NewRequestIF {
addressSuggestions: any[]
affiliationErrorModalValue: NrAffiliationErrors
allowAutoApprove: boolean
amalgamateNowError: boolean
analysisJSON: AnalysisJSONI
applicant: ApplicantI
assumedNameOriginal: string
Expand Down
Loading
Loading