From 996bc6b51c850b381932d8273c02cd11deb57286 Mon Sep 17 00:00:00 2001 From: deetz99 <73151365+deetz99@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:30:58 -0800 Subject: [PATCH] All - UI: New core layer update (#401) * update core layer version and base layer stuff * update host with changes from core layer * updates * updates * fix error.vue i18n stuff --- strr-base-web/app/assets/css/layout.css | 11 - .../app/components/connect/SystemBanner.vue | 46 - .../components/connect/form/certify/index.vue | 4 +- .../app/components/connect/typography/H1.vue | 8 - .../app/components/connect/typography/H2.vue | 8 - strr-base-web/app/composables/useNavigate.ts | 28 - .../app/composables/useStrrModals.ts | 4 +- strr-base-web/app/error.vue | 38 - strr-base-web/app/layouts/default.vue | 11 - strr-base-web/app/locales/en-CA.ts | 26 +- strr-base-web/app/pages/comingSoon.vue | 6 +- strr-base-web/app/pages/default.vue | 6 +- strr-base-web/app/plugins/pay-api.ts | 30 - strr-base-web/app/spa-loading-template.html | 41 - strr-base-web/app/utils/todoItems.ts | 2 +- strr-base-web/nuxt.config.ts | 10 +- strr-base-web/package.json | 2 +- strr-base-web/pnpm-lock.yaml | 8 +- strr-host-pm-web/app/app.config.ts | 12 + .../form/DefineYourRental/UnitDetails.vue | 2 +- .../UnitRequirements/Error.vue | 2 +- .../UnitRequirements/StrProhibited.vue | 2 +- .../UnitRequirements/StraaExempt.vue | 2 +- .../app/components/form/Review/Index.vue | 2 +- strr-host-pm-web/app/locales/en-CA.ts | 2 +- strr-host-pm-web/app/pages/application.vue | 2 +- .../pages/auth/account/choose-existing.vue | 9 +- .../app/pages/dashboard/index.vue | 2 +- strr-host-pm-web/package.json | 4 +- strr-host-pm-web/pnpm-lock.yaml | 8 +- strr-platform-web/app/app.config.ts | 12 + .../pages/auth/account/choose-existing.vue | 2 +- .../app/pages/platform/application.vue | 1 - .../app/pages/platform/dashboard.vue | 5 +- strr-platform-web/package.json | 6 +- strr-platform-web/pnpm-lock.yaml | 3563 +++++++++-------- strr-strata-web/app/app.config.ts | 12 + strr-strata-web/app/pages/application.vue | 2 +- strr-strata-web/package.json | 4 +- strr-strata-web/pnpm-lock.yaml | 8 +- 40 files changed, 1903 insertions(+), 2050 deletions(-) delete mode 100644 strr-base-web/app/assets/css/layout.css delete mode 100644 strr-base-web/app/components/connect/SystemBanner.vue delete mode 100644 strr-base-web/app/components/connect/typography/H1.vue delete mode 100644 strr-base-web/app/components/connect/typography/H2.vue delete mode 100644 strr-base-web/app/composables/useNavigate.ts delete mode 100644 strr-base-web/app/error.vue delete mode 100644 strr-base-web/app/layouts/default.vue delete mode 100644 strr-base-web/app/plugins/pay-api.ts delete mode 100644 strr-base-web/app/spa-loading-template.html diff --git a/strr-base-web/app/assets/css/layout.css b/strr-base-web/app/assets/css/layout.css deleted file mode 100644 index 9715eaf4..00000000 --- a/strr-base-web/app/assets/css/layout.css +++ /dev/null @@ -1,11 +0,0 @@ -.app-container { - @apply bg-gray-100 text-gray-700 min-h-[100vh] flex flex-col; -} - -.app-inner-container { - @apply max-w-bcGovLg w-full mx-auto px-4; -} - -.app-body { - @apply grow relative flex flex-col; -} diff --git a/strr-base-web/app/components/connect/SystemBanner.vue b/strr-base-web/app/components/connect/SystemBanner.vue deleted file mode 100644 index 36bf16a5..00000000 --- a/strr-base-web/app/components/connect/SystemBanner.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/strr-base-web/app/components/connect/form/certify/index.vue b/strr-base-web/app/components/connect/form/certify/index.vue index 554fa874..01551843 100644 --- a/strr-base-web/app/components/connect/form/certify/index.vue +++ b/strr-base-web/app/components/connect/form/certify/index.vue @@ -34,7 +34,7 @@ defineProps<{ class="py-5 first:pt-0 last:pb-8" > - - -defineProps<{ text: string, customClass?: string }>() - - - - {{ text }} - - diff --git a/strr-base-web/app/components/connect/typography/H2.vue b/strr-base-web/app/components/connect/typography/H2.vue deleted file mode 100644 index a515f4fc..00000000 --- a/strr-base-web/app/components/connect/typography/H2.vue +++ /dev/null @@ -1,8 +0,0 @@ - - - - {{ text }} - - diff --git a/strr-base-web/app/composables/useNavigate.ts b/strr-base-web/app/composables/useNavigate.ts deleted file mode 100644 index 1aa63f2f..00000000 --- a/strr-base-web/app/composables/useNavigate.ts +++ /dev/null @@ -1,28 +0,0 @@ -export const useNavigate = () => { - const accountStore = useConnectAccountStore() - const localePath = useLocalePath() - const config = useRuntimeConfig().public - - function redirect (url: string, params?: { [key: string]: string }, target = '_self') { - // get account id and set in params - const redirectURL = new URL(url) - const accountId = accountStore.currentAccount.id - if (accountId) { - redirectURL.searchParams.append('accountid', accountId.toString()) - } - for (const [key, value] of Object.entries(params ?? {})) { - redirectURL.searchParams.append(key, value) - } - // assume URL is always reachable - window.open(redirectURL, target) - } - - async function handlePaymentRedirect (paymentToken: number, redirectPath: string): Promise { - const returnUrl = encodeURIComponent(window.location.origin + localePath(redirectPath)) - const payUrl = config.paymentPortalUrl + paymentToken + '/' + returnUrl - - await navigateTo(payUrl, { external: true }) - } - - return { redirect, handlePaymentRedirect } -} diff --git a/strr-base-web/app/composables/useStrrModals.ts b/strr-base-web/app/composables/useStrrModals.ts index bd9959ac..d7f5e331 100644 --- a/strr-base-web/app/composables/useStrrModals.ts +++ b/strr-base-web/app/composables/useStrrModals.ts @@ -9,7 +9,7 @@ import { export const useStrrModals = () => { const modal = useModal() const t = useNuxtApp().$i18n.t - const { redirect } = useNavigate() + const { handleExternalRedirect } = useConnectNav() const accountStore = useConnectAccountStore() const config = useRuntimeConfig().public @@ -84,7 +84,7 @@ export const useStrrModals = () => { actions: [ { label: t('modal.changeAccountConfirm.leaveBtn'), - handler: () => redirect(config.registryHomeURL + 'dashboard') + handler: () => handleExternalRedirect(config.registryHomeURL + 'dashboard') }, { label: t('btn.cancel'), diff --git a/strr-base-web/app/error.vue b/strr-base-web/app/error.vue deleted file mode 100644 index 2c21b99a..00000000 --- a/strr-base-web/app/error.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - {{ $t(`page.error.${errorKey}.h1`) }} - - {{ $t(`page.error.${errorKey}.content`) }} - - - - diff --git a/strr-base-web/app/layouts/default.vue b/strr-base-web/app/layouts/default.vue deleted file mode 100644 index 125df2cc..00000000 --- a/strr-base-web/app/layouts/default.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/strr-base-web/app/locales/en-CA.ts b/strr-base-web/app/locales/en-CA.ts index 181e47d0..0ce3d863 100644 --- a/strr-base-web/app/locales/en-CA.ts +++ b/strr-base-web/app/locales/en-CA.ts @@ -342,18 +342,6 @@ export default { certificate: 'certificate' }, page: { - error: { - 404: { - title: 'Page Not Found - Short-Term Rental Registry', - h1: '404 Page Not Found', - content: 'This page could not be found or does not exist.' - }, - unknown: { - title: 'Unknown Error - Short-Term Rental Registry', - h1: 'Unknown Error', - content: 'An unknown error occured, please refresh the page or try again later.' - } - }, notFound: { h1: 'Page Not Found' }, @@ -519,5 +507,19 @@ export default { 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].' } } + }, + ConnectPage: { + error: { + 404: { + title: 'Page Not Found - Short-Term Rental Registry', + h1: '404 Page Not Found', + content: 'This page could not be found or does not exist.' + }, + unknown: { + title: 'Unknown Error - Short-Term Rental Registry', + h1: 'Unknown Error', + content: 'An unknown error occured, please refresh the page or try again later.' + } + } } } diff --git a/strr-base-web/app/pages/comingSoon.vue b/strr-base-web/app/pages/comingSoon.vue index 5dc1050e..ef6be4f5 100644 --- a/strr-base-web/app/pages/comingSoon.vue +++ b/strr-base-web/app/pages/comingSoon.vue @@ -6,9 +6,9 @@ useHead({ title: t('strr.title.comingSoon') }) -definePageMeta({ - path: '/comingSoon' -}) +// definePageMeta({ +// path: '/comingSoon' +// }) setBreadcrumbs([ { diff --git a/strr-base-web/app/pages/default.vue b/strr-base-web/app/pages/default.vue index bdd50ad2..b6b29f4f 100644 --- a/strr-base-web/app/pages/default.vue +++ b/strr-base-web/app/pages/default.vue @@ -6,9 +6,9 @@ useHead({ title: t('strr.title') }) -definePageMeta({ - path: '/' -}) +// definePageMeta({ +// path: '/' +// }) setBreadcrumbs([ { label: t('strr.title') } diff --git a/strr-base-web/app/plugins/pay-api.ts b/strr-base-web/app/plugins/pay-api.ts deleted file mode 100644 index 7cf2418b..00000000 --- a/strr-base-web/app/plugins/pay-api.ts +++ /dev/null @@ -1,30 +0,0 @@ -export default defineNuxtPlugin(() => { - const payApiUrl = useRuntimeConfig().public.payApiURL - const { $keycloak } = useNuxtApp() - const localePath = useLocalePath() - - const api = $fetch.create({ - baseURL: payApiUrl, - onRequest ({ options }) { - const headers = options.headers ||= {} - if (Array.isArray(headers)) { - headers.push(['Authorization', `Bearer ${$keycloak.token}`]) - } else if (headers instanceof Headers) { - headers.set('Authorization', `Bearer ${$keycloak.token}`) - } else { - headers.Authorization = `Bearer ${$keycloak.token}` - } - }, - async onResponseError ({ response }) { - if (response.status === 401) { - await navigateTo(localePath('/auth/login')) - } - } - }) - - return { - provide: { - payApi: api - } - } -}) diff --git a/strr-base-web/app/spa-loading-template.html b/strr-base-web/app/spa-loading-template.html deleted file mode 100644 index be959def..00000000 --- a/strr-base-web/app/spa-loading-template.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - \ No newline at end of file diff --git a/strr-base-web/app/utils/todoItems.ts b/strr-base-web/app/utils/todoItems.ts index ef1577c4..7457a1a9 100644 --- a/strr-base-web/app/utils/todoItems.ts +++ b/strr-base-web/app/utils/todoItems.ts @@ -40,7 +40,7 @@ export const getTodoApplication = ( } }) } else if (applicationInfo?.hostActions.includes(HostActions.SUBMIT_PAYMENT)) { // TODO: handle other host actions - const { handlePaymentRedirect } = useNavigate() + const { handlePaymentRedirect } = useConnectNav() todos.push({ title: t('label.completePayment'), subtitle: undefined, // TODO: add subtitle ? diff --git a/strr-base-web/nuxt.config.ts b/strr-base-web/nuxt.config.ts index 12d8c718..9c6d63a3 100644 --- a/strr-base-web/nuxt.config.ts +++ b/strr-base-web/nuxt.config.ts @@ -1,8 +1,8 @@ // https://nuxt.com/docs/api/configuration/nuxt-config -import { fileURLToPath } from 'url' -import { dirname, join } from 'path' +// import { fileURLToPath } from 'url' +// import { dirname, join } from 'path' -const currentDir = dirname(fileURLToPath(import.meta.url)) +// const currentDir = dirname(fileURLToPath(import.meta.url)) export default defineNuxtConfig({ devtools: { enabled: false }, @@ -34,9 +34,7 @@ export default defineNuxtConfig({ dirs: ['stores', 'composables', 'enums', 'interfaces', 'types', 'utils'] }, - css: [ - join(currentDir, './app/assets/css/layout.css') - ], + css: [], app: { head: { diff --git a/strr-base-web/package.json b/strr-base-web/package.json index 7e89dd0d..0a12966c 100644 --- a/strr-base-web/package.json +++ b/strr-base-web/package.json @@ -42,7 +42,7 @@ "vitest": "^1.6.0" }, "dependencies": { - "@daxiom/nuxt-core-layer-test": "^0.0.11", + "@daxiom/nuxt-core-layer-test": "^0.0.14", "@vuepic/vue-datepicker": "^9.0.3", "country-codes-list": "^1.6.11", "luxon": "^3.5.0", diff --git a/strr-base-web/pnpm-lock.yaml b/strr-base-web/pnpm-lock.yaml index 8672a317..08638f81 100644 --- a/strr-base-web/pnpm-lock.yaml +++ b/strr-base-web/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@daxiom/nuxt-core-layer-test': - specifier: ^0.0.11 - version: 0.0.11(nuxt@3.12.3)(pinia@2.1.7)(rollup@4.18.0)(typescript@5.5.3)(vite@5.3.3)(vue@3.4.31) + specifier: ^0.0.14 + version: 0.0.14(nuxt@3.12.3)(pinia@2.1.7)(rollup@4.18.0)(typescript@5.5.3)(vite@5.3.3)(vue@3.4.31) '@vuepic/vue-datepicker': specifier: ^9.0.3 version: 9.0.3(vue@3.4.31) @@ -645,8 +645,8 @@ packages: postcss-selector-parser: 6.1.0 dev: false - /@daxiom/nuxt-core-layer-test@0.0.11(nuxt@3.12.3)(pinia@2.1.7)(rollup@4.18.0)(typescript@5.5.3)(vite@5.3.3)(vue@3.4.31): - resolution: {integrity: sha512-2eK44vPM5SYNCCyM/xmrKKBris6KdbHPQf17ASW9ya7VDL8GonDRvWa+46RozinA+LlgPdKfhJMw2IWAgJ4ccQ==} + /@daxiom/nuxt-core-layer-test@0.0.14(nuxt@3.12.3)(pinia@2.1.7)(rollup@4.18.0)(typescript@5.5.3)(vite@5.3.3)(vue@3.4.31): + resolution: {integrity: sha512-ZsiU75SZZEAkwERroJjdoY0Ap2U0HZ5BRMjhGIl0d8R3qL6ML4tYy6EIAMbkLuiQFUMNhLJv8IY+FDmZv41JvA==} dependencies: '@iconify-json/mdi': 1.1.68 '@nuxt/content': 2.13.2(nuxt@3.12.3)(rollup@4.18.0)(vue@3.4.31) diff --git a/strr-host-pm-web/app/app.config.ts b/strr-host-pm-web/app/app.config.ts index 4ffff914..d5b4a242 100644 --- a/strr-host-pm-web/app/app.config.ts +++ b/strr-host-pm-web/app/app.config.ts @@ -18,6 +18,18 @@ export default defineAppConfig({ accountOptionsMenu: true } } + }, + plugin: { + authApi: { + errorRedirect: { + 401: '/auth/login' + } + }, + payApi: { + errorRedirect: { + 401: '/auth/login' + } + } } } }, diff --git a/strr-host-pm-web/app/components/form/DefineYourRental/UnitDetails.vue b/strr-host-pm-web/app/components/form/DefineYourRental/UnitDetails.vue index e3d560d5..32e4a9bd 100644 --- a/strr-host-pm-web/app/components/form/DefineYourRental/UnitDetails.vue +++ b/strr-host-pm-web/app/components/form/DefineYourRental/UnitDetails.vue @@ -127,7 +127,7 @@ onMounted(async () => { }" > - - + diff --git a/strr-host-pm-web/app/components/form/DefineYourRental/UnitRequirements/StrProhibited.vue b/strr-host-pm-web/app/components/form/DefineYourRental/UnitRequirements/StrProhibited.vue index 6699ed67..de83b7db 100644 --- a/strr-host-pm-web/app/components/form/DefineYourRental/UnitRequirements/StrProhibited.vue +++ b/strr-host-pm-web/app/components/form/DefineYourRental/UnitRequirements/StrProhibited.vue @@ -60,7 +60,7 @@ function handleContinueApp () { {{ $t('alert.strProhibited.description') }} - + diff --git a/strr-host-pm-web/app/components/form/DefineYourRental/UnitRequirements/StraaExempt.vue b/strr-host-pm-web/app/components/form/DefineYourRental/UnitRequirements/StraaExempt.vue index 739d72c0..2282862c 100644 --- a/strr-host-pm-web/app/components/form/DefineYourRental/UnitRequirements/StraaExempt.vue +++ b/strr-host-pm-web/app/components/form/DefineYourRental/UnitRequirements/StraaExempt.vue @@ -17,7 +17,7 @@ const localePath = useLocalePath() }" > - + diff --git a/strr-host-pm-web/app/components/form/Review/Index.vue b/strr-host-pm-web/app/components/form/Review/Index.vue index 336d643a..a17d02de 100644 --- a/strr-host-pm-web/app/components/form/Review/Index.vue +++ b/strr-host-pm-web/app/components/form/Review/Index.vue @@ -158,7 +158,7 @@ const getCompPartyName = computed(() => { > - - @@ -137,9 +137,10 @@ function handleAccountSwitch (id: string) { icon="i-mdi-chevron-right" trailing :block="isSmallScreen" - :to="$keycloak.tokenParsed.loginSource === LoginSource.BCSC - ? localePath('/auth/account/create-new') - : useConnectNav().createAccountUrl()" + :to="$keycloak.tokenParsed.loginSource === LoginSource.BCSC + ? localePath('/auth/account/create-new') + : useConnectNav().createAccountUrl() + " :external="$keycloak.tokenParsed.loginSource !== LoginSource.BCSC" :target="$keycloak.tokenParsed.loginSource === LoginSource.BCSC ? '_self' : '_blank'" /> diff --git a/strr-host-pm-web/app/pages/dashboard/index.vue b/strr-host-pm-web/app/pages/dashboard/index.vue index 88efc19d..1fbd23af 100644 --- a/strr-host-pm-web/app/pages/dashboard/index.vue +++ b/strr-host-pm-web/app/pages/dashboard/index.vue @@ -101,7 +101,7 @@ async function handleItemSelect (row: any) { - +
{{ $t(`page.error.${errorKey}.content`) }}
{{ $t('alert.strProhibited.description') }}