mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into new-password-encryption
This commit is contained in:
commit
13df737c09
36
CHANGELOG.md
36
CHANGELOG.md
@ -4,8 +4,44 @@ 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).
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||||
|
|
||||||
|
#### [1.14.1](https://github.com/gradido/gradido/compare/1.14.0...1.14.1)
|
||||||
|
|
||||||
|
- fix(frontend): load contributionMessages is fixed [`#2390`](https://github.com/gradido/gradido/pull/2390)
|
||||||
|
|
||||||
|
#### [1.14.0](https://github.com/gradido/gradido/compare/1.13.3...1.14.0)
|
||||||
|
|
||||||
|
> 14 November 2022
|
||||||
|
|
||||||
|
- chore(release): version 1.14.0 [`#2389`](https://github.com/gradido/gradido/pull/2389)
|
||||||
|
- fix(frontend): close all open collapse by change tabs in community [`#2388`](https://github.com/gradido/gradido/pull/2388)
|
||||||
|
- fix(backend): corrected E-Mail texts [`#2386`](https://github.com/gradido/gradido/pull/2386)
|
||||||
|
- fix(frontend): better history messages [`#2381`](https://github.com/gradido/gradido/pull/2381)
|
||||||
|
- fix(frontend): mailto link [`#2383`](https://github.com/gradido/gradido/pull/2383)
|
||||||
|
- fix(admin): fix text in admin area to uppercase [`#2365`](https://github.com/gradido/gradido/pull/2365)
|
||||||
|
- feat(frontend): move the information about gradido being free to the auth layout [`#2349`](https://github.com/gradido/gradido/pull/2349)
|
||||||
|
- fix(admin): load error fixed for contribution link [`#2364`](https://github.com/gradido/gradido/pull/2364)
|
||||||
|
- fix(admin): edit contribution link does not take old values [`#2362`](https://github.com/gradido/gradido/pull/2362)
|
||||||
|
- fix(other): corrected dockerfile descriptions [`#2346`](https://github.com/gradido/gradido/pull/2346)
|
||||||
|
- feat(backend): 🍰 Send email for rejected contributions [`#2340`](https://github.com/gradido/gradido/pull/2340)
|
||||||
|
- feat(admin): edit automatic contribution link [`#2309`](https://github.com/gradido/gradido/pull/2309)
|
||||||
|
- refactor(backend): fix logger mocks [`#2308`](https://github.com/gradido/gradido/pull/2308)
|
||||||
|
- fix(admin): update contribution list after admin updates contribution [`#2330`](https://github.com/gradido/gradido/pull/2330)
|
||||||
|
- fix(frontend): inconsistent labeling on login register [`#2350`](https://github.com/gradido/gradido/pull/2350)
|
||||||
|
- feat(backend): setup hyperswarm [`#1874`](https://github.com/gradido/gradido/pull/1874)
|
||||||
|
- feat(other): lint pull request workflow [`#2338`](https://github.com/gradido/gradido/pull/2338)
|
||||||
|
- Feature: 🍰 add updated at to contributions [`#2237`](https://github.com/gradido/gradido/pull/2237)
|
||||||
|
- Refactor: GitHub test workflow - disable video recording and reduce wait time [`#2336`](https://github.com/gradido/gradido/pull/2336)
|
||||||
|
- 2274 feature concept manuel user registration for admins [`#2289`](https://github.com/gradido/gradido/pull/2289)
|
||||||
|
- 1574 concept to introduce gradidoID and change password encryption [`#2252`](https://github.com/gradido/gradido/pull/2252)
|
||||||
|
- contributionlink stage-2 and stage-3 of capturing and activation [`#2241`](https://github.com/gradido/gradido/pull/2241)
|
||||||
|
- Github workflow: update actions to the current API version using Node v 16 [`#2323`](https://github.com/gradido/gradido/pull/2323)
|
||||||
|
- feature: Fullstack tests in GitHub workflow [`#2319`](https://github.com/gradido/gradido/pull/2319)
|
||||||
|
|
||||||
#### [1.13.3](https://github.com/gradido/gradido/compare/1.13.2...1.13.3)
|
#### [1.13.3](https://github.com/gradido/gradido/compare/1.13.2...1.13.3)
|
||||||
|
|
||||||
|
> 1 November 2022
|
||||||
|
|
||||||
|
- release: Version 1.13.3 [`#2322`](https://github.com/gradido/gradido/pull/2322)
|
||||||
- 2294 contribution links on its own page [`#2312`](https://github.com/gradido/gradido/pull/2312)
|
- 2294 contribution links on its own page [`#2312`](https://github.com/gradido/gradido/pull/2312)
|
||||||
- fix: Change Orange Color [`#2302`](https://github.com/gradido/gradido/pull/2302)
|
- fix: Change Orange Color [`#2302`](https://github.com/gradido/gradido/pull/2302)
|
||||||
- fix: Release Statistic Query Runner [`#2320`](https://github.com/gradido/gradido/pull/2320)
|
- fix: Release Statistic Query Runner [`#2320`](https://github.com/gradido/gradido/pull/2320)
|
||||||
|
|||||||
@ -20,10 +20,10 @@ ENV PORT="8080"
|
|||||||
# Labels
|
# Labels
|
||||||
LABEL org.label-schema.build-date="${BUILD_DATE}"
|
LABEL org.label-schema.build-date="${BUILD_DATE}"
|
||||||
LABEL org.label-schema.name="gradido:admin"
|
LABEL org.label-schema.name="gradido:admin"
|
||||||
LABEL org.label-schema.description="Gradido Vue Admin Interface"
|
LABEL org.label-schema.description="Gradido Admin Interface"
|
||||||
LABEL org.label-schema.usage="https://github.com/gradido/gradido/admin/README.md"
|
LABEL org.label-schema.usage="https://github.com/gradido/gradido/blob/master/README.md"
|
||||||
LABEL org.label-schema.url="https://gradido.net"
|
LABEL org.label-schema.url="https://gradido.net"
|
||||||
LABEL org.label-schema.vcs-url="https://github.com/gradido/gradido/backend"
|
LABEL org.label-schema.vcs-url="https://github.com/gradido/gradido/tree/master/admin"
|
||||||
LABEL org.label-schema.vcs-ref="${BUILD_COMMIT}"
|
LABEL org.label-schema.vcs-ref="${BUILD_COMMIT}"
|
||||||
LABEL org.label-schema.vendor="gradido Community"
|
LABEL org.label-schema.vendor="gradido Community"
|
||||||
LABEL org.label-schema.version="${BUILD_VERSION}"
|
LABEL org.label-schema.version="${BUILD_VERSION}"
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
"description": "Administraion Interface for Gradido",
|
"description": "Administraion Interface for Gradido",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"author": "Moriz Wahl",
|
"author": "Moriz Wahl",
|
||||||
"version": "1.13.3",
|
"version": "1.14.1",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -46,5 +46,10 @@ describe('ContributionLink', () => {
|
|||||||
wrapper.vm.editContributionLinkData()
|
wrapper.vm.editContributionLinkData()
|
||||||
expect(wrapper.vm.$root.$emit('bv::toggle::collapse', 'newContribution')).toBeTruthy()
|
expect(wrapper.vm.$root.$emit('bv::toggle::collapse', 'newContribution')).toBeTruthy()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('emits toggle::collapse close Contribution-Form ', async () => {
|
||||||
|
wrapper.vm.closeContributionForm()
|
||||||
|
expect(wrapper.vm.$root.$emit('bv::toggle::collapse', 'newContribution')).toBeTruthy()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -8,7 +8,11 @@
|
|||||||
header-class="text-center"
|
header-class="text-center"
|
||||||
class="mt-5"
|
class="mt-5"
|
||||||
>
|
>
|
||||||
<b-button v-b-toggle.newContribution class="my-3 d-flex justify-content-left">
|
<b-button
|
||||||
|
v-if="!editContributionLink"
|
||||||
|
v-b-toggle.newContribution
|
||||||
|
class="my-3 d-flex justify-content-left"
|
||||||
|
>
|
||||||
{{ $t('math.plus') }} {{ $t('contributionLink.newContributionLink') }}
|
{{ $t('math.plus') }} {{ $t('contributionLink.newContributionLink') }}
|
||||||
</b-button>
|
</b-button>
|
||||||
|
|
||||||
@ -17,7 +21,9 @@
|
|||||||
<p class="h2 ml-5">{{ $t('contributionLink.contributionLinks') }}</p>
|
<p class="h2 ml-5">{{ $t('contributionLink.contributionLinks') }}</p>
|
||||||
<contribution-link-form
|
<contribution-link-form
|
||||||
:contributionLinkData="contributionLinkData"
|
:contributionLinkData="contributionLinkData"
|
||||||
|
:editContributionLink="editContributionLink"
|
||||||
@get-contribution-links="$emit('get-contribution-links')"
|
@get-contribution-links="$emit('get-contribution-links')"
|
||||||
|
@closeContributionForm="closeContributionForm"
|
||||||
/>
|
/>
|
||||||
</b-card>
|
</b-card>
|
||||||
</b-collapse>
|
</b-collapse>
|
||||||
@ -28,6 +34,7 @@
|
|||||||
:items="items"
|
:items="items"
|
||||||
@editContributionLinkData="editContributionLinkData"
|
@editContributionLinkData="editContributionLinkData"
|
||||||
@get-contribution-links="$emit('get-contribution-links')"
|
@get-contribution-links="$emit('get-contribution-links')"
|
||||||
|
@closeContributionForm="closeContributionForm"
|
||||||
/>
|
/>
|
||||||
<div v-else>{{ $t('contributionLink.noContributionLinks') }}</div>
|
<div v-else>{{ $t('contributionLink.noContributionLinks') }}</div>
|
||||||
</b-card-text>
|
</b-card-text>
|
||||||
@ -58,12 +65,23 @@ export default {
|
|||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
contributionLinkData: {},
|
contributionLinkData: {},
|
||||||
|
editContributionLink: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
closeContributionForm() {
|
||||||
|
if (this.visible) {
|
||||||
|
this.$root.$emit('bv::toggle::collapse', 'newContribution')
|
||||||
|
this.editContributionLink = false
|
||||||
|
this.contributionLinkData = {}
|
||||||
|
}
|
||||||
|
},
|
||||||
editContributionLinkData(data) {
|
editContributionLinkData(data) {
|
||||||
if (!this.visible) this.$root.$emit('bv::toggle::collapse', 'newContribution')
|
if (!this.visible) {
|
||||||
|
this.$root.$emit('bv::toggle::collapse', 'newContribution')
|
||||||
|
}
|
||||||
this.contributionLinkData = data
|
this.contributionLinkData = data
|
||||||
|
this.editContributionLink = true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ global.alert = jest.fn()
|
|||||||
|
|
||||||
const propsData = {
|
const propsData = {
|
||||||
contributionLinkData: {},
|
contributionLinkData: {},
|
||||||
|
editContributionLink: false,
|
||||||
}
|
}
|
||||||
const apolloMutateMock = jest.fn().mockResolvedValue()
|
const apolloMutateMock = jest.fn().mockResolvedValue()
|
||||||
|
|
||||||
@ -108,6 +109,7 @@ describe('ContributionLinkForm', () => {
|
|||||||
cycle: 'ONCE',
|
cycle: 'ONCE',
|
||||||
maxPerCycle: 1,
|
maxPerCycle: 1,
|
||||||
maxAmountPerMonth: '0',
|
maxAmountPerMonth: '0',
|
||||||
|
id: null,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
<b-col>
|
<b-col>
|
||||||
<b-form-group :label="$t('contributionLink.validFrom')">
|
<b-form-group :label="$t('contributionLink.validFrom')">
|
||||||
<b-form-datepicker
|
<b-form-datepicker
|
||||||
|
reset-button
|
||||||
v-model="form.validFrom"
|
v-model="form.validFrom"
|
||||||
size="lg"
|
size="lg"
|
||||||
:min="min"
|
:min="min"
|
||||||
@ -19,6 +20,7 @@
|
|||||||
<b-col>
|
<b-col>
|
||||||
<b-form-group :label="$t('contributionLink.validTo')">
|
<b-form-group :label="$t('contributionLink.validTo')">
|
||||||
<b-form-datepicker
|
<b-form-datepicker
|
||||||
|
reset-button
|
||||||
v-model="form.validTo"
|
v-model="form.validTo"
|
||||||
size="lg"
|
size="lg"
|
||||||
:min="form.validFrom ? form.validFrom : min"
|
:min="form.validFrom ? form.validFrom : min"
|
||||||
@ -102,16 +104,25 @@
|
|||||||
</b-form-group>
|
</b-form-group>
|
||||||
-->
|
-->
|
||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<b-button type="submit" variant="primary">{{ $t('contributionLink.create') }}</b-button>
|
<b-button type="submit" variant="primary">
|
||||||
|
{{
|
||||||
|
editContributionLink ? $t('contributionLink.saveChange') : $t('contributionLink.create')
|
||||||
|
}}
|
||||||
|
</b-button>
|
||||||
<b-button type="reset" variant="danger" @click.prevent="onReset">
|
<b-button type="reset" variant="danger" @click.prevent="onReset">
|
||||||
{{ $t('contributionLink.clear') }}
|
{{ $t('contributionLink.clear') }}
|
||||||
</b-button>
|
</b-button>
|
||||||
|
<b-button @click.prevent="$emit('closeContributionForm')">
|
||||||
|
{{ $t('contributionLink.close') }}
|
||||||
|
</b-button>
|
||||||
</div>
|
</div>
|
||||||
</b-form>
|
</b-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { createContributionLink } from '@/graphql/createContributionLink.js'
|
import { createContributionLink } from '@/graphql/createContributionLink.js'
|
||||||
|
import { updateContributionLink } from '@/graphql/updateContributionLink.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ContributionLinkForm',
|
name: 'ContributionLinkForm',
|
||||||
props: {
|
props: {
|
||||||
@ -121,6 +132,7 @@ export default {
|
|||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
editContributionLink: { type: Boolean, required: true },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -157,23 +169,24 @@ export default {
|
|||||||
if (this.form.validFrom === null)
|
if (this.form.validFrom === null)
|
||||||
return this.toastError(this.$t('contributionLink.noStartDate'))
|
return this.toastError(this.$t('contributionLink.noStartDate'))
|
||||||
if (this.form.validTo === null) return this.toastError(this.$t('contributionLink.noEndDate'))
|
if (this.form.validTo === null) return this.toastError(this.$t('contributionLink.noEndDate'))
|
||||||
|
|
||||||
|
const variables = {
|
||||||
|
...this.form,
|
||||||
|
id: this.contributionLinkData.id ? this.contributionLinkData.id : null,
|
||||||
|
}
|
||||||
|
|
||||||
this.$apollo
|
this.$apollo
|
||||||
.mutate({
|
.mutate({
|
||||||
mutation: createContributionLink,
|
mutation: this.editContributionLink ? updateContributionLink : createContributionLink,
|
||||||
variables: {
|
variables: variables,
|
||||||
validFrom: this.form.validFrom,
|
|
||||||
validTo: this.form.validTo,
|
|
||||||
name: this.form.name,
|
|
||||||
amount: this.form.amount,
|
|
||||||
memo: this.form.memo,
|
|
||||||
cycle: this.form.cycle,
|
|
||||||
maxPerCycle: this.form.maxPerCycle,
|
|
||||||
maxAmountPerMonth: this.form.maxAmountPerMonth,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.link = result.data.createContributionLink.link
|
const link = this.editContributionLink
|
||||||
this.toastSuccess(this.link)
|
? result.data.updateContributionLink.link
|
||||||
|
: result.data.createContributionLink.link
|
||||||
|
this.toastSuccess(
|
||||||
|
this.editContributionLink ? this.$t('contributionLink.changeSaved') : link,
|
||||||
|
)
|
||||||
this.onReset()
|
this.onReset()
|
||||||
this.$root.$emit('bv::toggle::collapse', 'newContribution')
|
this.$root.$emit('bv::toggle::collapse', 'newContribution')
|
||||||
this.$emit('get-contribution-links')
|
this.$emit('get-contribution-links')
|
||||||
@ -184,6 +197,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onReset() {
|
onReset() {
|
||||||
this.$refs.contributionLinkForm.reset()
|
this.$refs.contributionLinkForm.reset()
|
||||||
|
this.form = {}
|
||||||
this.form.validFrom = null
|
this.form.validFrom = null
|
||||||
this.form.validTo = null
|
this.form.validTo = null
|
||||||
},
|
},
|
||||||
@ -195,14 +209,7 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
contributionLinkData() {
|
contributionLinkData() {
|
||||||
this.form.name = this.contributionLinkData.name
|
this.form = this.contributionLinkData
|
||||||
this.form.memo = this.contributionLinkData.memo
|
|
||||||
this.form.amount = this.contributionLinkData.amount
|
|
||||||
this.form.validFrom = this.contributionLinkData.validFrom
|
|
||||||
this.form.validTo = this.contributionLinkData.validTo
|
|
||||||
this.form.cycle = this.contributionLinkData.cycle
|
|
||||||
this.form.maxPerCycle = this.contributionLinkData.maxPerCycle
|
|
||||||
this.form.maxAmountPerMonth = this.contributionLinkData.maxAmountPerMonth
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -108,6 +108,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.toastSuccess(this.$t('contributionLink.deleted'))
|
this.toastSuccess(this.$t('contributionLink.deleted'))
|
||||||
|
this.$emit('closeContributionForm')
|
||||||
this.$emit('get-contribution-links')
|
this.$emit('get-contribution-links')
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|||||||
@ -1,7 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<span v-for="({ type, text }, index) in linkifiedMessage" :key="index">
|
<span v-for="({ type, text }, index) in parsedMessage" :key="index">
|
||||||
<b-link v-if="type === 'link'" :href="text" target="_blank">{{ text }}</b-link>
|
<b-link v-if="type === 'link'" :href="text" target="_blank">{{ text }}</b-link>
|
||||||
|
<span v-else-if="type === 'date'">
|
||||||
|
{{ $d(new Date(text), 'short') }}
|
||||||
|
<br />
|
||||||
|
</span>
|
||||||
|
<span v-else-if="type === 'amount'">
|
||||||
|
<br />
|
||||||
|
{{ `${$n(Number(text), 'decimal')} GDD` }}
|
||||||
|
</span>
|
||||||
<span v-else>{{ text }}</span>
|
<span v-else>{{ text }}</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -12,17 +20,28 @@ const LINK_REGEX_PATTERN =
|
|||||||
/(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*))/i
|
/(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*))/i
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'LinkifyMessage',
|
name: 'ParseMessage',
|
||||||
props: {
|
props: {
|
||||||
message: {
|
message: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
reuired: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
linkifiedMessage() {
|
parsedMessage() {
|
||||||
const linkified = []
|
|
||||||
let string = this.message
|
let string = this.message
|
||||||
|
const linkified = []
|
||||||
|
let amount
|
||||||
|
if (this.type === 'HISTORY') {
|
||||||
|
const split = string.split(/\n\s*---\n\s*/)
|
||||||
|
string = split[1]
|
||||||
|
linkified.push({ type: 'date', text: split[0].trim() })
|
||||||
|
amount = split[2].trim()
|
||||||
|
}
|
||||||
let match
|
let match
|
||||||
while ((match = string.match(LINK_REGEX_PATTERN))) {
|
while ((match = string.match(LINK_REGEX_PATTERN))) {
|
||||||
if (match.index > 0)
|
if (match.index > 0)
|
||||||
@ -31,6 +50,7 @@ export default {
|
|||||||
string = string.substring(match.index + match[0].length)
|
string = string.substring(match.index + match[0].length)
|
||||||
}
|
}
|
||||||
if (string.length > 0) linkified.push({ type: 'text', text: string })
|
if (string.length > 0) linkified.push({ type: 'text', text: string })
|
||||||
|
if (amount) linkified.push({ type: 'amount', text: amount })
|
||||||
return linkified
|
return linkified
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -3,12 +3,16 @@ import ContributionMessagesListItem from './ContributionMessagesListItem.vue'
|
|||||||
|
|
||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
|
const dateMock = jest.fn((d) => d)
|
||||||
|
const numberMock = jest.fn((n) => n)
|
||||||
|
|
||||||
describe('ContributionMessagesListItem', () => {
|
describe('ContributionMessagesListItem', () => {
|
||||||
let wrapper
|
let wrapper
|
||||||
|
|
||||||
const mocks = {
|
const mocks = {
|
||||||
$t: jest.fn((t) => t),
|
$t: jest.fn((t) => t),
|
||||||
$d: jest.fn((d) => d),
|
$d: dateMock,
|
||||||
|
$n: numberMock,
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('if message author has moderator role', () => {
|
describe('if message author has moderator role', () => {
|
||||||
@ -189,4 +193,64 @@ and here is the link to the repository: https://github.com/gradido/gradido`)
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('contribution message type HISTORY', () => {
|
||||||
|
const propsData = {
|
||||||
|
message: {
|
||||||
|
id: 111,
|
||||||
|
message: `Sun Nov 13 2022 13:05:48 GMT+0100 (Central European Standard Time)
|
||||||
|
---
|
||||||
|
This message also contains a link: https://gradido.net/de/
|
||||||
|
---
|
||||||
|
350.00`,
|
||||||
|
createdAt: '2022-08-29T12:23:27.000Z',
|
||||||
|
updatedAt: null,
|
||||||
|
type: 'HISTORY',
|
||||||
|
userFirstName: 'Peter',
|
||||||
|
userLastName: 'Lustig',
|
||||||
|
userId: 107,
|
||||||
|
__typename: 'ContributionMessage',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const itemWrapper = () => {
|
||||||
|
return mount(ContributionMessagesListItem, {
|
||||||
|
localVue,
|
||||||
|
mocks,
|
||||||
|
propsData,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
let messageField
|
||||||
|
|
||||||
|
describe('render HISTORY message', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks()
|
||||||
|
wrapper = itemWrapper()
|
||||||
|
messageField = wrapper.find('div.is-not-moderator.text-left > div:nth-child(4)')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('renders the date', () => {
|
||||||
|
expect(dateMock).toBeCalledWith(
|
||||||
|
new Date('Sun Nov 13 2022 13:05:48 GMT+0100 (Central European Standard Time'),
|
||||||
|
'short',
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('renders the amount', () => {
|
||||||
|
expect(numberMock).toBeCalledWith(350, 'decimal')
|
||||||
|
expect(messageField.text()).toContain('350 GDD')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('contains the link as text', () => {
|
||||||
|
expect(messageField.text()).toContain(
|
||||||
|
'This message also contains a link: https://gradido.net/de/',
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('contains a link to the given address', () => {
|
||||||
|
expect(messageField.find('a').attributes('href')).toBe('https://gradido.net/de/')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -5,23 +5,23 @@
|
|||||||
<span class="ml-2 mr-2">{{ message.userFirstName }} {{ message.userLastName }}</span>
|
<span class="ml-2 mr-2">{{ message.userFirstName }} {{ message.userLastName }}</span>
|
||||||
<span class="ml-2">{{ $d(new Date(message.createdAt), 'short') }}</span>
|
<span class="ml-2">{{ $d(new Date(message.createdAt), 'short') }}</span>
|
||||||
<small class="ml-4 text-success">{{ $t('moderator') }}</small>
|
<small class="ml-4 text-success">{{ $t('moderator') }}</small>
|
||||||
<linkify-message :message="message.message"></linkify-message>
|
<parse-message v-bind="message"></parse-message>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="text-left is-not-moderator">
|
<div v-else class="text-left is-not-moderator">
|
||||||
<b-avatar variant="info"></b-avatar>
|
<b-avatar variant="info"></b-avatar>
|
||||||
<span class="ml-2 mr-2">{{ message.userFirstName }} {{ message.userLastName }}</span>
|
<span class="ml-2 mr-2">{{ message.userFirstName }} {{ message.userLastName }}</span>
|
||||||
<span class="ml-2">{{ $d(new Date(message.createdAt), 'short') }}</span>
|
<span class="ml-2">{{ $d(new Date(message.createdAt), 'short') }}</span>
|
||||||
<linkify-message :message="message.message"></linkify-message>
|
<parse-message v-bind="message"></parse-message>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import LinkifyMessage from '@/components/ContributionMessages/LinkifyMessage.vue'
|
import ParseMessage from '@/components/ContributionMessages/ParseMessage.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ContributionMessagesListItem',
|
name: 'ContributionMessagesListItem',
|
||||||
components: {
|
components: {
|
||||||
LinkifyMessage,
|
ParseMessage,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
message: {
|
message: {
|
||||||
|
|||||||
40
admin/src/graphql/updateContributionLink.js
Normal file
40
admin/src/graphql/updateContributionLink.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
|
export const updateContributionLink = gql`
|
||||||
|
mutation (
|
||||||
|
$amount: Decimal!
|
||||||
|
$name: String!
|
||||||
|
$memo: String!
|
||||||
|
$cycle: String!
|
||||||
|
$validFrom: String
|
||||||
|
$validTo: String
|
||||||
|
$maxAmountPerMonth: Decimal
|
||||||
|
$maxPerCycle: Int! = 1
|
||||||
|
$id: Int!
|
||||||
|
) {
|
||||||
|
updateContributionLink(
|
||||||
|
amount: $amount
|
||||||
|
name: $name
|
||||||
|
memo: $memo
|
||||||
|
cycle: $cycle
|
||||||
|
validFrom: $validFrom
|
||||||
|
validTo: $validTo
|
||||||
|
maxAmountPerMonth: $maxAmountPerMonth
|
||||||
|
maxPerCycle: $maxPerCycle
|
||||||
|
id: $id
|
||||||
|
) {
|
||||||
|
id
|
||||||
|
amount
|
||||||
|
name
|
||||||
|
memo
|
||||||
|
code
|
||||||
|
link
|
||||||
|
createdAt
|
||||||
|
validFrom
|
||||||
|
validTo
|
||||||
|
maxAmountPerMonth
|
||||||
|
cycle
|
||||||
|
maxPerCycle
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
||||||
@ -3,7 +3,9 @@
|
|||||||
"back": "zurück",
|
"back": "zurück",
|
||||||
"contributionLink": {
|
"contributionLink": {
|
||||||
"amount": "Betrag",
|
"amount": "Betrag",
|
||||||
|
"changeSaved": "Änderungen gespeichert",
|
||||||
"clear": "Löschen",
|
"clear": "Löschen",
|
||||||
|
"close": "Schließen",
|
||||||
"contributionLinks": "Beitragslinks",
|
"contributionLinks": "Beitragslinks",
|
||||||
"create": "Anlegen",
|
"create": "Anlegen",
|
||||||
"cycle": "Zyklus",
|
"cycle": "Zyklus",
|
||||||
@ -23,6 +25,7 @@
|
|||||||
"once": "einmalig"
|
"once": "einmalig"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"saveChange": "Änderungen speichern",
|
||||||
"validFrom": "Startdatum",
|
"validFrom": "Startdatum",
|
||||||
"validTo": "Enddatum"
|
"validTo": "Enddatum"
|
||||||
},
|
},
|
||||||
@ -95,7 +98,7 @@
|
|||||||
"multiple_creation_text": "Bitte wähle ein oder mehrere Mitglieder aus für die du Schöpfen möchtest.",
|
"multiple_creation_text": "Bitte wähle ein oder mehrere Mitglieder aus für die du Schöpfen möchtest.",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"navbar": {
|
"navbar": {
|
||||||
"automaticContributions": "automatische Beiträge",
|
"automaticContributions": "Automatische Beiträge",
|
||||||
"logout": "Abmelden",
|
"logout": "Abmelden",
|
||||||
"multi_creation": "Mehrfachschöpfung",
|
"multi_creation": "Mehrfachschöpfung",
|
||||||
"my-account": "Mein Konto",
|
"my-account": "Mein Konto",
|
||||||
|
|||||||
@ -3,7 +3,9 @@
|
|||||||
"back": "back",
|
"back": "back",
|
||||||
"contributionLink": {
|
"contributionLink": {
|
||||||
"amount": "Amount",
|
"amount": "Amount",
|
||||||
|
"changeSaved": "Changes saved",
|
||||||
"clear": "Clear",
|
"clear": "Clear",
|
||||||
|
"close": "Close",
|
||||||
"contributionLinks": "Contribution Links",
|
"contributionLinks": "Contribution Links",
|
||||||
"create": "Create",
|
"create": "Create",
|
||||||
"cycle": "Cycle",
|
"cycle": "Cycle",
|
||||||
@ -23,6 +25,7 @@
|
|||||||
"once": "once"
|
"once": "once"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"saveChange": "Save Changes",
|
||||||
"validFrom": "Start-date",
|
"validFrom": "Start-date",
|
||||||
"validTo": "End-Date"
|
"validTo": "End-Date"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gradido-backend",
|
"name": "gradido-backend",
|
||||||
"version": "1.13.3",
|
"version": "1.14.1",
|
||||||
"description": "Gradido unified backend providing an API-Service for Gradido Transactions",
|
"description": "Gradido unified backend providing an API-Service for Gradido Transactions",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": "https://github.com/gradido/gradido/backend",
|
"repository": "https://github.com/gradido/gradido/backend",
|
||||||
|
|||||||
@ -139,6 +139,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('user to get a new role does not exist', () => {
|
describe('user to get a new role does not exist', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({ mutation: setUserRole, variables: { userId: admin.id + 1, isAdmin: true } }),
|
mutate({ mutation: setUserRole, variables: { userId: admin.id + 1, isAdmin: true } }),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -195,6 +196,7 @@ describe('AdminResolver', () => {
|
|||||||
describe('change role with error', () => {
|
describe('change role with error', () => {
|
||||||
describe('is own role', () => {
|
describe('is own role', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({ mutation: setUserRole, variables: { userId: admin.id, isAdmin: false } }),
|
mutate({ mutation: setUserRole, variables: { userId: admin.id, isAdmin: false } }),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -211,6 +213,7 @@ describe('AdminResolver', () => {
|
|||||||
describe('user has already role to be set', () => {
|
describe('user has already role to be set', () => {
|
||||||
describe('to admin', () => {
|
describe('to admin', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await mutate({
|
await mutate({
|
||||||
mutation: setUserRole,
|
mutation: setUserRole,
|
||||||
variables: { userId: user.id, isAdmin: true },
|
variables: { userId: user.id, isAdmin: true },
|
||||||
@ -231,6 +234,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('to usual user', () => {
|
describe('to usual user', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await mutate({
|
await mutate({
|
||||||
mutation: setUserRole,
|
mutation: setUserRole,
|
||||||
variables: { userId: user.id, isAdmin: false },
|
variables: { userId: user.id, isAdmin: false },
|
||||||
@ -307,6 +311,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('user to be deleted does not exist', () => {
|
describe('user to be deleted does not exist', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({ mutation: deleteUser, variables: { userId: admin.id + 1 } }),
|
mutate({ mutation: deleteUser, variables: { userId: admin.id + 1 } }),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -323,6 +328,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('delete self', () => {
|
describe('delete self', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({ mutation: deleteUser, variables: { userId: admin.id } }),
|
mutate({ mutation: deleteUser, variables: { userId: admin.id } }),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -356,6 +362,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('delete deleted user', () => {
|
describe('delete deleted user', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({ mutation: deleteUser, variables: { userId: user.id } }),
|
mutate({ mutation: deleteUser, variables: { userId: user.id } }),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -427,6 +434,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('user to be undelete does not exist', () => {
|
describe('user to be undelete does not exist', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({ mutation: unDeleteUser, variables: { userId: admin.id + 1 } }),
|
mutate({ mutation: unDeleteUser, variables: { userId: admin.id + 1 } }),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -447,6 +455,7 @@ describe('AdminResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({ mutation: unDeleteUser, variables: { userId: user.id } }),
|
mutate({ mutation: unDeleteUser, variables: { userId: user.id } }),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -939,6 +948,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('user to create for does not exist', () => {
|
describe('user to create for does not exist', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({ mutation: adminCreateContribution, variables }),
|
mutate({ mutation: adminCreateContribution, variables }),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -962,6 +972,7 @@ describe('AdminResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({ mutation: adminCreateContribution, variables }),
|
mutate({ mutation: adminCreateContribution, variables }),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -987,6 +998,7 @@ describe('AdminResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({ mutation: adminCreateContribution, variables }),
|
mutate({ mutation: adminCreateContribution, variables }),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -1013,6 +1025,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('date of creation is not a date string', () => {
|
describe('date of creation is not a date string', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({ mutation: adminCreateContribution, variables }),
|
mutate({ mutation: adminCreateContribution, variables }),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -1034,6 +1047,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('date of creation is four months ago', () => {
|
describe('date of creation is four months ago', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
variables.creationDate = new Date(
|
variables.creationDate = new Date(
|
||||||
now.getFullYear(),
|
now.getFullYear(),
|
||||||
@ -1061,6 +1075,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('date of creation is in the future', () => {
|
describe('date of creation is in the future', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
variables.creationDate = new Date(
|
variables.creationDate = new Date(
|
||||||
now.getFullYear(),
|
now.getFullYear(),
|
||||||
@ -1088,6 +1103,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('amount of creation is too high', () => {
|
describe('amount of creation is too high', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
variables.creationDate = new Date().toString()
|
variables.creationDate = new Date().toString()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({ mutation: adminCreateContribution, variables }),
|
mutate({ mutation: adminCreateContribution, variables }),
|
||||||
@ -1213,6 +1229,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('user for creation to update does not exist', () => {
|
describe('user for creation to update does not exist', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
@ -1242,6 +1259,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('user for creation to update is deleted', () => {
|
describe('user for creation to update is deleted', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
@ -1267,6 +1285,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('creation does not exist', () => {
|
describe('creation does not exist', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
@ -1292,6 +1311,7 @@ describe('AdminResolver', () => {
|
|||||||
|
|
||||||
describe('user email does not match creation user', () => {
|
describe('user email does not match creation user', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
@ -1326,6 +1346,7 @@ describe('AdminResolver', () => {
|
|||||||
describe('creation update is not valid', () => {
|
describe('creation update is not valid', () => {
|
||||||
// as this test has not clearly defined that date, it is a false positive
|
// as this test has not clearly defined that date, it is a false positive
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
@ -1502,6 +1523,7 @@ describe('AdminResolver', () => {
|
|||||||
describe('adminDeleteContribution', () => {
|
describe('adminDeleteContribution', () => {
|
||||||
describe('creation id does not exist', () => {
|
describe('creation id does not exist', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: adminDeleteContribution,
|
mutation: adminDeleteContribution,
|
||||||
@ -1538,6 +1560,7 @@ describe('AdminResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: adminDeleteContribution,
|
mutation: adminDeleteContribution,
|
||||||
@ -1583,6 +1606,7 @@ describe('AdminResolver', () => {
|
|||||||
describe('confirmContribution', () => {
|
describe('confirmContribution', () => {
|
||||||
describe('creation does not exits', () => {
|
describe('creation does not exits', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: confirmContribution,
|
mutation: confirmContribution,
|
||||||
|
|||||||
@ -63,6 +63,7 @@ import ContributionMessageArgs from '@arg/ContributionMessageArgs'
|
|||||||
import { ContributionMessageType } from '@enum/MessageType'
|
import { ContributionMessageType } from '@enum/MessageType'
|
||||||
import { ContributionMessage } from '@model/ContributionMessage'
|
import { ContributionMessage } from '@model/ContributionMessage'
|
||||||
import { sendContributionConfirmedEmail } from '@/mailer/sendContributionConfirmedEmail'
|
import { sendContributionConfirmedEmail } from '@/mailer/sendContributionConfirmedEmail'
|
||||||
|
import { sendContributionRejectedEmail } from '@/mailer/sendContributionRejectedEmail'
|
||||||
import { sendAddedContributionMessageEmail } from '@/mailer/sendAddedContributionMessageEmail'
|
import { sendAddedContributionMessageEmail } from '@/mailer/sendAddedContributionMessageEmail'
|
||||||
import { eventProtocol } from '@/event/EventProtocolEmitter'
|
import { eventProtocol } from '@/event/EventProtocolEmitter'
|
||||||
import {
|
import {
|
||||||
@ -455,6 +456,10 @@ export class AdminResolver {
|
|||||||
) {
|
) {
|
||||||
throw new Error('Own contribution can not be deleted as admin')
|
throw new Error('Own contribution can not be deleted as admin')
|
||||||
}
|
}
|
||||||
|
const user = await dbUser.findOneOrFail(
|
||||||
|
{ id: contribution.userId },
|
||||||
|
{ relations: ['emailContact'] },
|
||||||
|
)
|
||||||
contribution.contributionStatus = ContributionStatus.DELETED
|
contribution.contributionStatus = ContributionStatus.DELETED
|
||||||
contribution.deletedBy = moderator.id
|
contribution.deletedBy = moderator.id
|
||||||
await contribution.save()
|
await contribution.save()
|
||||||
@ -468,6 +473,16 @@ export class AdminResolver {
|
|||||||
await eventProtocol.writeEvent(
|
await eventProtocol.writeEvent(
|
||||||
event.setEventAdminContributionDelete(eventAdminContributionDelete),
|
event.setEventAdminContributionDelete(eventAdminContributionDelete),
|
||||||
)
|
)
|
||||||
|
sendContributionRejectedEmail({
|
||||||
|
senderFirstName: moderator.firstName,
|
||||||
|
senderLastName: moderator.lastName,
|
||||||
|
recipientEmail: user.emailContact.email,
|
||||||
|
recipientFirstName: user.firstName,
|
||||||
|
recipientLastName: user.lastName,
|
||||||
|
contributionMemo: contribution.memo,
|
||||||
|
contributionAmount: contribution.amount,
|
||||||
|
overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
|
||||||
|
})
|
||||||
|
|
||||||
return !!res
|
return !!res
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,6 +74,7 @@ describe('ContributionResolver', () => {
|
|||||||
|
|
||||||
describe('input not valid', () => {
|
describe('input not valid', () => {
|
||||||
it('throws error when memo length smaller than 5 chars', async () => {
|
it('throws error when memo length smaller than 5 chars', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
@ -92,10 +93,11 @@ describe('ContributionResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('logs the error found', () => {
|
it('logs the error found', () => {
|
||||||
expect(logger.error).toBeCalledWith(`memo text is too short: memo.length=4 < (5)`)
|
expect(logger.error).toBeCalledWith(`memo text is too short: memo.length=4 < 5`)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('throws error when memo length greater than 255 chars', async () => {
|
it('throws error when memo length greater than 255 chars', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
@ -114,10 +116,11 @@ describe('ContributionResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('logs the error found', () => {
|
it('logs the error found', () => {
|
||||||
expect(logger.error).toBeCalledWith(`memo text is too long: memo.length=259 > (255)`)
|
expect(logger.error).toBeCalledWith(`memo text is too long: memo.length=259 > 255`)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('throws error when creationDate not-valid', async () => {
|
it('throws error when creationDate not-valid', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: createContribution,
|
mutation: createContribution,
|
||||||
@ -144,6 +147,7 @@ describe('ContributionResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('throws error when creationDate 3 month behind', async () => {
|
it('throws error when creationDate 3 month behind', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
@ -375,6 +379,7 @@ describe('ContributionResolver', () => {
|
|||||||
|
|
||||||
describe('wrong contribution id', () => {
|
describe('wrong contribution id', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: updateContribution,
|
mutation: updateContribution,
|
||||||
@ -399,6 +404,7 @@ describe('ContributionResolver', () => {
|
|||||||
|
|
||||||
describe('Memo length smaller than 5 chars', () => {
|
describe('Memo length smaller than 5 chars', () => {
|
||||||
it('throws error', async () => {
|
it('throws error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
@ -418,12 +424,13 @@ describe('ContributionResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('logs the error found', () => {
|
it('logs the error found', () => {
|
||||||
expect(logger.error).toBeCalledWith('memo text is too short: memo.length=4 < (5)')
|
expect(logger.error).toBeCalledWith('memo text is too short: memo.length=4 < 5')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('Memo length greater than 255 chars', () => {
|
describe('Memo length greater than 255 chars', () => {
|
||||||
it('throws error', async () => {
|
it('throws error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
@ -443,7 +450,7 @@ describe('ContributionResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('logs the error found', () => {
|
it('logs the error found', () => {
|
||||||
expect(logger.error).toBeCalledWith('memo text is too long: memo.length=259 > (255)')
|
expect(logger.error).toBeCalledWith('memo text is too long: memo.length=259 > 255')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -456,6 +463,7 @@ describe('ContributionResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: updateContribution,
|
mutation: updateContribution,
|
||||||
@ -486,6 +494,7 @@ describe('ContributionResolver', () => {
|
|||||||
|
|
||||||
describe('admin tries to update a user contribution', () => {
|
describe('admin tries to update a user contribution', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
@ -516,6 +525,7 @@ describe('ContributionResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: updateContribution,
|
mutation: updateContribution,
|
||||||
@ -546,6 +556,7 @@ describe('ContributionResolver', () => {
|
|||||||
|
|
||||||
describe('update creation to a date that is older than 3 months', () => {
|
describe('update creation to a date that is older than 3 months', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
@ -564,7 +575,7 @@ describe('ContributionResolver', () => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('logs the error found', () => {
|
it.skip('logs the error found', () => {
|
||||||
expect(logger.error).toBeCalledWith(
|
expect(logger.error).toBeCalledWith(
|
||||||
'No information for available creations with the given creationDate=',
|
'No information for available creations with the given creationDate=',
|
||||||
'Invalid Date',
|
'Invalid Date',
|
||||||
@ -830,6 +841,7 @@ describe('ContributionResolver', () => {
|
|||||||
|
|
||||||
describe('User deletes already confirmed contribution', () => {
|
describe('User deletes already confirmed contribution', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await mutate({
|
await mutate({
|
||||||
mutation: login,
|
mutation: login,
|
||||||
variables: { email: 'peter@lustig.de', password: 'Aa12345_' },
|
variables: { email: 'peter@lustig.de', password: 'Aa12345_' },
|
||||||
|
|||||||
@ -32,12 +32,12 @@ export class ContributionResolver {
|
|||||||
@Ctx() context: Context,
|
@Ctx() context: Context,
|
||||||
): Promise<UnconfirmedContribution> {
|
): Promise<UnconfirmedContribution> {
|
||||||
if (memo.length > MEMO_MAX_CHARS) {
|
if (memo.length > MEMO_MAX_CHARS) {
|
||||||
logger.error(`memo text is too long: memo.length=${memo.length} > (${MEMO_MAX_CHARS})`)
|
logger.error(`memo text is too long: memo.length=${memo.length} > ${MEMO_MAX_CHARS}`)
|
||||||
throw new Error(`memo text is too long (${MEMO_MAX_CHARS} characters maximum)`)
|
throw new Error(`memo text is too long (${MEMO_MAX_CHARS} characters maximum)`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memo.length < MEMO_MIN_CHARS) {
|
if (memo.length < MEMO_MIN_CHARS) {
|
||||||
logger.error(`memo text is too short: memo.length=${memo.length} < (${MEMO_MIN_CHARS})`)
|
logger.error(`memo text is too short: memo.length=${memo.length} < ${MEMO_MIN_CHARS}`)
|
||||||
throw new Error(`memo text is too short (${MEMO_MIN_CHARS} characters minimum)`)
|
throw new Error(`memo text is too short (${MEMO_MIN_CHARS} characters minimum)`)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,12 +172,12 @@ export class ContributionResolver {
|
|||||||
@Ctx() context: Context,
|
@Ctx() context: Context,
|
||||||
): Promise<UnconfirmedContribution> {
|
): Promise<UnconfirmedContribution> {
|
||||||
if (memo.length > MEMO_MAX_CHARS) {
|
if (memo.length > MEMO_MAX_CHARS) {
|
||||||
logger.error(`memo text is too long: memo.length=${memo.length} > (${MEMO_MAX_CHARS}`)
|
logger.error(`memo text is too long: memo.length=${memo.length} > ${MEMO_MAX_CHARS}`)
|
||||||
throw new Error(`memo text is too long (${MEMO_MAX_CHARS} characters maximum)`)
|
throw new Error(`memo text is too long (${MEMO_MAX_CHARS} characters maximum)`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memo.length < MEMO_MIN_CHARS) {
|
if (memo.length < MEMO_MIN_CHARS) {
|
||||||
logger.error(`memo text is too short: memo.length=${memo.length} < (${MEMO_MIN_CHARS}`)
|
logger.error(`memo text is too short: memo.length=${memo.length} < ${MEMO_MIN_CHARS}`)
|
||||||
throw new Error(`memo text is too short (${MEMO_MIN_CHARS} characters minimum)`)
|
throw new Error(`memo text is too short (${MEMO_MIN_CHARS} characters minimum)`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -67,6 +67,7 @@ describe('send coins', () => {
|
|||||||
|
|
||||||
describe('unknown recipient', () => {
|
describe('unknown recipient', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await mutate({
|
await mutate({
|
||||||
mutation: login,
|
mutation: login,
|
||||||
variables: bobData,
|
variables: bobData,
|
||||||
@ -93,6 +94,7 @@ describe('send coins', () => {
|
|||||||
|
|
||||||
describe('deleted recipient', () => {
|
describe('deleted recipient', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await mutate({
|
await mutate({
|
||||||
mutation: login,
|
mutation: login,
|
||||||
variables: peterData,
|
variables: peterData,
|
||||||
@ -125,6 +127,7 @@ describe('send coins', () => {
|
|||||||
|
|
||||||
describe('recipient account not activated', () => {
|
describe('recipient account not activated', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await mutate({
|
await mutate({
|
||||||
mutation: login,
|
mutation: login,
|
||||||
variables: peterData,
|
variables: peterData,
|
||||||
@ -166,6 +169,7 @@ describe('send coins', () => {
|
|||||||
|
|
||||||
describe('sender and recipient are the same', () => {
|
describe('sender and recipient are the same', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
expect(
|
expect(
|
||||||
await mutate({
|
await mutate({
|
||||||
mutation: sendCoins,
|
mutation: sendCoins,
|
||||||
@ -189,6 +193,7 @@ describe('send coins', () => {
|
|||||||
|
|
||||||
describe('memo text is too long', () => {
|
describe('memo text is too long', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
expect(
|
expect(
|
||||||
await mutate({
|
await mutate({
|
||||||
mutation: sendCoins,
|
mutation: sendCoins,
|
||||||
@ -212,6 +217,7 @@ describe('send coins', () => {
|
|||||||
|
|
||||||
describe('memo text is too short', () => {
|
describe('memo text is too short', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
expect(
|
expect(
|
||||||
await mutate({
|
await mutate({
|
||||||
mutation: sendCoins,
|
mutation: sendCoins,
|
||||||
@ -235,6 +241,7 @@ describe('send coins', () => {
|
|||||||
|
|
||||||
describe('user has not enough GDD', () => {
|
describe('user has not enough GDD', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
expect(
|
expect(
|
||||||
await mutate({
|
await mutate({
|
||||||
mutation: sendCoins,
|
mutation: sendCoins,
|
||||||
@ -260,6 +267,7 @@ describe('send coins', () => {
|
|||||||
|
|
||||||
describe('sending negative amount', () => {
|
describe('sending negative amount', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
expect(
|
expect(
|
||||||
await mutate({
|
await mutate({
|
||||||
mutation: sendCoins,
|
mutation: sendCoins,
|
||||||
|
|||||||
@ -515,18 +515,20 @@ describe('UserResolver', () => {
|
|||||||
await mutate({ mutation: createUser, variables: createUserVariables })
|
await mutate({ mutation: createUser, variables: createUserVariables })
|
||||||
const emailContact = await UserContact.findOneOrFail({ email: createUserVariables.email })
|
const emailContact = await UserContact.findOneOrFail({ email: createUserVariables.email })
|
||||||
emailVerificationCode = emailContact.emailVerificationCode.toString()
|
emailVerificationCode = emailContact.emailVerificationCode.toString()
|
||||||
result = await mutate({
|
|
||||||
mutation: setPassword,
|
|
||||||
variables: { code: emailVerificationCode, password: 'not-valid' },
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
await cleanDB()
|
await cleanDB()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('throws an error', () => {
|
it('throws an error', async () => {
|
||||||
expect(result).toEqual(
|
jest.clearAllMocks()
|
||||||
|
expect(
|
||||||
|
await mutate({
|
||||||
|
mutation: setPassword,
|
||||||
|
variables: { code: emailVerificationCode, password: 'not-valid' },
|
||||||
|
}),
|
||||||
|
).toEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
errors: [
|
errors: [
|
||||||
new GraphQLError(
|
new GraphQLError(
|
||||||
@ -545,18 +547,20 @@ describe('UserResolver', () => {
|
|||||||
describe('no valid optin code', () => {
|
describe('no valid optin code', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await mutate({ mutation: createUser, variables: createUserVariables })
|
await mutate({ mutation: createUser, variables: createUserVariables })
|
||||||
result = await mutate({
|
|
||||||
mutation: setPassword,
|
|
||||||
variables: { code: 'not valid', password: 'Aa12345_' },
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
await cleanDB()
|
await cleanDB()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('throws an error', () => {
|
it('throws an error', async () => {
|
||||||
expect(result).toEqual(
|
jest.clearAllMocks()
|
||||||
|
expect(
|
||||||
|
await mutate({
|
||||||
|
mutation: setPassword,
|
||||||
|
variables: { code: 'not valid', password: 'Aa12345_' },
|
||||||
|
}),
|
||||||
|
).toEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
errors: [new GraphQLError('Could not login with emailVerificationCode')],
|
errors: [new GraphQLError('Could not login with emailVerificationCode')],
|
||||||
}),
|
}),
|
||||||
@ -583,13 +587,9 @@ describe('UserResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe('no users in database', () => {
|
describe('no users in database', () => {
|
||||||
beforeAll(async () => {
|
it('throws an error', async () => {
|
||||||
jest.clearAllMocks()
|
jest.clearAllMocks()
|
||||||
result = await mutate({ mutation: login, variables })
|
expect(await mutate({ mutation: login, variables })).toEqual(
|
||||||
})
|
|
||||||
|
|
||||||
it('throws an error', () => {
|
|
||||||
expect(result).toEqual(
|
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
errors: [new GraphQLError('No user with this credentials')],
|
errors: [new GraphQLError('No user with this credentials')],
|
||||||
}),
|
}),
|
||||||
@ -667,6 +667,7 @@ describe('UserResolver', () => {
|
|||||||
describe('logout', () => {
|
describe('logout', () => {
|
||||||
describe('unauthenticated', () => {
|
describe('unauthenticated', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
resetToken()
|
resetToken()
|
||||||
await expect(mutate({ mutation: logout })).resolves.toEqual(
|
await expect(mutate({ mutation: logout })).resolves.toEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
@ -705,6 +706,7 @@ describe('UserResolver', () => {
|
|||||||
describe('verifyLogin', () => {
|
describe('verifyLogin', () => {
|
||||||
describe('unauthenticated', () => {
|
describe('unauthenticated', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
resetToken()
|
resetToken()
|
||||||
await expect(query({ query: verifyLogin })).resolves.toEqual(
|
await expect(query({ query: verifyLogin })).resolves.toEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
@ -724,6 +726,7 @@ describe('UserResolver', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
resetToken()
|
resetToken()
|
||||||
await expect(query({ query: verifyLogin })).resolves.toEqual(
|
await expect(query({ query: verifyLogin })).resolves.toEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
@ -884,6 +887,7 @@ describe('UserResolver', () => {
|
|||||||
|
|
||||||
describe('wrong optin code', () => {
|
describe('wrong optin code', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
query({ query: queryOptIn, variables: { optIn: 'not-valid' } }),
|
query({ query: queryOptIn, variables: { optIn: 'not-valid' } }),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -920,6 +924,7 @@ describe('UserResolver', () => {
|
|||||||
describe('updateUserInfos', () => {
|
describe('updateUserInfos', () => {
|
||||||
describe('unauthenticated', () => {
|
describe('unauthenticated', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
resetToken()
|
resetToken()
|
||||||
await expect(mutate({ mutation: updateUserInfos })).resolves.toEqual(
|
await expect(mutate({ mutation: updateUserInfos })).resolves.toEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
@ -977,6 +982,7 @@ describe('UserResolver', () => {
|
|||||||
|
|
||||||
describe('language is not valid', () => {
|
describe('language is not valid', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: updateUserInfos,
|
mutation: updateUserInfos,
|
||||||
@ -999,6 +1005,7 @@ describe('UserResolver', () => {
|
|||||||
describe('password', () => {
|
describe('password', () => {
|
||||||
describe('wrong old password', () => {
|
describe('wrong old password', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: updateUserInfos,
|
mutation: updateUserInfos,
|
||||||
@ -1021,6 +1028,7 @@ describe('UserResolver', () => {
|
|||||||
|
|
||||||
describe('invalid new password', () => {
|
describe('invalid new password', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: updateUserInfos,
|
mutation: updateUserInfos,
|
||||||
@ -1109,6 +1117,7 @@ describe('UserResolver', () => {
|
|||||||
describe('searchAdminUsers', () => {
|
describe('searchAdminUsers', () => {
|
||||||
describe('unauthenticated', () => {
|
describe('unauthenticated', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
|
jest.clearAllMocks()
|
||||||
resetToken()
|
resetToken()
|
||||||
await expect(mutate({ mutation: searchAdminUsers })).resolves.toEqual(
|
await expect(mutate({ mutation: searchAdminUsers })).resolves.toEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
|
|||||||
@ -26,12 +26,12 @@ describe('sendAddedContributionMessageEmail', () => {
|
|||||||
it('calls sendEMail', () => {
|
it('calls sendEMail', () => {
|
||||||
expect(sendEMail).toBeCalledWith({
|
expect(sendEMail).toBeCalledWith({
|
||||||
to: `Bibi Bloxberg <bibi@bloxberg.de>`,
|
to: `Bibi Bloxberg <bibi@bloxberg.de>`,
|
||||||
subject: 'Rückfrage zu Deinem Gemeinwohl-Beitrag',
|
subject: 'Nachricht zu deinem Gemeinwohl-Beitrag',
|
||||||
text:
|
text:
|
||||||
expect.stringContaining('Hallo Bibi Bloxberg') &&
|
expect.stringContaining('Hallo Bibi Bloxberg') &&
|
||||||
expect.stringContaining('Peter Lustig') &&
|
expect.stringContaining('Peter Lustig') &&
|
||||||
expect.stringContaining(
|
expect.stringContaining(
|
||||||
'Du hast soeben zu deinem eingereichten Gradido Schöpfungsantrag "Vielen herzlichen Dank für den neuen Hexenbesen!" eine Rückfrage von Peter Lustig erhalten.',
|
'du hast zu deinem Gemeinwohl-Beitrag "Vielen herzlichen Dank für den neuen Hexenbesen!" eine Nachricht von Peter Lustig erhalten.',
|
||||||
) &&
|
) &&
|
||||||
expect.stringContaining('Was für ein Besen ist es geworden?') &&
|
expect.stringContaining('Was für ein Besen ist es geworden?') &&
|
||||||
expect.stringContaining('http://localhost/overview'),
|
expect.stringContaining('http://localhost/overview'),
|
||||||
|
|||||||
@ -26,11 +26,11 @@ describe('sendContributionConfirmedEmail', () => {
|
|||||||
it('calls sendEMail', () => {
|
it('calls sendEMail', () => {
|
||||||
expect(sendEMail).toBeCalledWith({
|
expect(sendEMail).toBeCalledWith({
|
||||||
to: 'Bibi Bloxberg <bibi@bloxberg.de>',
|
to: 'Bibi Bloxberg <bibi@bloxberg.de>',
|
||||||
subject: 'Schöpfung wurde bestätigt',
|
subject: 'Dein Gemeinwohl-Beitrag wurde bestätigt',
|
||||||
text:
|
text:
|
||||||
expect.stringContaining('Hallo Bibi Bloxberg') &&
|
expect.stringContaining('Hallo Bibi Bloxberg') &&
|
||||||
expect.stringContaining(
|
expect.stringContaining(
|
||||||
'Dein Gradido Schöpfungsantrag "Vielen herzlichen Dank für den neuen Hexenbesen!" wurde soeben bestätigt.',
|
'dein Gemeinwohl-Beitrag "Vielen herzlichen Dank für den neuen Hexenbesen!" wurde soeben von Peter Lustig bestätigt und in deinem Gradido-Konto gutgeschrieben.',
|
||||||
) &&
|
) &&
|
||||||
expect.stringContaining('Betrag: 200,00 GDD') &&
|
expect.stringContaining('Betrag: 200,00 GDD') &&
|
||||||
expect.stringContaining('Link zu deinem Konto: http://localhost/overview'),
|
expect.stringContaining('Link zu deinem Konto: http://localhost/overview'),
|
||||||
|
|||||||
38
backend/src/mailer/sendContributionRejectedEmail.test.ts
Normal file
38
backend/src/mailer/sendContributionRejectedEmail.test.ts
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import Decimal from 'decimal.js-light'
|
||||||
|
import { sendContributionRejectedEmail } from './sendContributionRejectedEmail'
|
||||||
|
import { sendEMail } from './sendEMail'
|
||||||
|
|
||||||
|
jest.mock('./sendEMail', () => {
|
||||||
|
return {
|
||||||
|
__esModule: true,
|
||||||
|
sendEMail: jest.fn(),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('sendContributionConfirmedEmail', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
await sendContributionRejectedEmail({
|
||||||
|
senderFirstName: 'Peter',
|
||||||
|
senderLastName: 'Lustig',
|
||||||
|
recipientFirstName: 'Bibi',
|
||||||
|
recipientLastName: 'Bloxberg',
|
||||||
|
recipientEmail: 'bibi@bloxberg.de',
|
||||||
|
contributionMemo: 'Vielen herzlichen Dank für den neuen Hexenbesen!',
|
||||||
|
contributionAmount: new Decimal(200.0),
|
||||||
|
overviewURL: 'http://localhost/overview',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('calls sendEMail', () => {
|
||||||
|
expect(sendEMail).toBeCalledWith({
|
||||||
|
to: 'Bibi Bloxberg <bibi@bloxberg.de>',
|
||||||
|
subject: 'Dein Gemeinwohl-Beitrag wurde abgelehnt',
|
||||||
|
text:
|
||||||
|
expect.stringContaining('Hallo Bibi Bloxberg') &&
|
||||||
|
expect.stringContaining(
|
||||||
|
'dein Gemeinwohl-Beitrag "Vielen herzlichen Dank für den neuen Hexenbesen!" wurde von Peter Lustig abgelehnt.',
|
||||||
|
) &&
|
||||||
|
expect.stringContaining('Link zu deinem Konto: http://localhost/overview'),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
26
backend/src/mailer/sendContributionRejectedEmail.ts
Normal file
26
backend/src/mailer/sendContributionRejectedEmail.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
import Decimal from 'decimal.js-light'
|
||||||
|
import { sendEMail } from './sendEMail'
|
||||||
|
import { contributionRejected } from './text/contributionRejected'
|
||||||
|
|
||||||
|
export const sendContributionRejectedEmail = (data: {
|
||||||
|
senderFirstName: string
|
||||||
|
senderLastName: string
|
||||||
|
recipientFirstName: string
|
||||||
|
recipientLastName: string
|
||||||
|
recipientEmail: string
|
||||||
|
contributionMemo: string
|
||||||
|
contributionAmount: Decimal
|
||||||
|
overviewURL: string
|
||||||
|
}): Promise<boolean> => {
|
||||||
|
logger.info(
|
||||||
|
`sendEmail(): to=${data.recipientFirstName} ${data.recipientLastName} <${data.recipientEmail}>,
|
||||||
|
subject=${contributionRejected.de.subject},
|
||||||
|
text=${contributionRejected.de.text(data)}`,
|
||||||
|
)
|
||||||
|
return sendEMail({
|
||||||
|
to: `${data.recipientFirstName} ${data.recipientLastName} <${data.recipientEmail}>`,
|
||||||
|
subject: contributionRejected.de.subject,
|
||||||
|
text: contributionRejected.de.text(data),
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -26,7 +26,7 @@ describe('sendTransactionReceivedEmail', () => {
|
|||||||
it('calls sendEMail', () => {
|
it('calls sendEMail', () => {
|
||||||
expect(sendEMail).toBeCalledWith({
|
expect(sendEMail).toBeCalledWith({
|
||||||
to: `Peter Lustig <peter@lustig.de>`,
|
to: `Peter Lustig <peter@lustig.de>`,
|
||||||
subject: 'Gradido Überweisung',
|
subject: 'Du hast Gradidos erhalten',
|
||||||
text:
|
text:
|
||||||
expect.stringContaining('Hallo Peter Lustig') &&
|
expect.stringContaining('Hallo Peter Lustig') &&
|
||||||
expect.stringContaining('42,00 GDD') &&
|
expect.stringContaining('42,00 GDD') &&
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import Decimal from 'decimal.js-light'
|
|||||||
|
|
||||||
export const contributionConfirmed = {
|
export const contributionConfirmed = {
|
||||||
de: {
|
de: {
|
||||||
subject: 'Schöpfung wurde bestätigt',
|
subject: 'Dein Gemeinwohl-Beitrag wurde bestätigt',
|
||||||
text: (data: {
|
text: (data: {
|
||||||
senderFirstName: string
|
senderFirstName: string
|
||||||
senderLastName: string
|
senderLastName: string
|
||||||
@ -14,18 +14,17 @@ export const contributionConfirmed = {
|
|||||||
}): string =>
|
}): string =>
|
||||||
`Hallo ${data.recipientFirstName} ${data.recipientLastName},
|
`Hallo ${data.recipientFirstName} ${data.recipientLastName},
|
||||||
|
|
||||||
Dein eingereichter Gemeinwohl-Beitrag "${data.contributionMemo}" wurde soeben von ${
|
dein Gemeinwohl-Beitrag "${data.contributionMemo}" wurde soeben von ${data.senderFirstName} ${
|
||||||
data.senderFirstName
|
data.senderLastName
|
||||||
} ${data.senderLastName} bestätigt.
|
} bestätigt und in deinem Gradido-Konto gutgeschrieben.
|
||||||
|
|
||||||
Betrag: ${data.contributionAmount.toFixed(2).replace('.', ',')} GDD
|
Betrag: ${data.contributionAmount.toFixed(2).replace('.', ',')} GDD
|
||||||
|
|
||||||
|
Link zu deinem Konto: ${data.overviewURL}
|
||||||
|
|
||||||
Bitte antworte nicht auf diese E-Mail!
|
Bitte antworte nicht auf diese E-Mail!
|
||||||
|
|
||||||
Mit freundlichen Grüßen,
|
Liebe Grüße
|
||||||
dein Gradido-Team
|
dein Gradido-Team`,
|
||||||
|
|
||||||
|
|
||||||
Link zu deinem Konto: ${data.overviewURL}`,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
export const contributionMessageReceived = {
|
export const contributionMessageReceived = {
|
||||||
de: {
|
de: {
|
||||||
subject: 'Rückfrage zu Deinem Gemeinwohl-Beitrag',
|
subject: 'Nachricht zu deinem Gemeinwohl-Beitrag',
|
||||||
text: (data: {
|
text: (data: {
|
||||||
senderFirstName: string
|
senderFirstName: string
|
||||||
senderLastName: string
|
senderLastName: string
|
||||||
@ -14,15 +14,15 @@ export const contributionMessageReceived = {
|
|||||||
}): string =>
|
}): string =>
|
||||||
`Hallo ${data.recipientFirstName} ${data.recipientLastName},
|
`Hallo ${data.recipientFirstName} ${data.recipientLastName},
|
||||||
|
|
||||||
du hast soeben zu deinem eingereichten Gemeinwohl-Beitrag "${data.contributionMemo}" eine Rückfrage von ${data.senderFirstName} ${data.senderLastName} erhalten.
|
du hast zu deinem Gemeinwohl-Beitrag "${data.contributionMemo}" eine Nachricht von ${data.senderFirstName} ${data.senderLastName} erhalten.
|
||||||
|
|
||||||
Bitte beantworte die Rückfrage in deinem Gradido-Konto im Menü "Gemeinschaft" im Tab "Meine Beiträge zum Gemeinwohl"!
|
Um die Nachricht zu sehen und darauf zu antworten, gehe in deinem Gradido-Konto ins Menü "Gemeinschaft" auf den Tab "Meine Beiträge zum Gemeinwohl"!
|
||||||
|
|
||||||
Link zu deinem Konto: ${data.overviewURL}
|
Link zu deinem Konto: ${data.overviewURL}
|
||||||
|
|
||||||
Bitte antworte nicht auf diese E-Mail!
|
Bitte antworte nicht auf diese E-Mail!
|
||||||
|
|
||||||
Mit freundlichen Grüßen,
|
Liebe Grüße
|
||||||
dein Gradido-Team`,
|
dein Gradido-Team`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
28
backend/src/mailer/text/contributionRejected.ts
Normal file
28
backend/src/mailer/text/contributionRejected.ts
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import Decimal from 'decimal.js-light'
|
||||||
|
|
||||||
|
export const contributionRejected = {
|
||||||
|
de: {
|
||||||
|
subject: 'Dein Gemeinwohl-Beitrag wurde abgelehnt',
|
||||||
|
text: (data: {
|
||||||
|
senderFirstName: string
|
||||||
|
senderLastName: string
|
||||||
|
recipientFirstName: string
|
||||||
|
recipientLastName: string
|
||||||
|
contributionMemo: string
|
||||||
|
contributionAmount: Decimal
|
||||||
|
overviewURL: string
|
||||||
|
}): string =>
|
||||||
|
`Hallo ${data.recipientFirstName} ${data.recipientLastName},
|
||||||
|
|
||||||
|
dein Gemeinwohl-Beitrag "${data.contributionMemo}" wurde von ${data.senderFirstName} ${data.senderLastName} abgelehnt.
|
||||||
|
|
||||||
|
Um deine Gemeinwohl-Beiträge und dazugehörige Nachrichten zu sehen, gehe in deinem Gradido-Konto ins Menü "Gemeinschaft" auf den Tab "Meine Beiträge zum Gemeinwohl"!
|
||||||
|
|
||||||
|
Link zu deinem Konto: ${data.overviewURL}
|
||||||
|
|
||||||
|
Bitte antworte nicht auf diese E-Mail!
|
||||||
|
|
||||||
|
Liebe Grüße
|
||||||
|
dein Gradido-Team`,
|
||||||
|
},
|
||||||
|
}
|
||||||
@ -14,7 +14,7 @@ export const transactionLinkRedeemed = {
|
|||||||
memo: string
|
memo: string
|
||||||
overviewURL: string
|
overviewURL: string
|
||||||
}): string =>
|
}): string =>
|
||||||
`Hallo ${data.recipientFirstName} ${data.recipientLastName}
|
`Hallo ${data.recipientFirstName} ${data.recipientLastName},
|
||||||
|
|
||||||
${data.senderFirstName} ${data.senderLastName} (${
|
${data.senderFirstName} ${data.senderLastName} (${
|
||||||
data.senderEmail
|
data.senderEmail
|
||||||
@ -27,7 +27,7 @@ export const transactionLinkRedeemed = {
|
|||||||
|
|
||||||
Bitte antworte nicht auf diese E-Mail!
|
Bitte antworte nicht auf diese E-Mail!
|
||||||
|
|
||||||
Mit freundlichen Grüßen,
|
Liebe Grüße
|
||||||
dein Gradido-Team`,
|
dein Gradido-Team`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import Decimal from 'decimal.js-light'
|
|||||||
|
|
||||||
export const transactionReceived = {
|
export const transactionReceived = {
|
||||||
de: {
|
de: {
|
||||||
subject: 'Gradido Überweisung',
|
subject: 'Du hast Gradidos erhalten',
|
||||||
text: (data: {
|
text: (data: {
|
||||||
senderFirstName: string
|
senderFirstName: string
|
||||||
senderLastName: string
|
senderLastName: string
|
||||||
@ -13,9 +13,9 @@ export const transactionReceived = {
|
|||||||
amount: Decimal
|
amount: Decimal
|
||||||
overviewURL: string
|
overviewURL: string
|
||||||
}): string =>
|
}): string =>
|
||||||
`Hallo ${data.recipientFirstName} ${data.recipientLastName}
|
`Hallo ${data.recipientFirstName} ${data.recipientLastName},
|
||||||
|
|
||||||
Du hast soeben ${data.amount.toFixed(2).replace('.', ',')} GDD von ${data.senderFirstName} ${
|
du hast soeben ${data.amount.toFixed(2).replace('.', ',')} GDD von ${data.senderFirstName} ${
|
||||||
data.senderLastName
|
data.senderLastName
|
||||||
} (${data.senderEmail}) erhalten.
|
} (${data.senderEmail}) erhalten.
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ Details zur Transaktion findest du in deinem Gradido-Konto: ${data.overviewURL}
|
|||||||
|
|
||||||
Bitte antworte nicht auf diese E-Mail!
|
Bitte antworte nicht auf diese E-Mail!
|
||||||
|
|
||||||
Mit freundlichen Grüßen,
|
Liebe Grüße
|
||||||
dein Gradido-Team`,
|
dein Gradido-Team`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ ENV NODE_ENV="production"
|
|||||||
# Labels
|
# Labels
|
||||||
LABEL org.label-schema.build-date="${BUILD_DATE}"
|
LABEL org.label-schema.build-date="${BUILD_DATE}"
|
||||||
LABEL org.label-schema.name="gradido:database"
|
LABEL org.label-schema.name="gradido:database"
|
||||||
LABEL org.label-schema.description="Gradido GraphQL Backend"
|
LABEL org.label-schema.description="Gradido Database Migration Service"
|
||||||
LABEL org.label-schema.usage="https://github.com/gradido/gradido/blob/master/README.md"
|
LABEL org.label-schema.usage="https://github.com/gradido/gradido/blob/master/README.md"
|
||||||
LABEL org.label-schema.url="https://gradido.net"
|
LABEL org.label-schema.url="https://gradido.net"
|
||||||
LABEL org.label-schema.vcs-url="https://github.com/gradido/gradido/tree/master/database"
|
LABEL org.label-schema.vcs-url="https://github.com/gradido/gradido/tree/master/database"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gradido-database",
|
"name": "gradido-database",
|
||||||
"version": "1.13.3",
|
"version": "1.14.1",
|
||||||
"description": "Gradido Database Tool to execute database migrations",
|
"description": "Gradido Database Tool to execute database migrations",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": "https://github.com/gradido/gradido/database",
|
"repository": "https://github.com/gradido/gradido/database",
|
||||||
|
|||||||
@ -20,10 +20,10 @@ ENV PORT="3000"
|
|||||||
# Labels
|
# Labels
|
||||||
LABEL org.label-schema.build-date="${BUILD_DATE}"
|
LABEL org.label-schema.build-date="${BUILD_DATE}"
|
||||||
LABEL org.label-schema.name="gradido:frontend"
|
LABEL org.label-schema.name="gradido:frontend"
|
||||||
LABEL org.label-schema.description="Gradido Vue Webwallet"
|
LABEL org.label-schema.description="Gradido Wallet Interface"
|
||||||
LABEL org.label-schema.usage="https://github.com/gradido/gradido_vue_wallet/blob/master/README.md"
|
LABEL org.label-schema.usage="https://github.com/gradido/gradido/blob/master/README.md"
|
||||||
LABEL org.label-schema.url="https://gradido.net"
|
LABEL org.label-schema.url="https://gradido.net"
|
||||||
LABEL org.label-schema.vcs-url="https://github.com/gradido/gradido_vue_wallet/tree/master/backend"
|
LABEL org.label-schema.vcs-url="https://github.com/gradido/gradido/tree/master/frontend"
|
||||||
LABEL org.label-schema.vcs-ref="${BUILD_COMMIT}"
|
LABEL org.label-schema.vcs-ref="${BUILD_COMMIT}"
|
||||||
LABEL org.label-schema.vendor="gradido Community"
|
LABEL org.label-schema.vendor="gradido Community"
|
||||||
LABEL org.label-schema.version="${BUILD_VERSION}"
|
LABEL org.label-schema.version="${BUILD_VERSION}"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bootstrap-vue-gradido-wallet",
|
"name": "bootstrap-vue-gradido-wallet",
|
||||||
"version": "1.13.3",
|
"version": "1.14.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node run/server.js",
|
"start": "node run/server.js",
|
||||||
|
|||||||
@ -67,9 +67,9 @@ describe('ContributionMessagesFormular', () => {
|
|||||||
await wrapper.find('form').trigger('submit')
|
await wrapper.find('form').trigger('submit')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('emitted "get-list-contribution-messages" with data', async () => {
|
it('emitted "get-list-contribution-messages" with false', async () => {
|
||||||
expect(wrapper.emitted('get-list-contribution-messages')).toEqual(
|
expect(wrapper.emitted('get-list-contribution-messages')).toEqual(
|
||||||
expect.arrayContaining([expect.arrayContaining([42])]),
|
expect.arrayContaining([expect.arrayContaining([false])]),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.$emit('get-list-contribution-messages', this.contributionId)
|
this.$emit('get-list-contribution-messages', false)
|
||||||
this.$emit('update-state', this.contributionId)
|
this.$emit('update-state', this.contributionId)
|
||||||
this.form.text = ''
|
this.form.text = ''
|
||||||
this.toastSuccess(this.$t('message.reply'))
|
this.toastSuccess(this.$t('message.reply'))
|
||||||
|
|||||||
@ -40,16 +40,6 @@ describe('ContributionMessagesList', () => {
|
|||||||
expect(wrapper.findComponent({ name: 'ContributionMessagesFormular' }).exists()).toBe(true)
|
expect(wrapper.findComponent({ name: 'ContributionMessagesFormular' }).exists()).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('get List Contribution Messages', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
wrapper.vm.getListContributionMessages()
|
|
||||||
})
|
|
||||||
|
|
||||||
it('emits getListContributionMessages', async () => {
|
|
||||||
expect(wrapper.vm.$emit('get-list-contribution-messages')).toBeTruthy()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
describe('update State', () => {
|
describe('update State', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper.vm.updateState()
|
wrapper.vm.updateState()
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<contribution-messages-formular
|
<contribution-messages-formular
|
||||||
v-if="['PENDING', 'IN_PROGRESS'].includes(state)"
|
v-if="['PENDING', 'IN_PROGRESS'].includes(state)"
|
||||||
:contributionId="contributionId"
|
:contributionId="contributionId"
|
||||||
@get-list-contribution-messages="getListContributionMessages"
|
v-on="$listeners"
|
||||||
@update-state="updateState"
|
@update-state="updateState"
|
||||||
/>
|
/>
|
||||||
</b-container>
|
</b-container>
|
||||||
@ -50,9 +50,6 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getListContributionMessages() {
|
|
||||||
this.$emit('get-list-contribution-messages', this.contributionId)
|
|
||||||
},
|
|
||||||
updateState(id) {
|
updateState(id) {
|
||||||
this.$emit('update-state', id)
|
this.$emit('update-state', id)
|
||||||
},
|
},
|
||||||
|
|||||||
@ -5,9 +5,11 @@ import ContributionMessagesListItem from './ContributionMessagesListItem.vue'
|
|||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
let wrapper
|
let wrapper
|
||||||
|
|
||||||
|
const dateMock = jest.fn((d) => d)
|
||||||
|
|
||||||
const mocks = {
|
const mocks = {
|
||||||
$t: jest.fn((t) => t),
|
$t: jest.fn((t) => t),
|
||||||
$d: jest.fn((d) => d),
|
$d: dateMock,
|
||||||
$store: {
|
$store: {
|
||||||
state: {
|
state: {
|
||||||
firstName: 'Peter',
|
firstName: 'Peter',
|
||||||
@ -239,4 +241,63 @@ and here is the link to the repository: https://github.com/gradido/gradido`)
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('contribution message type HISTORY', () => {
|
||||||
|
const propsData = {
|
||||||
|
message: {
|
||||||
|
id: 111,
|
||||||
|
message: `Sun Nov 13 2022 13:05:48 GMT+0100 (Central European Standard Time)
|
||||||
|
---
|
||||||
|
This message also contains a link: https://gradido.net/de/
|
||||||
|
---
|
||||||
|
350.00`,
|
||||||
|
createdAt: '2022-08-29T12:23:27.000Z',
|
||||||
|
updatedAt: null,
|
||||||
|
type: 'HISTORY',
|
||||||
|
userFirstName: 'Peter',
|
||||||
|
userLastName: 'Lustig',
|
||||||
|
userId: 107,
|
||||||
|
__typename: 'ContributionMessage',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const itemWrapper = () => {
|
||||||
|
return mount(ContributionMessagesListItem, {
|
||||||
|
localVue,
|
||||||
|
mocks,
|
||||||
|
propsData,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
let messageField
|
||||||
|
|
||||||
|
describe('render HISTORY message', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks()
|
||||||
|
wrapper = itemWrapper()
|
||||||
|
messageField = wrapper.find('div.is-not-moderator.text-right > div:nth-child(4)')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('renders the date', () => {
|
||||||
|
expect(dateMock).toBeCalledWith(
|
||||||
|
new Date('Sun Nov 13 2022 13:05:48 GMT+0100 (Central European Standard Time'),
|
||||||
|
'short',
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('renders the amount', () => {
|
||||||
|
expect(messageField.text()).toContain('350.00 GDD')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('contains the link as text', () => {
|
||||||
|
expect(messageField.text()).toContain(
|
||||||
|
'This message also contains a link: https://gradido.net/de/',
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('contains a link to the given address', () => {
|
||||||
|
expect(messageField.find('a').attributes('href')).toBe('https://gradido.net/de/')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -4,25 +4,25 @@
|
|||||||
<b-avatar variant="info"></b-avatar>
|
<b-avatar variant="info"></b-avatar>
|
||||||
<span class="ml-2 mr-2">{{ message.userFirstName }} {{ message.userLastName }}</span>
|
<span class="ml-2 mr-2">{{ message.userFirstName }} {{ message.userLastName }}</span>
|
||||||
<span class="ml-2">{{ $d(new Date(message.createdAt), 'short') }}</span>
|
<span class="ml-2">{{ $d(new Date(message.createdAt), 'short') }}</span>
|
||||||
<linkify-message :message="message.message"></linkify-message>
|
<parse-message v-bind="message"></parse-message>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="is-moderator text-left">
|
<div v-else class="is-moderator text-left">
|
||||||
<b-avatar square variant="warning"></b-avatar>
|
<b-avatar square variant="warning"></b-avatar>
|
||||||
<span class="ml-2 mr-2">{{ message.userFirstName }} {{ message.userLastName }}</span>
|
<span class="ml-2 mr-2">{{ message.userFirstName }} {{ message.userLastName }}</span>
|
||||||
<span class="ml-2">{{ $d(new Date(message.createdAt), 'short') }}</span>
|
<span class="ml-2">{{ $d(new Date(message.createdAt), 'short') }}</span>
|
||||||
<small class="ml-4 text-success">{{ $t('community.moderator') }}</small>
|
<small class="ml-4 text-success">{{ $t('community.moderator') }}</small>
|
||||||
<linkify-message :message="message.message"></linkify-message>
|
<parse-message v-bind="message"></parse-message>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import LinkifyMessage from '@/components/ContributionMessages/LinkifyMessage.vue'
|
import ParseMessage from '@/components/ContributionMessages/ParseMessage.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ContributionMessagesListItem',
|
name: 'ContributionMessagesListItem',
|
||||||
components: {
|
components: {
|
||||||
LinkifyMessage,
|
ParseMessage,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
message: {
|
message: {
|
||||||
|
|||||||
@ -1,7 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<span v-for="({ type, text }, index) in linkifiedMessage" :key="index">
|
<span v-for="({ type, text }, index) in parsedMessage" :key="index">
|
||||||
<b-link v-if="type === 'link'" :href="text" target="_blank">{{ text }}</b-link>
|
<b-link v-if="type === 'link'" :href="text" target="_blank">{{ text }}</b-link>
|
||||||
|
<span v-else-if="type === 'date'">
|
||||||
|
{{ $d(new Date(text), 'short') }}
|
||||||
|
<br />
|
||||||
|
</span>
|
||||||
|
<span v-else-if="type === 'amount'">
|
||||||
|
<br />
|
||||||
|
{{ text | GDD }}
|
||||||
|
</span>
|
||||||
<span v-else>{{ text }}</span>
|
<span v-else>{{ text }}</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -11,17 +19,28 @@
|
|||||||
const LINK_REGEX_PATTERN = /(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*))/i
|
const LINK_REGEX_PATTERN = /(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*))/i
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'LinkifyMessage',
|
name: 'ParseMessage',
|
||||||
props: {
|
props: {
|
||||||
message: {
|
message: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
reuired: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
linkifiedMessage() {
|
parsedMessage() {
|
||||||
const linkified = []
|
|
||||||
let string = this.message
|
let string = this.message
|
||||||
|
const linkified = []
|
||||||
|
let amount
|
||||||
|
if (this.type === 'HISTORY') {
|
||||||
|
const split = string.split(/\n\s*---\n\s*/)
|
||||||
|
string = split[1]
|
||||||
|
linkified.push({ type: 'date', text: split[0].trim() })
|
||||||
|
amount = split[2].trim()
|
||||||
|
}
|
||||||
let match
|
let match
|
||||||
while ((match = string.match(LINK_REGEX_PATTERN))) {
|
while ((match = string.match(LINK_REGEX_PATTERN))) {
|
||||||
if (match.index > 0)
|
if (match.index > 0)
|
||||||
@ -30,6 +49,7 @@ export default {
|
|||||||
string = string.substring(match.index + match[0].length)
|
string = string.substring(match.index + match[0].length)
|
||||||
}
|
}
|
||||||
if (string.length > 0) linkified.push({ type: 'text', text: string })
|
if (string.length > 0) linkified.push({ type: 'text', text: string })
|
||||||
|
if (amount) linkified.push({ type: 'amount', text: amount })
|
||||||
return linkified
|
return linkified
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -3,6 +3,7 @@
|
|||||||
<div class="list-group" v-for="item in items" :key="item.id">
|
<div class="list-group" v-for="item in items" :key="item.id">
|
||||||
<contribution-list-item
|
<contribution-list-item
|
||||||
v-bind="item"
|
v-bind="item"
|
||||||
|
@closeAllOpenCollapse="$emit('closeAllOpenCollapse')"
|
||||||
:contributionId="item.id"
|
:contributionId="item.id"
|
||||||
:allContribution="allContribution"
|
:allContribution="allContribution"
|
||||||
@update-contribution-form="updateContributionForm"
|
@update-contribution-form="updateContributionForm"
|
||||||
|
|||||||
@ -9,6 +9,7 @@ describe('ContributionListItem', () => {
|
|||||||
const mocks = {
|
const mocks = {
|
||||||
$t: jest.fn((t) => t),
|
$t: jest.fn((t) => t),
|
||||||
$d: jest.fn((d) => d),
|
$d: jest.fn((d) => d),
|
||||||
|
$apollo: { query: jest.fn().mockResolvedValue() },
|
||||||
}
|
}
|
||||||
|
|
||||||
const propsData = {
|
const propsData = {
|
||||||
@ -132,6 +133,27 @@ describe('ContributionListItem', () => {
|
|||||||
expect(wrapper.emitted('delete-contribution')).toBeFalsy()
|
expect(wrapper.emitted('delete-contribution')).toBeFalsy()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('updateState', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
await wrapper.vm.updateState()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('emit update-state', () => {
|
||||||
|
expect(wrapper.vm.$emit('update-state')).toBeTruthy()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('getListContributionMessages', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
wrapper
|
||||||
|
.findComponent({ name: 'ContributionMessagesList' })
|
||||||
|
.vm.$emit('get-list-contribution-messages')
|
||||||
|
})
|
||||||
|
it('emits closeAllOpenCollapse', () => {
|
||||||
|
expect(wrapper.emitted('closeAllOpenCollapse')).toBeTruthy()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -32,6 +32,7 @@
|
|||||||
v-if="!['CONFIRMED', 'DELETED'].includes(state) && !allContribution"
|
v-if="!['CONFIRMED', 'DELETED'].includes(state) && !allContribution"
|
||||||
class="pointer ml-5"
|
class="pointer ml-5"
|
||||||
@click="
|
@click="
|
||||||
|
$emit('closeAllOpenCollapse'),
|
||||||
$emit('update-contribution-form', {
|
$emit('update-contribution-form', {
|
||||||
id: id,
|
id: id,
|
||||||
contributionDate: contributionDate,
|
contributionDate: contributionDate,
|
||||||
@ -178,8 +179,10 @@ export default {
|
|||||||
if (value) this.$emit('delete-contribution', item)
|
if (value) this.$emit('delete-contribution', item)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getListContributionMessages() {
|
getListContributionMessages(closeCollapse = true) {
|
||||||
// console.log('getListContributionMessages', this.contributionId)
|
if (closeCollapse) {
|
||||||
|
this.$emit('closeAllOpenCollapse')
|
||||||
|
}
|
||||||
this.$apollo
|
this.$apollo
|
||||||
.query({
|
.query({
|
||||||
query: listContributionMessages,
|
query: listContributionMessages,
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
<div class="m-1 mt-2">{{ $t('GDD') }}</div>
|
<div class="m-1 mt-2">{{ $t('GDD') }}</div>
|
||||||
</b-input-group-prepend>
|
</b-input-group-prepend>
|
||||||
|
|
||||||
<div class="p-3">{{ (amount * -1) | GDD }}</div>
|
<div class="p-3">{{ amount | GDD }}</div>
|
||||||
</b-input-group>
|
</b-input-group>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
@ -13,7 +13,6 @@
|
|||||||
<b-button variant="primary" :to="register">
|
<b-button variant="primary" :to="register">
|
||||||
{{ $t('gdd_per_link.to-register') }}
|
{{ $t('gdd_per_link.to-register') }}
|
||||||
</b-button>
|
</b-button>
|
||||||
<p class="mt-3">{{ $t('gdd_per_link.isFree') }}</p>
|
|
||||||
</b-col>
|
</b-col>
|
||||||
<b-col sm="12" md="6" class="mt-xs-6 mt-sm-6 mt-md-0">
|
<b-col sm="12" md="6" class="mt-xs-6 mt-sm-6 mt-md-0">
|
||||||
<p>{{ $t('gdd_per_link.has-account') }}</p>
|
<p>{{ $t('gdd_per_link.has-account') }}</p>
|
||||||
|
|||||||
@ -288,16 +288,12 @@
|
|||||||
"forgotPassword": {
|
"forgotPassword": {
|
||||||
"heading": "Bitte gib deine E-Mail an mit der du bei Gradido angemeldet bist."
|
"heading": "Bitte gib deine E-Mail an mit der du bei Gradido angemeldet bist."
|
||||||
},
|
},
|
||||||
"login": {
|
|
||||||
"heading": "Melde dich mit deinen Zugangsdaten an. Bewahre sie stets sicher auf!"
|
|
||||||
},
|
|
||||||
"resetPassword": {
|
"resetPassword": {
|
||||||
"heading": "Trage bitte dein Passwort ein und wiederhole es."
|
"heading": "Trage bitte dein Passwort ein und wiederhole es."
|
||||||
},
|
},
|
||||||
"signup": {
|
"signup": {
|
||||||
"agree": "Ich stimme der <a href='https://gradido.net/de/datenschutz/' target='_blank' >Datenschutzerklärung</a> zu.",
|
"agree": "Ich stimme der <a href='https://gradido.net/de/datenschutz/' target='_blank' >Datenschutzerklärung</a> zu.",
|
||||||
"dont_match": "Die Passwörter stimmen nicht überein.",
|
"dont_match": "Die Passwörter stimmen nicht überein.",
|
||||||
"heading": "Registriere dich indem du alle Daten vollständig und in die richtigen Felder eingibst.",
|
|
||||||
"lowercase": "Ein Kleinbuchstabe erforderlich.",
|
"lowercase": "Ein Kleinbuchstabe erforderlich.",
|
||||||
"minimum": "Mindestens 8 Zeichen.",
|
"minimum": "Mindestens 8 Zeichen.",
|
||||||
"no-whitespace": "Keine Leerzeichen und Tabulatoren",
|
"no-whitespace": "Keine Leerzeichen und Tabulatoren",
|
||||||
|
|||||||
@ -288,16 +288,12 @@
|
|||||||
"forgotPassword": {
|
"forgotPassword": {
|
||||||
"heading": "Please enter the email address by which you're registered here."
|
"heading": "Please enter the email address by which you're registered here."
|
||||||
},
|
},
|
||||||
"login": {
|
|
||||||
"heading": "Sign in with your access data. Keep them safe!"
|
|
||||||
},
|
|
||||||
"resetPassword": {
|
"resetPassword": {
|
||||||
"heading": "Please enter your password and repeat it."
|
"heading": "Please enter your password and repeat it."
|
||||||
},
|
},
|
||||||
"signup": {
|
"signup": {
|
||||||
"agree": "I agree to the <a href='https://gradido.net/en/datenschutz/' target='_blank' > privacy policy</a>.",
|
"agree": "I agree to the <a href='https://gradido.net/en/datenschutz/' target='_blank' > privacy policy</a>.",
|
||||||
"dont_match": "Passwords don't match.",
|
"dont_match": "Passwords don't match.",
|
||||||
"heading": "Register by entering all data completely and in the correct fields.",
|
|
||||||
"lowercase": "One lowercase letter required.",
|
"lowercase": "One lowercase letter required.",
|
||||||
"minimum": "8 characters minimum.",
|
"minimum": "8 characters minimum.",
|
||||||
"no-whitespace": "No white spaces and tabs",
|
"no-whitespace": "No white spaces and tabs",
|
||||||
|
|||||||
@ -288,16 +288,12 @@
|
|||||||
"forgotPassword": {
|
"forgotPassword": {
|
||||||
"heading": "Por favor, introduce la dirección de correo electrónico con la que estas registrado en Gradido."
|
"heading": "Por favor, introduce la dirección de correo electrónico con la que estas registrado en Gradido."
|
||||||
},
|
},
|
||||||
"login": {
|
|
||||||
"heading": "Inicia sesión con tus datos de acceso. Manténlos seguros en todo momento!"
|
|
||||||
},
|
|
||||||
"resetPassword": {
|
"resetPassword": {
|
||||||
"heading": "Por favor, introduce tu contraseña y repítela."
|
"heading": "Por favor, introduce tu contraseña y repítela."
|
||||||
},
|
},
|
||||||
"signup": {
|
"signup": {
|
||||||
"agree": "Acepto la <a href='https://gradido.net/de/datenschutz/' target='_blank' >Política de privacidad</a>.",
|
"agree": "Acepto la <a href='https://gradido.net/de/datenschutz/' target='_blank' >Política de privacidad</a>.",
|
||||||
"dont_match": "Las contraseñas no coinciden.",
|
"dont_match": "Las contraseñas no coinciden.",
|
||||||
"heading": "Regístrate introduciendo todos los datos completos y en los campos correctos.",
|
|
||||||
"lowercase": "Se requiere una letra minúscula.",
|
"lowercase": "Se requiere una letra minúscula.",
|
||||||
"minimum": "Al menos 8 caracteres.",
|
"minimum": "Al menos 8 caracteres.",
|
||||||
"no-whitespace": "Sin espacios ni tabulaciones.",
|
"no-whitespace": "Sin espacios ni tabulaciones.",
|
||||||
|
|||||||
@ -288,16 +288,12 @@
|
|||||||
"forgotPassword": {
|
"forgotPassword": {
|
||||||
"heading": "Veuillez entrer l´adresse email sous laquelle vous êtes enregistré ici svp."
|
"heading": "Veuillez entrer l´adresse email sous laquelle vous êtes enregistré ici svp."
|
||||||
},
|
},
|
||||||
"login": {
|
|
||||||
"heading": "Vous connecter avec vos données d´accès. Gardez les en sécurité!"
|
|
||||||
},
|
|
||||||
"resetPassword": {
|
"resetPassword": {
|
||||||
"heading": "Entrez votre mot de passe et répétez l´action svp."
|
"heading": "Entrez votre mot de passe et répétez l´action svp."
|
||||||
},
|
},
|
||||||
"signup": {
|
"signup": {
|
||||||
"agree": "J´accepte le <a href='https://gradido.net/en/datenschutz/' target='_blank' > politique de confidentialité </a>.",
|
"agree": "J´accepte le <a href='https://gradido.net/en/datenschutz/' target='_blank' > politique de confidentialité </a>.",
|
||||||
"dont_match": "Les mots de passe ne correspondent pas.",
|
"dont_match": "Les mots de passe ne correspondent pas.",
|
||||||
"heading": "Vous enregistrer en entrant toutes les données demandées dans les champs requis.",
|
|
||||||
"lowercase": "Une lettre minuscule est requise.",
|
"lowercase": "Une lettre minuscule est requise.",
|
||||||
"minimum": "8 caractères minimum.",
|
"minimum": "8 caractères minimum.",
|
||||||
"no-whitespace": "Pas d´espace ni d´onglet",
|
"no-whitespace": "Pas d´espace ni d´onglet",
|
||||||
|
|||||||
@ -288,16 +288,12 @@
|
|||||||
"forgotPassword": {
|
"forgotPassword": {
|
||||||
"heading": "Geef alsjeblieft jouw email, waarmee je bij Gradido aangemeld bent."
|
"heading": "Geef alsjeblieft jouw email, waarmee je bij Gradido aangemeld bent."
|
||||||
},
|
},
|
||||||
"login": {
|
|
||||||
"heading": "Meld je met jouw inloggegevens aan. Sla deze altijd veilig op!"
|
|
||||||
},
|
|
||||||
"resetPassword": {
|
"resetPassword": {
|
||||||
"heading": "Vul alsjeblieft jouw wachtwoord in, en herhaal het."
|
"heading": "Vul alsjeblieft jouw wachtwoord in, en herhaal het."
|
||||||
},
|
},
|
||||||
"signup": {
|
"signup": {
|
||||||
"agree": "Ik ga akkoord met <a href='https://gradido.net/de/datenschutz/' target='_blank' >Datenschutzerklärung</a>.",
|
"agree": "Ik ga akkoord met <a href='https://gradido.net/de/datenschutz/' target='_blank' >Datenschutzerklärung</a>.",
|
||||||
"dont_match": "De wachtwoorden zijn niet gelijk.",
|
"dont_match": "De wachtwoorden zijn niet gelijk.",
|
||||||
"heading": "Schrijf je in door alle gegevens volledig en in de juiste velden in te vullen.",
|
|
||||||
"lowercase": "Een kleine letter is noodzakelijk.",
|
"lowercase": "Een kleine letter is noodzakelijk.",
|
||||||
"minimum": "Minstens 8 tekens.",
|
"minimum": "Minstens 8 tekens.",
|
||||||
"no-whitespace": "Geen spaties en tabs",
|
"no-whitespace": "Geen spaties en tabs",
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<div class="community-page">
|
<div class="community-page">
|
||||||
<div>
|
<div>
|
||||||
<b-tabs v-model="tabIndex" content-class="mt-3" align="center">
|
<b-tabs v-model="tabIndex" content-class="mt-3" align="center">
|
||||||
<b-tab :title="$t('community.submitContribution')">
|
<b-tab :title="$t('community.submitContribution')" @click="closeAllOpenCollapse">
|
||||||
<contribution-form
|
<contribution-form
|
||||||
@set-contribution="setContribution"
|
@set-contribution="setContribution"
|
||||||
@update-contribution="updateContribution"
|
@update-contribution="updateContribution"
|
||||||
@ -39,6 +39,7 @@
|
|||||||
</b-alert>
|
</b-alert>
|
||||||
</div>
|
</div>
|
||||||
<contribution-list
|
<contribution-list
|
||||||
|
@closeAllOpenCollapse="closeAllOpenCollapse"
|
||||||
:items="items"
|
:items="items"
|
||||||
@update-list-contributions="updateListContributions"
|
@update-list-contributions="updateListContributions"
|
||||||
@update-contribution-form="updateContributionForm"
|
@update-contribution-form="updateContributionForm"
|
||||||
@ -49,7 +50,7 @@
|
|||||||
:pageSize="pageSize"
|
:pageSize="pageSize"
|
||||||
/>
|
/>
|
||||||
</b-tab>
|
</b-tab>
|
||||||
<b-tab :title="$t('navigation.community')">
|
<b-tab :title="$t('navigation.community')" @click="closeAllOpenCollapse">
|
||||||
<b-alert show dismissible fade variant="secondary" class="text-dark">
|
<b-alert show dismissible fade variant="secondary" class="text-dark">
|
||||||
<h4 class="alert-heading">{{ $t('navigation.community') }}</h4>
|
<h4 class="alert-heading">{{ $t('navigation.community') }}</h4>
|
||||||
<p>
|
<p>
|
||||||
@ -112,6 +113,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
closeAllOpenCollapse() {
|
||||||
|
// console.log('Community closeAllOpenCollapse ')
|
||||||
|
// console.log('closeAllOpenCollapse', this.$el.querySelectorAll('.collapse.show'))
|
||||||
|
this.$el.querySelectorAll('.collapse.show').forEach((value) => {
|
||||||
|
this.$root.$emit('bv::toggle::collapse', value.id)
|
||||||
|
})
|
||||||
|
},
|
||||||
setContribution(data) {
|
setContribution(data) {
|
||||||
this.$apollo
|
this.$apollo
|
||||||
.mutate({
|
.mutate({
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
</b-container>
|
</b-container>
|
||||||
<b-container>
|
<b-container>
|
||||||
<div class="h3">{{ $t('contact') }}</div>
|
<div class="h3">{{ $t('contact') }}</div>
|
||||||
<b-link href="mailto: abc@example.com">{{ supportMail }}</b-link>
|
<b-link :href="`mailto:${supportMail}`">{{ supportMail }}</b-link>
|
||||||
</b-container>
|
</b-container>
|
||||||
<!--
|
<!--
|
||||||
<hr />
|
<hr />
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="login-form">
|
<div class="login-form">
|
||||||
<b-container v-if="enterData">
|
<b-container v-if="enterData">
|
||||||
<div class="pb-5">{{ $t('site.login.heading') }}</div>
|
<div class="pb-5" align="center">{{ $t('gdd_per_link.isFree') }}</div>
|
||||||
<validation-observer ref="observer" v-slot="{ handleSubmit }">
|
<validation-observer ref="observer" v-slot="{ handleSubmit }">
|
||||||
<b-form @submit.stop.prevent="handleSubmit(onSubmit)">
|
<b-form @submit.stop.prevent="handleSubmit(onSubmit)">
|
||||||
<b-row>
|
<b-row>
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="registerform">
|
<div id="registerform">
|
||||||
<b-container v-if="enterData">
|
<b-container v-if="enterData">
|
||||||
<div class="pb-5">
|
<div class="pb-5" align="center">{{ $t('gdd_per_link.isFree') }}</div>
|
||||||
{{ $t('site.signup.heading') }}
|
|
||||||
</div>
|
|
||||||
<validation-observer ref="observer" v-slot="{ handleSubmit }">
|
<validation-observer ref="observer" v-slot="{ handleSubmit }">
|
||||||
<b-form role="form" @submit.prevent="handleSubmit(onSubmit)">
|
<b-form role="form" @submit.prevent="handleSubmit(onSubmit)">
|
||||||
<b-row>
|
<b-row>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gradido",
|
"name": "gradido",
|
||||||
"version": "1.13.3",
|
"version": "1.14.1",
|
||||||
"description": "Gradido",
|
"description": "Gradido",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": "git@github.com:gradido/gradido.git",
|
"repository": "git@github.com:gradido/gradido.git",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user