Merge branch 'master' into unit-tests-community-page

This commit is contained in:
Moriz Wahl 2023-01-20 10:41:29 +01:00
commit a1b1142128
13 changed files with 283 additions and 262 deletions

View File

@ -35,7 +35,6 @@ jobs:
build_test_admin: build_test_admin:
name: Docker Build Test - Admin Interface name: Docker Build Test - Admin Interface
runs-on: ubuntu-latest runs-on: ubuntu-latest
#needs: [nothing]
steps: steps:
########################################################################## ##########################################################################
# CHECKOUT CODE ########################################################## # CHECKOUT CODE ##########################################################

View File

@ -4,8 +4,24 @@ 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.17.1](https://github.com/gradido/gradido/compare/1.17.0...1.17.1)
- refactor(frontend): change contribution memo add word-break [`#2583`](https://github.com/gradido/gradido/pull/2583)
- refactor(admin): add text-break on all table memo fields [`#2584`](https://github.com/gradido/gradido/pull/2584)
- fix(frontend): throw proper frontend warning errors [`#2586`](https://github.com/gradido/gradido/pull/2586)
- refactor(frontend): equalize en with fr languages. [`#2585`](https://github.com/gradido/gradido/pull/2585)
- refactor(frontend): forgot password unit tests [`#2582`](https://github.com/gradido/gradido/pull/2582)
- fix(frontend): fix min value for hours input [`#2581`](https://github.com/gradido/gradido/pull/2581)
- fix(frontend): change dropdown placement calender no-flip true [`#2580`](https://github.com/gradido/gradido/pull/2580)
- refactor(frontend): link send result style [`#2577`](https://github.com/gradido/gradido/pull/2577)
- refactor(frontend): remove vertical scrolling & small fixes [`#2578`](https://github.com/gradido/gradido/pull/2578)
- refactor(frontend): tyle mobile device auth template [`#2576`](https://github.com/gradido/gradido/pull/2576)
#### [1.17.0](https://github.com/gradido/gradido/compare/1.16.0...1.17.0) #### [1.17.0](https://github.com/gradido/gradido/compare/1.16.0...1.17.0)
> 18 January 2023
- chore(release): v1.17.0 [`#2575`](https://github.com/gradido/gradido/pull/2575)
- fix(frontend): submit contribution text [`#2573`](https://github.com/gradido/gradido/pull/2573) - fix(frontend): submit contribution text [`#2573`](https://github.com/gradido/gradido/pull/2573)
- fix(backend): admin cannot delete confirmed contribution [`#2571`](https://github.com/gradido/gradido/pull/2571) - fix(backend): admin cannot delete confirmed contribution [`#2571`](https://github.com/gradido/gradido/pull/2571)
- fix(frontend): english locales - horas -> hours [`#2572`](https://github.com/gradido/gradido/pull/2572) - fix(frontend): english locales - horas -> hours [`#2572`](https://github.com/gradido/gradido/pull/2572)

View File

@ -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.17.0", "version": "1.17.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"private": false, "private": false,
"scripts": { "scripts": {

View File

@ -1,6 +1,6 @@
{ {
"name": "gradido-backend", "name": "gradido-backend",
"version": "1.17.0", "version": "1.17.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",

View File

@ -1,6 +1,6 @@
{ {
"name": "gradido-database", "name": "gradido-database",
"version": "1.17.0", "version": "1.17.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",

View File

@ -1,6 +1,6 @@
{ {
"name": "bootstrap-vue-gradido-wallet", "name": "bootstrap-vue-gradido-wallet",
"version": "1.17.0", "version": "1.17.1",
"private": true, "private": true,
"scripts": { "scripts": {
"start": "node run/server.js", "start": "node run/server.js",

View File

@ -16,12 +16,15 @@
<b-avatar v-else :icon="icon" :variant="variant" size="3em"></b-avatar> <b-avatar v-else :icon="icon" :variant="variant" size="3em"></b-avatar>
</b-col> </b-col>
<b-col> <b-col>
<div v-if="firstName" class="mr-3 font-weight-bold">{{ firstName }} {{ lastName }}</div> <div v-if="firstName" class="mr-3 font-weight-bold">
{{ firstName }} {{ lastName }}
<b-icon :icon="icon" :variant="variant"></b-icon>
</div>
<div class="small"> <div class="small">
{{ $d(new Date(contributionDate), 'monthAndYear') }} {{ $d(new Date(contributionDate), 'monthAndYear') }}
</div> </div>
<div class="mt-3 font-weight-bold">{{ $t('contributionText') }}</div> <div class="mt-3 font-weight-bold">{{ $t('contributionText') }}</div>
<div class="mb-3">{{ memo }}</div> <div class="mb-3 text-break word-break">{{ memo }}</div>
<div v-if="state === 'IN_PROGRESS'" class="text-205"> <div v-if="state === 'IN_PROGRESS'" class="text-205">
{{ $t('contribution.alert.answerQuestion') }} {{ $t('contribution.alert.answerQuestion') }}
</div> </div>

View File

@ -18,6 +18,7 @@
rows="4" rows="4"
max-rows="4" max-rows="4"
:disabled="disabled" :disabled="disabled"
no-resize
></b-form-textarea> ></b-form-textarea>
<b-form-invalid-feedback v-bind="ariaMsg"> <b-form-invalid-feedback v-bind="ariaMsg">
{{ errors[0] }} {{ errors[0] }}

View File

@ -37,7 +37,8 @@
"contribution": { "contribution": {
"activity": "Tätigkeit", "activity": "Tätigkeit",
"alert": { "alert": {
"answerQuestion": "Bitte beantworte die Rückfrage!", "answerQuestion": "Bitte beantworte diese Rückfrage.",
"answerQuestionToast": "Du hast eine Rückfrage auf einen Beitrag. Bitte antworte auf diese.",
"communityNoteList": "Hier findest du alle eingereichten und bestätigten Beiträge von allen Mitgliedern aus dieser Gemeinschaft.", "communityNoteList": "Hier findest du alle eingereichten und bestätigten Beiträge von allen Mitgliedern aus dieser Gemeinschaft.",
"confirm": "bestätigt", "confirm": "bestätigt",
"deleted": "gelöscht", "deleted": "gelöscht",

View File

@ -37,7 +37,8 @@
"contribution": { "contribution": {
"activity": "Activity", "activity": "Activity",
"alert": { "alert": {
"answerQuestion": "Please answer the question", "answerQuestion": "Please answer the question.",
"answerQuestionToast": "You have a question about a post. Please reply to it.",
"communityNoteList": "Here you will find all submitted and confirmed contributions from all members of this community.", "communityNoteList": "Here you will find all submitted and confirmed contributions from all members of this community.",
"confirm": "confirmed", "confirm": "confirmed",
"deleted": "deleted", "deleted": "deleted",

View File

@ -250,7 +250,7 @@ describe('Community', () => {
it('toasts an info', () => { it('toasts an info', () => {
expect(toastInfoSpy).toBeCalledWith( expect(toastInfoSpy).toBeCalledWith(
'Du hast eine Rückfrage auf eine Contribution. Bitte beantworte diese!', 'contribution.alert.answerQuestionToast',
) )
}) })
}) })

View File

@ -48,258 +48,258 @@
</div> </div>
</template> </template>
<script> <script>
import OpenCreationsAmount from '@/components/Contributions/OpenCreationsAmount.vue' import OpenCreationsAmount from '@/components/Contributions/OpenCreationsAmount.vue'
import ContributionForm from '@/components/Contributions/ContributionForm.vue' import ContributionForm from '@/components/Contributions/ContributionForm.vue'
import ContributionList from '@/components/Contributions/ContributionList.vue' import ContributionList from '@/components/Contributions/ContributionList.vue'
import { createContribution, updateContribution, deleteContribution } from '@/graphql/mutations' import { createContribution, updateContribution, deleteContribution } from '@/graphql/mutations'
import { listContributions, listAllContributions, openCreations } from '@/graphql/queries' import { listContributions, listAllContributions, openCreations } from '@/graphql/queries'
export default { export default {
name: 'Community', name: 'Community',
components: { components: {
ContributionForm, ContributionForm,
ContributionList, ContributionList,
OpenCreationsAmount, OpenCreationsAmount,
}, },
data() { data() {
return { return {
hashLink: '', hashLink: '',
tabLinkHashes: ['#edit', '#my', '#all'], tabLinkHashes: ['#edit', '#my', '#all'],
tabIndex: 0, tabIndex: 0,
items: [], items: [],
itemsAll: [], itemsAll: [],
currentPage: 1, currentPage: 1,
pageSize: 25, pageSize: 25,
currentPageAll: 1, currentPageAll: 1,
pageSizeAll: 25, pageSizeAll: 25,
contributionCount: 0, contributionCount: 0,
contributionCountAll: 0, contributionCountAll: 0,
form: { form: {
id: null, id: null,
date: '', date: '',
memo: '', memo: '',
hours: 0, hours: 0,
amount: '', amount: '',
}, },
updateAmount: '', updateAmount: '',
maximalDate: new Date(), maximalDate: new Date(),
openCreations: [], openCreations: [],
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.tabIndex = this.tabLinkHashes.findIndex((hashLink) => hashLink === this.$route.hash) this.tabIndex = this.tabLinkHashes.findIndex((hashLink) => hashLink === this.$route.hash)
this.hashLink = this.$route.hash this.hashLink = this.$route.hash
}) })
}, },
apollo: { apollo: {
OpenCreations: { OpenCreations: {
query() { query() {
return openCreations return openCreations
}, },
fetchPolicy: 'network-only', fetchPolicy: 'network-only',
variables() { variables() {
return {} return {}
}, },
update({ openCreations }) { update({ openCreations }) {
this.openCreations = openCreations this.openCreations = openCreations
}, },
error({ message }) { error({ message }) {
this.toastError(message) this.toastError(message)
}, },
}, },
ListAllContributions: { ListAllContributions: {
query() { query() {
return listAllContributions return listAllContributions
}, },
fetchPolicy: 'network-only', fetchPolicy: 'network-only',
variables() { variables() {
return { return {
currentPage: this.currentPageAll, currentPage: this.currentPageAll,
pageSize: this.pageSizeAll, pageSize: this.pageSizeAll,
} }
}, },
update({ listAllContributions }) { update({ listAllContributions }) {
this.contributionCountAll = listAllContributions.contributionCount this.contributionCountAll = listAllContributions.contributionCount
this.itemsAll = listAllContributions.contributionList this.itemsAll = listAllContributions.contributionList
}, },
error({ message }) { error({ message }) {
this.toastError(message) this.toastError(message)
}, },
}, },
ListContributions: { ListContributions: {
query() { query() {
return listContributions return listContributions
}, },
fetchPolicy: 'network-only', fetchPolicy: 'network-only',
variables() { variables() {
return { return {
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
} }
}, },
update({ listContributions }) { update({ listContributions }) {
this.contributionCount = listContributions.contributionCount this.contributionCount = listContributions.contributionCount
this.items = listContributions.contributionList this.items = listContributions.contributionList
if (this.items.find((item) => item.state === 'IN_PROGRESS')) { if (this.items.find((item) => item.state === 'IN_PROGRESS')) {
this.tabIndex = 1 this.tabIndex = 1
if (this.$route.hash !== '#my') { if (this.$route.hash !== '#my') {
this.$router.push({ path: '/community#my' }) this.$router.push({ path: '/community#my' })
} }
this.toastInfo('Du hast eine Rückfrage auf eine Contribution. Bitte beantworte diese!') this.toastInfo(this.$t('contribution.alert.answerQuestionToast'))
} }
}, },
error({ message }) { error({ message }) {
this.toastError(message) this.toastError(message)
}, },
}, },
}, },
watch: { watch: {
$route(to, from) { $route(to, from) {
this.tabIndex = this.tabLinkHashes.findIndex((hashLink) => hashLink === to.hash) this.tabIndex = this.tabLinkHashes.findIndex((hashLink) => hashLink === to.hash)
this.hashLink = to.hash this.hashLink = to.hash
this.closeAllOpenCollapse() this.closeAllOpenCollapse()
}, },
tabIndex(num) { tabIndex(num) {
if (num !== 0) { if (num !== 0) {
this.form = { this.form = {
id: null, id: null,
date: new Date(), date: new Date(),
memo: '', memo: '',
hours: 0, hours: 0,
amount: '', amount: '',
} }
} }
}, },
}, },
computed: { computed: {
minimalDate() { minimalDate() {
const date = new Date(this.maximalDate) const date = new Date(this.maximalDate)
return new Date(date.setMonth(date.getMonth() - 1, 1)) return new Date(date.setMonth(date.getMonth() - 1, 1))
}, },
isThisMonth() { isThisMonth() {
const formDate = new Date(this.form.date) const formDate = new Date(this.form.date)
return ( return (
formDate.getFullYear() === this.maximalDate.getFullYear() && formDate.getFullYear() === this.maximalDate.getFullYear() &&
formDate.getMonth() === this.maximalDate.getMonth() formDate.getMonth() === this.maximalDate.getMonth()
) )
}, },
amountToAdd() { amountToAdd() {
// when existing contribution is edited, the amount is added back on top of the amount // when existing contribution is edited, the amount is added back on top of the amount
if (this.form.id) return parseInt(this.updateAmount) if (this.form.id) return parseInt(this.updateAmount)
return 0 return 0
}, },
maxForMonths() { maxForMonths() {
const formDate = new Date(this.form.date) const formDate = new Date(this.form.date)
if (this.openCreations && this.openCreations.length) if (this.openCreations && this.openCreations.length)
return this.openCreations.slice(1).map((creation) => { return this.openCreations.slice(1).map((creation) => {
if (creation.year === formDate.getFullYear() && creation.month === formDate.getMonth()) if (creation.year === formDate.getFullYear() && creation.month === formDate.getMonth())
return parseInt(creation.amount) + this.amountToAdd return parseInt(creation.amount) + this.amountToAdd
return parseInt(creation.amount) return parseInt(creation.amount)
}) })
return [0, 0] return [0, 0]
}, },
}, },
methods: { methods: {
closeAllOpenCollapse() { closeAllOpenCollapse() {
this.$el.querySelectorAll('.collapse.show').forEach((value) => { this.$el.querySelectorAll('.collapse.show').forEach((value) => {
this.$root.$emit('bv::toggle::collapse', value.id) this.$root.$emit('bv::toggle::collapse', value.id)
}) })
}, },
refetchData() { refetchData() {
this.$apollo.queries.ListAllContributions.refetch() this.$apollo.queries.ListAllContributions.refetch()
this.$apollo.queries.ListContributions.refetch() this.$apollo.queries.ListContributions.refetch()
this.$apollo.queries.OpenCreations.refetch() this.$apollo.queries.OpenCreations.refetch()
}, },
saveContribution(data) { saveContribution(data) {
this.$apollo this.$apollo
.mutate({ .mutate({
fetchPolicy: 'no-cache', fetchPolicy: 'no-cache',
mutation: createContribution, mutation: createContribution,
variables: { variables: {
creationDate: data.date, creationDate: data.date,
memo: data.memo, memo: data.memo,
amount: data.amount, amount: data.amount,
}, },
}) })
.then((result) => { .then((result) => {
this.toastSuccess(this.$t('contribution.submitted')) this.toastSuccess(this.$t('contribution.submitted'))
this.refetchData() this.refetchData()
}) })
.catch((err) => { .catch((err) => {
this.toastError(err.message) this.toastError(err.message)
}) })
}, },
updateContribution(data) { updateContribution(data) {
this.$apollo this.$apollo
.mutate({ .mutate({
fetchPolicy: 'no-cache', fetchPolicy: 'no-cache',
mutation: updateContribution, mutation: updateContribution,
variables: { variables: {
contributionId: data.id, contributionId: data.id,
creationDate: data.date, creationDate: data.date,
memo: data.memo, memo: data.memo,
amount: data.amount, amount: data.amount,
}, },
}) })
.then((result) => { .then((result) => {
this.toastSuccess(this.$t('contribution.updated')) this.toastSuccess(this.$t('contribution.updated'))
this.refetchData() this.refetchData()
}) })
.catch((err) => { .catch((err) => {
this.toastError(err.message) this.toastError(err.message)
}) })
}, },
deleteContribution(data) { deleteContribution(data) {
this.$apollo this.$apollo
.mutate({ .mutate({
fetchPolicy: 'no-cache', fetchPolicy: 'no-cache',
mutation: deleteContribution, mutation: deleteContribution,
variables: { variables: {
id: data.id, id: data.id,
}, },
}) })
.then((result) => { .then((result) => {
this.toastSuccess(this.$t('contribution.deleted')) this.toastSuccess(this.$t('contribution.deleted'))
this.refetchData() this.refetchData()
}) })
.catch((err) => { .catch((err) => {
this.toastError(err.message) this.toastError(err.message)
}) })
}, },
updateListAllContributions(pagination) { updateListAllContributions(pagination) {
this.currentPageAll = pagination.currentPage this.currentPageAll = pagination.currentPage
this.pageSizeAll = pagination.pageSize this.pageSizeAll = pagination.pageSize
this.$apollo.queries.ListAllContributions.refetch() this.$apollo.queries.ListAllContributions.refetch()
}, },
updateListContributions(pagination) { updateListContributions(pagination) {
this.currentPage = pagination.currentPage this.currentPage = pagination.currentPage
this.pageSize = pagination.pageSize this.pageSize = pagination.pageSize
this.$apollo.queries.ListContributions.refetch() this.$apollo.queries.ListContributions.refetch()
}, },
updateContributionForm(item) { updateContributionForm(item) {
this.form.id = item.id this.form.id = item.id
this.form.date = item.contributionDate this.form.date = item.contributionDate
this.form.memo = item.memo this.form.memo = item.memo
this.form.amount = item.amount this.form.amount = item.amount
this.form.hours = item.amount / 20 this.form.hours = item.amount / 20
this.updateAmount = item.amount this.updateAmount = item.amount
this.$router.push({ path: '#edit' }) this.$router.push({ path: '#edit' })
this.tabIndex = 0 this.tabIndex = 0
}, },
updateTransactions(pagination) { updateTransactions(pagination) {
this.$emit('update-transactions', pagination) this.$emit('update-transactions', pagination)
}, },
updateState(id) { updateState(id) {
this.items.find((item) => item.id === id).state = 'PENDING' this.items.find((item) => item.id === id).state = 'PENDING'
}, },
}, },
created() { created() {
this.updateTransactions(0) this.updateTransactions(0)
this.tabIndex = 1 this.tabIndex = 1
this.$router.push({ path: '/community#my' }) this.$router.push({ path: '/community#my' })
}, },
} }
</script> </script>
<style scoped> <style scoped>
.tab-content { .tab-content {

View File

@ -1,6 +1,6 @@
{ {
"name": "gradido", "name": "gradido",
"version": "1.17.0", "version": "1.17.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",