-
Notifications
You must be signed in to change notification settings - Fork 49
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
18640 Amalgamating business table (initial) #586
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 |
---|---|---|
|
@@ -32,9 +32,7 @@ | |
flat | ||
class="section-container mt-4 pr-0" | ||
> | ||
<v-row | ||
no-gutters | ||
> | ||
<v-row no-gutters> | ||
<v-col | ||
cols="12" | ||
sm="3" | ||
|
@@ -82,9 +80,7 @@ | |
flat | ||
class="section-container mt-4" | ||
> | ||
<v-row | ||
no-gutters | ||
> | ||
<v-row no-gutters> | ||
<v-col | ||
cols="12" | ||
sm="3" | ||
|
@@ -104,7 +100,8 @@ | |
</v-row> | ||
</v-card> | ||
</v-expand-transition> | ||
<v-row class="mt-4 ml-1"> | ||
|
||
<!-- <v-row class="mt-4 ml-1"> | ||
<ul> | ||
Amalgamating Businesses: <br><br> | ||
<li | ||
|
@@ -126,7 +123,15 @@ | |
</template> | ||
</li> | ||
</ul> | ||
</v-row> | ||
</v-row> --> | ||
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'm going to keep this around for a bit while figuring out what business data we need in the table. 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. Sev, one thing I'm scratching my head around are A companies and companies that are not found in LEAR. Currently, in my upcoming PR, I have the business as what the lookup returns. The identifier alongside a couple of fields. Is that fine? This way, we have two flavors:
I'm wondering, that's enough right? 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. The lookup returns an object that contains some fields but not all. That's why you have to make other API calls to fetch the rest. "A" companies are, I believe xpros. That means they're out-of-BC companies but we still have a COLIN/LEAR record for them, so we can handle them normally. Foreign companies won't be returned by business lookup. Staff will enter those 3 data fields for them only. I would consider their identified "special" in that it's user-entered and not necessarily unique. We will have to assume they are in good standing. Yes, we have 2 flavours: LEAR (including A) + Foreign. |
||
|
||
<!-- FOR DEBUGGING --> | ||
<!-- <pre>getAmalgamatingBusinesses={{ getAmalgamatingBusinesses }}</pre> --> | ||
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. Can delete this soon, but not yet as I'm enabling/disabling this while verifying the data. |
||
<BusinessTable | ||
class="mt-8" | ||
:class="{ 'invalid-section': getShowErrors && !businessTableValid }" | ||
@valid="businessTableValid=$event" | ||
/> | ||
</div> | ||
</template> | ||
|
||
|
@@ -137,24 +142,28 @@ import { useStore } from '@/store/store' | |
import { CommonMixin } from '@/mixins' | ||
import { BusinessLookupServices, LegalServices } from '@/services' | ||
import { BusinessLookup } from '@bcrs-shared-components/business-lookup' | ||
import { BusinessIF, BusinessLookupIF, EmptyBusinessLookup } from '@/interfaces' | ||
import { BusinessLookupIF, EmptyBusinessLookup } from '@/interfaces' | ||
import BusinessTable from '@/components/Amalgamation/BusinessTable.vue' | ||
|
||
@Component({ | ||
components: { | ||
BusinessLookup | ||
BusinessLookup, | ||
BusinessTable | ||
} | ||
}) | ||
export default class AmalgamatingBusinesses extends Mixins(CommonMixin) { | ||
@Getter(useStore) getAmalgamatingBusinesses!: Array<BusinessIF> | ||
@Getter(useStore) getAmalgamatingBusinesses!: Array<any> | ||
@Getter(useStore) getShowErrors!: boolean | ||
@Getter(useStore) isAmalgamationFilingHorizontal!: boolean | ||
@Getter(useStore) isRoleStaff!: boolean | ||
|
||
@Action(useStore) setAmalgamatingBusinesses!: (x: Array<BusinessIF>) => void | ||
@Action(useStore) setAmalgamatingBusinesses!: (x: Array<any>) => void | ||
|
||
// Local properties | ||
amalgamatingBusinessesValid = false | ||
amalgamatingBusinesses = [] | ||
initialBusinessLookupObject = EmptyBusinessLookup | ||
businessTableValid = false | ||
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. Note that initial value here doesn't matter since the BusinessTable component computes this early on and emits its validity. |
||
|
||
// Button properties | ||
isAddingAmalgamatingBusiness = false | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<template> | ||
<div class="business-status d-flex align-start"> | ||
<v-tooltip | ||
top | ||
max-width="24rem" | ||
content-class="top-tooltip" | ||
transition="fade-transition" | ||
:disabled="!tooltip" | ||
> | ||
<template #activator="{ on }"> | ||
<v-icon | ||
small | ||
:color="color" | ||
v-on="on" | ||
> | ||
{{ icon }} | ||
</v-icon> | ||
</template> | ||
<span>{{ tooltip }}</span> | ||
</v-tooltip> | ||
|
||
<span class="ml-2">{{ text }}</span> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Prop, Vue } from 'vue-property-decorator' | ||
import { BusinessStatuses } from '@/enums' | ||
|
||
@Component({}) | ||
export default class BusinessStatus extends Vue { | ||
@Prop({ required: true }) readonly status!: BusinessStatuses | ||
|
||
get icon (): string { | ||
switch (this.status) { | ||
case BusinessStatuses.OK: return 'mdi-check' | ||
|
||
case BusinessStatuses.ERROR_AFFILIATION: | ||
case BusinessStatuses.ERROR_CCC_MISMATCH: | ||
case BusinessStatuses.ERROR_FOREIGN: | ||
case BusinessStatuses.ERROR_NIGS: return 'mdi-alert' | ||
|
||
default: return 'mdi-help' // should never happen | ||
} | ||
} | ||
|
||
get color (): string { | ||
switch (this.status) { | ||
case BusinessStatuses.OK: return 'success' | ||
|
||
case BusinessStatuses.ERROR_AFFILIATION: | ||
case BusinessStatuses.ERROR_CCC_MISMATCH: | ||
case BusinessStatuses.ERROR_FOREIGN: | ||
case BusinessStatuses.ERROR_NIGS: return 'warning' | ||
|
||
default: return 'gray7' // should never happen | ||
} | ||
} | ||
|
||
get text (): string { | ||
switch (this.status) { | ||
case BusinessStatuses.OK: return 'Ready' | ||
|
||
case BusinessStatuses.ERROR_AFFILIATION: | ||
case BusinessStatuses.ERROR_CCC_MISMATCH: | ||
case BusinessStatuses.ERROR_FOREIGN: | ||
case BusinessStatuses.ERROR_NIGS: return 'Attention Required' | ||
|
||
default: return 'Unknown' // should never happen | ||
} | ||
} | ||
|
||
get tooltip (): string { | ||
switch (this.status) { | ||
case BusinessStatuses.OK: | ||
return '' | ||
case BusinessStatuses.ERROR_AFFILIATION: | ||
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 BusinessStatuses.ERROR_CCC_MISMATCH: | ||
return 'A BC Community Contribution Company must amalgamate to form a new BC Community ' + | ||
'Contribution Company.' | ||
case BusinessStatuses.ERROR_FOREIGN: | ||
return 'A foreign corporation must not amalgamate with a limited company and continue as ' + | ||
'an unlimited liability company.' | ||
case BusinessStatuses.ERROR_NIGS: | ||
return 'This business is not in good standing. This filing cannot be submitted until all ' + | ||
'businesses are in good standing.' | ||
|
||
default: return null // should never happen | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
// @import '@/assets/styles/theme.scss'; | ||
|
||
.v-icon { | ||
margin-top: 3px; | ||
} | ||
</style> |
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.
See Vuetify theme declaration in main.ts.