From 03149c5a3649574573dec01fc5889d6d2a91d9a9 Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 7 Jan 2022 16:23:24 +0100 Subject: [PATCH 01/13] =?UTF-8?q?transactionCount=20fa=C3=B6se=20or=20tran?= =?UTF-8?q?sactionCount=20error=20text=20hide=20if=20transactionCount=20tr?= =?UTF-8?q?ue=20and=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/Pages/AccountOverview/GddTransactionList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue index 955a6adc1..52a66817a 100644 --- a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue +++ b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue @@ -7,7 +7,7 @@ {{ $t('error.no-transactionlist') }} -
+
{{ $t('error.empty-transactionlist') }}
From 3e7144f816aa05dc993d1c24aa4f50f7bd399819 Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 7 Jan 2022 21:36:19 +0100 Subject: [PATCH 02/13] test div.test-empty-transactionlist is empty --- .../views/Pages/AccountOverview/GddTransactionList.spec.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js b/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js index 55f65bee6..2c4b15e17 100644 --- a/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js +++ b/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js @@ -56,16 +56,14 @@ describe('GddTransactionList', () => { }) }) it('Transactions Array is empty, 0 transactions', () => { - expect(wrapper.find('div.test-empty-transactionlist').text()).toContain( - 'error.empty-transactionlist', - ) + expect(wrapper.find('div.test-empty-transactionlist').exists()).toBe(false) }) }) describe('without any properties', () => { it('renders text saying that there are error.empty-transactionlist ', () => { expect(wrapper.find('div.gdd-transaction-list').text()).toContain( - 'error.empty-transactionlist', + 'transaction.nullTransactions', ) }) it('renders text saying that there are no transaction.nullTransactions', () => { From 34e86a73186053eef1ba732b9febdc9a2bb0246d Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 10 Jan 2022 10:40:05 +0100 Subject: [PATCH 03/13] add href on profil settings change name --- frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue index 9f23c864d..9dbdd5c3d 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue @@ -3,7 +3,7 @@
- + {{ $t('settings.name.change-name') }} From ae2fd66eed521f039b5ec10ff68b955a83905105 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 10 Jan 2022 10:43:45 +0100 Subject: [PATCH 04/13] add href on profil settings change passwort --- .../src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue index 54ad39431..749f1f3ce 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue @@ -3,7 +3,7 @@
- + {{ $t('settings.password.change-password') }} From 6a25d1177c18b3be439b5dc394221f37a960e9d9 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 10 Jan 2022 10:59:09 +0100 Subject: [PATCH 05/13] add href on profil settings change language --- frontend/src/views/Pages/UserProfile/UserCard_Language.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/Pages/UserProfile/UserCard_Language.vue b/frontend/src/views/Pages/UserProfile/UserCard_Language.vue index b53d08189..de9af9994 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_Language.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_Language.vue @@ -3,7 +3,7 @@
- + {{ $t('settings.language.changeLanguage') }} From a3682a424ecea5343a12acd1ac0afea4c0b68c59 Mon Sep 17 00:00:00 2001 From: elweyn Date: Wed, 12 Jan 2022 11:52:30 +0100 Subject: [PATCH 06/13] Fix redirect to /logout, now redirects to the wallet login. --- admin/src/plugins/apolloProvider.js | 3 +-- admin/src/plugins/apolloProvider.test.js | 14 +++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/admin/src/plugins/apolloProvider.js b/admin/src/plugins/apolloProvider.js index 0e342b8fc..cde5408da 100644 --- a/admin/src/plugins/apolloProvider.js +++ b/admin/src/plugins/apolloProvider.js @@ -2,7 +2,6 @@ import { ApolloClient, ApolloLink, InMemoryCache, HttpLink } from 'apollo-boost' import VueApollo from 'vue-apollo' import CONFIG from '../config' import store from '../store/store' -import router from '../router/router' import i18n from '../i18n' const httpLink = new HttpLink({ uri: CONFIG.GRAPHQL_URI }) @@ -18,7 +17,7 @@ const authLink = new ApolloLink((operation, forward) => { if (response.errors && response.errors[0].message === '403.13 - Client certificate revoked') { response.errors[0].message = i18n.t('error.session-expired') store.dispatch('logout', null) - if (router.currentRoute.path !== '/logout') router.push('/logout') + window.location.assign(CONFIG.WALLET_URL) return response } const newToken = operation.getContext().response.headers.get('token') diff --git a/admin/src/plugins/apolloProvider.test.js b/admin/src/plugins/apolloProvider.test.js index e5f394e96..ab8b01f28 100644 --- a/admin/src/plugins/apolloProvider.test.js +++ b/admin/src/plugins/apolloProvider.test.js @@ -66,6 +66,11 @@ describe('apolloProvider', () => { path: '/overview', } + const windowLocationMock = jest.fn() + delete window.location + window.location = { + assign: windowLocationMock, + } // mock context const setContextMock = jest.fn() const getContextMock = jest.fn(() => { @@ -130,18 +135,13 @@ describe('apolloProvider', () => { describe('current route is not logout', () => { it('redirects to logout', () => { - expect(routerPushMock).toBeCalledWith('/logout') + expect(windowLocationMock).toBeCalledWith('http://localhost/vue/login') }) }) describe('current route is logout', () => { - beforeEach(() => { - jest.clearAllMocks() - router.currentRoute.path = '/logout' - }) - it('does not redirect to logout', () => { - expect(routerPushMock).not.toBeCalled() + expect(windowLocationMock).toBeCalledWith('http://localhost/vue/login') }) }) }) From 9d29c00ebbade58d71c0fd1a029a0b6f6c130322 Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 13 Jan 2022 08:58:26 +0100 Subject: [PATCH 07/13] Remove route from apolloProvider.test and changed the test that checks the redirect on wallet login. --- admin/src/plugins/apolloProvider.test.js | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/admin/src/plugins/apolloProvider.test.js b/admin/src/plugins/apolloProvider.test.js index ab8b01f28..637efd1be 100644 --- a/admin/src/plugins/apolloProvider.test.js +++ b/admin/src/plugins/apolloProvider.test.js @@ -4,12 +4,10 @@ import CONFIG from '../config' import VueApollo from 'vue-apollo' import store from '../store/store' -import router from '../router/router' import i18n from '../i18n' jest.mock('vue-apollo') jest.mock('../store/store') -jest.mock('../router/router') jest.mock('../i18n') jest.mock('apollo-boost', () => { @@ -59,13 +57,6 @@ describe('apolloProvider', () => { errors: [{ message: '403.13 - Client certificate revoked' }], } - // mock router - const routerPushMock = jest.fn() - router.push = routerPushMock - router.currentRoute = { - path: '/overview', - } - const windowLocationMock = jest.fn() delete window.location window.location = { @@ -133,16 +124,8 @@ describe('apolloProvider', () => { expect(storeDispatchMock).toBeCalledWith('logout', null) }) - describe('current route is not logout', () => { - it('redirects to logout', () => { - expect(windowLocationMock).toBeCalledWith('http://localhost/vue/login') - }) - }) - - describe('current route is logout', () => { - it('does not redirect to logout', () => { - expect(windowLocationMock).toBeCalledWith('http://localhost/vue/login') - }) + it('redirects to logout', () => { + expect(windowLocationMock).toBeCalledWith('http://localhost/vue/login') }) }) From 173a25dc3ac8489c4a8de26322081139dd312cd9 Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 13 Jan 2022 10:19:20 +0100 Subject: [PATCH 08/13] Removed href='#!' and replaced it with class='cursor-pointer' --- .../src/views/Pages/UserProfile/UserCard_FormUserData.vue | 5 ++++- .../views/Pages/UserProfile/UserCard_FormUserPasswort.vue | 5 ++++- frontend/src/views/Pages/UserProfile/UserCard_Language.vue | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue index 9dbdd5c3d..555e3e78b 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue @@ -3,7 +3,10 @@
- + {{ $t('settings.name.change-name') }} diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue index 749f1f3ce..7e993bc75 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue @@ -3,7 +3,10 @@
- + {{ $t('settings.password.change-password') }} diff --git a/frontend/src/views/Pages/UserProfile/UserCard_Language.vue b/frontend/src/views/Pages/UserProfile/UserCard_Language.vue index de9af9994..c10648efa 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_Language.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_Language.vue @@ -3,7 +3,10 @@
- + {{ $t('settings.language.changeLanguage') }} From 03c7d664c3d2e7ec4e7339a0525b725a8ea050ca Mon Sep 17 00:00:00 2001 From: elweyn Date: Fri, 14 Jan 2022 08:00:50 +0100 Subject: [PATCH 09/13] Changed href=#! to class cursor-pointer. --- .../src/views/Pages/UserProfile/UserCard_FormUserData.vue | 6 +++++- .../views/Pages/UserProfile/UserCard_FormUserPasswort.vue | 5 +++++ frontend/src/views/Pages/UserProfile/UserCard_Language.vue | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue index 555e3e78b..84f8b60df 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue @@ -133,4 +133,8 @@ export default { }, } - + diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue index 7e993bc75..e67304e02 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue @@ -94,3 +94,8 @@ export default { }, } + diff --git a/frontend/src/views/Pages/UserProfile/UserCard_Language.vue b/frontend/src/views/Pages/UserProfile/UserCard_Language.vue index c10648efa..dfaf6cf55 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_Language.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_Language.vue @@ -113,3 +113,8 @@ export default { }, } + From bea99f6904e9cae90fe9c17a9106e54a0b16bc76 Mon Sep 17 00:00:00 2001 From: elweyn Date: Fri, 14 Jan 2022 08:06:50 +0100 Subject: [PATCH 10/13] New login page is on localhost/login no vue anymore. --- admin/src/plugins/apolloProvider.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/src/plugins/apolloProvider.test.js b/admin/src/plugins/apolloProvider.test.js index 637efd1be..75e415901 100644 --- a/admin/src/plugins/apolloProvider.test.js +++ b/admin/src/plugins/apolloProvider.test.js @@ -125,7 +125,7 @@ describe('apolloProvider', () => { }) it('redirects to logout', () => { - expect(windowLocationMock).toBeCalledWith('http://localhost/vue/login') + expect(windowLocationMock).toBeCalledWith('http://localhost/login') }) }) From 151f497252b9f6bda4f16a18b4e464a21e38fa7f Mon Sep 17 00:00:00 2001 From: elweyn Date: Fri, 14 Jan 2022 08:47:07 +0100 Subject: [PATCH 11/13] Changed the logic of no transactions, sets -1 if error was thrown so that we dont have the error if no transactions are present. --- frontend/src/views/Layout/DashboardLayout_gdd.vue | 1 + .../views/Pages/AccountOverview/GddTransactionList.spec.js | 6 ++++++ .../src/views/Pages/AccountOverview/GddTransactionList.vue | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index bd3bd8e4c..40a6011d5 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -100,6 +100,7 @@ export default { }) .catch((error) => { this.pending = true + this.transactionCount = -1 this.$toasted.global.error(error.message) // what to do when loading balance fails? }) diff --git a/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js b/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js index 2c4b15e17..b116de9e8 100644 --- a/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js +++ b/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js @@ -61,6 +61,12 @@ describe('GddTransactionList', () => { }) describe('without any properties', () => { + beforeEach(async () => { + await wrapper.setProps({ + transactions: [], + transactionCount: -1, + }) + }) it('renders text saying that there are error.empty-transactionlist ', () => { expect(wrapper.find('div.gdd-transaction-list').text()).toContain( 'transaction.nullTransactions', diff --git a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue index 52a66817a..f6c046fe6 100644 --- a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue +++ b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue @@ -7,7 +7,7 @@ {{ $t('error.no-transactionlist') }}
-
+
{{ $t('error.empty-transactionlist') }}
@@ -134,7 +134,7 @@ :per-page="pageSize" :total-rows="transactionCount" > -
+
{{ $t('transaction.nullTransactions') }}
From 5b5d56e14f8f158b8d8543c9e4eca63774979b3b Mon Sep 17 00:00:00 2001 From: elweyn Date: Mon, 17 Jan 2022 10:28:49 +0100 Subject: [PATCH 12/13] Set container-fluid in the parent div over the row that has been changed to row-fluid. --- frontend/src/views/Pages/AccountOverview.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/Pages/AccountOverview.vue b/frontend/src/views/Pages/AccountOverview.vue index 5cb04d9f0..44062f4ec 100644 --- a/frontend/src/views/Pages/AccountOverview.vue +++ b/frontend/src/views/Pages/AccountOverview.vue @@ -1,7 +1,7 @@