Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usability improvements #194

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: There should be a newline between template and style.

.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