Skip to content

Commit

Permalink
Hosts - UI: Doc and text updates (#374)
Browse files Browse the repository at this point in the history
* update doc validation

* remove unused component

* update host info collection notice

* moved app submit error modal into base layer

* remove unneeded i18n

* clear address when switching from lookup to manual search
  • Loading branch information
deetz99 authored Dec 11, 2024
1 parent 45191e0 commit d0533fb
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const getErrorKey = () => {
const errorKey = getErrorKey()
</script>
<template>
<ModalBase :actions="[{ label: $t('btn.close'), handler: () => useStrataModals().close() }]">
<ModalBase :actions="[{ label: $t('btn.close'), handler: () => useStrrModals().close() }]">
<div class="-mt-6 flex flex-col items-center gap-4 text-center">
<UIcon
name="i-mdi-alert-circle-outline"
Expand Down
14 changes: 5 additions & 9 deletions strr-base-web/app/composables/useStrrModals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import {
ModalBase,
ModalHelpRegisterStr,
ModalInfoCollectionNotice
ModalInfoCollectionNotice,
ModalErrorApplicationSubmit
} from '#components'

export const useStrrModals = () => {
Expand All @@ -13,14 +14,9 @@ export const useStrrModals = () => {
const accountStore = useConnectAccountStore()
const config = useRuntimeConfig().public

function openAppSubmitError (e: any) {
modal.open(ModalBase, {
error: {
title: 'Error submitting application', // need to come up with different error messages for different scenarios
description: 'Some description here.'
},
content: e.data?.message ?? undefined,
actions: [{ label: t('btn.close'), handler: () => close() }]
function openAppSubmitError (e: unknown) {
modal.open(ModalErrorApplicationSubmit, {
error: e
})
}

Expand Down
16 changes: 16 additions & 0 deletions strr-base-web/app/locales/en-CA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,22 @@ export default {
title: 'Information Collection Notice',
content: 'Any personal information required is collected to support the administration and enforcement of the {straAct}, under the authority of section 33(1) of that Act. Any questions about the collection of any information can be directed to the Executive Director of the Short-Term Rental Branch, at {email}.'
}
},
error: {
applicationSubmit: {
badRequest: {
title: 'Invalid Request',
content: 'There was an issue with the information submitted. Please review your input and try again.'
},
internal: {
title: 'Internal Server Error',
content: 'We encountered an issue processing your application. Please try again or come back later. If the problem persists, contact us.'
},
unknown: {
title: 'Unexpected Error',
content: 'An unexpected error occurred. Please refresh the page or try again later. If the problem persists, contact us.'
}
}
}
},
word: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function handleNewAddress () {
// clear autocomplete input errors and open manual input
function handleUseManual () {
unitAddressFormRef.value?.clear('address.street')
propStore.resetUnitAddress()
propStore.useManualAddressInput = true
}
Expand Down
4 changes: 0 additions & 4 deletions strr-host-pm-web/app/components/form/Review/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ const getCompPartyName = computed(() => {
<SummaryProperty />
</FormCommonReviewSection>
</ConnectPageSection>
<FormReviewProperty
:error="isSectionInvalid('rental-unit-address-form') || isSectionInvalid('unit-details-form')"
@edit="$emit('edit', 0)"
/>
<!-- step 2: Individuals and Businesses -->
<ConnectPageSection
:heading="{
Expand Down
24 changes: 0 additions & 24 deletions strr-host-pm-web/app/components/modal/help/RegisterStrataHotel.vue

This file was deleted.

26 changes: 26 additions & 0 deletions strr-host-pm-web/app/components/modal/info/CollectionNotice.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<ModalBase :title="$t('modal.info.collectionNotice.title')">
<div class="space-y-4">
<i18n-t keypath="modal.info.collectionNotice.content.p1" tag="p" scope="global">
<template #straAct>
<em class="italic">{{ $t('act.strrAccomodations') }}</em>
</template>

<template #fippaAct>
<em class="italic">{{ $t('act.fippa') }}</em>
</template>
</i18n-t>
<i18n-t keypath="modal.info.collectionNotice.content.p2" tag="p" scope="global">
<template #email>
<a
class="text-blue-500 underline"
href="mailto:[email protected]"
target="_blank"
>
[email protected]
</a>
</template>
</i18n-t>
</div>
</ModalBase>
</template>
23 changes: 9 additions & 14 deletions strr-host-pm-web/app/locales/en-CA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,20 +317,15 @@ export default {
learnMore: 'Learn More'
},
modal: {
helpRegisteringStrata: {
triggerBtn: 'Help with registering and managing short-term rentals',
title: 'Short Term Rental Help',
content: 'Help Text Here'
},
helpRegisterStrataHotel: {
triggerBtn: 'Help with registering a strata hotel',
title: 'Need Help?',
content: 'For more information on definitions and rules, refer to the {act} and the Short-Term Rental Accommodation Regulation, or visit the {link}. If you need help with registering your strata hotel, using the My STR Registry Dashboard, or resolving a technical issue, you can also contact us directly.'
},
infoCollectionNotice: {
triggerBtn: 'Information collection notice',
title: 'Information Collection Notice',
content: 'Any personal information required is collected to support the administration and enforcement of the {act}, under the authority of section 33(1) of that Act. Any questions about the collection of any information can be directed to the Executive Director of the Short-Term Rental Branch, at {link}.'
info: {
collectionNotice: {
triggerBtn: 'Information collection notice',
title: 'Information Collection Notice',
content: {
p1: 'This personal information is being collected by the Ministry of Housing and Municipal Affairs under s. 33(1) of the {straAct} and s. 33(2)(e) of the {fippaAct} for the purpose of registering a short-term rental offer.',
p2: 'The Ministry may share the information with the local government of the area in which the property where short-term rental accommodation services will be offered. If you have any questions about the collection of this personal information, please contact the Executive Director of the Short-Term Rental Branch, at {email}'
}
}
},
createAccount: {
triggerBtn: 'Help with setting up an account',
Expand Down
4 changes: 1 addition & 3 deletions strr-host-pm-web/app/pages/application.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,10 @@ const handleSubmit = async () => {
}
const isApplicationValid = formErrors.every(result => result.success === true)
console.info('is application valid: ', isApplicationValid, formErrors)
// console.info('is application valid: ', isApplicationValid, formErrors)
// if all steps valid, submit form with store function
if (isApplicationValid) {
console.info('Submit')
const { paymentToken, filingId, applicationStatus } = await submitApplication()
const redirectPath = `/dashboard/${filingId}`
if (applicationStatus === ApplicationStatus.PAYMENT_DUE) {
Expand Down
4 changes: 2 additions & 2 deletions strr-host-pm-web/app/stores/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const useDocumentStore = defineStore('host/document', () => {
label: t('label.localGovShortTermRentalBL')
})
}
if (reqs.isPrincipalResidenceRequired && exemptionReason !== PrExemptionReason.FARM_LAND) {
if (reqs.isPrincipalResidenceRequired && exemptionReason === undefined) {
const isPrValid = validatePrincipalResidenceDocuments()
docs.push({
isValid: isPrValid,
Expand Down Expand Up @@ -86,7 +86,7 @@ export const useDocumentStore = defineStore('host/document', () => {

docs.push(t('label.localGovShortTermRentalBL'))

if (exemptionReason !== PrExemptionReason.FARM_LAND) {
if (exemptionReason === undefined) {
docs.push(t('label.proofOfPr'))
}

Expand Down
2 changes: 1 addition & 1 deletion strr-host-pm-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "strr-host-pm-web",
"private": true,
"type": "module",
"version": "0.0.1",
"version": "0.0.2",
"scripts": {
"build-check": "nuxt build",
"build": "nuxt generate",
Expand Down
8 changes: 0 additions & 8 deletions strr-strata-web/app/composables/useStrataModals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,17 @@

import {
// ModalBase,
ModalErrorApplicationSubmit
} from '#components'

export const useStrataModals = () => {
const modal = useModal()
// const { t } = useI18n()

function openApplicationSubmitErrorModal (e: unknown) {
modal.open(ModalErrorApplicationSubmit, {
error: e
})
}

function close () {
modal.close()
}

return {
openApplicationSubmitErrorModal,
close
}
}
16 changes: 0 additions & 16 deletions strr-strata-web/app/locales/en-CA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,6 @@ export default {
p2: 'The Ministry may share the information with the local government of the area in which the strata-titled hotel or motel is located. If you have any questions about the collection of this personal information, please contact the Executive Director of the Short-Term Rental Branch, at {email}'
}
}
},
error: {
applicationSubmit: {
badRequest: {
title: 'Invalid Request',
content: 'There was an issue with the information submitted. Please review your input and try again.'
},
internal: {
title: 'Internal Server Error',
content: 'We encountered an issue processing your application. Please try again or come back later. If the problem persists, contact us.'
},
unknown: {
title: 'Unexpected Error',
content: 'An unexpected error occurred. Please refresh the page or try again later. If the problem persists, contact us.'
}
}
}
},
table: {
Expand Down
4 changes: 2 additions & 2 deletions strr-strata-web/app/pages/application.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ConnectStepper, FormReviewConfirm } from '#components'
const { t } = useI18n()
const localePath = useLocalePath()
const strataModal = useStrataModals()
const strrModal = useStrrModals()
const { handlePaymentRedirect } = useNavigate()
const { validateContact } = useStrrContactStore()
Expand Down Expand Up @@ -130,7 +130,7 @@ const handleStrataSubmit = async () => {
}
} catch (e) {
logFetchError(e, 'Error creating strata application')
strataModal.openApplicationSubmitErrorModal(e)
strrModal.openAppSubmitError(e)
} finally {
// set buttons back to non loading state
setButtonControl({
Expand Down
2 changes: 1 addition & 1 deletion strr-strata-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "strr-strata-web",
"private": true,
"type": "module",
"version": "0.0.11",
"version": "0.0.12",
"scripts": {
"build-check": "nuxt build",
"build": "nuxt generate",
Expand Down

0 comments on commit d0533fb

Please sign in to comment.