Skip to content

Commit

Permalink
Merge pull request bcgov#330 from dimak1/feat/update-details-page
Browse files Browse the repository at this point in the history
Update App & Reg Details pages
  • Loading branch information
dimak1 authored Nov 25, 2024
2 parents cd16ba5 + 9fcc173 commit 80c2395
Show file tree
Hide file tree
Showing 15 changed files with 419 additions and 476 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<script setup lang="ts">
const { t } = useTranslation()
const { header, contact } = defineProps<{
header: string,
contact: ContactI
}>()
const displayHostType = {
[HostContactTypeE.INDIVIDUAL]: t('createAccount.contactForm.hostTypeIndividual'),
[HostContactTypeE.BUSINESS]: t('createAccount.contactForm.hostTypeBusiness')
}
</script>

<template>
<div>
<h2 class="font-bold mb-6 mobile:mx-2 text-xl">
{{ header }}
</h2>
<div class="bg-white p-8 m:px-2 grid d:grid-cols-3 d:grid-rows-4 d:grid-flow-col">
<BcrosFormSectionReviewItem
:title="t('common.formLabels.hostType')"
:content="displayHostType[contact.contactType]"
data-test-id="contact-info-host-type"
/>
<BcrosFormSectionReviewItem
:title="t('common.formLabels.name')"
:content="displayContactFullName(contact.name)"
data-test-id="contact-info-name"
/>
<div class="grid grid-rows-subgrid row-span-2">
<BcrosFormSectionReviewItem
:title="t('common.formLabels.preferredName')"
:content="contact.details.preferredName || '-'"
data-test-id="contact-info-preferred-name"
/>
</div>
<BcrosFormSectionReviewItem
:title="t('common.formLabels.dateOfBirth')"
:content="convertDateToLongFormat(contact.dateOfBirth) || '-'"
/>
<BcrosFormSectionReviewItem
:title="t('common.formLabels.socialInsuranceNumber')"
:content="contact.socialInsuranceNumber || '-'"
/>
<BcrosFormSectionReviewItem
:title="t('common.formLabels.businessLegalName')"
:content="contact.businessLegalName || '-'"
/>
<BcrosFormSectionReviewItem
:title="t('common.formLabels.craBusinessNumber')"
:content="contact.businessNumber || '-'"
/>
<BcrosFormSectionReviewItem
:title="t('common.formLabels.phoneNumber')"
:content="displayPhoneAndExt(
contact.details.phoneNumber,
contact.details.extension) || '-'"
data-test-id="contact-info-phone"
/>
<BcrosFormSectionReviewItem
:title="t('common.formLabels.faxNumber')"
:content="displayFormattedPhone(contact.details.faxNumber) || '-'"
/>
<BcrosFormSectionReviewItem
:title="t('common.formLabels.emailAddress')"
:content="contact.details.emailAddress || '-'"
data-test-id="contact-info-email"
/>
<BcrosFormSectionReviewItem
:title="t('common.formLabels.mailingAddress')"
data-test-id="contact-info-address"
>
<!-- eslint-disable-next-line vue/no-v-html -->
<p v-html="displayFullAddress(contact.mailingAddress) || '-'" />
</BcrosFormSectionReviewItem>
</div>
</div>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const propertyAddressDetails = computed((): UnitAddressAPII => {
</div>
<BcrosFormSectionReviewItem
:title="tReview('isUnitOnPrincipalResidenceProperty')"
:content="propertyDetails.isUnitOnPrincipalResidenceProperty !== null
:content="propertyDetails.isUnitOnPrincipalResidenceProperty !== undefined
? tReview(String(propertyDetails.isUnitOnPrincipalResidenceProperty)) : '-'
"
/>
Expand Down
27 changes: 2 additions & 25 deletions strr-web/interfaces/account-i.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export interface OrgI {
export interface ContactI {
socialInsuranceNumber: string
businessNumber: string
businessLegalName: string
contactType: HostContactTypeE
dateOfBirth: string
details: {
emailAddress: string
Expand All @@ -79,33 +81,8 @@ export interface ContactI {
}
}

interface UserTermsI {
isTermsOfUseAccepted: boolean
termsOfUseAcceptedVersion: string
}

export interface ProfileI {
contacts: ContactI[]
created: string
firstname: string
id: number
idpUserid: string
keycloakGuid: string
lastname: string
loginSource: string
loginTime: string
modified: string
modifiedBy: string
type: string
userStatus: number
userTerms: UserTermsI
username: string
verified: boolean
}

export interface MeI {
orgs: OrgI[]
profile: ProfileI
settings: UserSettingsI[]
}

Expand Down
2 changes: 0 additions & 2 deletions strr-web/interfaces/terms-of-service-i.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export interface TermsOfServiceI {
isTermsOfUseAccepted: boolean
termsOfUseAcceptedVersion: string
termsOfUseCurrentVersion?: string
termsOfUse?: string
}
8 changes: 8 additions & 0 deletions strr-web/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
"formLabels": {
"hostType": "Host Type",
"contactName": "Contact Name",
"name": "Name",
"preferredName": "Preferred Name",
"dateOfBirth": "Date of Birth",
"socialInsuranceNumber": "Social Insurance Number",
"phoneNumber": "Phone Number",
"faxNumber": "Fax Number",
"emailAddress": "Email Address",
"mailingAddress": "Mailing Address",
"businessDetails": "Business Details",
"businessLegalName": "Business Legal Name",
"businessLegalNameOptional" : "Business Legal Name (Optional)",
Expand Down
2 changes: 1 addition & 1 deletion strr-web/pages/account-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const existingAccountsTitle = `${t('account.existingAccountSection.title')} (${u
onMounted(() => {
// if no sbc accounts navigate to sbc account creation
if (!me?.settings.length) {
if (!me?.orgs.length) {
goToCreateSbcAccount()
}
})
Expand Down
Loading

0 comments on commit 80c2395

Please sign in to comment.