From acfae34b19d52ecba05d903945756c07f235f9be Mon Sep 17 00:00:00 2001 From: Oliver Fritz Date: Tue, 23 Apr 2024 15:24:47 +0200 Subject: [PATCH 1/3] feat: remove home view and redirect to projects/sign in --- src/components/AppHeader.vue | 5 ----- src/i18n/locales/de.json | 6 ------ src/i18n/locales/en.json | 6 ------ src/router/index.ts | 5 ++--- src/views/HomeView.vue | 31 ------------------------------- 5 files changed, 2 insertions(+), 51 deletions(-) delete mode 100644 src/views/HomeView.vue diff --git a/src/components/AppHeader.vue b/src/components/AppHeader.vue index 00deb99..9cb25b1 100644 --- a/src/components/AppHeader.vue +++ b/src/components/AppHeader.vue @@ -12,11 +12,6 @@ export default defineComponent({ data() { return { menuItems: [ - { - href: '/', - icon: 'mdi-home', - name: 'home', - }, { href: '/projects', icon: 'mdi-link', diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index 37cdf49..46c6f8a 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -49,12 +49,6 @@ "signUp": "Registrieren", "signUpFailed": "Registrierung gescheitert" }, - "homeView": { - "title": "Willkommen bei der MapSwipe Web App!", - "text": "Als Teil des Missing Maps-Projekts ist {mapswipeLink} eine mobile App, die entwickelt wurde, um Kartendaten von einem Netzwerk globaler Freiwilliger zu sammeln. Es geht darum wichtige Infrastrukturen wie Gebäude und Straßen auf Satellitendaten und Luftbildern zu finden, Schäden zu kartieren oder Veränderungen zu erkennen. Neben der {mobileAppLink} steht nun auch eine Webanwendung (Beta-Version) zur Verfügung. Diese kann über einen Webbrowser auf dem Laptop, PC, Tablet oder Smartphone genutzen werden.{newline}{newline}Wenn Sie weitere Informationen benötigen oder Fragen zur MapSwipe Web-App haben, kontaktieren Sie gern das Team des {heigitLink}.", - "betaText": "Die Beta-Version der MapSwipe-Web-App dient dazu, Feedback von Nutzer*innen zu bekommen und Probleme zu medlen. Derzeit werden die gesammelten Kartierungsdaten nicht zur Unterstützung humanitärer Maßnahmen verwendet.", - "mobileApp": "mobilen App" - }, "languageSwitcher": { "switchLanguage": "Sprache wählen" }, diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 24ecf01..43de177 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -49,12 +49,6 @@ "signUp": "Sign up", "signUpFailed": "Sign-up failed" }, - "homeView": { - "title": "Welcome to the MapSwipe web app!", - "text": "As part of the Missing Map project, {mapswipeLink} was created to crowdsource map data from a network of global volunteers - just one swipe at a time. Individuals, volunteers from communities all over the world, can find crucial infrastructure such as buildings and roads, identify changes in areas. In addition to the {mobileAppLink}, volunteers can use the MapSwipe web app (beta) and start contributing right away through a web browser on multiple platforms like laptops, desktops, or mobiles.{newline}{newline}If you need more information or if you have requests related to the MapSwipe web app get in contact with the team at the {heigitLink}.", - "betaText": "The beta version of the MapSwipe web app is for submitting bugs, feature requests and other feedback. Currently, the collected mapping data won’t be used for supporting humanitarian response.", - "mobileApp": "mobile app" - }, "languageSwitcher": { "switchLanguage": "Switch Language" }, diff --git a/src/router/index.ts b/src/router/index.ts index 9f1ed69..c2899b4 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,5 +1,4 @@ import { createRouter, createWebHashHistory, RouterView } from 'vue-router' -import HomeView from '../views/HomeView.vue' import { getCurrentUser } from 'vuefire' import { default as Tr, i18nRoute } from '@/i18n/translation' @@ -10,7 +9,7 @@ const denyUnauthorized = async (to, from, next) => { if (currentUser?.emailVerified) { next() } else if (currentUser) { - next(i18nRoute({ name: 'home', params: { authTab: 'recover-account' } })) + next(i18nRoute({ name: 'authentification', params: { authTab: 'recover-account' } })) } else { next(i18nRoute({ name: 'authentication', params: { authTab: 'sign-in' } })) } @@ -28,7 +27,7 @@ const router = createRouter({ { path: '', name: 'home', - component: HomeView, + redirect: i18nRoute({ name: 'projects' }), }, { path: 'projects', diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue deleted file mode 100644 index bb8c742..0000000 --- a/src/views/HomeView.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - From 0409a877407dfc8beb7d7fdb0765512d25d01995 Mon Sep 17 00:00:00 2001 From: Oliver Fritz Date: Tue, 23 Apr 2024 15:28:37 +0200 Subject: [PATCH 2/3] fix: auth route name --- src/router/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/index.ts b/src/router/index.ts index c2899b4..489048d 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -9,7 +9,7 @@ const denyUnauthorized = async (to, from, next) => { if (currentUser?.emailVerified) { next() } else if (currentUser) { - next(i18nRoute({ name: 'authentification', params: { authTab: 'recover-account' } })) + next(i18nRoute({ name: 'authentication', params: { authTab: 'recover-account' } })) } else { next(i18nRoute({ name: 'authentication', params: { authTab: 'sign-in' } })) } From 3f4f8b426c9701fc4563b13f7c347fb9cef78e69 Mon Sep 17 00:00:00 2001 From: Oliver Fritz Date: Tue, 23 Apr 2024 16:19:47 +0200 Subject: [PATCH 3/3] fix: use alias instead of redirect --- src/components/AppHeader.vue | 2 +- src/router/index.ts | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/AppHeader.vue b/src/components/AppHeader.vue index 9cb25b1..6e10539 100644 --- a/src/components/AppHeader.vue +++ b/src/components/AppHeader.vue @@ -44,7 +44,7 @@ export default defineComponent({ @click.stop="drawer = !drawer" > - + diff --git a/src/router/index.ts b/src/router/index.ts index 489048d..fce60c6 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -24,14 +24,10 @@ const router = createRouter({ beforeEnter: Tr.routeMiddleware, meta: { title: appName }, children: [ - { - path: '', - name: 'home', - redirect: i18nRoute({ name: 'projects' }), - }, { path: 'projects', name: 'projects', + alias: '', // lazy-load component when the route is visited component: () => import('../views/ProjectsView.vue'), beforeEnter: denyUnauthorized,