mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 2366-devopsbackend-have-yarn-locales-fix-in-the-backend
This commit is contained in:
commit
ff0282f1a5
15
CHANGELOG.md
15
CHANGELOG.md
@ -4,8 +4,23 @@ All notable changes to this project will be documented in this file. Dates are d
|
||||
|
||||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
|
||||
#### [1.18.2](https://github.com/gradido/gradido/compare/1.18.1...1.18.2)
|
||||
|
||||
- fix(admin): deny contribution button to left [`#2699`](https://github.com/gradido/gradido/pull/2699)
|
||||
|
||||
#### [1.18.1](https://github.com/gradido/gradido/compare/1.18.0...1.18.1)
|
||||
|
||||
> 10 February 2023
|
||||
|
||||
- chore(release): version 1.18.1 [`#2698`](https://github.com/gradido/gradido/pull/2698)
|
||||
- fix(frontend): fix is last month for empty form date [`#2697`](https://github.com/gradido/gradido/pull/2697)
|
||||
- fix(frontend): community link [`#2696`](https://github.com/gradido/gradido/pull/2696)
|
||||
|
||||
#### [1.18.0](https://github.com/gradido/gradido/compare/1.17.1...1.18.0)
|
||||
|
||||
> 9 February 2023
|
||||
|
||||
- feat(release): version 1.18.0 [`#2690`](https://github.com/gradido/gradido/pull/2690)
|
||||
- refactor(frontend): toast by automatically logged out [`#2681`](https://github.com/gradido/gradido/pull/2681)
|
||||
- refactor(frontend): change text for gdd_per_link.choose-amount [`#2638`](https://github.com/gradido/gradido/pull/2638)
|
||||
- fix(backend): emails for deny and delete contribution [`#2688`](https://github.com/gradido/gradido/pull/2688)
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"description": "Administraion Interface for Gradido",
|
||||
"main": "index.js",
|
||||
"author": "Moriz Wahl",
|
||||
"version": "1.18.0",
|
||||
"version": "1.18.2",
|
||||
"license": "Apache-2.0",
|
||||
"private": false,
|
||||
"scripts": {
|
||||
|
||||
@ -259,7 +259,7 @@ describe('CreationConfirm', () => {
|
||||
|
||||
describe('deny creation', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.findAll('tr').at(1).findAll('button').at(2).trigger('click')
|
||||
await wrapper.findAll('tr').at(1).findAll('button').at(1).trigger('click')
|
||||
})
|
||||
|
||||
it('opens the overlay', () => {
|
||||
|
||||
@ -129,6 +129,7 @@ export default {
|
||||
fields() {
|
||||
return [
|
||||
{ key: 'bookmark', label: this.$t('delete') },
|
||||
{ key: 'deny', label: this.$t('deny') },
|
||||
{ key: 'email', label: this.$t('e_mail') },
|
||||
{ key: 'firstName', label: this.$t('firstname') },
|
||||
{ key: 'lastName', label: this.$t('lastname') },
|
||||
@ -149,7 +150,6 @@ export default {
|
||||
},
|
||||
{ key: 'moderator', label: this.$t('moderator') },
|
||||
{ key: 'editCreation', label: this.$t('edit') },
|
||||
{ key: 'deny', label: this.$t('deny') },
|
||||
{ key: 'confirm', label: this.$t('save') },
|
||||
]
|
||||
},
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gradido-backend",
|
||||
"version": "1.18.0",
|
||||
"version": "1.18.2",
|
||||
"description": "Gradido unified backend providing an API-Service for Gradido Transactions",
|
||||
"main": "src/index.ts",
|
||||
"repository": "https://github.com/gradido/gradido/backend",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gradido-database",
|
||||
"version": "1.18.0",
|
||||
"version": "1.18.2",
|
||||
"description": "Gradido Database Tool to execute database migrations",
|
||||
"main": "src/index.ts",
|
||||
"repository": "https://github.com/gradido/gradido/database",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bootstrap-vue-gradido-wallet",
|
||||
"version": "1.18.0",
|
||||
"version": "1.18.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node run/server.js",
|
||||
|
||||
@ -24,11 +24,6 @@ describe('ContributionForm', () => {
|
||||
$t: jest.fn((t) => t),
|
||||
$d: jest.fn((d) => d),
|
||||
$n: jest.fn((n) => n),
|
||||
$store: {
|
||||
state: {
|
||||
creation: ['1000', '1000', '1000'],
|
||||
},
|
||||
},
|
||||
$i18n: {
|
||||
locale: 'en',
|
||||
},
|
||||
@ -61,7 +56,7 @@ describe('ContributionForm', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('dates', () => {
|
||||
describe('dates and max amounts', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.setData({
|
||||
form: {
|
||||
@ -73,204 +68,176 @@ describe('ContributionForm', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('actual date', () => {
|
||||
describe('same month', () => {
|
||||
beforeEach(async () => {
|
||||
const now = new Date().toISOString()
|
||||
await wrapper.findComponent({ name: 'BFormDatepicker' }).vm.$emit('input', now)
|
||||
describe('max amount reached for both months', () => {
|
||||
beforeEach(() => {
|
||||
wrapper.setProps({
|
||||
maxGddLastMonth: 0,
|
||||
maxGddThisMonth: 0,
|
||||
})
|
||||
|
||||
describe('isThisMonth', () => {
|
||||
it('has true', () => {
|
||||
expect(wrapper.vm.isThisMonth).toBe(true)
|
||||
})
|
||||
wrapper.setData({
|
||||
form: {
|
||||
id: null,
|
||||
date: 'set',
|
||||
memo: '',
|
||||
amount: '',
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
describe.skip('month before', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper
|
||||
.findComponent({ name: 'BFormDatepicker' })
|
||||
.vm.$emit('input', wrapper.vm.minimalDate)
|
||||
})
|
||||
|
||||
describe('isThisMonth', () => {
|
||||
it('has false', () => {
|
||||
expect(wrapper.vm.isThisMonth).toBe(false)
|
||||
})
|
||||
})
|
||||
it('shows message that no contributions are available', () => {
|
||||
expect(wrapper.find('[data-test="contribtion-message"]').text()).toBe(
|
||||
'contribution.noOpenCreation.allMonth',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe.skip('date in middle of year', () => {
|
||||
describe('same month', () => {
|
||||
beforeEach(async () => {
|
||||
// jest.useFakeTimers('modern')
|
||||
// jest.setSystemTime(new Date('2020-07-06'))
|
||||
// await wrapper.findComponent({ name: 'BFormDatepicker' }).vm.$emit('input', now)
|
||||
await wrapper.setData({
|
||||
maximalDate: new Date(2020, 6, 6),
|
||||
form: { date: new Date(2020, 6, 6) },
|
||||
})
|
||||
})
|
||||
|
||||
describe('minimalDate', () => {
|
||||
it('has "2020-06-01T00:00:00.000Z"', () => {
|
||||
expect(wrapper.vm.minimalDate.toISOString()).toBe('2020-06-01T00:00:00.000Z')
|
||||
})
|
||||
})
|
||||
|
||||
describe('isThisMonth', () => {
|
||||
it('has true', () => {
|
||||
expect(wrapper.vm.isThisMonth).toBe(true)
|
||||
})
|
||||
describe('max amount reached for last month, no date selected', () => {
|
||||
beforeEach(() => {
|
||||
wrapper.setProps({
|
||||
maxGddLastMonth: 0,
|
||||
})
|
||||
})
|
||||
|
||||
describe('month before', () => {
|
||||
beforeEach(async () => {
|
||||
// jest.useFakeTimers('modern')
|
||||
// jest.setSystemTime(new Date('2020-07-06'))
|
||||
// console.log('middle of year date – now:', wrapper.vm.minimalDate)
|
||||
// await wrapper
|
||||
// .findComponent({ name: 'BFormDatepicker' })
|
||||
// .vm.$emit('input', wrapper.vm.minimalDate)
|
||||
await wrapper.setData({
|
||||
maximalDate: new Date(2020, 6, 6),
|
||||
form: { date: new Date(2020, 5, 6) },
|
||||
})
|
||||
})
|
||||
|
||||
describe('minimalDate', () => {
|
||||
it('has "2020-06-01T00:00:00.000Z"', () => {
|
||||
expect(wrapper.vm.minimalDate.toISOString()).toBe('2020-06-01T00:00:00.000Z')
|
||||
})
|
||||
})
|
||||
|
||||
describe('isThisMonth', () => {
|
||||
it('has false', () => {
|
||||
expect(wrapper.vm.isThisMonth).toBe(false)
|
||||
})
|
||||
})
|
||||
it('shows no message', () => {
|
||||
expect(wrapper.find('[data-test="contribtion-message"]').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe.skip('date in january', () => {
|
||||
describe('same month', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.setData({
|
||||
maximalDate: new Date(2020, 0, 6),
|
||||
form: { date: new Date(2020, 0, 6) },
|
||||
})
|
||||
describe('max amount reached for last month, last month selected', () => {
|
||||
beforeEach(async () => {
|
||||
wrapper.setProps({
|
||||
maxGddLastMonth: 0,
|
||||
isThisMonth: false,
|
||||
})
|
||||
|
||||
describe('minimalDate', () => {
|
||||
it('has "2019-12-01T00:00:00.000Z"', () => {
|
||||
expect(wrapper.vm.minimalDate.toISOString()).toBe('2019-12-01T00:00:00.000Z')
|
||||
})
|
||||
})
|
||||
|
||||
describe('isThisMonth', () => {
|
||||
it('has true', () => {
|
||||
expect(wrapper.vm.isThisMonth).toBe(true)
|
||||
})
|
||||
await wrapper.setData({
|
||||
form: {
|
||||
id: null,
|
||||
date: 'set',
|
||||
memo: '',
|
||||
amount: '',
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
describe('month before', () => {
|
||||
beforeEach(async () => {
|
||||
// jest.useFakeTimers('modern')
|
||||
// jest.setSystemTime(new Date('2020-07-06'))
|
||||
// console.log('middle of year date – now:', wrapper.vm.minimalDate)
|
||||
// await wrapper
|
||||
// .findComponent({ name: 'BFormDatepicker' })
|
||||
// .vm.$emit('input', wrapper.vm.minimalDate)
|
||||
await wrapper.setData({
|
||||
maximalDate: new Date(2020, 0, 6),
|
||||
form: { date: new Date(2019, 11, 6) },
|
||||
})
|
||||
})
|
||||
|
||||
describe('minimalDate', () => {
|
||||
it('has "2019-12-01T00:00:00.000Z"', () => {
|
||||
expect(wrapper.vm.minimalDate.toISOString()).toBe('2019-12-01T00:00:00.000Z')
|
||||
})
|
||||
})
|
||||
|
||||
describe('isThisMonth', () => {
|
||||
it('has false', () => {
|
||||
expect(wrapper.vm.isThisMonth).toBe(false)
|
||||
})
|
||||
})
|
||||
it('shows message that no contributions are available for last month', () => {
|
||||
expect(wrapper.find('[data-test="contribtion-message"]').text()).toBe(
|
||||
'contribution.noOpenCreation.lastMonth',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe.skip('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('max amount reached for last month, this month selected', () => {
|
||||
beforeEach(async () => {
|
||||
wrapper.setProps({
|
||||
maxGddLastMonth: 0,
|
||||
isThisMonth: true,
|
||||
})
|
||||
await wrapper.setData({
|
||||
form: {
|
||||
id: null,
|
||||
date: 'set',
|
||||
memo: '',
|
||||
amount: '',
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
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)
|
||||
})
|
||||
})
|
||||
it('shows no message', () => {
|
||||
expect(wrapper.find('[data-test="contribtion-message"]').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe.skip('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('max amount reached for this month, no date selected', () => {
|
||||
beforeEach(() => {
|
||||
wrapper.setProps({
|
||||
maxGddThisMonth: 0,
|
||||
})
|
||||
})
|
||||
|
||||
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)
|
||||
})
|
||||
})
|
||||
it('shows no message', () => {
|
||||
expect(wrapper.find('[data-test="contribtion-message"]').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe.skip('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('max amount reached for this month, this month selected', () => {
|
||||
beforeEach(async () => {
|
||||
wrapper.setProps({
|
||||
maxGddThisMonth: 0,
|
||||
isThisMonth: true,
|
||||
})
|
||||
await wrapper.setData({
|
||||
form: {
|
||||
id: null,
|
||||
date: 'set',
|
||||
memo: '',
|
||||
amount: '',
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
describe('minimalDate', () => {
|
||||
it('has "2024-01-01T00:00:00.000Z"', () => {
|
||||
expect(wrapper.vm.minimalDate.toISOString()).toBe('2024-01-01T00:00:00.000Z')
|
||||
})
|
||||
})
|
||||
it('shows message that no contributions are available for last month', () => {
|
||||
expect(wrapper.find('[data-test="contribtion-message"]').text()).toBe(
|
||||
'contribution.noOpenCreation.thisMonth',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('isThisMonth', () => {
|
||||
it('has true', () => {
|
||||
expect(wrapper.vm.isThisMonth).toBe(true)
|
||||
})
|
||||
describe('max amount reached for this month, last month selected', () => {
|
||||
beforeEach(async () => {
|
||||
wrapper.setProps({
|
||||
maxGddThisMonth: 0,
|
||||
isThisMonth: false,
|
||||
})
|
||||
await wrapper.setData({
|
||||
form: {
|
||||
id: null,
|
||||
date: 'set',
|
||||
memo: '',
|
||||
amount: '',
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it('shows no message', () => {
|
||||
expect(wrapper.find('[data-test="contribtion-message"]').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('default return message', () => {
|
||||
it('returns an empty string', () => {
|
||||
expect(wrapper.vm.noOpenCreation).toBe('')
|
||||
})
|
||||
})
|
||||
|
||||
describe('update amount', () => {
|
||||
beforeEach(() => {
|
||||
wrapper.findComponent({ name: 'InputHour' }).vm.$emit('updateAmount', 20)
|
||||
})
|
||||
|
||||
it('updates form amount', () => {
|
||||
expect(wrapper.vm.form.amount).toBe('400.00')
|
||||
})
|
||||
})
|
||||
|
||||
describe('watch value', () => {
|
||||
beforeEach(() => {
|
||||
wrapper.setProps({
|
||||
value: {
|
||||
id: 42,
|
||||
date: 'set',
|
||||
memo: 'Some Memo',
|
||||
amount: '400.00',
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it('updates form', () => {
|
||||
expect(wrapper.vm.form).toEqual({
|
||||
id: 42,
|
||||
date: 'set',
|
||||
memo: 'Some Memo',
|
||||
amount: '400.00',
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -477,24 +444,23 @@ describe('ContributionForm', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe.skip('on trigger submit', () => {
|
||||
describe('on trigger submit', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.find('form').trigger('submit')
|
||||
})
|
||||
|
||||
it('emits "update-contribution"', () => {
|
||||
expect(wrapper.emitted('update-contribution')).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.arrayContaining([
|
||||
{
|
||||
id: 2,
|
||||
date: now,
|
||||
memo: 'Mein Beitrag zur Gemeinschaft für diesen Monat ...',
|
||||
amount: '200',
|
||||
},
|
||||
]),
|
||||
]),
|
||||
)
|
||||
expect(wrapper.emitted('update-contribution')).toEqual([
|
||||
[
|
||||
{
|
||||
id: 2,
|
||||
date: now,
|
||||
hours: 0,
|
||||
memo: 'Mein Beitrag zur Gemeinschaft für diesen Monat ...',
|
||||
amount: '200',
|
||||
},
|
||||
],
|
||||
])
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -23,10 +23,7 @@
|
||||
<template #nav-next-year><span></span></template>
|
||||
</b-form-datepicker>
|
||||
|
||||
<div
|
||||
v-if="(isThisMonth && maxGddThisMonth <= 0) || (!isThisMonth && maxGddLastMonth <= 0)"
|
||||
class="p-3"
|
||||
>
|
||||
<div v-if="showMessage" class="p-3" data-test="contribtion-message">
|
||||
{{ noOpenCreation }}
|
||||
</div>
|
||||
<div v-else>
|
||||
@ -118,8 +115,8 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateAmount(amount) {
|
||||
this.form.amount = (amount * 20).toFixed(2).toString()
|
||||
updateAmount(hours) {
|
||||
this.form.amount = (hours * 20).toFixed(2).toString()
|
||||
},
|
||||
submit() {
|
||||
this.$emit(this.form.id ? 'update-contribution' : 'set-contribution', { ...this.form })
|
||||
@ -135,6 +132,15 @@ export default {
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
showMessage() {
|
||||
if (this.maxGddThisMonth <= 0 && this.maxGddLastMonth <= 0) return true
|
||||
if (this.form.date)
|
||||
return (
|
||||
(this.isThisMonth && this.maxGddThisMonth <= 0) ||
|
||||
(!this.isThisMonth && this.maxGddLastMonth <= 0)
|
||||
)
|
||||
return false
|
||||
},
|
||||
disabled() {
|
||||
return (
|
||||
this.form.date === '' ||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gradido",
|
||||
"version": "1.18.0",
|
||||
"version": "1.18.2",
|
||||
"description": "Gradido",
|
||||
"main": "index.js",
|
||||
"repository": "git@github.com:gradido/gradido.git",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user