From 4dcfb0a876b80353d0c1f478b95496a35f634186 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 7 Oct 2021 15:05:28 +0200 Subject: [PATCH 1/5] refactor: Links in Frontend --- frontend/src/routes/router.test.js | 14 ++++++++++++ frontend/src/routes/routes.js | 2 +- frontend/src/views/Pages/Register.vue | 21 +++++++++--------- .../src/views/Pages/RegisterCommunity.vue | 22 ++++++++++++------- .../views/Pages/RegisterSelectCommunity.vue | 12 ++++++---- 5 files changed, 47 insertions(+), 24 deletions(-) diff --git a/frontend/src/routes/router.test.js b/frontend/src/routes/router.test.js index 8b6fbf3b9..5e2e16005 100644 --- a/frontend/src/routes/router.test.js +++ b/frontend/src/routes/router.test.js @@ -131,6 +131,20 @@ describe('router', () => { }) }) + describe('register-community', () => { + it('loads the "registerCommunity" component', async () => { + const component = await routes.find((r) => r.path === '/register-community').component() + expect(component.default.name).toBe('registerCommunity') + }) + }) + + describe('select-community', () => { + it('loads the "registerSelectCommunity" component', async () => { + const component = await routes.find((r) => r.path === '/select-community').component() + expect(component.default.name).toBe('registerSelectCommunity') + }) + }) + describe('reset', () => { it('loads the "ResetPassword" component', async () => { const component = await routes.find((r) => r.path === '/reset/:optin').component() diff --git a/frontend/src/routes/routes.js b/frontend/src/routes/routes.js index 6bd1ac75d..71315da9e 100755 --- a/frontend/src/routes/routes.js +++ b/frontend/src/routes/routes.js @@ -36,7 +36,7 @@ const routes = [ path: '/thx/:comingFrom', component: () => import('../views/Pages/thx.vue'), beforeEnter: (to, from, next) => { - const validFrom = ['password', 'reset', 'register', 'community'] + const validFrom = ['password', 'reset', 'register'] if (!validFrom.includes(from.path.split('/')[1])) { next({ path: '/login' }) } else { diff --git a/frontend/src/views/Pages/Register.vue b/frontend/src/views/Pages/Register.vue index 43885e1c6..9210970ec 100755 --- a/frontend/src/views/Pages/Register.vue +++ b/frontend/src/views/Pages/Register.vue @@ -124,10 +124,11 @@
- - {{ $t('back') }} - - + + + {{ $t('back') }} + +
- - {{ $t('community.choose-another-community') }} - + + + {{ $t('community.choose-another-community') }} + +
diff --git a/frontend/src/views/Pages/RegisterCommunity.vue b/frontend/src/views/Pages/RegisterCommunity.vue index ca1305e87..9512edd1a 100644 --- a/frontend/src/views/Pages/RegisterCommunity.vue +++ b/frontend/src/views/Pages/RegisterCommunity.vue @@ -17,24 +17,30 @@ - - {{ $t('community.continue-to-registration') }} - + + + {{ $t('community.continue-to-registration') }} + +
- - {{ $t('community.choose-another-community') }} - + + + {{ $t('community.choose-another-community') }} + +
- {{ $t('back') }} + + {{ $t('back') }} +
@@ -44,7 +50,7 @@