Skip to content

Commit

Permalink
Implemented continuation in start + misc. fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JazzarKarim committed Jan 30, 2024
1 parent 7b3b5c1 commit 3c6ba6d
Show file tree
Hide file tree
Showing 14 changed files with 250 additions and 105 deletions.
27 changes: 11 additions & 16 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "name-request",
"version": "5.3.12",
"version": "5.3.13",
"private": true,
"appName": "Name Request UI",
"sbcName": "SBC Common Components",
Expand All @@ -15,8 +15,8 @@
"dependencies": {
"@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.1.4",
"@bcrs-shared-components/corp-type-module":"1.0.15",
"@bcrs-shared-components/enums": "1.1.7",
"@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
37 changes: 27 additions & 10 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
:dialog="getAmalgamateNowErrorStatus"
@close="closeAmalgamateNowErrorDialog()"
/>
<ContinuationInErrorDialog
attach="#app"
:dialog="getContinuationInErrorStatus"
@close="closeContinuationInErrorDialog()"
/>
<MrasSearchInfoDialog />
<NrNotRequiredDialog />
<PaymentCompleteDialog />
Expand Down Expand Up @@ -126,9 +131,9 @@ 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, AmalgamateNowErrorDialog, CancelDialog, ConditionsDialog, ErrorDialog, ExitDialog,
HelpMeChooseDialog, IncorporateNowErrorDialog, MrasSearchInfoDialog, NrNotRequiredDialog, ConfirmNrDialog,
PaymentCompleteDialog, PickEntityOrConversionDialog, RenewDialog, ReceiptsDialog,
AffiliationErrorDialog, AmalgamateNowErrorDialog, CancelDialog, ConditionsDialog, ContinuationInErrorDialog,
ErrorDialog, ExitDialog, HelpMeChooseDialog, IncorporateNowErrorDialog, MrasSearchInfoDialog, NrNotRequiredDialog,
ConfirmNrDialog, PaymentCompleteDialog, PickEntityOrConversionDialog, RenewDialog, ReceiptsDialog,
RefundDialog, ResubmitDialog, RetryDialog, StaffPaymentErrorDialog, UpgradeDialog, ExitIncompletePaymentDialog
} from '@/components/dialogs'
import SbcHeader from 'sbc-common-components/src/components/SbcHeader.vue'
Expand All @@ -149,6 +154,7 @@ import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module'
ChatPopup,
ConditionsDialog,
ConfirmNrDialog,
ContinuationInErrorDialog,
ErrorDialog,
ExitDialog,
ExitIncompletePaymentDialog,
Expand All @@ -175,6 +181,7 @@ export default class App extends Mixins(
) {
// Global getters
@Getter getAmalgamateNowErrorStatus!: boolean
@Getter getContinuationInErrorStatus!: boolean
@Getter getDisplayedComponent!: string
@Getter getIncorporateNowErrorStatus!: boolean
@Getter getNrId!: number
Expand All @@ -189,6 +196,7 @@ export default class App extends Mixins(
@Action setDisplayedComponent!: ActionBindingIF
@Action toggleConfirmNrModal!: ActionBindingIF
@Action setCurrentJsDate!: ActionBindingIF
@Action setRequestAction!: ActionBindingIF
@Action setWindowWidth!: ActionBindingIF
readonly axios = axios
Expand Down Expand Up @@ -273,22 +281,25 @@ export default class App extends Mixins(
sessionStorage.removeItem('NR_DATA')
}
// if there is stored legal type for an IA then incorporate/register it now
// if there is stored legal type and request action cd, try to continue
const legaltype = sessionStorage.getItem('LEGAL_TYPE')
if (legaltype && this.isAuthenticated) {
const requestActionCd = sessionStorage.getItem('REQUEST_ACTION_CD')
if (legaltype && requestActionCd && this.isAuthenticated) {
try {
if (this.isNewBusiness) {
await this.incorporateNow(legaltype as CorpTypeCd)
} else {
await this.amalgamateNow(legaltype as CorpTypeCd)
this.setRequestAction(requestActionCd)
if (this.isNewBusiness || this.isAmalgamation || this.isContinuationIn) {
await this.actionNumberedEntity(legaltype as CorpTypeCd)
}
// clear the legal type data
sessionStorage.removeItem('LEGAL_TYPE')
} catch (error) {
if (this.isNewBusiness) {
this.setIncorporateNowErrorStatus(true)
} else {
} else if (this.isAmalgamation) {
this.setAmalgamateNowErrorStatus(true)
} else if (this.isContinuationIn) {
this.setContinuationInErrorStatus(true)
}
console.error(error)
}
Expand Down Expand Up @@ -370,6 +381,12 @@ export default class App extends Mixins(
sessionStorage.removeItem('LEGAL_TYPE')
this.setAmalgamateNowErrorStatus(false)
}
/** Close ContinuationInErrorDialog and clear session storage. */
closeContinuationInErrorDialog (): void {
sessionStorage.removeItem('LEGAL_TYPE')
this.setContinuationInErrorStatus(false)
}
}
</script>

Expand Down
96 changes: 96 additions & 0 deletions src/components/dialogs/continuation-in-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 Continue in
</v-card-title>

<v-card-text id="dialog-text">
<!-- display message -->
<div class="general-error">
<p>Unable to continue in. 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 ContinuationInErrorDialog 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
Expand Up @@ -3,6 +3,7 @@ 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'
export { default as ContinuationInErrorDialog } from './continuation-in-error.vue'
export { default as ErrorDialog } from './error.vue'
export { default as ExitDialog } from './exit.vue'
export { default as ExitIncompletePaymentDialog } from './exit-incomplete-payment.vue'
Expand Down
38 changes: 38 additions & 0 deletions src/components/existing-request/nr-approved-gray-box.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,34 @@
</v-btn>
</div>

<div
v-else-if="showContinueInNowButton"
class="d-flex justify-center my-1"
>
<v-btn
v-if="showOpenExternalIcon"
class="amalgamate-now-external-btn mt-30"
min-width="20rem"
:disabled="disabled"
@click="$emit('goToCorpOnline')"
>
<strong>Continue In Now</strong>
&nbsp;
<v-icon small>
mdi-open-in-new
</v-icon>
</v-btn>
<v-btn
v-else
class="amalgamate-now-btn mt-30"
min-width="20rem"
:disabled="disabled"
@click="$emit('affiliateYourBusiness')"
>
<strong>Continue In Now</strong>
</v-btn>
</div>

<div
v-else-if="showAlterNowButton"
class="my-1"
Expand Down Expand Up @@ -199,6 +227,10 @@ export default class NrApprovedGrayBox extends Mixins(CommonMixin) {
return (this.getNr.request_action_cd === NrRequestActionCodes.AMALGAMATE)
}
get isContinuationIn (): boolean {
return (this.getNr.request_action_cd === NrRequestActionCodes.MOVE)
}
get isApprovedOrConsentUnRequired (): boolean {
return (NrState.APPROVED === this.getNr.state || this.isConsentUnRequired)
}
Expand All @@ -220,13 +252,19 @@ export default class NrApprovedGrayBox extends Mixins(CommonMixin) {
return (this.isAmalgamate && this.isApprovedOrConsentUnRequired)
}
/** True if the Continue In button should be shown. */
get showContinueInNowButton (): boolean {
return (this.isContinuationIn && this.isApprovedOrConsentUnRequired)
}
get isAllowAlterOnline (): boolean {
return this.isAlterOnline(this.getNr.requestTypeCd)
}
get showOpenExternalIcon (): boolean {
if (this.showAmalgamateNowButton && !this.isSupportedAmalgamation(this.getNr.entity_type_cd)) return true
if (this.showAlterNowButton && !this.isSupportedAlteration(this.getNr.requestTypeCd)) return true
if (this.showContinueInNowButton && !this.isSupportedContinuationIn(this.getNr.entity_type_cd)) return true
return false
}
Expand Down
7 changes: 3 additions & 4 deletions src/components/new-request/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -707,14 +707,13 @@ export default class Search extends Mixins(CommonMixin, NrAffiliationMixin, Sear
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)
await this.actionNumberedEntity(legalType)
}
} else {
// persist legal type of incorporate now in session upon authentication via Signin component
// persist legal type and request type of the action in session upon authentication via Signin component
sessionStorage.setItem('LEGAL_TYPE', legalType)
sessionStorage.setItem('REQUEST_ACTION_CD', this.getRequestActionCd)
// navigate to BC Registry login page with return parameter
const registryHomeUrl = sessionStorage.getItem('REGISTRY_HOME_URL')
const nameRequestUrl = `${window.location.origin}`
Expand Down
6 changes: 6 additions & 0 deletions src/interfaces/business.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export interface BusinessRequest {
},
type: AmalgamationTypes
},
continuationIn?: {
nameRequest: {
legalType: string
nrNumber?: string
}
},
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 @@ -17,6 +17,7 @@ export interface NewRequestIF {
assumedNameOriginal: string
conditionsModalVisible: boolean
conflictId: string
continuationInError: boolean
conversionType: NrRequestTypeCodes
conversionTypeAddToSelect: ConversionTypesI
corpNum: string
Expand Down
Loading

0 comments on commit 3c6ba6d

Please sign in to comment.