Merge branch 'master' into define-context-object

This commit is contained in:
Moriz Wahl 2022-04-12 19:45:19 +02:00 committed by GitHub
commit 263d0ab812
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 26 additions and 66 deletions

View File

@ -1,6 +1,5 @@
import { ObjectType, Field } from 'type-graphql'
import Decimal from 'decimal.js-light'
import CONFIG from '@/config'
@ObjectType()
export class Balance {
@ -11,7 +10,6 @@ export class Balance {
balanceGDT: number | null
count: number
linkCount: number
decayStartBlock?: Date
lastBookedDate?: Date | null
}) {
this.balance = data.balance
@ -20,7 +18,6 @@ export class Balance {
this.balanceGDT = data.balanceGDT || null
this.count = data.count
this.linkCount = data.linkCount
this.decayStartBlock = data.decayStartBlock || CONFIG.DECAY_START_TIME
this.lastBookedDate = data.lastBookedDate || null
}
@ -46,9 +43,6 @@ export class Balance {
@Field(() => Number)
linkCount: number
@Field(() => Date)
decayStartBlock: Date
// may be null as there may be no transaction
@Field(() => Date, { nullable: true })
lastBookedDate: Date | null

View File

@ -59,7 +59,6 @@ export const transactionsQuery = gql`
balanceGDT
count
balance
decayStartBlock
transactions {
id
typeId

View File

@ -168,6 +168,10 @@ a,
background-color: #ebebeba3 !important;
}
.gradido-shadow-inset {
box-shadow: inset 0.3em rgba(241 187 187 / 100%);
}
.gradido-max-width {
width: 100%;
}

View File

@ -9,6 +9,7 @@ const mocks = {
},
$tc: jest.fn((tc) => tc),
$t: jest.fn((t) => t),
$d: jest.fn((d) => d),
}
const propsData = {

View File

@ -50,7 +50,6 @@ export default {
name: 'DecayInformation-StartBlock',
props: {
balanceDate: { type: String },
decayStartBlock: { type: Date },
amount: {
type: String,
},

View File

@ -14,6 +14,7 @@
import DecayInformationLong from '../DecayInformations/DecayInformation-Long'
import DecayInformationBeforeStartblock from '../DecayInformations/DecayInformation-BeforeStartblock'
import DecayInformationDecayStartblock from '../DecayInformations/DecayInformation-DecayStartblock'
import CONFIG from '@/config'
export default {
components: {
@ -34,14 +35,10 @@ export default {
type: String,
required: true,
},
decayStartBlock: {
type: Date,
required: true,
},
},
computed: {
isStartBlock() {
return new Date(this.decay.start).getTime() === this.decayStartBlock.getTime()
return new Date(this.decay.start).getTime() === CONFIG.DECAY_START_TIME.getTime()
},
},
}

View File

@ -26,7 +26,6 @@
<transaction-send
class="list-group-item"
v-bind="transactions[index]"
:decayStartBlock="decayStartBlock"
:previousBookedBalance="previousBookedBalance(index)"
v-on="$listeners"
/>
@ -36,7 +35,6 @@
<transaction-receive
class="list-group-item"
v-bind="transactions[index]"
:decayStartBlock="decayStartBlock"
:previousBookedBalance="previousBookedBalance(index)"
v-on="$listeners"
/>
@ -46,7 +44,6 @@
<transaction-creation
class="list-group-item"
v-bind="transactions[index]"
:decayStartBlock="decayStartBlock"
:previousBookedBalance="previousBookedBalance(index)"
v-on="$listeners"
/>
@ -105,7 +102,6 @@ export default {
}
},
props: {
decayStartBlock: { type: Date },
transactions: { default: () => [] },
pageSize: { type: Number, default: 25 },
timestamp: { type: Number, default: 0 },

View File

@ -13,6 +13,7 @@ const mocks = {
locale: 'en',
},
$t: jest.fn((t) => t),
$d: jest.fn((d) => d),
$tc: jest.fn((tc) => tc),
$apollo: {
mutate: mockAPIcall,

View File

@ -8,7 +8,7 @@
</b-col>
<b-col cols="7">
<div class="gdd-transaction-list-item-date">
{{ dateString }}
{{ $d(new Date(this.date), 'long') }}
</div>
</b-col>
</b-row>
@ -28,12 +28,5 @@ export default {
default: false,
},
},
computed: {
dateString() {
return this.diffNow
? this.$moment(this.date).locale(this.$i18n.locale).fromNow()
: this.$d(new Date(this.date), 'long')
},
},
}
</script>

View File

@ -27,12 +27,7 @@
</div>
<b-collapse :class="visible ? 'bg-secondary' : ''" class="pb-4 pt-5" v-model="visible">
<decay-information
:typeId="typeId"
:decay="decay"
:amount="amount"
:decayStartBlock="decayStartBlock"
/>
<decay-information :typeId="typeId" :decay="decay" :amount="amount" />
</b-collapse>
</div>
</div>
@ -82,10 +77,6 @@ export default {
type: String,
required: true,
},
decayStartBlock: {
type: Date,
required: true,
},
previousBookedBalance: {
type: String,
required: true,

View File

@ -12,6 +12,7 @@ const mocks = {
locale: 'en',
},
$t: jest.fn((t) => t),
$d: jest.fn((d) => d),
$tc: jest.fn((tc) => tc),
$apollo: {
query: apolloQueryMock,

View File

@ -1,5 +1,5 @@
<template>
<div class="transaction-slot-link">
<div class="transaction-slot-link gradido-shadow-inset">
<div>
<div @click="visible = !visible">
<!-- Collaps Icon -->

View File

@ -33,12 +33,7 @@
</div>
<b-collapse :class="visible ? 'bg-secondary' : ''" class="pb-4 pt-5" v-model="visible">
<decay-information
:typeId="typeId"
:decay="decay"
:amount="amount"
:decayStartBlock="decayStartBlock"
/>
<decay-information :typeId="typeId" :decay="decay" :amount="amount" />
</b-collapse>
</div>
</div>
@ -87,10 +82,6 @@ export default {
typeId: {
type: String,
},
decayStartBlock: {
type: Date,
required: true,
},
transactionLinkId: {
type: Number,
required: false,

View File

@ -33,12 +33,7 @@
</div>
<b-collapse :class="visible ? 'bg-secondary' : ''" class="pb-4 pt-5" v-model="visible">
<decay-information
:typeId="typeId"
:decay="decay"
:amount="amount"
:decayStartBlock="decayStartBlock"
/>
<decay-information :typeId="typeId" :decay="decay" :amount="amount" />
</b-collapse>
</div>
</div>
@ -88,10 +83,6 @@ export default {
type: String,
required: true,
},
decayStartBlock: {
type: Date,
required: true,
},
transactionLinkId: {
type: Number,
required: false,

View File

@ -5,6 +5,7 @@
const pkg = require('../../package')
const constants = {
DECAY_START_TIME: new Date('2021-05-13 17:46:31'), // GMT+0
CONFIG_VERSION: {
DEFAULT: 'DEFAULT',
EXPECTED: 'v1.2022-03-18',

View File

@ -0,0 +1,9 @@
import CONFIG from './index'
describe('config/index', () => {
describe('decay start block', () => {
it('has the correct date set', () => {
expect(CONFIG.DECAY_START_TIME).toEqual(new Date('2021-05-13 17:46:31'))
})
})
})

View File

@ -52,7 +52,6 @@ export const transactionsQuery = gql`
balanceGDT
count
linkCount
decayStartBlock
lastBookedDate
}
transactions {

View File

@ -26,7 +26,6 @@
:transactionCount="transactionCount"
:transactionLinkCount="transactionLinkCount"
:pending="pending"
:decayStartBlock="decayStartBlock"
@update-transactions="updateTransactions"
@set-tunneled-email="setTunneledEmail"
></router-view>
@ -63,7 +62,6 @@ export default {
transactionLinkCount: 0,
pending: true,
visible: false,
decayStartBlock: new Date(),
tunneledEmail: null,
}
},
@ -110,7 +108,6 @@ export default {
this.balance = Number(transactionList.balance.balance)
this.transactionCount = transactionList.balance.count
this.transactionLinkCount = transactionList.balance.linkCount
this.decayStartBlock = new Date(transactionList.balance.decayStartBlock)
this.pending = false
})
.catch((error) => {

View File

@ -109,7 +109,7 @@
"link-expired": "Der Link ist nicht mehr gültig. Die Gültigkeit ist am {date} abgelaufen.",
"link-overview": "Linkübersicht",
"links_count": "Aktive Links",
"links_sum": "Summe deiner versendeten Gradidos",
"links_sum": "Offene Links und QR-Codes",
"no-account": "Du besitzt noch kein Gradido Konto",
"no-redeem": "Du darfst deinen eigenen Link nicht einlösen!",
"not-copied": "Konnte den Link nicht kopieren: {err}",

View File

@ -109,7 +109,7 @@
"link-expired": "The link is no longer valid. The validity expired on {date}.",
"link-overview": "Link overview",
"links_count": "Active links",
"links_sum": "Total of your sent Gradidos",
"links_sum": "Open links and QR codes",
"no-account": "You don't have a Gradido account yet",
"no-redeem": "You not allowed to redeem your own link!",
"not-copied": "Could not copy link: {err}",

View File

@ -18,7 +18,6 @@
:transactions="transactions"
:pageSize="5"
:timestamp="timestamp"
:decayStartBlock="decayStartBlock"
:transaction-count="transactionCount"
:transactionLinkCount="transactionLinkCount"
:pending="pending"
@ -49,7 +48,6 @@ export default {
props: {
balance: { type: Number, default: 0 },
GdtBalance: { type: Number, default: 0 },
decayStartBlock: { type: Date },
transactions: {
default: () => [],
},

View File

@ -10,7 +10,6 @@
:transactionLinkCount="transactionLinkCount"
:transactions="transactions"
:show-pagination="true"
:decayStartBlock="decayStartBlock"
@update-transactions="updateTransactions"
v-on="$listeners"
/>
@ -45,7 +44,6 @@ export default {
},
transactionCount: { type: Number, default: 0 },
transactionLinkCount: { type: Number, default: 0 },
decayStartBlock: { type: Date },
},
data() {
return {