Skip to content

Commit 398c86f

Browse files
authored
Remove HomeView in favor of TB Pro Appointment Landing Page + OIDC redirects (#1327)
* Add VITE_LANDING_PAGE_URL for external landing page * Guard auth required pages with a redirect to OIDC * Update HomeView to be a redirect handler instead * Remove waiting list footer link * Redirect /login user to /dashboard if already logged in * Fix tests for FooterBar
1 parent 177cf46 commit 398c86f

File tree

18 files changed

+68
-586
lines changed

18 files changed

+68
-586
lines changed

frontend/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# -- Frontend --
44
VITE_BASE_URL=localhost:8080
55
VITE_SHORT_BASE_URL=http://localhost:8080/user
6+
VITE_LANDING_PAGE_URL=http://stage.tb.pro/appointment
67
# Set true to activate polling for dev server
78
VITE_SERVER_WATCH_POLLING=
89
VITE_SERVER_WATCH_INTERVAL=

frontend/.env.prod.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ VITE_API_URL=appointment.tb.pro/api/v1/
33
VITE_BASE_URL=appointment.tb.pro
44
VITE_API_SECURE=true
55
VITE_SHORT_BASE_URL=apt.mt
6+
VITE_LANDING_PAGE_URL=http://tb.pro/appointment
67

78
# -- Sentry --
89
VITE_SENTRY_DSN=https://66f57328baac4929be7d62b77f41b510@o4505428107853824.ingest.sentry.io/4505428280279040

frontend/.env.stage.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ VITE_API_URL=appointment-stage.tb.pro/api/v1/
33
VITE_BASE_URL=appointment-stage.tb.pro
44
VITE_API_SECURE=true
55
VITE_SHORT_BASE_URL=stage.apt.mt
6+
VITE_LANDING_PAGE_URL=http://stage.tb.pro/appointment
67

78
# -- Sentry --
89
VITE_SENTRY_DSN=https://66f57328baac4929be7d62b77f41b510@o4505428107853824.ingest.sentry.io/4505428280279040

frontend/.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# -- Frontend --
44
VITE_BASE_URL=localhost:8080
55
VITE_SHORT_BASE_URL=localhost:8080/user
6+
VITE_LANDING_PAGE_URL=http://stage.tb.pro/appointment
67

78
# -- Backend API --
89
VITE_API_URL=localhost

frontend/src/App.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ const routeIsPublic = computed(
140140
const routeIsHome = computed(
141141
() => ['home'].includes(typeof route.name === 'string' ? route.name : ''),
142142
);
143+
const routeIsLogin = computed(
144+
() => ['login'].includes(typeof route.name === 'string' ? route.name : ''),
145+
);
143146
const routeHasModal = computed(
144147
() => ['login'].includes(typeof route.name === 'string' ? route.name : ''),
145148
);
@@ -310,8 +313,13 @@ onMounted(async () => {
310313
</script>
311314

312315
<template>
316+
<!-- Home page is actually just a redirect to another route -->
317+
<template v-if="routeIsHome || (routeIsLogin && isOidcAuth)">
318+
<router-view/>
319+
</template>
320+
313321
<!-- authenticated subscriber content -->
314-
<template v-if="router.hasRoute(route.name) && (user?.authenticated || routeIsPublic)">
322+
<template v-else-if="router.hasRoute(route.name) && (user?.authenticated || routeIsPublic)">
315323
<site-notification
316324
v-if="user?.authenticated && visibleNotification"
317325
:title="notificationTitle"
@@ -321,14 +329,14 @@ onMounted(async () => {
321329
</site-notification>
322330

323331
<!-- Desktop NavBar show / hide is handled in CSS land -->
324-
<nav-bar v-if="!(routeIsHome && !user?.authenticated)" :nav-items="navItems"/>
332+
<nav-bar :nav-items="navItems"/>
325333

326334
<!-- Mobile NavBar show / hide is handled in CSS land -->
327-
<nav-bar-mobile v-if="!(routeIsHome && !user?.authenticated)"/>
335+
<nav-bar-mobile />
328336

329337
<main
330338
:class="{
331-
'private-route': !routeIsHome && !routeIsPublic,
339+
'private-route': !routeIsPublic,
332340
'public-route': routeIsPublic && !routeHasModal,
333341
}"
334342
>
-104 KB
Binary file not shown.
-162 KB
Binary file not shown.
-151 KB
Binary file not shown.
-106 KB
Binary file not shown.

frontend/src/components/FooterBar.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const { authenticated: isAuthenticated } = storeToRefs(userStore);
1111
1212
const appointmentNotLoggedInNavItems = [
1313
{ route: '/login', i18nKey: 'logIn' },
14-
{ route: '/waiting-list', i18nKey: 'signUpForBeta' },
1514
];
1615
1716
const appointmentLoggedInNavItems = [

0 commit comments

Comments
 (0)