From 1626f28f2063d680c0c29d0d7da5d3634f34376a Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 10 Dec 2021 00:39:57 +0100 Subject: [PATCH 01/74] an incorrect login should always result in an error not in a request to reset the password --- frontend/src/views/Pages/Login.vue | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/frontend/src/views/Pages/Login.vue b/frontend/src/views/Pages/Login.vue index d5d3e25a4..0d51cc4c6 100755 --- a/frontend/src/views/Pages/Login.vue +++ b/frontend/src/views/Pages/Login.vue @@ -104,13 +104,8 @@ export default { this.$router.push('/overview') loader.hide() }) - .catch((error) => { - if (error.message.includes('No user with this credentials')) { - this.$toasted.global.error(this.$t('error.no-account')) - } else { - // : this.$t('error.no-email-verify') - this.$router.push('/reset/login') - } + .catch(() => { + this.$toasted.global.error(this.$t('error.no-account')) loader.hide() }) }, From 83a2269a42c413e68efd8d4c63e88464f526c389 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 10 Dec 2021 14:51:10 +0100 Subject: [PATCH 02/74] Update frontend/src/views/Pages/Login.vue Co-authored-by: Hannes Heine --- frontend/src/views/Pages/Login.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/Pages/Login.vue b/frontend/src/views/Pages/Login.vue index 0d51cc4c6..8364f15ab 100755 --- a/frontend/src/views/Pages/Login.vue +++ b/frontend/src/views/Pages/Login.vue @@ -104,8 +104,11 @@ export default { this.$router.push('/overview') loader.hide() }) - .catch(() => { + .catch((error) => { this.$toasted.global.error(this.$t('error.no-account')) + if (error.message.uncludes('User email not validated')) { + this.$router.push('/reset/login') + } loader.hide() }) }, From 508bb774def07ba8381d942b8e60523cadd7eb79 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Sat, 11 Dec 2021 06:17:45 +0100 Subject: [PATCH 03/74] Update Login.vue Correct own typo --- frontend/src/views/Pages/Login.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/Pages/Login.vue b/frontend/src/views/Pages/Login.vue index 8364f15ab..3f434268a 100755 --- a/frontend/src/views/Pages/Login.vue +++ b/frontend/src/views/Pages/Login.vue @@ -106,7 +106,7 @@ export default { }) .catch((error) => { this.$toasted.global.error(this.$t('error.no-account')) - if (error.message.uncludes('User email not validated')) { + if (error.message.includes('User email not validated')) { this.$router.push('/reset/login') } loader.hide() From 7b8426593eead482a43046ec50dd00f0e2b78267 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 13 Dec 2021 10:38:05 +0100 Subject: [PATCH 04/74] Test redirect when no password is present --- frontend/src/views/Pages/Login.spec.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/frontend/src/views/Pages/Login.spec.js b/frontend/src/views/Pages/Login.spec.js index 34175d8b3..9e8be9342 100644 --- a/frontend/src/views/Pages/Login.spec.js +++ b/frontend/src/views/Pages/Login.spec.js @@ -251,6 +251,25 @@ describe('Login', () => { it('toasts an error message', () => { expect(toastErrorMock).toBeCalledWith('error.no-account') }) + + describe('login fails with "User email not validated"', () => { + beforeEach(async () => { + apolloQueryMock.mockRejectedValue({ + message: 'User email not validated', + }) + wrapper = Wrapper() + jest.clearAllMocks() + await wrapper.find('input[placeholder="Email"]').setValue('user@example.org') + await wrapper.find('input[placeholder="form.password"]').setValue('1234') + await flushPromises() + await wrapper.find('form').trigger('submit') + await flushPromises() + }) + + it('redirects to /reset/login', () => { + expect(mockRouterPush).toBeCalledWith('/reset/login') + }) + }) }) }) }) From 7341515dad84839c62ac9694d33ebcec32139e54 Mon Sep 17 00:00:00 2001 From: elweyn Date: Mon, 13 Dec 2021 12:02:21 +0100 Subject: [PATCH 05/74] Send to /thx/login not /reset/login so the user get's a message to check to validate his account. --- frontend/src/views/Pages/Login.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/Pages/Login.vue b/frontend/src/views/Pages/Login.vue index 3f434268a..d7f09ea4c 100755 --- a/frontend/src/views/Pages/Login.vue +++ b/frontend/src/views/Pages/Login.vue @@ -107,7 +107,7 @@ export default { .catch((error) => { this.$toasted.global.error(this.$t('error.no-account')) if (error.message.includes('User email not validated')) { - this.$router.push('/reset/login') + this.$router.push('/thx/login') } loader.hide() }) From f1b28a640e5d27e2e51903165cec5a5fc10ad98b Mon Sep 17 00:00:00 2001 From: elweyn Date: Tue, 14 Dec 2021 08:09:47 +0100 Subject: [PATCH 06/74] In case where their is no password set now we need to send the user to a page to change his password. --- frontend/src/views/Pages/Login.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/views/Pages/Login.vue b/frontend/src/views/Pages/Login.vue index d7f09ea4c..4d2b75d2a 100755 --- a/frontend/src/views/Pages/Login.vue +++ b/frontend/src/views/Pages/Login.vue @@ -108,6 +108,8 @@ export default { this.$toasted.global.error(this.$t('error.no-account')) if (error.message.includes('User email not validated')) { this.$router.push('/thx/login') + } else if (error.message.includes('User has no password set yet')) { + this.$router.push('/reset/login') } loader.hide() }) From ab5baf00d4bb815f889bc6495b393e2aa40c035e Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 16 Dec 2021 17:06:02 +0100 Subject: [PATCH 07/74] unused elements removed --- admin/src/components/NavBar.vue | 22 +++++++++++++--------- admin/src/pages/Creation.vue | 1 - admin/src/pages/Overview.vue | 22 ---------------------- 3 files changed, 13 insertions(+), 32 deletions(-) diff --git a/admin/src/components/NavBar.vue b/admin/src/components/NavBar.vue index aaff9d61d..e99307f3e 100644 --- a/admin/src/components/NavBar.vue +++ b/admin/src/components/NavBar.vue @@ -1,30 +1,34 @@ diff --git a/admin/src/components/UserTable.vue b/admin/src/components/UserTable.vue index 01d3dc5ae..7560a0215 100644 --- a/admin/src/components/UserTable.vue +++ b/admin/src/components/UserTable.vue @@ -49,15 +49,34 @@ @@ -67,27 +86,30 @@ {{ type }} - - +
+ + +
+ import CreationFormular from '../components/CreationFormular.vue' import EditCreationFormular from '../components/EditCreationFormular.vue' +import ConfirmRegisterMailFormular from '../components/ConfirmRegisterMailFormular.vue' import { confirmPendingCreation } from '../graphql/confirmPendingCreation' export default { @@ -168,9 +191,11 @@ export default { components: { CreationFormular, EditCreationFormular, + ConfirmRegisterMailFormular, }, data() { return { + showCreationFormular: null, creationUserData: {}, overlay: false, overlayBookmarkType: '', @@ -187,6 +212,54 @@ export default { } }, methods: { + rowDetailsToogle(row, details) { + console.log('rowDetailsToogle row', row) + console.log('rowDetailsToogle details', details) + console.log('this.showCreationFormular', this.showCreationFormular) + + + // if ( this.showCreationFormular === false) { + // this.showCreationFormular = true + // return + // }else { + + if (details) { + row.toggleDetails() + this.showCreationFormular = null + + } + if (!details) { + row.toggleDetails() + this.showCreationFormular = true + if (this.$refs.showing_detals_true !== undefined) { + this.$refs.showing_detals_true.click() + + } + } + // } + }, + + rowDetailsToogleRegisterMail(row, details) { + console.log('rowDetailsToogleRegisterMail row', row) + console.log('rowDetailsToogleRegisterMail details', details) + console.log('this.showCreationFormular', this.showCreationFormular) + + if ( this.showCreationFormular === true) { + this.showCreationFormular = false + return + } + if (details) { + row.toggleDetails() + this.showCreationFormular === null + } + if (!details) { + row.toggleDetails() + this.showCreationFormular === false + if (this.$refs.showing_registermail_detals_true !== undefined) { + this.$refs.showing_registermail_detals_true.click() + } + } + }, overlayShow(bookmarkType, item) { this.overlay = true this.overlayBookmarkType = bookmarkType From bb703f9fa87cbdfd0b27ee8dbbc5d78110098361 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 19 Dec 2021 12:58:22 +0100 Subject: [PATCH 21/74] clean code from creation or confirm registermail formular --- admin/src/components/UserTable.vue | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/admin/src/components/UserTable.vue b/admin/src/components/UserTable.vue index 7560a0215..a6e6fa357 100644 --- a/admin/src/components/UserTable.vue +++ b/admin/src/components/UserTable.vue @@ -213,41 +213,24 @@ export default { }, methods: { rowDetailsToogle(row, details) { - console.log('rowDetailsToogle row', row) - console.log('rowDetailsToogle details', details) - console.log('this.showCreationFormular', this.showCreationFormular) - - - // if ( this.showCreationFormular === false) { - // this.showCreationFormular = true - // return - // }else { - if (details) { row.toggleDetails() this.showCreationFormular = null - } if (!details) { row.toggleDetails() this.showCreationFormular = true if (this.$refs.showing_detals_true !== undefined) { this.$refs.showing_detals_true.click() - } } - // } }, rowDetailsToogleRegisterMail(row, details) { - console.log('rowDetailsToogleRegisterMail row', row) - console.log('rowDetailsToogleRegisterMail details', details) - console.log('this.showCreationFormular', this.showCreationFormular) - - if ( this.showCreationFormular === true) { - this.showCreationFormular = false - return - } + if (this.showCreationFormular === true) { + this.showCreationFormular = false + return + } if (details) { row.toggleDetails() this.showCreationFormular === null From d13b341bae85dc3a0d1215a0a33da24a2a0915c3 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 19 Dec 2021 13:03:34 +0100 Subject: [PATCH 22/74] Switching between two form additions is clean --- admin/src/components/UserTable.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/admin/src/components/UserTable.vue b/admin/src/components/UserTable.vue index a6e6fa357..b597c5a1d 100644 --- a/admin/src/components/UserTable.vue +++ b/admin/src/components/UserTable.vue @@ -213,6 +213,10 @@ export default { }, methods: { rowDetailsToogle(row, details) { + if (this.showCreationFormular === false) { + this.showCreationFormular = true + return + } if (details) { row.toggleDetails() this.showCreationFormular = null @@ -233,11 +237,10 @@ export default { } if (details) { row.toggleDetails() - this.showCreationFormular === null + this.showCreationFormular = null } if (!details) { row.toggleDetails() - this.showCreationFormular === false if (this.$refs.showing_registermail_detals_true !== undefined) { this.$refs.showing_registermail_detals_true.click() } From 9bc71d1af02ea74dc3b44740ac35030a7a7aad63 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 19 Dec 2021 13:47:30 +0100 Subject: [PATCH 23/74] register mail send style and function added --- .../ConfirmRegisterMailFormular.vue | 36 ++++++++++++++++--- admin/src/components/UserTable.vue | 8 +++-- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/admin/src/components/ConfirmRegisterMailFormular.vue b/admin/src/components/ConfirmRegisterMailFormular.vue index 859cca881..c9ab36d18 100644 --- a/admin/src/components/ConfirmRegisterMailFormular.vue +++ b/admin/src/components/ConfirmRegisterMailFormular.vue @@ -1,7 +1,18 @@ @@ -10,12 +21,29 @@ // import { createPendingCreation } from '../graphql/createPendingCreation' export default { name: 'ConfirmRegisterMail', - props: {}, + props: { + email: { + type: String, + }, + dateLastSend: { + type: String, + }, + }, data() { return {} }, - methods: {}, - created() {}, + methods: { + sendRegisterMail() { + alert( + 'sende wiederholt den ConfirmText an die register E-Mail (' + this.email + ') des User!', + ) + }, + }, } + diff --git a/admin/src/components/UserTable.vue b/admin/src/components/UserTable.vue index 848731a24..8ec9e0f60 100644 --- a/admin/src/components/UserTable.vue +++ b/admin/src/components/UserTable.vue @@ -82,11 +82,10 @@