Skip to content

Commit

Permalink
- app version = 5.6.13
Browse files Browse the repository at this point in the history
- added dotted underline class that works for multiple lines
- cleaned up BusinessStatus and changed tooltip activator
- added tooltip text cases
- added validation rules and getters (still WIP)
- moved static businesses code from state-model to filing-template-mixin
  • Loading branch information
Severin Beauvais committed Dec 15, 2023
1 parent 2e9c91a commit 397eb88
Show file tree
Hide file tree
Showing 9 changed files with 221 additions and 270 deletions.
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": "business-create-ui",
"version": "5.6.12",
"version": "5.6.13",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
5 changes: 5 additions & 0 deletions src/assets/styles/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ p {
border-bottom: 1px dotted;
}

.text-decoration-dotted-underline {
text-decoration-style: dotted;
text-decoration-line: underline;
}

.section-container {
font-size: $px-16;
color: $gray7;
Expand Down
114 changes: 44 additions & 70 deletions src/components/Amalgamation/BusinessStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@
<template #activator="{ on }">
<v-icon
small
:color="color"
v-on="on"
:color="status === AmlStatuses.OK ? 'success' : 'warning'"
>
{{ icon }}
{{ status === AmlStatuses.OK ? 'mdi-check' : 'mdi-alert' }}
</v-icon>
<span
class="ml-2 text-decoration-dotted-underline"
v-on="on"
>
{{ status === AmlStatuses.OK ? 'Ready' : 'Attention Required' }}
</span>
</template>
<span>{{ tooltip }}</span>
</v-tooltip>

<span class="ml-2">{{ text }}</span>
</div>
</template>

Expand All @@ -29,99 +32,70 @@ import { AmlStatuses } from '@/enums'
@Component({})
export default class BusinessStatus extends Vue {
@Prop({ required: true }) readonly status!: AmlStatuses
get icon (): string {
switch (this.status) {
case AmlStatuses.OK:
return 'mdi-check'
case AmlStatuses.ERROR_CCC_MISMATCH:
case AmlStatuses.ERROR_FOREIGN:
case AmlStatuses.ERROR_FOREIGN_UNLIMITED:
case AmlStatuses.ERROR_FUTURE_EFFECTIVE_FILING:
case AmlStatuses.ERROR_LIMITED_RESTORATION:
case AmlStatuses.ERROR_NOT_AFFILIATED:
case AmlStatuses.ERROR_NOT_IN_GOOD_STANDING:
case AmlStatuses.ERROR_ULC_MISMATCH:
return 'mdi-alert'
default:
return 'mdi-alert-circle-outline' // should never happen
}
}
get color (): string {
switch (this.status) {
case AmlStatuses.OK:
return 'success'
case AmlStatuses.ERROR_CCC_MISMATCH:
case AmlStatuses.ERROR_FOREIGN:
case AmlStatuses.ERROR_FOREIGN_UNLIMITED:
case AmlStatuses.ERROR_FUTURE_EFFECTIVE_FILING:
case AmlStatuses.ERROR_LIMITED_RESTORATION:
case AmlStatuses.ERROR_NOT_AFFILIATED:
case AmlStatuses.ERROR_NOT_IN_GOOD_STANDING:
case AmlStatuses.ERROR_ULC_MISMATCH:
return 'warning'
default:
return 'error' // should never happen
}
}
get text (): string {
switch (this.status) {
case AmlStatuses.OK:
return 'Ready'
case AmlStatuses.ERROR_CCC_MISMATCH:
case AmlStatuses.ERROR_FOREIGN:
case AmlStatuses.ERROR_FOREIGN_UNLIMITED:
case AmlStatuses.ERROR_FUTURE_EFFECTIVE_FILING:
case AmlStatuses.ERROR_LIMITED_RESTORATION:
case AmlStatuses.ERROR_NOT_AFFILIATED:
case AmlStatuses.ERROR_NOT_IN_GOOD_STANDING:
case AmlStatuses.ERROR_ULC_MISMATCH:
return 'Attention Required'
readonly AmlStatuses = AmlStatuses
default:
return '(Unknown)' // should never happen
}
}
@Prop({ required: true }) readonly status!: AmlStatuses
/**
* The tooltip text for the current status.
* Note that the status is evaluated in amalgamation-mixin.ts.
*/
get tooltip (): string {
/* eslint-disable indent */
switch (this.status) {
case AmlStatuses.OK:
return ''
return 'The currently selected BC Registries account has access to this business.'
case AmlStatuses.ERROR_CCC_MISMATCH:
return 'A BC Community Contribution Company must amalgamate to form a new BC Community ' +
'Contribution Company.'
case AmlStatuses.ERROR_FOREIGN:
return 'A foreign corporation cannot be amalgamated except by Registries staff.'
case AmlStatuses.ERROR_FOREIGN_HORIZONTAL:
return 'A foreign company (including an Extraprovincial Company) cannot be part of a Short ' +
'Form Horizontal amalgamation. '
case AmlStatuses.ERROR_FOREIGN_UNLIMITED:
return 'A foreign corporation must not amalgamate with a limited company and continue as ' +
'an Unlimited Liability Company.'
case AmlStatuses.ERROR_FOREIGN_UNLIMITED2:
return 'A BC Company cannot amalgamate with an existing foreign corporation to form a BC ' +
'Unlimited Liability Company.'
case AmlStatuses.ERROR_FOREIGN_UNLIMITED3:
return 'A BC Company cannot amalgamate with a foreign company to form a BC Unlimited ' +
'Liability Company.'
case AmlStatuses.ERROR_FUTURE_EFFECTIVE_FILING:
return 'This business has a future effective filing. It cannot be part of an amalgamation ' +
'until all future effective filings have come into effect.'
case AmlStatuses.ERROR_LIMITED_RESTORATION:
return 'This business is under limited restoration. It cannot be part of an amalgamation ' +
'unless it is fully restored.'
// case AmlStatuses.ERROR_NEED_BC_COMPANY:
// return 'You must add at least one BC company.'
case AmlStatuses.ERROR_NOT_AFFILIATED:
return 'This business is not affiliated with the currently selected BC Registries account. ' +
'Affiliate this business with the account on My Business Registry page.'
case AmlStatuses.ERROR_NOT_IN_GOOD_STANDING:
return 'This business is not in good standing. This filing cannot be submitted until all ' +
'businesses are in good standing.'
case AmlStatuses.ERROR_ULC_MISMATCH:
return 'A BC Unlimited Liability Company must amalgamate to form a new BC Unlimited Liability ' +
'Company.'
case AmlStatuses.ERROR_XPRO_ULC_CCC:
return 'An Extraprovincial Company cannot amalgamate to form a new BC Unlimited Liability ' +
'Company or a new BC Community Contribution Company.'
default:
return null // should never happen
return '(Unknown)' // should never happen
}
/* eslint-enable indent */
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Amalgamation/BusinessTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default class BusinessTable extends Mixins(AmalgamationMixin) {
// assign the value of the first failed rule (if any) else OK
business.status = this.rules.reduce(
(status: AmlStatuses, rule: (business: AmalgamatingBusinessIF) => AmlStatuses) => {
// if we already failed a rule, don't check the rest of the rules
// if we already failed a rule, don't evaluate the current rule
if (status) return status
// return the value of the current rule (may be null)
return rule(business)
Expand Down
6 changes: 5 additions & 1 deletion src/enums/amalgamationEnums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ export enum AmlStatuses {
OK,
ERROR_CCC_MISMATCH,
ERROR_FOREIGN,
ERROR_FOREIGN_HORIZONTAL,
ERROR_FOREIGN_UNLIMITED,
ERROR_FOREIGN_UNLIMITED2,
ERROR_FOREIGN_UNLIMITED3,
ERROR_FUTURE_EFFECTIVE_FILING,
ERROR_LIMITED_RESTORATION,
// ERROR_NEED_BC_COMPANY,
ERROR_NOT_AFFILIATED,
ERROR_NOT_IN_GOOD_STANDING,
ERROR_ULC_MISMATCH,
ERROR_XPRO_ULC_CCC,
}

export enum AmlRoles {
Expand Down
Loading

0 comments on commit 397eb88

Please sign in to comment.