mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #2093 from gradido/2089-fix-created-at-contribution-date
[Fix] Add createdAt & contributionDate to ContributionListItems
This commit is contained in:
commit
ba1bf68819
@ -13,6 +13,7 @@ describe('ContributionListItem', () => {
|
||||
|
||||
const propsData = {
|
||||
id: 1,
|
||||
createdAt: '26/07/2022',
|
||||
contributionDate: '07/06/2022',
|
||||
memo: 'Ich habe 10 Stunden die Elbwiesen von Müll befreit.',
|
||||
amount: '200',
|
||||
@ -84,21 +85,9 @@ describe('ContributionListItem', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('contribution date', () => {
|
||||
it('is contributionDate by default', () => {
|
||||
expect(wrapper.vm.date).toBe(wrapper.vm.contributionDate)
|
||||
})
|
||||
|
||||
it('is deletedAt when deletedAt is present', async () => {
|
||||
const now = new Date().toISOString()
|
||||
await wrapper.setProps({ deletedAt: now })
|
||||
expect(wrapper.vm.date).toBe(now)
|
||||
})
|
||||
|
||||
it('is confirmedAt at when confirmedAt is present', async () => {
|
||||
const now = new Date().toISOString()
|
||||
await wrapper.setProps({ confirmedAt: now })
|
||||
expect(wrapper.vm.date).toBe(now)
|
||||
describe('date', () => {
|
||||
it('is equal to createdAt', () => {
|
||||
expect(wrapper.vm.date).toBe(wrapper.vm.createdAt)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -11,6 +11,12 @@
|
||||
{{ $t('math.minus') }}
|
||||
<div class="mx-2">{{ $d(new Date(date), 'short') }}</div>
|
||||
</div>
|
||||
<div class="mr-2">
|
||||
<span>{{ $t('contribution.date') }}</span>
|
||||
<span>
|
||||
{{ $d(new Date(contributionDate), 'monthAndYear') }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mr-2">{{ memo }}</div>
|
||||
<div v-if="type === 'pending' && !firstName" class="d-flex flex-row-reverse">
|
||||
<div
|
||||
@ -91,9 +97,10 @@ export default {
|
||||
return 'primary'
|
||||
},
|
||||
date() {
|
||||
if (this.deletedAt) return this.deletedAt
|
||||
if (this.confirmedAt) return this.confirmedAt
|
||||
return this.contributionDate
|
||||
// if (this.deletedAt) return this.deletedAt
|
||||
// if (this.confirmedAt) return this.confirmedAt
|
||||
// return this.contributionDate
|
||||
return this.createdAt
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
@ -41,6 +41,7 @@
|
||||
"pending": "Eingereicht und wartet auf Bestätigung",
|
||||
"rejected": "abgelehnt"
|
||||
},
|
||||
"date": "Beitrag für:",
|
||||
"delete": "Beitrag löschen! Bist du sicher?",
|
||||
"deleted": "Der Beitrag wurde gelöscht! Wird aber sichtbar bleiben.",
|
||||
"formText": {
|
||||
|
||||
@ -41,6 +41,7 @@
|
||||
"pending": "Submitted and waiting for confirmation",
|
||||
"rejected": "deleted"
|
||||
},
|
||||
"date": "Contribution for:",
|
||||
"delete": "Delete Contribution! Are you sure?",
|
||||
"deleted": "The contribution has been deleted! But it will remain visible.",
|
||||
"formText": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user