-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update info collection notice modal for strata * update unit number validation * update error modal text * remove alert on review step * handle payment due for strata * update todos in platform * update todos for hosts * remove alert on review step platforms * remove comment * fix nuxt config
- Loading branch information
Showing
20 changed files
with
196 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum HostActions { | ||
SUBMIT_PAYMENT = 'SUBMIT_PAYMENT' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,58 @@ | ||
export const getTodoApplication = (applicationPath: string, applicationInfo?: ApplicationHeader) => { | ||
import { HostActions } from '~/enums/host-actions' | ||
|
||
// TODO: host actions enums | ||
export const getTodoApplication = ( | ||
applicationPath: string, | ||
payRedirectPath: string, | ||
applicationInfo?: ApplicationHeader | ||
) => { | ||
// NOTE: even though this function is called within 'setup', useNuxtApp is required for the app context | ||
const { t } = useNuxtApp().$i18n | ||
return { | ||
title: t('strr.title.application'), | ||
// NOTE: currently this status could only ever be DRAFT as there is no review process for platforms | ||
subtitle: applicationInfo ? applicationInfo.status : undefined, | ||
button: { | ||
label: applicationInfo ? t('btn.resumeApplication') : t('btn.beginApplication'), | ||
action: () => { | ||
if (applicationInfo) { | ||
const localePath = useLocalePath() | ||
const todos = [] | ||
|
||
if (!applicationInfo) { | ||
todos.push({ | ||
title: t('strr.title.application'), | ||
subtitle: undefined, | ||
button: { | ||
label: t('btn.beginApplication'), | ||
action: async () => { | ||
if (applicationInfo) { | ||
await navigateTo(localePath(applicationPath)) | ||
} | ||
} | ||
} | ||
}) | ||
} else if (applicationInfo?.status === ApplicationStatus.DRAFT) { | ||
todos.push({ | ||
title: t('strr.title.application'), | ||
// NOTE: currently this status could only ever be DRAFT as there is no review process for platforms | ||
subtitle: applicationInfo.status, | ||
button: { | ||
label: t('btn.resumeApplication'), | ||
action: async () => { | ||
if (applicationInfo) { | ||
// pass application number so that the application form can load in the saved data | ||
useRouter().push({ | ||
path: useLocalePath()(applicationPath), | ||
query: { applicationId: applicationInfo.applicationNumber } | ||
}) | ||
} else { | ||
useRouter().push({ path: useLocalePath()(applicationPath) }) | ||
await navigateTo( | ||
{ path: localePath(applicationPath), query: { applicationId: applicationInfo.applicationNumber } } | ||
) | ||
} | ||
} | ||
} | ||
} | ||
}) | ||
} else if (applicationInfo?.hostActions.includes(HostActions.SUBMIT_PAYMENT)) { // TODO: handle other host actions | ||
const { handlePaymentRedirect } = useNavigate() | ||
todos.push({ | ||
title: t('label.completePayment'), | ||
subtitle: undefined, // TODO: add subtitle ? | ||
button: { | ||
label: t('label.payNow'), | ||
action: () => // TODO: how to complete payment for PAD accounts? | ||
handlePaymentRedirect(applicationInfo.paymentToken, payRedirectPath) | ||
} | ||
}) | ||
} | ||
|
||
return todos | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
strr-strata-web/app/components/modal/error/ApplicationSubmit.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<script setup lang="ts"> | ||
import { FetchError } from 'ofetch' | ||
const props = defineProps<{ | ||
error: unknown | ||
}>() | ||
const getErrorKey = () => { | ||
if (props.error instanceof FetchError) { | ||
const code = props.error.statusCode | ||
if (code) { | ||
if (code > 399 && code < 500) { | ||
return 'badRequest' | ||
} else if (code >= 500) { | ||
return 'internal' | ||
} | ||
} | ||
} | ||
return 'unknown' | ||
} | ||
const errorKey = getErrorKey() | ||
</script> | ||
<template> | ||
<ModalBase :actions="[{ label: $t('btn.close'), handler: () => useStrataModals().close() }]"> | ||
<div class="-mt-6 flex flex-col items-center gap-4 text-center"> | ||
<UIcon | ||
name="i-mdi-alert-circle-outline" | ||
class="size-8 text-red-500" | ||
/> | ||
<h2 class="text-xl font-semibold"> | ||
{{ $t(`modal.error.applicationSubmit.${errorKey}.title`) }} | ||
</h2> | ||
<p>{{ $t(`modal.error.applicationSubmit.${errorKey}.content`) }}</p> | ||
<ContactSTRR class="self-start text-left" /> | ||
</div> | ||
</ModalBase> | ||
</template> |
24 changes: 0 additions & 24 deletions
24
strr-strata-web/app/components/modal/help/RegisterStrataHotel.vue
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
strr-strata-web/app/components/modal/info/CollectionNotice.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.