From 65861fded884e458b70851b7bc9a3db46eb28b71 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sun, 27 Feb 2022 03:45:36 +0100 Subject: [PATCH] have some things working in frontend --- frontend/src/components/DecayInformation.vue | 14 +++-- .../src/views/Layout/DashboardLayout_gdd.vue | 5 +- .../AccountOverview/GddTransactionList.vue | 52 ++++++++++--------- 3 files changed, 37 insertions(+), 34 deletions(-) diff --git a/frontend/src/components/DecayInformation.vue b/frontend/src/components/DecayInformation.vue index 0daa45a18..f092d90dd 100644 --- a/frontend/src/components/DecayInformation.vue +++ b/frontend/src/components/DecayInformation.vue @@ -22,8 +22,8 @@
{{ $t('decay.decay_introduced') }} :
- - {{ $d(new Date(decay.decayStart * 1000), 'long') }} + + {{ $d(new Date(decay.start), 'long') }} {{ $i18n.locale === 'de' ? 'Uhr' : '' }}
@@ -109,20 +109,18 @@ export default { name: 'DecayInformation', props: { - balance: { type: Number }, type: { type: String, default: '' }, decay: { balance: '', - decayDuration: '', - decayStart: 0, - decayEnd: 0, - decayStartBlock: 0, + duration: '', + start: 0, + end: 0, }, decaytyp: { type: String, default: '' }, }, computed: { duration() { - return this.$moment.duration((this.decay.decayEnd - this.decay.decayStart) * 1000)._data + return this.$moment.duration(new Date(this.decay.end) - new Date(this.decay.start))._data }, }, } diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index a473469b6..a1771997e 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -92,9 +92,10 @@ export default { const { data: { transactionList }, } = result - this.GdtBalance = transactionList.gdtSum === null ? null : Number(transactionList.gdtSum) + this.GdtBalance = + transactionList.balanceGDT === null ? null : Number(transactionList.balanceGDT) this.transactions = transactionList.transactions - this.balance = Number(transactionList.decay) + this.balance = Number(transactionList.balance) this.bookedBalance = Number(transactionList.balance) this.transactionCount = transactionList.count this.pending = false diff --git a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue index 4e2df58d1..ad3480e96 100644 --- a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue +++ b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue @@ -12,17 +12,22 @@ {{ $t('error.empty-transactionlist') }}
-
+
@@ -36,7 +41,7 @@
- +
@@ -46,22 +51,22 @@
- {{ getProperties(type).operator }} + {{ getProperties(typeId).operator }} - {{ $n(balance, 'decimal') }} + {{ $n(Math.abs(Number(amount)), 'decimal') }}
- {{ type !== 'decay' ? name : $t('decay.decay_since_last_transaction') }} + {{ typeId !== 'DECAY' ? `${linkedUser.firstName} ${linkedUser.lastName}` : $t('decay.decay_since_last_transaction') }}
- +
{{ $t('form.memo') }}
@@ -71,13 +76,13 @@
- +
{{ $t('form.date') }}
- {{ $d(new Date(date), 'long') }} {{ $i18n.locale === 'de' ? 'Uhr' : '' }} + {{ $d(new Date(balanceDate), 'long') }} {{ $i18n.locale === 'de' ? 'Uhr' : '' }}
@@ -86,7 +91,7 @@
- +
@@ -98,7 +103,7 @@
- +
@@ -113,14 +118,13 @@ - +
@@ -146,10 +150,10 @@ import PaginationButtons from '../../../components/PaginationButtons' import DecayInformation from '../../../components/DecayInformation' const iconsByType = { - send: { icon: 'arrow-left-circle', classes: 'text-danger', operator: '−' }, - receive: { icon: 'arrow-right-circle', classes: 'gradido-global-color-accent', operator: '+' }, - creation: { icon: 'gift', classes: 'gradido-global-color-accent', operator: '+' }, - decay: { icon: 'droplet-half', classes: 'gradido-global-color-gray', operator: '−' }, + SEND: { icon: 'arrow-left-circle', classes: 'text-danger', operator: '−' }, + RECEIVE: { icon: 'arrow-right-circle', classes: 'gradido-global-color-accent', operator: '+' }, + CREATION: { icon: 'gift', classes: 'gradido-global-color-accent', operator: '+' }, + DECAY: { icon: 'droplet-half', classes: 'gradido-global-color-gray', operator: '−' }, } export default {