From 14fb99da21ac50357a61ffab580d8d8ee8319f45 Mon Sep 17 00:00:00 2001 From: Sam Schantz Date: Tue, 25 Jun 2024 08:22:30 -0700 Subject: [PATCH 1/7] adding chip fix --- strr-web/components/bcros/chip/Chip.vue | 1 - strr-web/components/bcros/status-card/StatusCard.vue | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/strr-web/components/bcros/chip/Chip.vue b/strr-web/components/bcros/chip/Chip.vue index ca7159460..e487549cd 100644 --- a/strr-web/components/bcros/chip/Chip.vue +++ b/strr-web/components/bcros/chip/Chip.vue @@ -2,7 +2,6 @@
-
From b5f2cdd0668c75accc1162a3f14875db18a84387 Mon Sep 17 00:00:00 2001 From: Sam Schantz Date: Tue, 25 Jun 2024 08:41:36 -0700 Subject: [PATCH 2/7] adding route to create sbc --- .../ExistingAccountsList.vue | 5 ++-- strr-web/composables/useBcrosNavigate.ts | 4 +++ strr-web/pages/create-account.vue | 26 +++++++------------ 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/strr-web/components/bcros/existing-accounts-list/ExistingAccountsList.vue b/strr-web/components/bcros/existing-accounts-list/ExistingAccountsList.vue index 9385629e6..51fda6d7f 100644 --- a/strr-web/components/bcros/existing-accounts-list/ExistingAccountsList.vue +++ b/strr-web/components/bcros/existing-accounts-list/ExistingAccountsList.vue @@ -63,13 +63,12 @@ import { formState } from '@/stores/strr' const { accounts } = defineProps<{ accounts: OrgI[] }>() const t = useNuxtApp().$i18n.t -const { goToCreateAccount } = useBcrosNavigate() +const { goToCreateAccount, goToCreateSbcAccount } = useBcrosNavigate() const buttonText = t('account.existing-account-section.use-account-button') const createButtonAction = () => { - formState.selectedAccount = {} as OrgI - goToCreateAccount() + goToCreateSbcAccount() } const chooseButtonAction = (account: OrgI) => { diff --git a/strr-web/composables/useBcrosNavigate.ts b/strr-web/composables/useBcrosNavigate.ts index 5fe0218cb..7ba62231b 100644 --- a/strr-web/composables/useBcrosNavigate.ts +++ b/strr-web/composables/useBcrosNavigate.ts @@ -33,6 +33,9 @@ export const useBcrosNavigate = () => { function goToTransactions () { redirect(config.public.authWebURL + `account/${account.currentAccount.id}/settings/transactions`) } + function goToCreateSbcAccount () { + router.push('/finalization') + } function goToCreateAccount () { router.push('/create-account') } @@ -45,6 +48,7 @@ export const useBcrosNavigate = () => { goToBcrosHome, goToBcrosLogin, goToAccountInfo, + goToCreateSbcAccount, goToCreateAccount, goToEditProfile, goToSetupAccount, diff --git a/strr-web/pages/create-account.vue b/strr-web/pages/create-account.vue index b905b14bb..b4c862646 100644 --- a/strr-web/pages/create-account.vue +++ b/strr-web/pages/create-account.vue @@ -116,6 +116,9 @@ const ownershipToApiType = (type: string | undefined): string => { } const submit = () => { + validateStep(contactSchema, formState.primaryContact, 0) + validateStep(contactSchema, formState.secondaryContact, 1) + steps[2].step.complete = true formState.principal.agreeToSubmit ? submitCreateAccountForm( userFirstName, @@ -138,29 +141,20 @@ const setStepValid = (index: number, valid: boolean) => { steps[index].step.isValid = valid } +const validateStep = (schema: any, state: any, index: number) => { + steps[index].step.isValid = schema.safeParse(state).success +} + watch(formState.primaryContact, () => { - if (contactSchema.safeParse(formState.primaryContact).success) { - setStepValid(0, true) - } else { - setStepValid(0, false) - } + validateStep(contactSchema, formState.primaryContact, 0) }) watch(formState.secondaryContact, () => { - if (contactSchema.safeParse(formState.secondaryContact).success) { - setStepValid(0, true) - } else { - setStepValid(0, false) - } + validateStep(contactSchema, formState.secondaryContact, 0) }) watch(formState.propertyDetails, () => { - const parsed = propertyDetailsSchema.safeParse(formState.propertyDetails) - if (parsed.success) { - setStepValid(1, true) - } else { - setStepValid(1, false) - } + validateStep(propertyDetailsSchema, formState.propertyDetails, 1) }) const validateProofPage = () => { From 795ab4d0302531cdfe6571f2ad0afaca445f6d62 Mon Sep 17 00:00:00 2001 From: Sam Schantz Date: Tue, 25 Jun 2024 08:53:35 -0700 Subject: [PATCH 3/7] adding create button to mobile view --- .../bcros/form-section/principal-residence/Form.vue | 2 ++ strr-web/pages/application-status.vue | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/strr-web/components/bcros/form-section/principal-residence/Form.vue b/strr-web/components/bcros/form-section/principal-residence/Form.vue index 9420b1236..0592048a4 100644 --- a/strr-web/components/bcros/form-section/principal-residence/Form.vue +++ b/strr-web/components/bcros/form-section/principal-residence/Form.vue @@ -44,6 +44,7 @@ :options="exemptionReasons" option-attribute="key" class="w-full text-[16px]" + style="color: #1a202c; /* text-gray-900 */ dark:text-white; /* Override with dark mode text color */" aria-label="Exemption reason" @blur="(event: any, reason: string) => validateReason(reason, event)" @change="(reason: string) => validateReason(reason)" @@ -63,6 +64,7 @@ :options="otherExemptionReasons" option-attribute="key" class="w-full text-[16px]" + style="color: #1a202c; /* text-gray-900 */ dark:text-white; /* Override with dark mode text color */" aria-label="Other exemption reason" @blur="(event: any, reason: string) => validateOtherReason(reason, event)" @change="(reason: string) => validateOtherReason(reason)" diff --git a/strr-web/pages/application-status.vue b/strr-web/pages/application-status.vue index aec977641..078b57a02 100644 --- a/strr-web/pages/application-status.vue +++ b/strr-web/pages/application-status.vue @@ -66,10 +66,18 @@ +
+ +
diff --git a/strr-web/enums/alerts-e.ts b/strr-web/enums/alerts-e.ts index 5ce7bc979..fb49f3903 100644 --- a/strr-web/enums/alerts-e.ts +++ b/strr-web/enums/alerts-e.ts @@ -3,5 +3,6 @@ export enum AlertsFlavourE { INFO = 'info', WARNING = 'warning', SUCCESS = 'success', - MESSAGE = 'message' + MESSAGE = 'message', + APPLIED = 'pending' } diff --git a/strr-web/interfaces/registration-i.ts b/strr-web/interfaces/registration-i.ts index e262868db..38f9f7c47 100644 --- a/strr-web/interfaces/registration-i.ts +++ b/strr-web/interfaces/registration-i.ts @@ -10,6 +10,13 @@ export interface RegistrationAddressI { export interface RegistrationI { id: number, + invoices: { + 'invoice_id': number, + 'payment_account': string, + 'payment_completion_date': string, + 'payment_status_code': string, + 'registration_id': number + }[], listingDetails: { url: string }[], primaryContact: ContactI, principalResidence: PrincipalResidenceI, diff --git a/strr-web/lang/en.json b/strr-web/lang/en.json index c60fe7f1a..2f446fb2e 100644 --- a/strr-web/lang/en.json +++ b/strr-web/lang/en.json @@ -17,6 +17,8 @@ "APPROVED": "APPROVED", "MORE_INFO_NEEDED": "PROVISIONAL", "DENIED": "DENIED", + "applied": "Applied", + "payment-due": "Payment Due", "create": "Create New Registration", "my-app": "My Registration Application", "title": "My STR Registry Dashboard", diff --git a/strr-web/pages/application-status.vue b/strr-web/pages/application-status.vue index 078b57a02..902043075 100644 --- a/strr-web/pages/application-status.vue +++ b/strr-web/pages/application-status.vue @@ -29,7 +29,7 @@ `" > @@ -68,15 +68,16 @@
+ :text="tRegistrationStatus('create')" + :action="() => navigateTo('/create-account')" + icon="i-mdi-plus" + />
+ + diff --git a/strr-web/tailwind.config.ts b/strr-web/tailwind.config.ts index 706d01305..0949ee430 100644 --- a/strr-web/tailwind.config.ts +++ b/strr-web/tailwind.config.ts @@ -7,7 +7,7 @@ export default >{ d: { min: '1263px' }, m: { max: '1263px' }, desktop: { min: '1263px' }, - mobile: { max: '1263px' } + mobile: { max: '1262px' } }, extend: { height: { From 417605b71c5e97f62701d1d327a2592634ff5092 Mon Sep 17 00:00:00 2001 From: Sam Schantz Date: Tue, 25 Jun 2024 10:10:44 -0700 Subject: [PATCH 5/7] fixing layout issues --- .../components/bcros/status-card/StatusCard.vue | 1 + strr-web/layouts/wideGutters.vue | 13 +++++++++++++ strr-web/pages/application-status.vue | 10 +++------- 3 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 strr-web/layouts/wideGutters.vue diff --git a/strr-web/components/bcros/status-card/StatusCard.vue b/strr-web/components/bcros/status-card/StatusCard.vue index d623585d3..58857f5ec 100644 --- a/strr-web/components/bcros/status-card/StatusCard.vue +++ b/strr-web/components/bcros/status-card/StatusCard.vue @@ -3,6 +3,7 @@ :class=" ` ${single ? 'flex-1': ''} + w-full mb-[42px] mobile:mb-[24px] justify-between flex-col bg-white px-[30px] mobile:px-[8px] py-[22px] border-[2px] border-bcGovColor-hairlinesOnWhite diff --git a/strr-web/layouts/wideGutters.vue b/strr-web/layouts/wideGutters.vue new file mode 100644 index 000000000..a8b28517f --- /dev/null +++ b/strr-web/layouts/wideGutters.vue @@ -0,0 +1,13 @@ + diff --git a/strr-web/pages/application-status.vue b/strr-web/pages/application-status.vue index 902043075..28c46292c 100644 --- a/strr-web/pages/application-status.vue +++ b/strr-web/pages/application-status.vue @@ -15,14 +15,14 @@ class-name="mobile:hidden" /> -
+
- +
@@ -66,6 +71,7 @@ const activeStep: Ref = ref(steps[activeStepIndex.value]) const tPrincipalResidence = (translationKey: string) => t(`create-account.principal-residence.${translationKey}`) const contactForm = ref() const fee = ref() +const headerUpdateKey = ref(0) const { getFeeAmount } = useFees() @@ -117,8 +123,11 @@ const ownershipToApiType = (type: string | undefined): string => { const submit = () => { validateStep(contactSchema, formState.primaryContact, 0) - validateStep(contactSchema, formState.secondaryContact, 1) + validateStep(contactSchema, formState.secondaryContact, 0) + validateStep(propertyDetailsSchema, formState.propertyDetails, 1) + steps[1].step.complete = true steps[2].step.complete = true + headerUpdateKey.value++ formState.principal.agreeToSubmit ? submitCreateAccountForm( userFirstName, From ba8ae80219d90213e535b78eec56f1e7e98f8924 Mon Sep 17 00:00:00 2001 From: Sam Schantz Date: Tue, 25 Jun 2024 10:48:52 -0700 Subject: [PATCH 7/7] spacing --- strr-web/pages/application-status.vue | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/strr-web/pages/application-status.vue b/strr-web/pages/application-status.vue index 28c46292c..e14f42fe0 100644 --- a/strr-web/pages/application-status.vue +++ b/strr-web/pages/application-status.vue @@ -18,7 +18,7 @@
t(`registration-status.${translationKey}`) const { getRegistrations } = useRegistrations() -const registrations = ref() -registrations.value = await getRegistrations() +const registrations = ref<(RegistrationI | null)[]>() +const fetchedRegistrations = await getRegistrations() + +const addSpacingToRegistrations = (): (RegistrationI | null)[] => { + const spacedRegistrations: (RegistrationI | null)[] = [...fetchedRegistrations] + while (spacedRegistrations.length % 3 !== 0) { + spacedRegistrations.push(null) + } + return spacedRegistrations +} + +registrations.value = + fetchedRegistrations.length % 3 === 0 && + fetchedRegistrations.length !== 1 + ? fetchedRegistrations + : addSpacingToRegistrations() const getFlavour = (status: string, invoices: RegistrationI['invoices']): { alert: AlertsFlavourE, text: string } | undefined => {