Skip to content

Commit

Permalink
update confirm checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
deetz99 committed Oct 17, 2024
1 parent f51a872 commit 737ceee
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 8 deletions.
34 changes: 29 additions & 5 deletions strr-pm-web/app/components/form/platform/Review/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { completingParty, primaryRep, secondaryRep } = storeToRefs(useStrrPlatfor
const { platformBusiness } = storeToRefs(useStrrPlatformBusiness())
const { platformDetails } = storeToRefs(useStrrPlatformDetails())
const { agreeToSubmit } = storeToRefs(useStrrHostApplication())
const { confirmInfoAccuracy, confirmDelistAndCancelBookings } = storeToRefs(useStrrPlatformApplication())
defineProps<{ isComplete: boolean }>()
Expand Down Expand Up @@ -349,13 +349,37 @@ defineEmits<{
</div>
</ConnectPageSection>
<ConnectPageSection :heading="{ label: tReview('review') }">
<section class="space-y-6">
<h2>Certify</h2>
<UCheckbox
v-model="confirmInfoAccuracy"
:label="tPlatReview('confirm.infoAccuracy')"
class="rounded bg-white p-4"
:class="`${isComplete && !confirmInfoAccuracy ? 'outline outline-red-600' : ''}`"
/>
<UCheckbox
v-model="confirmDelistAndCancelBookings"
:label="tPlatReview('confirm.delistAndCancelBookings')"
class="rounded bg-white p-4"
:class="`${isComplete && !confirmDelistAndCancelBookings ? 'outline outline-red-600' : ''}`"
/>
</section>
<!-- <ConnectPageSection :heading="{ label: tReview('review') }">
<UCheckbox
v-model="agreeToSubmit"
v-model="confirmInfoAccuracy"
:label="tReview('confirm')"
class="p-4"
:class="`${isComplete && !agreeToSubmit ? 'outline outline-red-600' : ''}`"
:class="`${isComplete && !confirmInfoAccuracy ? 'outline outline-red-600' : ''}`"
/>
</ConnectPageSection>
<UCheckbox
v-model="confirmDelistAndCancelBookings"
:label="tReview('confirm')"
class="p-4"
:class="`${isComplete && !confirmDelistAndCancelBookings ? 'outline outline-red-600' : ''}`"
/>
</ConnectPageSection> -->
</div>
</template>
4 changes: 4 additions & 0 deletions strr-pm-web/app/locales/en-CA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,10 @@ export default {
GREATER_THAN_THOUSAND: 'Greater than 1,000 listings',
LESS_THAN_THOUSAND: 'Less than 1,000 listings'
}
},
confirm: {
infoAccuracy: '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.',
delistAndCancelBookings: 'I confirm agreement to delist and cancel existing bookings for unregistered listings as required under s. 17 (2) (a) and [relevant section of the forthcoming regulation].'
}
}
}
Expand Down
16 changes: 14 additions & 2 deletions strr-pm-web/app/pages/platform/application.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { t } = useI18n()
const { getContactSchema } = useStrrPlatformContact()
const { isCompletingPartyRep, completingParty, primaryRep, secondaryRep } = storeToRefs(useStrrPlatformContact())
const { submitPlatformApplication } = useStrrPlatformApplication()
// fee stuff
const { addReplaceFee, getFee, removeFee, setPlaceholderFilingTypeCode, setPlaceholderServiceFee } = useConnectFee()
Expand Down Expand Up @@ -125,6 +125,18 @@ const setPreviousStep = () => {
}
}
// something like this? need to discuss options
// how can we set loading state on the submit and pay button?
// i wonder if tracking the steps in a store would be useful
const handlePlatformSubmit = () => {
// validate each step
// if invalid step, set prop on Review component to highlight invalid fields/section ?
// show alert with some error text ?
// if all steps valid, submit form with store function
submitPlatformApplication()
}
watch(activeStepIndex, (val) => {
const buttons: ConnectBtnControlItem[] = []
if (val !== 0) {
Expand All @@ -142,7 +154,7 @@ watch(activeStepIndex, (val) => {
}
const isLastStep = val === steps.value.length - 1
buttons.push({
action: isLastStep ? () => console.log('submit and pay') : setNextStep,
action: isLastStep ? handlePlatformSubmit : setNextStep,
icon: 'i-mdi-chevron-right',
label: isLastStep ? t('btn.submitAndPay') : t('btn.next'),
trailing: true
Expand Down
7 changes: 6 additions & 1 deletion strr-pm-web/app/stores/platformApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ export const useStrrPlatformApplication = defineStore('strr/platformApplication'
}

// TODO: submit
function submitPlatformApplication () {
// eslint-disable-next-line
console.log('submitting platform app')
}

return {
confirmInfoAccuracy,
confirmDelistAndCancelBookings,
getPlatformApplication
getPlatformApplication,
submitPlatformApplication
}
})

0 comments on commit 737ceee

Please sign in to comment.