Skip to content

Commit

Permalink
Merge pull request #135 from shaangill025/fix_22935
Browse files Browse the repository at this point in the history
UI - Display Correct Ownership Type Label
  • Loading branch information
shaangill025 authored Sep 10, 2024
2 parents b3bd935 + 65f945c commit 853251e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
4 changes: 3 additions & 1 deletion strr-web/components/bcros/form-section/review/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/>
<BcrosFormSectionReviewItem
:title="tReview('ownershipType')"
:content="formState.propertyDetails.ownershipType ?? '-'"
:content="getOwnershipTypeDisplay(formState.propertyDetails.ownershipType, tReview)"
/>
</div>
<div class="flex flex-row justify-between w-full desktop:mb-[24px] mobile:flex-col">
Expand Down Expand Up @@ -165,6 +165,8 @@
</template>

<script setup lang="ts">
import { getOwnershipTypeDisplay } from '@/utils/common'
const { t } = useTranslation()
const { secondaryContact, isComplete } = defineProps<{ secondaryContact: boolean, isComplete: boolean }>()
Expand Down
10 changes: 8 additions & 2 deletions strr-web/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@
"PROVISIONAL": "Provisional",
"SUBMITTED": "Submitted",
"PAID": "Paid",
"REJECTED": "Rejected"
"REJECTED": "Rejected",
"coOwner": "Co-own",
"owner": "Own",
"rent": "Rent"
},
"banner": {
"approve": "Approve",
Expand Down Expand Up @@ -301,7 +304,10 @@
"declaration": "Declaration",
"proof": "Proof of Principal Residence",
"listing": "Internet Listings",
"confirm": "I confirm that the information contained in the application for registration is accurate and true. I understand that, if I have provided inaccurate or false information, I may be the subject of enforcement action under Part 4 of the Short-Term Rental Accommodations Act. Enforcement action may include being ordered to pay an administrative penalty."
"confirm": "I confirm that the information contained in the application for registration is accurate and true. I understand that, if I have provided inaccurate or false information, I may be the subject of enforcement action under Part 4 of the Short-Term Rental Accommodations Act. Enforcement action may include being ordered to pay an administrative penalty.",
"coOwner": "Co-own",
"owner": "Own",
"rent": "Rent"
},
"details": {
"title": "Step 2 - Add Your Short Term Rental Property Details",
Expand Down
2 changes: 1 addition & 1 deletion strr-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "strr-web",
"version": "0.1.21",
"version": "0.1.22",
"description": "Short Term Rental Registration UI - Mono repo workspace",
"scripts": {
"preinstall": "npx only-allow pnpm",
Expand Down
3 changes: 2 additions & 1 deletion strr-web/pages/application-details/[id]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<p>{{ applicationDetails?.unitDetails.businessLicense ?? '-' }}</p>
</BcrosFormSectionReviewItem>
<BcrosFormSectionReviewItem :title="tApplicationDetails('ownership')">
<p>{{ applicationDetails?.unitDetails.ownershipType ?? '-' }}</p>
<p>{{ getOwnershipTypeDisplay(applicationDetails?.unitDetails.ownershipType, tApplicationDetails) }}</p>
</BcrosFormSectionReviewItem>
</div>
<div class="flex flex-row justify-between w-full mobile:flex-col">
Expand Down Expand Up @@ -211,6 +211,7 @@
<script setup lang="ts">
import FilingHistory from '~/components/FilingHistory.vue'
import { propertyTypeMap } from '~/utils/propertyTypeMap'
import { getOwnershipTypeDisplay } from '@/utils/common'
const route = useRoute()
const { t } = useTranslation()
Expand Down
12 changes: 12 additions & 0 deletions strr-web/utils/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const getOwnershipTypeDisplay = (ownershipType: string | null, t: (key: string) => string) => {
switch (ownershipType) {
case 'CO_OWN':
return t('coOwner')
case 'OWN':
return t('owner')
case 'RENT':
return t('rent')
default:
return ownershipType ?? '-'
}
}

0 comments on commit 853251e

Please sign in to comment.