forked from bcgov/namerequest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
16638 & 16639 Created new BulletsColinLink component + implemented ne…
…w registration wireframes (bcgov#620) * 16638 & 16639 Created new component that either links to colin or dashboard + other changes * Fixed styling + rearranged after rebasing * Fixed spacing * removed unnecessary emitter * Added comment in template * Update in response to Sev's comments before rebasing * Update after rebase - redirect to dashboard after login + cleanup * Third update in response to Sev's comments * added extra line (lint fix) * Updated the incorporate now error dialog + removed code from signin * Remove session storage legal_type variable when user closes error dialog * Made incorporate now error dialog naive and some cleanup * Moved incorporate now error status to the store * removed useless variable * alternate cleaner syntax * updated package version after rebase
- Loading branch information
1 parent
f11e203
commit 4d0ce2c
Showing
19 changed files
with
454 additions
and
47 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
<template> | ||
<v-row id="bullets-colin-link"> | ||
<v-col cols="12" sm="3"> | ||
<v-radio-group | ||
v-model="selectedCompanyType" | ||
flat | ||
mandatory | ||
@change="radioButtonChanged(selectedCompanyType)" | ||
> | ||
<v-radio id="named-company-radio" | ||
class="mb-0 pb-4" | ||
label="Named Company" | ||
:value="CompanyType.NAMED_COMPANY" | ||
/> | ||
<v-radio id="numbered-company-radio" | ||
label="Numbered Company" | ||
:value="CompanyType.NUMBERED_COMPANY" | ||
/> | ||
</v-radio-group> | ||
</v-col> | ||
<v-col cols="12" sm="9"> | ||
<div v-if="selectedCompanyType === CompanyType.NAMED_COMPANY"> | ||
<v-row> | ||
<slot name="name-input-slot">Name Input</slot> | ||
<template v-if="showDesignation"> | ||
<slot name="designation">Designation</slot> | ||
</template> | ||
</v-row> | ||
</div> | ||
<div v-else> | ||
<ul class="bullet-points"> | ||
<li v-for="bulletPoint in bulletPoints" :key="bulletPoint"> | ||
{{ bulletPoint }} | ||
</li> | ||
</ul> | ||
<div class="btn-spacing" v-if="colinButton"> | ||
<v-btn class="px-9" :href="colinLink" target="_blank"> | ||
Go to Corporate Online to Register <v-icon small class="ml-1">mdi-open-in-new</v-icon> | ||
</v-btn> | ||
</div> | ||
<div class="btn-spacing" v-else> | ||
<v-btn | ||
class="px-9" | ||
id="incorporate-now-button" | ||
@click="incorporateNowClicked()" | ||
> | ||
Incorporate Now | ||
</v-btn> | ||
</div> | ||
</div> | ||
</v-col> | ||
</v-row> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Emit, Mixins, Prop } from 'vue-property-decorator' | ||
import { Getter } from 'vuex-class' | ||
import { CompanyType, EntityType } from '@/enums' | ||
import NameInput from '@/components/new-request/name-input.vue' | ||
import { Navigate } from '@/plugins' | ||
import { NrAffiliationMixin } from '@/mixins' | ||
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module' | ||
@Component({ | ||
components: { | ||
NameInput | ||
} | ||
}) | ||
export default class BulletsColinLink extends Mixins(NrAffiliationMixin) { | ||
/** The selected business type. */ | ||
@Prop({ default: '' }) readonly businessType!: EntityType | ||
/** Show Colin Button. */ | ||
@Prop({ default: false }) readonly colinButton!: boolean | ||
/** Show Designation Dropdown. */ | ||
@Prop({ default: false }) readonly showDesignation!: boolean | ||
/** Whether user is authenticated. */ | ||
@Getter getIsAuthenticated!: boolean | ||
// Local properties | ||
selectedCompanyType: CompanyType = null | ||
bulletPoints = [ | ||
'Your business name will be the Incorporation Number assinged by the Registry.', | ||
'You can change your business name at a later date.', | ||
'It is not possible to request a specific Incorporation Number.' | ||
] | ||
readonly colinLink = sessionStorage.getItem('CORPORATE_ONLINE_URL') | ||
// For template | ||
readonly CompanyType = CompanyType | ||
/** | ||
* The alternate codes for entity types. | ||
* Alternate codes are used in Entities UIs. | ||
*/ | ||
entityTypeAlternateCode (entityType: EntityType): CorpTypeCd { | ||
switch (entityType) { | ||
case EntityType.BC: return CorpTypeCd.BENEFIT_COMPANY | ||
case EntityType.CC: return CorpTypeCd.BC_CCC | ||
case EntityType.CR: return CorpTypeCd.BC_COMPANY | ||
case EntityType.UL: return CorpTypeCd.BC_ULC_COMPANY | ||
default: return null | ||
} | ||
} | ||
/** Navigate to the Entity Dashboard. */ | ||
goToEntityDashboard (businessId: string): void { | ||
if (businessId) { | ||
const dashboardUrl = sessionStorage.getItem('DASHBOARD_URL') | ||
Navigate(`${dashboardUrl}${businessId}`) | ||
} | ||
} | ||
/** | ||
* If user is authenticated, create draft business and redirect to Dashboard. | ||
* If user is not authenticated, redirect to login screen then redirect back. | ||
*/ | ||
async incorporateNowClicked () { | ||
const legalType = this.entityTypeAlternateCode(this.businessType) | ||
if (this.getIsAuthenticated) { | ||
await this.incorporateNow(legalType) | ||
} else { | ||
// persist legal type of incorporate now in session upon authentication via Signin component | ||
sessionStorage.setItem('LEGAL_TYPE', legalType) | ||
// navigate to BC Registry login page with return parameter | ||
const registryHomeUrl = sessionStorage.getItem('REGISTRY_HOME_URL') | ||
const nameRequestUrl = `${window.location.origin}` | ||
Navigate(`${registryHomeUrl}login?return=${nameRequestUrl}`) | ||
} | ||
} | ||
/** Emit the selected radio button CompanyType enum value. */ | ||
@Emit('radioButtonChange') | ||
radioButtonChanged (event: CompanyType): void {} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import '@/assets/styles/theme.scss'; | ||
// Radio button group spacing | ||
.v-input--selection-controls { | ||
padding-top: 0rem; | ||
margin-top: 0rem; | ||
} | ||
// Remove background color from radio button group | ||
.v-input__slot, .v-input--selection-controls .v-radio { | ||
background-color: white; | ||
font-weight: bold; | ||
} | ||
// Line spacing between bullet points and sizing | ||
.bullet-points { | ||
font-size: 0.875rem; | ||
margin-top: -0.75rem; | ||
line-height: 2rem; | ||
} | ||
// Font weight + size of button. This is done to stay consistent with "Check this Name" Button. | ||
.v-btn { | ||
font-weight: bold; | ||
min-height: 45px; | ||
padding-left: 4rem; | ||
} | ||
// Button Spacing. This is done to stay consistent with "Check this Name" Button. | ||
.btn-spacing { | ||
margin-top: 1rem; | ||
padding-left: 8rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { default as AppTitleCols } from './app-title-cols.vue' | ||
export { Breadcrumb } from '@bcrs-shared-components/breadcrumb' | ||
export { default as BulletsColinLink } from './bullets-colin-link.vue' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<template> | ||
<v-dialog v-model="dialog" width="45rem" persistent :attach="attach"> | ||
<v-card> | ||
<v-card-title id="dialog-title">Unable to Incorporate Now</v-card-title> | ||
|
||
<v-card-text id="dialog-text"> | ||
<!-- display message --> | ||
<div class="general-error"> | ||
<p>Unable to incorporate now. Please cancel or try again.</p> | ||
</div> | ||
</v-card-text> | ||
|
||
<v-divider class="my-0"></v-divider> | ||
|
||
<v-card-actions> | ||
<v-spacer></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 IncorporateNowErrorDialog 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: 1.125rem; | ||
font-weight: bold; | ||
margin: 0; | ||
} | ||
.v-card__text { | ||
padding: 1.5rem !important; | ||
font-weight: 300; | ||
color: $gray7 !important; | ||
font-size: 1rem; | ||
} | ||
.v-card__actions { | ||
padding: 1rem; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.