Merge branch 'master' into 2294-Contribution-Links-on-its-own-Page

This commit is contained in:
Moriz Wahl 2022-11-01 15:33:38 +01:00
commit e81fcbdba1
8 changed files with 81 additions and 7 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="content-footer">
<hr />
<b-row align-v="center" class="mt-4 justify-content-lg-between">
<div align-v="center" class="mt-4 mb-4 justify-content-lg-between">
<b-col>
<div class="copyright text-center text-lg-center text-muted">
{{ $t('footer.copyright.year', { year }) }}
@ -25,7 +25,7 @@
</a>
</div>
</b-col>
</b-row>
</div>
</div>
</template>
<script>

View File

@ -1,6 +1,6 @@
<template>
<div class="contribution-link-list">
<b-table striped hover :items="items" :fields="fields">
<b-table :items="items" :fields="fields" striped hover stacked="lg">
<template #cell(delete)="data">
<b-button
variant="danger"

View File

@ -63,6 +63,8 @@ export class StatisticsResolver {
.where('transaction.decay IS NOT NULL')
.getRawOne()
await queryRunner.release()
return {
totalUsers,
activeUsers,

View File

@ -198,6 +198,75 @@ describe('ContributionForm', () => {
})
})
})
describe('date with the 31st day of the month', () => {
describe('same month', () => {
beforeEach(async () => {
await wrapper.setData({
maximalDate: new Date('2022-10-31T00:00:00.000Z'),
form: { date: new Date('2022-10-31T00:00:00.000Z') },
})
})
describe('minimalDate', () => {
it('has "2022-09-01T00:00:00.000Z"', () => {
expect(wrapper.vm.minimalDate.toISOString()).toBe('2022-09-01T00:00:00.000Z')
})
})
describe('isThisMonth', () => {
it('has true', () => {
expect(wrapper.vm.isThisMonth).toBe(true)
})
})
})
})
describe('date with the 28th day of the month', () => {
describe('same month', () => {
beforeEach(async () => {
await wrapper.setData({
maximalDate: new Date('2023-02-28T00:00:00.000Z'),
form: { date: new Date('2023-02-28T00:00:00.000Z') },
})
})
describe('minimalDate', () => {
it('has "2023-01-01T00:00:00.000Z"', () => {
expect(wrapper.vm.minimalDate.toISOString()).toBe('2023-01-01T00:00:00.000Z')
})
})
describe('isThisMonth', () => {
it('has true', () => {
expect(wrapper.vm.isThisMonth).toBe(true)
})
})
})
})
describe('date with 29.02.2024 leap year', () => {
describe('same month', () => {
beforeEach(async () => {
await wrapper.setData({
maximalDate: new Date('2024-02-29T00:00:00.000Z'),
form: { date: new Date('2024-02-29T00:00:00.000Z') },
})
})
describe('minimalDate', () => {
it('has "2024-01-01T00:00:00.000Z"', () => {
expect(wrapper.vm.minimalDate.toISOString()).toBe('2024-01-01T00:00:00.000Z')
})
})
describe('isThisMonth', () => {
it('has true', () => {
expect(wrapper.vm.isThisMonth).toBe(true)
})
})
})
})
})
describe('set contrubtion', () => {

View File

@ -131,10 +131,8 @@ export default {
},
computed: {
minimalDate() {
// sets the date to the 1st of the previous month
let date = new Date(this.maximalDate) // has to be a new object, because of 'setMonth' changes the objects date
date = new Date(date.setMonth(date.getMonth() - 1))
return new Date(date.getFullYear(), date.getMonth(), 1)
const date = new Date(this.maximalDate)
return new Date(date.setMonth(date.getMonth() - 1, 1))
},
disabled() {
return (

View File

@ -31,6 +31,7 @@
"submitContribution": "Beitrag einreichen",
"switch-to-this-community": "zu dieser Gemeinschaft wechseln"
},
"contact": "Kontakt",
"contribution": {
"activity": "Tätigkeit",
"alert": {

View File

@ -31,6 +31,7 @@
"submitContribution": "Submit contribution",
"switch-to-this-community": "Switch to this community"
},
"contact": "Contact",
"contribution": {
"activity": "Activity",
"alert": {

View File

@ -44,6 +44,9 @@
{{ item.firstName }} {{ item.lastName }}
</li>
</ul>
</b-container>
<b-container>
<div class="h3">{{ $t('contact') }}</div>
<b-link href="mailto: abc@example.com">{{ supportMail }}</b-link>
</b-container>
<!--