Skip to content

Commit

Permalink
- Added staff comments (#379)
Browse files Browse the repository at this point in the history
- Redirection for SP/GP filing from App.vue
  • Loading branch information
severinbeauvais authored Apr 15, 2022
1 parent 523ac4f commit c43a5c8
Show file tree
Hide file tree
Showing 9 changed files with 188 additions and 103 deletions.
201 changes: 113 additions & 88 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-create-ui",
"version": "3.5.15",
"version": "3.5.16",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand All @@ -24,7 +24,9 @@
"@bcrs-shared-components/effective-date-time": "1.0.2",
"@bcrs-shared-components/enums": "1.0.17",
"@bcrs-shared-components/interfaces": "1.0.32",
"@bcrs-shared-components/mixins": "1.0.6",
"@bcrs-shared-components/nature-of-business": "1.0.3",
"@bcrs-shared-components/staff-comments": "^1.2.0",
"@bcrs-shared-components/staff-payment": "2.0.1",
"@mdi/font": "^5.5.55",
"@sentry/browser": "^5.21.1",
Expand Down
4 changes: 1 addition & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,7 @@ export default class App extends Mixins(
switch (this.getFilingType) {
case FilingTypes.VOLUNTARY_DISSOLUTION:
if (this.isTypeSoleProp) {
// FUTURE: for Faiz to do
// this.$router.push(RouteNames.DISSOLUTION_FIRM).catch(() => {})
throw new Error('Dissolution filings for firms is not yet supported.') // go to catch()
this.$router.push(RouteNames.DISSOLUTION_FIRM).catch(() => {})
} else {
this.$router.push(RouteNames.DISSOLUTION_DEFINE_DISSOLUTION).catch(() => {})
}
Expand Down
28 changes: 20 additions & 8 deletions src/components/common/EntityInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@
<v-col cols="12" md="9">
<div v-show="isEntityType" id="entity-legal-name">
{{ legalName || getNumberedEntityName }}
</div>
</div>

<div id="entity-description">
{{ entityDescription }}
</div>

<div class="mt-5" />
<menu class="mt-5">
<!-- Staff Comments -->
<div class=" ml-n3" v-if="getBusinessId && isRoleStaff">
<StaffComments
:axios="axios"
:businessId="getBusinessId"
maxLength="2000"
:key="getBusinessId"
/>
</div>
</menu>
</v-col>

<v-col cols="12" md="3">
Expand All @@ -36,18 +46,15 @@
</template>

<script lang="ts">
// Libraries
import { Component, Mixins } from 'vue-property-decorator'
import { Getter } from 'vuex-class'
// Interfaces & enums
import { CorpTypeCd, FilingNames, FilingTypes } from '@/enums'
import { ContactPointIF, RegistrationStateIF } from '@/interfaces'
// Modules
import { EnumMixin } from '@/mixins'
import { StaffComments } from '@bcrs-shared-components/staff-comments'
import { axios } from '@/utils'
@Component({})
@Component({ components: { StaffComments } })
export default class EntityInfo extends Mixins(EnumMixin) {
@Getter getBusinessLegalName!: string
@Getter getBusinessContact!: ContactPointIF
Expand All @@ -64,6 +71,11 @@ export default class EntityInfo extends Mixins(EnumMixin) {
@Getter isIncorporationFiling!: boolean
@Getter isRegistrationFiling!: boolean
@Getter isTypeSoleProp!: boolean
@Getter getBusinessId!: string
@Getter isRoleStaff!: boolean
// axios for template
readonly axios = axios
/** The entity description. */
get entityDescription (): string {
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export * from './Registration/business-address-interface'
// NB: importing EmptyAddress doesn't work in local components
export {
BreadcrumbIF,
CommentIF,
ContactPointIF,
EffectiveDateTimeIF,
EmptyContactPoint,
Expand Down
16 changes: 16 additions & 0 deletions src/mixins/date-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,20 @@ export default class DateMixin extends Mixins(CommonMixin) {

return new Date(dateTimeString)
}

/**
* Converts an API datetime string (in UTC) to a date and time string (Month Day, Year at HH:MM am/pm
* Pacific time).
* @example "2021-01-01T00:00:00.000000+00:00" -> "Dec 31, 2020 at 04:00 pm Pacific time" (PST example)
* @example "2021-07-01T00:00:00.000000+00:00" -> "Jun 30, 2021 at 05:00 pm Pacific time" (PDT example)
*/
apiToPacificDateTime (dateTimeString: string): string {
if (!dateTimeString) return null // safety check

const date = this.apiToDate(dateTimeString)
const dateStr = this.dateToPacificDate(date)
const timeStr = this.dateToPacificTime(date)

return `${dateStr} at ${timeStr} Pacific time`
}
}
3 changes: 3 additions & 0 deletions src/mixins/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// External interfaces
export { FilingMixin } from '@bcrs-shared-components/mixins'

export { default as AddEditOrgPersonMixin } from './add-edit-org-person-mixin'
export { default as CommonMixin } from './common-mixin'
export { default as CurrencyLookupMixin } from '@/mixins/currency-lookup-mixin'
Expand Down
Loading

0 comments on commit c43a5c8

Please sign in to comment.