diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index e3868124c..363b8fbc6 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -42,12 +42,12 @@ "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", "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..6f9a790d9 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -42,12 +42,12 @@ "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", - "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/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index 79270493a..5fc696574 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -31,7 +31,9 @@ @@ -76,6 +78,7 @@ export default { return { balance: 0, GdtBalance: 0, + transactions: [], } }, methods: { @@ -99,10 +102,11 @@ export default { // what to do when loading balance fails? } }, - async loadGDTBalance() { + 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? } @@ -116,7 +120,7 @@ export default { }, created() { this.loadBalance() - this.loadGDTBalance() + this.updateTransactions() }, } diff --git a/frontend/src/views/Pages/AccountOverview.spec.js b/frontend/src/views/Pages/AccountOverview.spec.js index 676ccc433..668521cf6 100644 --- a/frontend/src/views/Pages/AccountOverview.spec.js +++ b/frontend/src/views/Pages/AccountOverview.spec.js @@ -35,12 +35,6 @@ describe('AccountOverview', () => { 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]) - 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/AccountOverview.vue b/frontend/src/views/Pages/AccountOverview.vue index c4dc8efd8..dad678ca8 100644 --- a/frontend/src/views/Pages/AccountOverview.vue +++ b/frontend/src/views/Pages/AccountOverview.vue @@ -2,11 +2,7 @@
- +

@@ -32,13 +28,15 @@ 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 +50,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/AccountOverview/GddStatus.vue b/frontend/src/views/Pages/AccountOverview/GddStatus.vue index 508744ca0..d8fa1939f 100644 --- a/frontend/src/views/Pages/AccountOverview/GddStatus.vue +++ b/frontend/src/views/Pages/AccountOverview/GddStatus.vue @@ -29,7 +29,6 @@ export default { name: 'GddStatus', props: { - showTransactionList: { type: Boolean, default: true }, balance: { type: Number, default: 0 }, GdtBalance: { type: Number, default: 0 }, }, diff --git a/frontend/src/views/Pages/AccountOverview/GddTable.vue b/frontend/src/views/Pages/AccountOverview/GddTable.vue index e35b1ff13..589925453 100644 --- a/frontend/src/views/Pages/AccountOverview/GddTable.vue +++ b/frontend/src/views/Pages/AccountOverview/GddTable.vue @@ -2,26 +2,42 @@
-

+ + +

+ + + - {{ $n(item.balance / 10000) }} GDD

@@ -73,11 +89,11 @@ - - + + {{ $t('transaction.nullTransactions') }} @@ -87,13 +103,11 @@ diff --git a/login_server/src/cpp/JSONInterface/JsonUnsecureLogin.cpp b/login_server/src/cpp/JSONInterface/JsonUnsecureLogin.cpp index 5eba547d0..077770927 100644 --- a/login_server/src/cpp/JSONInterface/JsonUnsecureLogin.cpp +++ b/login_server/src/cpp/JSONInterface/JsonUnsecureLogin.cpp @@ -118,7 +118,7 @@ Poco::JSON::Object* JsonUnsecureLogin::handle(Poco::Dynamic::Var params) default: result->set("state", "error"); result->set("msg", "unknown user state"); - result->set("details", USER_NO_GROUP); + result->set("details", user_state); } sm->releaseSession(session);