Skip to content

Commit

Permalink
Merge pull request bcgov#53 from turb0c0w/sam/examiner-dash
Browse files Browse the repository at this point in the history
Fixing enum mapping logic
  • Loading branch information
Arash-IND authored Jul 15, 2024
2 parents c34bc87 + de47ffd commit 1b78bdc
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 17 deletions.
2 changes: 1 addition & 1 deletion strr-web/components/bcros/typography/H2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

<script setup lang="ts">
const t = useNuxtApp().$i18n.t
const { text, className, dataCy } = defineProps<{ text: string, className: string, dataCy?: string }>()
const { text, className, dataCy } = defineProps<{ text: string, className?: string, dataCy?: string }>()
</script>
25 changes: 10 additions & 15 deletions strr-web/pages/create-account-pre/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,12 @@ const {
const toggleAddSecondary = () => { addSecondaryContact.value = !addSecondaryContact.value }
const propertyToApiType = (type: string | undefined): string => {
switch (type) {
case (t('create-account.property-form.primaryDwelling')):
return 'PRIMARY'
case (t('create-account.property-form.secondarySuite')):
return 'SECONDARY'
case (t('create-account.property-form.accessory')):
return 'ACCESSORY'
case (t('create-account.property-form.float')):
return 'FLOAT_HOME'
case (t('create-account.property-form.other')):
return 'OTHER'
const tPropertyForm = (translationKey: string) => t(`create-account.property-form.${translationKey}`)
for (const key in propertyTypeMap) {
const propertyKey = propertyTypeMap[key as keyof PropertyTypeMapI]
if (type && tPropertyForm(propertyKey) === type) {
return key
}
}
return ''
}
Expand All @@ -126,8 +121,8 @@ const ownershipToApiType = (type: string | undefined): string => {
}
const submit = () => {
validateStep(contactSchema, formState.primaryContact, 0)
validateStep(contactSchema, formState.secondaryContact, 0)
validateStep(primaryContactSchema, formState.primaryContact, 0)
validateStep(secondaryContactSchema, formState.secondaryContact, 0)
validateStep(propertyDetailsSchema, formState.propertyDetails, 1)
steps[1].step.complete = true
steps[2].step.complete = true
Expand Down Expand Up @@ -159,11 +154,11 @@ const validateStep = (schema: any, state: any, index: number) => {
}
watch(formState.primaryContact, () => {
validateStep(contactSchema, formState.primaryContact, 0)
validateStep(primaryContactSchema, formState.primaryContact, 0)
})
watch(formState.secondaryContact, () => {
validateStep(contactSchema, formState.secondaryContact, 0)
validateStep(secondaryContactSchema, formState.secondaryContact, 0)
})
watch(formState.propertyDetails, () => {
Expand Down
3 changes: 2 additions & 1 deletion strr-web/pages/create-account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ const toggleAddSecondary = () => { addSecondaryContact.value = !addSecondaryCont
const propertyToApiType = (type: string | undefined): string => {
const tPropertyForm = (translationKey: string) => t(`create-account.property-form.${translationKey}`)
for (const key in propertyTypeMap) {
if (type && propertyTypeMap[key as keyof PropertyTypeMapI] === tPropertyForm(type)) {
const propertyKey = propertyTypeMap[key as keyof PropertyTypeMapI]
if (type && tPropertyForm(propertyKey) === type) {
return key
}
}
Expand Down
28 changes: 28 additions & 0 deletions strr-web/pages/registry-dashboard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<div>
<BcrosTypographyH1 text="My CEU STR Registry Dashboard" />
<BcrosTypographyH2 text="Owners STR Registration Applications" />
<div />
<div class="bg-white">
<div class="flex flex-row justify-between">
<div>
<UInput />
</div>
<div>
<USelect />
</div>
</div>
<UTable />
</div>
</div>
</template>

<script setup lang="ts">
// const t = useNuxtApp().$i18n.t
definePageMeta({
layout: 'wide-no-space'
})
</script>

0 comments on commit 1b78bdc

Please sign in to comment.