Skip to content

Commit

Permalink
Usability improvements: Submission intake form changes, Confirmation …
Browse files Browse the repository at this point in the history
…page changes-new routes & views
  • Loading branch information
sanjaytkbabu committed Nov 19, 2024
1 parent 03a9e93 commit 8e39184
Show file tree
Hide file tree
Showing 10 changed files with 242 additions and 126 deletions.
22 changes: 7 additions & 15 deletions frontend/src/components/housing/enquiry/EnquiryIntakeForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
FormAutosave
} from '@/components/form';
import CollectionDisclaimer from '@/components/housing/CollectionDisclaimer.vue';
import EnquiryIntakeConfirmation from '@/components/housing/enquiry/EnquiryIntakeConfirmation.vue';
import { Button, Card, Divider, useConfirm, useToast } from '@/lib/primevue';
import { enquiryService, submissionService } from '@/services';
import { useConfigStore } from '@/store';
Expand All @@ -41,7 +40,6 @@ const { enquiryId = undefined } = defineProps<{
const { getConfig } = storeToRefs(useConfigStore());
// State
const assignedActivityId: Ref<string | undefined> = ref(undefined);
const autoSaveRef: Ref<InstanceType<typeof FormAutosave> | null> = ref(null);
const editable: Ref<boolean> = ref(true);
const filteredProjectActivityIds: Ref<Array<string>> = ref([]);
Expand Down Expand Up @@ -117,7 +115,7 @@ async function confirmNext(data: any) {
function confirmSubmit(data: any) {
confirm.require({
message: 'Are you sure you wish to submit this form? Please review the form before submitting.',
message: 'Are you sure you wish to submit this form?',
header: 'Please confirm submission',
acceptLabel: 'Confirm',
rejectLabel: 'Cancel',
Expand Down Expand Up @@ -253,21 +251,19 @@ async function onSubmit(data: any) {
enquiryResponse = await enquiryService.submitDraft(data);
if (enquiryResponse.data.activityId && enquiryResponse.data.enquiryId) {
assignedActivityId.value = enquiryResponse.data.activityId;
formRef.value?.setFieldValue('activityId', enquiryResponse.data.activityId);
formRef.value?.setFieldValue('enquiryId', enquiryResponse.data.enquiryId);
// Update route query for refreshing
router.replace({
name: RouteName.HOUSING_ENQUIRY_INTAKE,
// Send confirmation email
emailConfirmation(enquiryResponse.data.activityId, enquiryResponse.data.enquiryId);
router.push({
name: RouteName.HOUSING_ENQUIRY_CONFIRMATION,
query: {
activityId: enquiryResponse.data.activityId,
enquiryId: enquiryResponse.data.enquiryId
}
});
// Send confirmation email
emailConfirmation(enquiryResponse.data.activityId, enquiryResponse.data.enquiryId);
} else {
throw new Error('Failed to retrieve correct enquiry draft data');
}
Expand Down Expand Up @@ -296,7 +292,7 @@ onBeforeMount(async () => {
</script>

<template>
<div v-if="!assignedActivityId">
<div>
<div class="mb-2 p-0">
<BackButton
:route-name="getBackButtonConfig.routeName"
Expand Down Expand Up @@ -521,10 +517,6 @@ onBeforeMount(async () => {
</div>
</Form>
</div>
<EnquiryIntakeConfirmation
v-else
:assigned-activity-id="assignedActivityId"
/>
</template>

<style scoped lang="scss">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { Message } from '@/lib/primevue';
import { RouteName } from '@/utils/enums/application';
// Props
const { assignedActivityId } = defineProps<{
const { assignedActivityId, assignedEnquiryId } = defineProps<{
assignedActivityId: string;
assignedEnquiryId: string;
}>();
</script>

Expand All @@ -19,13 +20,27 @@ const { assignedActivityId } = defineProps<{
>
Your assistance request has been successfully submitted.
</Message>
<h3>Confirmation ID: {{ assignedActivityId }}</h3>
<h3 class="inline-block mr-2">Confirmation ID:</h3>
<router-link
:to="{
name: RouteName.HOUSING_ENQUIRY_INTAKE,
query: { activityId: assignedActivityId, enquiryId: assignedEnquiryId }
}"
>
<span class="text-2xl">{{ assignedActivityId }}</span>
</router-link>
<div>
A Housing Navigator will review your submission and contact you. Your form has also been saved as draft, you can
find it in
A Housing Navigator will review your submission and contact you in 2 business days. Your form has also been saved
as draft, you can find it in
<router-link :to="{ name: RouteName.HOUSING_SUBMISSIONS }">My drafts and previous entries.</router-link>
Please check your email for the confirmation email and keep the confirmation ID for future reference
</div>
<div class="mt-4"><router-link :to="{ name: RouteName.HOUSING }">Back to Housing</router-link></div>
</div>
</template>

<style scoped lang="scss">
.inline-block {
display: inline-block;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const checkApplicantValuesValid = (
const confirmSubmit = () => {
confirm.require({
message: 'Are you sure you want to request assistance for this form? Please review this form before submitting.',
message: 'Are you sure you want to request assistance for this form?',
header: 'Please confirm assistance',
acceptLabel: 'Confirm',
rejectLabel: 'Cancel',
Expand Down

This file was deleted.

Loading

0 comments on commit 8e39184

Please sign in to comment.