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

17468 Misc cleanup and prep for xpro aml #683

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "name-request",
"version": "5.0.42",
"version": "5.0.43",
"private": true,
"appName": "Name Request UI",
"sbcName": "SBC Common Components",
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export default class App extends Mixins(
sessionStorage.removeItem('NR_DATA')
}

// if there is stored legal type for an IA then incorporate it now
// if there is stored legal type for an IA then incorporate/register it now
const legaltype = sessionStorage.getItem('LEGAL_TYPE')
if (legaltype) {
try {
Expand Down
20 changes: 9 additions & 11 deletions src/components/common/app-title-cols.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<template>
<div>
<v-row no-gutters>
<v-col cols="12" md="6" lg="6" class="mt-4" :class="{'pt-10': !isMobile}">
<span class="h2 colour-white" id="app-title">Name Request
</span>
</v-col>
<v-col cols="12" md="6" lg="6">
<Stats />
</v-col>
</v-row>
</div>
<v-row no-gutters>
<v-col cols="12" md="6" lg="6" class="mt-4" :class="{'pt-10': !isMobile}">
<span class="h2 colour-white" id="app-title">Name Request
</span>
</v-col>
<v-col cols="12" md="6" lg="6">
<Stats />
</v-col>
</v-row>
</template>

<script lang="ts">
Expand Down
22 changes: 11 additions & 11 deletions src/components/common/names-capture.vue
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,13 @@ import NameRequestDetails from '@/components/existing-request/name-request-detai
import { NameChoicesIF, NameRequestI } from '@/interfaces'
import { sanitizeName } from '@/plugins'
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import { EntityType, Location } from '@/enums'
import { EntityTypes, Location } from '@/enums'
import { CommonMixin } from '@/mixins'
import { Designations } from '@/list-data'

/**
* This is the component that displays the name choices.
* It also shows the menu here when editing a NR.
* It also shows the name request details here when editing a NR.
*/
@Component({
components: {
Expand All @@ -277,7 +277,7 @@ export default class NamesCapture extends Mixins(CommonMixin) {
@Getter getDisplayedComponent!: string
@Getter getDesignation!: string
@Getter getEditMode!: boolean
@Getter getEntityTypeCd!: EntityType
@Getter getEntityTypeCd!: EntityTypes
@Getter getLocation!: Location
@Getter getName!: string
@Getter getNameChoices!: NameChoicesIF
Expand Down Expand Up @@ -358,10 +358,10 @@ export default class NamesCapture extends Mixins(CommonMixin) {

get showSecondAndThirdNameChoices () {
if (this.getLocation !== Location.BC) {
if (this.getEntityTypeCd === EntityType.XLP ||
this.getEntityTypeCd === EntityType.XLL ||
this.getEntityTypeCd === EntityType.XCP ||
this.getEntityTypeCd === EntityType.XSO) {
if (this.getEntityTypeCd === EntityTypes.XLP ||
this.getEntityTypeCd === EntityTypes.XLL ||
this.getEntityTypeCd === EntityTypes.XCP ||
this.getEntityTypeCd === EntityTypes.XSO) {
return false
}
}
Expand Down Expand Up @@ -490,9 +490,9 @@ export default class NamesCapture extends Mixins(CommonMixin) {
// define the text for the name designation error message for the entity types that require it
get entityTypeText (): string {
switch (this.getEntityTypeCd) {
case EntityType.SO: return 'Society'
case EntityType.CC: return 'Community Contribution Company'
case EntityType.CP: return 'Cooperative'
case EntityTypes.SO: return 'Society'
case EntityTypes.CC: return 'Community Contribution Company'
case EntityTypes.CP: return 'Cooperative'

// for other no name designation required entity types, return an empty string
default: return ''
Expand Down Expand Up @@ -646,7 +646,7 @@ export default class NamesCapture extends Mixins(CommonMixin) {

get items (): string[] {
let output: string[] = Designations[this.getEntityTypeCd].words
if (this.getEntityTypeCd === EntityType.CC) {
if (this.getEntityTypeCd === EntityTypes.CC) {
output = Designations['CR'].words
}
return output
Expand Down
126 changes: 80 additions & 46 deletions src/components/dialogs/pick-entity-or-conversion.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<v-dialog :value="getPickEntityModalVisible" :max-width="width" persistent>
<v-dialog :value="getPickEntityModalVisible" :max-width="maxWidth" persistent>
<v-card class="no-border pick-entity-card">
<v-row>
<v-col cols="10">
<span class="ml-1 copy-small">{{ locationText }}:</span>
<span class="copy-small" v-if="!showSocietiesInfo">{{ getLocationText }}</span>
</v-col>
<v-col cols="2">
<v-icon class="float-right" md color="primary" @click="closeIconClicked()">mdi-close</v-icon>
Expand All @@ -16,16 +16,17 @@
<v-row class="category-bg">
<v-col cols="12" class="font-weight-bold">Alterations</v-col>
</v-row>
<v-row v-for="(conversion, i) in ConversionTypes" :key="'conv-' + i">
<v-row v-for="(conversion, i) in ConversionTypes" :key="`conv-${i}`">
<v-col cols="12" class="clickable-cell"
:id="conversion.value"
@click="chooseConversion(conversion)">
@click="chooseConversion(conversion)"
>
<v-tooltip bottom content-class="bottom-tooltip" transition="fade-transition" :disabled="isMobile">
<template v-slot:activator="scope">
<button v-on="scope.on" class="link-sm-sans-ul entity-link">{{ conversion.desc }}</button>
</template>
<div v-for="(text, i) in entityBlurbs(conversion.value)" :key="'blurb-' + i">
<span>{{ text }}</span>
<div v-for="(blurb, i) in entityBlurbs(conversion.value)" :key="`blurb-${i}`">
<span>{{ blurb }}</span>
</div>
</v-tooltip>
</v-col>
Expand All @@ -34,29 +35,41 @@
</v-card-text>
</template>

<!-- List Tables -->
<template v-else-if="!showSocietiesInfo">
<v-card-text class="">
<!-- Special case for societies -->
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Sep 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simply moved this up from below.

(I think it's easier to understand "if true else everything else" instead of "if not true ...".)

<template v-if="showSocietiesInfo">
<v-card-text class="mt-n12">
<v-container fluid>
<v-row no-gutters class="text-center">
<v-col cols="12">To request a name for a Society</v-col>
<v-col cols="12">please use the Societies Online website</v-col>
<v-col cols="12">
<a href="https://www.bcregistry.ca/societies/">https://www.bcregistry.ca/societies/</a>
</v-col>
</v-row>
</v-container>
</v-card-text>
</template>

<!-- Category tables -->
<template v-else>
<v-card-text class="pt-4">
<v-row no-gutters>
<v-col v-for="(category, i) in tableData" :key="'cat' + i">
<v-col v-for="(category, i) in tableData" :key="`cat-${i}`">
<v-simple-table>
<tr class="category-bg cell">
<th>
<span class="font-weight-bold">{{ category.text }}</span>
</th>
</tr>
<tr v-for="(entity, n) in category.entities" :key="'ent' + n">
<tr v-for="(entity, n) in category.entities" :key="`ent-${n}`">
<td class="clickable-cell" :id="entity.value" @click="chooseType(entity)">
<v-tooltip bottom content-class="bottom-tooltip" transition="fade-transition" :disabled="isMobile">
<template v-slot:activator="scope">
<button v-on="scope.on" class="link-sm-sans-ul entity-link">{{ entity.text }}</button>
</template>
<template>
<div v-for="(item, index) in entityBlurbs(entity.value)"
:key="`Blurb-${index}`">
<span :class="{ 'tooltip-bullet': index !== 0}">
{{ item }}
</span>
<div v-for="(blurb, index) in entityBlurbs(entity.value)" :key="`blurb-${index}`">
<span :class="{ 'tooltip-bullet': index !== 0}">{{ blurb }}</span>
</div>
</template>
</v-tooltip>
Expand All @@ -68,17 +81,40 @@
</v-card-text>
</template>

<template v-else>
<v-card-text>
<v-container fluid>
<v-row no-gutters class="text-center">
<v-col cols="12">To request a name for a Society</v-col>
<v-col cols="12">please use the Societies Online website</v-col>
<v-col cols="12">
<a href="https://www.bcregistry.ca/societies/">https://www.bcregistry.ca/societies/</a>
</v-col>
</v-row>
</v-container>
<!-- Category tables - xpro (amalgamation only) -->
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the second block for amalgamations only. Note that it displays Xpro data directly. (The block above, for amalgamations, displayed BC data.)

See screenshot attached to comment above for example.

<template v-if="isAmalgamation">
<v-row class="pt-4">
<v-col cols="12">
<span class="copy-small">Extraprovincial:</span>
</v-col>
</v-row>

<v-card-text class="pt-4">
<v-row no-gutters>
<v-col v-for="(category, i) in tableDataXPRO" :key="`cat-xpro-${i}`">
<v-simple-table>
<tr class="category-bg cell">
<th>
<span class="font-weight-bold">{{ category.text }}</span>
</th>
</tr>
<tr v-for="(entity, n) in category.entities" :key="`ent-xpro-${n}`">
<td class="clickable-cell" :id="entity.value" @click="chooseType(entity)">
<v-tooltip bottom content-class="bottom-tooltip" transition="fade-transition" :disabled="isMobile">
<template v-slot:activator="scope">
<button v-on="scope.on" class="link-sm-sans-ul entity-link">{{ entity.text }}</button>
</template>
<template>
<div v-for="(blurb, index) in entityBlurbs(entity.value)" :key="`blurb-xpro-${index}`">
<span :class="{ 'tooltip-bullet': index !== 0}">{{ blurb }}</span>
</div>
</template>
</v-tooltip>
</td>
</tr>
</v-simple-table>
</v-col>
</v-row>
</v-card-text>
</template>
</v-card>
Expand All @@ -90,7 +126,7 @@ import { Component, Watch } from 'vue-property-decorator'
import { Action, Getter } from 'vuex-class'
import { ConversionTypesI, EntityI, SelectOptionsI } from '@/interfaces'
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import { EntityType, Location } from '@/enums'
import { EntityTypes, Location } from '@/enums'
import { ConversionTypes } from '@/list-data'
import { CommonMixin } from '@/mixins'

Expand All @@ -101,14 +137,15 @@ export default class PickEntityOrConversionDialog extends CommonMixin {

// Global getters
@Getter getConversionTypeOptions!: ConversionTypesI[]
@Getter getEntityBlurbs!: Array<EntityI>
@Getter getEntityTypeCd!: EntityType
@Getter getEntityBlurbs!: Array<EntityI | ConversionTypesI>
@Getter getEntityTypeCd!: EntityTypes
@Getter getEntityTypeOptions!: Array<EntityI>
@Getter getEntityTypesBC!: Array<EntityI>
@Getter getEntityTypesXPRO!: Array<EntityI>
@Getter getLocation!: Location
@Getter getLocationText!: string
@Getter getPickEntityModalVisible!: boolean
@Getter isAmalgamation!: boolean
@Getter isConversion!: boolean
@Getter isMobile!: boolean

Expand All @@ -123,7 +160,7 @@ export default class PickEntityOrConversionDialog extends CommonMixin {

closeIconClicked () {
this.setPickEntityModalVisible(false)
// clear "View all business types" selection
// clear empty string selection
this.setEntityTypeCd(null)
}

Expand All @@ -134,18 +171,14 @@ export default class PickEntityOrConversionDialog extends CommonMixin {
}
}

get entity_type_cd (): EntityType {
get entity_type_cd (): EntityTypes {
return this.getEntityTypeCd
}

set entity_type_cd (value: EntityType) {
set entity_type_cd (value: EntityTypes) {
this.setEntityTypeCd(value)
}

get locationText (): string {
return (this.getLocationText === 'BC') ? 'British Columbia' : this.getLocationText
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out the store getter getLocationText already returns "British Columbia", so this computed is not needed.


get tableData (): any[] {
if (this.getLocation === Location.BC) {
return this.tableDataBC
Expand Down Expand Up @@ -194,24 +227,25 @@ export default class PickEntityOrConversionDialog extends CommonMixin {
return output
}

get width (): string {
if (this.showSocietiesInfo || this.isConversion) {
get maxWidth (): string {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed for double-wide table layout.

See screenshot attached to comment above for example.

if (this.showSocietiesInfo || this.isConversion || this.isAmalgamation) {
return '550px'
}
let cols = this.tableData.length
const maxThreshold = this.$vuetify.breakpoint.thresholds.sm

// 210 per column with a max threshold of 960px
return `${210 * cols > maxThreshold ? maxThreshold : 210 * cols}px`
// 210 per column with a max threshold of 960px (sm)
const cols = this.tableData.length
const maxThreshold = this.$vuetify.breakpoint.thresholds.sm
const val = (210 * cols > maxThreshold) ? maxThreshold : (210 * cols)
return `${val}px`
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just cleanup.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you added the .sm, you're targeting the threshold for small screens?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't actually change this code; I just cleaned it up.

But, yes, this.$vuetify.breakpoint.thresholds.sm is the value (960) for "small" screens.

}

// FUTURE: clean up return type
entityBlurbs (entity_type_cd: string): string[][] | string[] | string {
return this.getEntityBlurbs?.find(type => type.value === entity_type_cd)?.blurbs || []
return this.getEntityBlurbs.find(type => type.value === entity_type_cd)?.blurbs || []
}

clearEntitySelection (): void {
this.entity_type_cd = EntityType.INFO
this.entity_type_cd = EntityTypes.INFO
}

chooseConversion (conversion) {
Expand All @@ -229,7 +263,7 @@ export default class PickEntityOrConversionDialog extends CommonMixin {

chooseType (entity: SelectOptionsI) {
// show an URL of creating society NR if Societies NR needs to be released AFTER the way of navigating changes
if (!this.isSocietyEnabled() && (entity.value === EntityType.SO || entity.value === EntityType.XSO)) {
if (!this.isSocietyEnabled() && (entity.value === EntityTypes.SO || entity.value === EntityTypes.XSO)) {
this.showSocietiesInfo = true
this.clearEntitySelection()
return
Expand Down
5 changes: 3 additions & 2 deletions src/components/existing-request/check-status-gray-box.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<v-row no-gutters class="bg-light-gray">
<v-col class="text-body-4 px-5 py-4">
<p>
To check on the status of this Name Request in the future, enter the request number <strong>{{nrNum}}</strong>
plus the Applicant Phone Number or Email Address using the "Manage My Name Request tab" on the site.
To check on the status of this Name Request in the future, enter the request number
<strong>{{nrNum}}</strong> plus the Applicant Phone Number or Email Address using the "Manage My Name
Request tab" on the site.
</p>
<v-row no-gutters>
<v-col cols="auto" class="pt-1 mr-2">
Expand Down
Loading