Merge pull request #1023 from gradido/1018-No-decay-is-incorrect

Text 'No decay' replaced by the number 0.00
This commit is contained in:
Alexander Friedland 2021-10-19 19:51:04 +02:00 committed by GitHub
commit 2342b2e266
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 62 deletions

View File

@ -1,12 +1,7 @@
<template> <template>
<div class="decayinformation"> <div class="decayinformation">
<span v-if="decaytyp === 'short'"> <span v-if="decaytyp === 'short'">
<span v-if="decay.balance > 0"> {{ decay ? ' - ' + $n(decay.balance, 'decimal') + ' ' + decayStartBlockTextShort : '' }}
{{ decay ? ' -' + $n(decay.balance, 'decimal') + ' ' + decayStartBlockTextShort : '' }}
</span>
<span v-else>
{{ $t('decay.noDecay') }}
</span>
</span> </span>
<div v-if="decaytyp === 'new'"> <div v-if="decaytyp === 'new'">
@ -58,60 +53,58 @@
</b-col> </b-col>
</b-row> </b-row>
<div v-if="decay.balance > 0"> <!-- Decay-->
<!-- Decay--> <b-row>
<b-row> <b-col cols="6" class="text-right">
<b-col cols="6" class="text-right"> <div>{{ $t('decay.decay') }}</div>
<div>{{ $t('decay.decay') }}</div> </b-col>
</b-col> <b-col cols="6">
<b-col cols="6"> <div>- {{ $n(decay.balance, 'decimal') }}</div>
<div>- {{ $n(decay.balance, 'decimal') }}</div> </b-col>
</b-col> </b-row>
</b-row> <hr class="mt-2 mb-2" />
<hr class="mt-2 mb-2" /> <b-row>
<b-row> <b-col class="text-center pt-3 pb-2">
<b-col class="text-center pt-3 pb-2"> <b>{{ $t('decay.calculation_total') }}</b>
<b>{{ $t('decay.calculation_total') }}</b> </b-col>
</b-col> </b-row>
</b-row> <!-- Type-->
<!-- Type--> <b-row>
<b-row> <b-col cols="6" class="text-right">
<b-col cols="6" class="text-right"> <div v-if="type === 'send'">{{ $t('decay.sent') }}</div>
<div v-if="type === 'send'">{{ $t('decay.sent') }}</div> <div v-if="type === 'receive'">{{ $t('decay.received') }}</div>
<div v-if="type === 'receive'">{{ $t('decay.received') }}</div> </b-col>
</b-col> <b-col cols="6">
<b-col cols="6"> <div v-if="type === 'send'">- {{ $n(balance, 'decimal') }}</div>
<div v-if="type === 'send'">- {{ $n(balance, 'decimal') }}</div> <div v-if="type === 'receive'">+ {{ $n(balance, 'decimal') }}</div>
<div v-if="type === 'receive'">+ {{ $n(balance, 'decimal') }}</div> </b-col>
</b-col> </b-row>
</b-row> <!-- Decay-->
<!-- Decay--> <b-row>
<b-row> <b-col cols="6" class="text-right">
<b-col cols="6" class="text-right"> <div>{{ $t('decay.decay') }}</div>
<div>{{ $t('decay.decay') }}</div> </b-col>
</b-col> <b-col cols="6">
<b-col cols="6"> <div>- {{ $n(decay.balance, 'decimal') }}</div>
<div>- {{ $n(decay.balance, 'decimal') }}</div> </b-col>
</b-col> </b-row>
</b-row> <!-- Total-->
<!-- Total--> <b-row>
<b-row> <b-col cols="6" class="text-right">
<b-col cols="6" class="text-right"> <div>{{ $t('decay.total') }}</div>
<div>{{ $t('decay.total') }}</div> </b-col>
</b-col> <b-col cols="6">
<b-col cols="6"> <div v-if="type === 'send'">
<div v-if="type === 'send'"> <b>- {{ $n(balance + decay.balance, 'decimal') }}</b>
<b>- {{ $n(balance + decay.balance, 'decimal') }}</b> </div>
</div> <div v-if="type === 'receive'">
<div v-if="type === 'receive'"> <b>{{ $n(balance - decay.balance, 'decimal') }}</b>
<b>{{ $n(balance - decay.balance, 'decimal') }}</b> </div>
</div> <div v-if="type === 'creation'">
<div v-if="type === 'creation'"> <b>- {{ $n(balance - decay.balance, 'decimal') }}</b>
<b>- {{ $n(balance - decay.balance, 'decimal') }}</b> </div>
</div> </b-col>
</b-col> </b-row>
</b-row>
</div>
</div> </div>
</div> </div>
</template> </template>

View File

@ -138,7 +138,7 @@ describe('GddTransactionList', () => {
it('shows the decay calculation', () => { it('shows the decay calculation', () => {
expect(transaction.findAll('div.gdd-transaction-list-item-decay').at(0).text()).toContain( expect(transaction.findAll('div.gdd-transaction-list-item-decay').at(0).text()).toContain(
'-0.5', '- 0.5',
) )
}) })
}) })
@ -228,7 +228,7 @@ describe('GddTransactionList', () => {
it('shows the decay calculation', () => { it('shows the decay calculation', () => {
expect(transaction.findAll('.gdd-transaction-list-item-decay').at(0).text()).toContain( expect(transaction.findAll('.gdd-transaction-list-item-decay').at(0).text()).toContain(
'-1.5', '- 1.5',
) )
}) })
}) })