From d5ba30df6fe5de0ee8bc395a1bc702e53df07c1a Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Fri, 30 Apr 2021 15:34:52 +0200 Subject: [PATCH 1/9] renamed KontoOverview to AccountOverview. Moved AccountOverview folder into Pages folder --- frontend/src/routes/routes.js | 2 +- .../{KontoOverview.spec.js => AccountOverview.spec.js} | 6 +++--- .../views/Pages/{KontoOverview.vue => AccountOverview.vue} | 6 +++--- .../AccountOverview}/GddAddWork2.vue | 0 .../{KontoOverview => Pages/AccountOverview}/GddSend.vue | 2 +- .../AccountOverview}/GddStatus.spec.js | 0 .../{KontoOverview => Pages/AccountOverview}/GddStatus.vue | 0 .../{KontoOverview => Pages/AccountOverview}/GddTable.vue | 2 +- .../AccountOverview}/GddWorkTable.vue | 0 frontend/src/views/Pages/UserProfileActivity.vue | 4 ++-- frontend/src/views/Pages/UserProfileTransactionList.vue | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) rename frontend/src/views/Pages/{KontoOverview.spec.js => AccountOverview.spec.js} (92%) rename frontend/src/views/Pages/{KontoOverview.vue => AccountOverview.vue} (89%) rename frontend/src/views/{KontoOverview => Pages/AccountOverview}/GddAddWork2.vue (100%) rename frontend/src/views/{KontoOverview => Pages/AccountOverview}/GddSend.vue (99%) rename frontend/src/views/{KontoOverview => Pages/AccountOverview}/GddStatus.spec.js (100%) rename frontend/src/views/{KontoOverview => Pages/AccountOverview}/GddStatus.vue (100%) rename frontend/src/views/{KontoOverview => Pages/AccountOverview}/GddTable.vue (98%) rename frontend/src/views/{KontoOverview => Pages/AccountOverview}/GddWorkTable.vue (100%) diff --git a/frontend/src/routes/routes.js b/frontend/src/routes/routes.js index cb1e0eeba..236cc15af 100755 --- a/frontend/src/routes/routes.js +++ b/frontend/src/routes/routes.js @@ -9,7 +9,7 @@ const routes = [ }, { path: '/overview', - component: () => import('../views/Pages/KontoOverview.vue'), + component: () => import('../views/Pages/AccountOverview.vue'), meta: { requiresAuth: true, }, diff --git a/frontend/src/views/Pages/KontoOverview.spec.js b/frontend/src/views/Pages/AccountOverview.spec.js similarity index 92% rename from frontend/src/views/Pages/KontoOverview.spec.js rename to frontend/src/views/Pages/AccountOverview.spec.js index b0385cbc3..676ccc433 100644 --- a/frontend/src/views/Pages/KontoOverview.spec.js +++ b/frontend/src/views/Pages/AccountOverview.spec.js @@ -1,9 +1,9 @@ import { shallowMount } from '@vue/test-utils' -import KontoOverview from './KontoOverview' +import AccountOverview from './AccountOverview' const localVue = global.localVue -describe('KontoOverview', () => { +describe('AccountOverview', () => { let wrapper let mocks = { @@ -11,7 +11,7 @@ describe('KontoOverview', () => { } const Wrapper = () => { - return shallowMount(KontoOverview, { localVue, mocks }) + return shallowMount(AccountOverview, { localVue, mocks }) } describe('shallow Mount', () => { diff --git a/frontend/src/views/Pages/KontoOverview.vue b/frontend/src/views/Pages/AccountOverview.vue similarity index 89% rename from frontend/src/views/Pages/KontoOverview.vue rename to frontend/src/views/Pages/AccountOverview.vue index e05a6236d..f756ba9bf 100644 --- a/frontend/src/views/Pages/KontoOverview.vue +++ b/frontend/src/views/Pages/AccountOverview.vue @@ -24,9 +24,9 @@ - From c62faf0d8661c8c50d387be310c80456e3030702 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 4 May 2021 15:28:14 +0200 Subject: [PATCH 3/9] use dynamic balance in user profile --- frontend/src/views/Pages/UserProfile/UserCard.vue | 5 ++++- frontend/src/views/Pages/UserProfileCard.vue | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/Pages/UserProfile/UserCard.vue b/frontend/src/views/Pages/UserProfile/UserCard.vue index 9282dd574..b14670e21 100755 --- a/frontend/src/views/Pages/UserProfile/UserCard.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard.vue @@ -36,7 +36,7 @@
- {{ $n(this.$store.state.user.balance) }} + {{ $n(balance) }} GDD
@@ -60,6 +60,9 @@ export default { components: { VueQrcode, }, + props: { + balance: { type: Number, default: 0 }, + }, } diff --git a/frontend/src/views/Pages/UserProfileCard.vue b/frontend/src/views/Pages/UserProfileCard.vue index 161bb30a0..882b52e78 100644 --- a/frontend/src/views/Pages/UserProfileCard.vue +++ b/frontend/src/views/Pages/UserProfileCard.vue @@ -7,7 +7,7 @@ - + @@ -20,6 +20,9 @@ export default { components: { UserCard, }, + props: { + balance: { type: Number, default: 0 }, + }, } From 5336742c1791cc921c5cbbb26ad1c28e3b2a7464 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 4 May 2021 19:02:18 +0200 Subject: [PATCH 4/9] fixed bug_report.md issue template - comment not closed --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 08e03c5b7..c7d06fcbe 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -6,4 +6,4 @@ title: 🐛 [Bug] --- ## 🐛 Bugreport - From 46bf1e2e936fcfbb2794943856438df3ab001652 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 5 May 2021 09:11:07 +0200 Subject: [PATCH 5/9] THX changed to Thank you --- frontend/src/locales/de.json | 4 ++-- frontend/src/locales/en.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index e3868124c..4859a3422 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -42,8 +42,8 @@ "scann_code":"QR Code Scanner - Scanne den QR Code deines Partners", "max_gdd_info":"maximale anzahl GDD zum versenden erreicht!", "send_check":"Bestätige deine Zahlung. Prüfe bitte nochmal alle Daten!", - "thx":"Danke!", - "send_success":"Deine Zahlung wurde erfolgreich versendet." + "thx":"Danke, ", + "send_success":"deine Transaktion wurde erfolgreich ausgeführt" }, "transaction":{ "show_part": "Die letzten {count} Transaktionen", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 521f68f0d..802a4af31 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -42,8 +42,8 @@ "scann_code":"QR Code Scanner - Scanne den QR Code deines Partners", "max_gdd_info":"maximale anzahl GDD zum versenden erreicht!", "send_check":"Bestätige deine Zahlung. Prüfe bitte nochmal alle Daten!", - "thx":"THX", - "send_success":"Deine Zahlung wurde erfolgreich versendet." + "thx":"Thank you, ", + "send_success":"your transaction was successfully completed" }, "transaction":{ "show_part": "The last {count} transactions", From 54c96657926fa343cba04a8e62ecc9d8300c7aed Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 5 May 2021 15:45:11 +0200 Subject: [PATCH 6/9] transactionslist load and icon --- frontend/src/locales/de.json | 2 +- frontend/src/locales/en.json | 2 +- .../src/views/KontoOverview/GddStatus.vue | 3 +- frontend/src/views/KontoOverview/GddTable.vue | 49 ++++++++------- .../src/views/Layout/DashboardLayout_gdd.vue | 63 ++++++++++++++++--- .../src/views/Pages/KontoOverview.spec.js | 4 +- frontend/src/views/Pages/KontoOverview.vue | 19 +++--- .../Pages/UserProfileTransactionList.vue | 17 ++++- 8 files changed, 112 insertions(+), 47 deletions(-) diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index e3868124c..0fd68c060 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -46,8 +46,8 @@ "send_success":"Deine Zahlung wurde erfolgreich versendet." }, "transaction":{ - "show_part": "Die letzten {count} Transaktionen", "show_all":"Alle {count} Transaktionen ansehen", + "nullTransactions":"Du hast noch keine Transaktionen auf deinem Konto.", "more": "mehr" }, "site": { diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 521f68f0d..f734e75ee 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -47,7 +47,7 @@ }, "transaction":{ "show_part": "The last {count} transactions", - "show_all":"View all {count} transactions", + "nullTransactions":"You don't have any transactions on your account yet.", "more": "more" }, "site": { diff --git a/frontend/src/views/KontoOverview/GddStatus.vue b/frontend/src/views/KontoOverview/GddStatus.vue index 87a06dfb6..ba4c64e68 100644 --- a/frontend/src/views/KontoOverview/GddStatus.vue +++ b/frontend/src/views/KontoOverview/GddStatus.vue @@ -1,6 +1,6 @@ diff --git a/frontend/src/views/Pages/KontoOverview.spec.js b/frontend/src/views/Pages/KontoOverview.spec.js index b0385cbc3..3cb3b8271 100644 --- a/frontend/src/views/Pages/KontoOverview.spec.js +++ b/frontend/src/views/Pages/KontoOverview.spec.js @@ -35,8 +35,8 @@ describe('KontoOverview', () => { expect(wrapper.find('gdd-table-stub').exists()).toBeTruthy() }) - it('updates transctions data when change-transactions is emitted', async () => { - wrapper.find('gdd-table-stub').vm.$emit('change-transactions', [0, 1]) + it('updates transctions data when update-transactions is emitted', async () => { + wrapper.find('gdd-table-stub').vm.$emit('update-transactions', [0, 1]) await wrapper.vm.$nextTick() expect(wrapper.vm.transactions).toEqual(expect.arrayContaining([0, 1])) }) diff --git a/frontend/src/views/Pages/KontoOverview.vue b/frontend/src/views/Pages/KontoOverview.vue index e05a6236d..52b9f832b 100644 --- a/frontend/src/views/Pages/KontoOverview.vue +++ b/frontend/src/views/Pages/KontoOverview.vue @@ -2,11 +2,7 @@
- +

@@ -32,13 +28,16 @@ export default { name: 'Overview', data() { return { - transactions: [], showTransactionList: true, } }, props: { balance: { type: Number, default: 0 }, GdtBalance: { type: Number, default: 0 }, + + transactions: { + default: [], + }, }, components: { GddStatus, @@ -52,8 +51,8 @@ export default { updateBalance(data) { this.$emit('update-balance', data.ammount) }, - setTransactions(transactions) { - this.transactions = transactions + updateTransactions() { + this.$emit('update-transactions') }, }, } diff --git a/frontend/src/views/Pages/UserProfileTransactionList.vue b/frontend/src/views/Pages/UserProfileTransactionList.vue index 2033a189a..7b4ad2ccc 100644 --- a/frontend/src/views/Pages/UserProfileTransactionList.vue +++ b/frontend/src/views/Pages/UserProfileTransactionList.vue @@ -7,19 +7,32 @@ - + + + {{ $t('transaction.nullTransactions') }} + From 7c972a1c72b6ef0d3b83d1024f47a29fd5690b19 Mon Sep 17 00:00:00 2001 From: Alexander Friedland Date: Wed, 5 May 2021 15:57:13 +0200 Subject: [PATCH 7/9] lehrzeichen entfernt --- frontend/src/locales/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 4859a3422..c5cbffef0 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -42,7 +42,7 @@ "scann_code":"QR Code Scanner - Scanne den QR Code deines Partners", "max_gdd_info":"maximale anzahl GDD zum versenden erreicht!", "send_check":"Bestätige deine Zahlung. Prüfe bitte nochmal alle Daten!", - "thx":"Danke, ", + "thx":"Danke,", "send_success":"deine Transaktion wurde erfolgreich ausgeführt" }, "transaction":{ From ff65c78244ffd21c6e2b14ba00ce3ded0f04d57a Mon Sep 17 00:00:00 2001 From: Alexander Friedland Date: Wed, 5 May 2021 15:57:45 +0200 Subject: [PATCH 8/9] update --- frontend/src/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 802a4af31..eb30bbc29 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -42,7 +42,7 @@ "scann_code":"QR Code Scanner - Scanne den QR Code deines Partners", "max_gdd_info":"maximale anzahl GDD zum versenden erreicht!", "send_check":"Bestätige deine Zahlung. Prüfe bitte nochmal alle Daten!", - "thx":"Thank you, ", + "thx":"Thank you,", "send_success":"your transaction was successfully completed" }, "transaction":{ From b3529c0ea36da438e23909ea8b3df1b409f5729e Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 5 May 2021 16:53:09 +0200 Subject: [PATCH 9/9] remove testData, fix test --- .../src/views/Layout/DashboardLayout_gdd.vue | 57 +++---------------- .../src/views/Pages/KontoOverview.spec.js | 6 -- frontend/src/views/Pages/KontoOverview.vue | 3 +- 3 files changed, 8 insertions(+), 58 deletions(-) diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index cdd72b68d..5fc696574 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -103,56 +103,13 @@ export default { } }, async updateTransactions() { - // const result = await communityAPI.transactions(this.$store.state.session_id) - // if (result.success) { - // this.GdtBalance = result.result.data.gdtSum / 10000 - // this.transactions = result.result.data.transactions - // } else { - // // what to do when loading balance fails? - // } - - this.transactions = [ - { - name: 'Max Mustermann', - email: 'Maxim@Mustermann', - type: 'send', - transaction_id: 2, - date: '2021-02-19T13:25:38+00:00', - balance: 1920000, - memo: 'a piece of cake :)', - pubkey: '038a6f93270dc57b91d76bf110ad3863fcb7d1b08e7692e793fcdb4467e5b6a7', - }, - { - name: 'Bob Bobmann', - email: 'Bob@Bobmann', - type: 'receive', - transaction_id: 3, - date: '2021-03-19T13:27:36+00:00', - balance: 1920000, - memo: 'test text hier eingeben :)', - pubkey: '038a6f93270dc57b91d76bf110ad3863fcb7d1b08e7692e793fcdb4467e5b6a7', - }, - { - name: 'Gradido Akademie', - email: 'Gradido@Akademie', - type: 'creation', - transaction_id: 4, - date: '2021-03-22T13:25:36+00:00', - balance: 10000000, - memo: '1000 Gradidos für das Sammeln von Müll im Wald.', - pubkey: '038a6f93270dc57b91d76bf110ad3863fcb7d1b08e7692e793fcdb4467e5b6a7', - }, - { - name: 'Verfall', - email: 'Gradido@Akademie', - type: 'decay', - transaction_id: 5, - date: '2021-02-22T13:25:37+00:00', - balance: 20000, - memo: 'verfall', - pubkey: '038a6f93270dc57b91d76bf110ad3863fcb7d1b08e7692e793fcdb4467e5b6a7', - }, - ] + const result = await communityAPI.transactions(this.$store.state.session_id) + if (result.success) { + this.GdtBalance = result.result.data.gdtSum / 10000 + this.transactions = result.result.data.transactions + } else { + // what to do when loading balance fails? + } }, updateBalance(ammount) { this.balance -= ammount diff --git a/frontend/src/views/Pages/KontoOverview.spec.js b/frontend/src/views/Pages/KontoOverview.spec.js index 3cb3b8271..7f09e4e2e 100644 --- a/frontend/src/views/Pages/KontoOverview.spec.js +++ b/frontend/src/views/Pages/KontoOverview.spec.js @@ -35,12 +35,6 @@ describe('KontoOverview', () => { expect(wrapper.find('gdd-table-stub').exists()).toBeTruthy() }) - it('updates transctions data when update-transactions is emitted', async () => { - wrapper.find('gdd-table-stub').vm.$emit('update-transactions', [0, 1]) - await wrapper.vm.$nextTick() - expect(wrapper.vm.transactions).toEqual(expect.arrayContaining([0, 1])) - }) - describe('updateBalance method', () => { beforeEach(async () => { wrapper.find('gdd-send-stub').vm.$emit('update-balance', { diff --git a/frontend/src/views/Pages/KontoOverview.vue b/frontend/src/views/Pages/KontoOverview.vue index 52b9f832b..64c5d2417 100644 --- a/frontend/src/views/Pages/KontoOverview.vue +++ b/frontend/src/views/Pages/KontoOverview.vue @@ -34,9 +34,8 @@ export default { props: { balance: { type: Number, default: 0 }, GdtBalance: { type: Number, default: 0 }, - transactions: { - default: [], + default: () => [], }, }, components: {