From 5ff0de7b4f604db95388ccd94380d03f554dee79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 26 Jul 2022 10:41:29 +0200 Subject: [PATCH] Submit on 'Change' (with id) submit button text shall change to 'Submit' and chnage button text from 'Edit' to 'Change' --- .../components/Contributions/ContributionForm.vue | 15 ++++++++------- frontend/src/locales/de.json | 2 +- frontend/src/locales/en.json | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/Contributions/ContributionForm.vue b/frontend/src/components/Contributions/ContributionForm.vue index 6bd18d784..647cd0067 100644 --- a/frontend/src/components/Contributions/ContributionForm.vue +++ b/frontend/src/components/Contributions/ContributionForm.vue @@ -74,7 +74,7 @@ - {{ value.id ? $t('form.edit') : $t('contribution.submit') }} + {{ form.id ? $t('form.change') : $t('contribution.submit') }} @@ -93,13 +93,13 @@ export default { minlength: 50, maxlength: 255, maximalDate: new Date(), - form: this.value, - id: this.value.id, + form: this.value, // includes 'id' + // Wolle: id: this.value.id, } }, methods: { submit() { - if (this.value.id) { + if (this.form.id) { this.$emit('update-contribution', this.form) } else { this.$emit('set-contribution', this.form) @@ -108,8 +108,9 @@ export default { }, reset() { this.$refs.form.reset() + // Wolle: this.id = null + this.form.id = null this.form.date = '' - this.id = null this.form.memo = '' this.form.amount = '' }, @@ -154,13 +155,13 @@ export default { }, maxGddLastMonth() { // When edited, the amount is added back on top of the amount - return this.value.id && !this.isThisMonth + return this.form.id && !this.isThisMonth ? parseInt(this.$store.state.creation[1]) + parseInt(this.updateAmount) : this.$store.state.creation[1] }, maxGddThisMonth() { // When edited, the amount is added back on top of the amount - return this.value.id && this.isThisMonth + return this.form.id && this.isThisMonth ? parseInt(this.$store.state.creation[2]) + parseInt(this.updateAmount) : this.$store.state.creation[2] }, diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index ef81d463e..d06299245 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -110,7 +110,7 @@ "current_balance": "Aktueller Kontostand", "date": "Datum", "description": "Beschreibung", - "edit": "Bearbeiten", + "change": "Ändern", "email": "E-Mail", "firstname": "Vorname", "from": "Von", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 47753487d..de1ee6900 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -110,7 +110,7 @@ "current_balance": "Current Balance", "date": "Date", "description": "Description", - "edit": "Edit", + "change": "Change", "email": "Email", "firstname": "Firstname", "from": "from",