-
Notifications
You must be signed in to change notification settings - Fork 45
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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> | ||
|
@@ -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> | ||
|
@@ -34,29 +35,41 @@ | |
</v-card-text> | ||
</template> | ||
|
||
<!-- List Tables --> | ||
<template v-else-if="!showSocietiesInfo"> | ||
<v-card-text class=""> | ||
<!-- Special case for societies --> | ||
<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> | ||
|
@@ -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) --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
|
@@ -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' | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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) | ||
} | ||
|
||
|
@@ -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 | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It turns out the store getter |
||
|
||
get tableData (): any[] { | ||
if (this.getLocation === Location.BC) { | ||
return this.tableDataBC | ||
|
@@ -194,24 +227,25 @@ export default class PickEntityOrConversionDialog extends CommonMixin { | |
return output | ||
} | ||
|
||
get width (): string { | ||
if (this.showSocietiesInfo || this.isConversion) { | ||
get maxWidth (): string { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just cleanup. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you added the There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, |
||
} | ||
|
||
// 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) { | ||
|
@@ -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 | ||
|
There was a problem hiding this comment.
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 ...".)