Merge pull request #1322 from gradido/1320-Transactionlist-for-user-Decay-Balance

defined fields for Transactionlist in UserSearch in Adminarea, add Lo…
This commit is contained in:
Alexander Friedland 2022-01-20 17:15:49 +01:00 committed by GitHub
commit 03f3bc77d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 3 deletions

View File

@ -15,7 +15,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
decayDuration: 0,
memo: 'Testing',
transactionId: 1,
name: 'Bibi',
name: 'Gradido Akademie',
email: 'bibi@bloxberg.de',
date: new Date(),
decay: {
@ -34,7 +34,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
decayDuration: 0,
memo: 'Testing 2',
transactionId: 2,
name: 'Bibi',
name: 'Gradido Akademie',
email: 'bibi@bloxberg.de',
date: new Date(),
decay: {
@ -53,6 +53,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
const toastedErrorMock = jest.fn()
const mocks = {
$d: jest.fn((t) => t),
$t: jest.fn((t) => t),
$apollo: {
query: apolloQueryMock,
@ -64,6 +65,7 @@ const mocks = {
const propsData = {
userId: 1,
fields: ['date', 'balance', 'name', 'memo', 'decay'],
}
describe('CreationTransactionListFormular', () => {

View File

@ -1,7 +1,7 @@
<template>
<div class="component-creation-transaction-list">
{{ $t('transactionlist.title') }}
<b-table striped hover :items="items"></b-table>
<b-table striped hover :fields="fields" :items="items"></b-table>
</div>
</template>
<script>
@ -13,6 +13,35 @@ export default {
},
data() {
return {
fields: [
{
key: 'date',
label: this.$t('transactionlist.date'),
formatter: (value, key, item) => {
return this.$d(new Date(value))
},
},
{
key: 'balance',
label: this.$t('transactionlist.amount'),
formatter: (value, key, item) => {
return `${value} GDD`
},
},
{ key: 'name', label: this.$t('transactionlist.community') },
{ key: 'memo', label: this.$t('transactionlist.memo') },
{
key: 'decay',
label: this.$t('transactionlist.decay'),
formatter: (value, key, item) => {
if (value && value.balance >= 0) {
return value.balance
} else {
return '0'
}
},
},
],
items: [],
}
},

View File

@ -52,6 +52,11 @@
"remove": "Entfernen",
"transaction": "Transaktion",
"transactionlist": {
"amount": "Betrag",
"community": "Gemeinschaft",
"date": "Datum",
"decay": "Vergänglichkeit",
"memo": "Nachricht",
"title": "Alle geschöpften Transaktionen für den Nutzer"
},
"unregistered_emails": "Nur unregistrierte Nutzer",

View File

@ -52,6 +52,11 @@
"remove": "Remove",
"transaction": "Transaction",
"transactionlist": {
"amount": "Amount",
"community": "Community",
"date": "Date",
"decay": "Decay",
"memo": "Message",
"title": "All creation-transactions for the user"
},
"unregistered_emails": "Only unregistered users",