From 5374b41905f10d54f96b7aeccd04d72b23afdc2e Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 15 Jun 2022 22:32:53 +0200 Subject: [PATCH] refactor review from claus-peter --- admin/.eslintrc.js | 2 +- admin/src/components/ContributionLinkForm.vue | 3 +- admin/src/components/ContributionLinkList.vue | 42 +++++++++---------- admin/src/locales/de.json | 5 ++- admin/src/locales/en.json | 7 ++-- 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/admin/.eslintrc.js b/admin/.eslintrc.js index e83beb40d..73dce291f 100644 --- a/admin/.eslintrc.js +++ b/admin/.eslintrc.js @@ -39,7 +39,7 @@ module.exports = { { src: './src', extensions: ['.js', '.vue'], - ignores: ['contributionLink.options.maxPerCycle.null'], + ignores: [], enableFix: false, }, ], diff --git a/admin/src/components/ContributionLinkForm.vue b/admin/src/components/ContributionLinkForm.vue index adb5db433..1e486cdcb 100644 --- a/admin/src/components/ContributionLinkForm.vue +++ b/admin/src/components/ContributionLinkForm.vue @@ -42,6 +42,7 @@ type="text" placeholder="Name" required + maxlength="80" > @@ -51,6 +52,7 @@ size="lg" :placeholder="$t('contributionLink.memo')" required + maxlength="255" > @@ -145,7 +147,6 @@ export default { { value: 'yearly', text: this.$t('contributionLink.options.cycle.yearly') }, ], maxPerCycle: [ - { value: null, text: this.$t('contributionLink.options.maxPerCycle.null') }, { value: '1', text: '1 x' }, { value: '2', text: '2 x' }, { value: '3', text: '3 x' }, diff --git a/admin/src/components/ContributionLinkList.vue b/admin/src/components/ContributionLinkList.vue index f3a0a2f15..3094386e0 100644 --- a/admin/src/components/ContributionLinkList.vue +++ b/admin/src/components/ContributionLinkList.vue @@ -57,10 +57,10 @@ export default { 'name', 'memo', 'amount', - { key: 'cycle', label: 'Zyklus' }, - { key: 'maxPerCycle', label: 'Wiederholung' }, - { key: 'validFrom', label: 'Start' }, - { key: 'validTo', label: 'Ende' }, + { key: 'cycle', label: this.$t('contributionLink.cycle') }, + { key: 'maxPerCycle', label: this.$t('contributionLink.maxPerCycle') }, + { key: 'validFrom', label: this.$t('contributionLink.validFrom') }, + { key: 'validTo', label: this.$t('contributionLink.validTo') }, 'delete', 'edit', 'show', @@ -71,24 +71,22 @@ export default { }, methods: { deleteContributionLink() { - this.$bvModal - .msgBoxConfirm('Automatische Creations wirklich löschen?') - .then(async (value) => { - if (value) - await this.$apollo - .mutate({ - mutation: deleteContributionLink, - variables: { - id: this.id, - }, - }) - .then(() => { - this.toastSuccess('TODO: request message deleted ') - }) - .catch((err) => { - this.toastError(err.message) - }) - }) + this.$bvModal.msgBoxConfirm(this.$t('contributionLink.deleteNow')).then(async (value) => { + if (value) + await this.$apollo + .mutate({ + mutation: deleteContributionLink, + variables: { + id: this.id, + }, + }) + .then(() => { + this.toastSuccess('TODO: request message deleted ') + }) + .catch((err) => { + this.toastError(err.message) + }) + }) }, editContributionLink(row) { this.$emit('editContributionLinkData', row) diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index c6eaf9cb3..77cf39abb 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -8,7 +8,7 @@ "create": "Anlegen", "cycle": "Zyklus", "maximumAmount": "maximaler Betrag", - "maxPerCycle": "Wiederholung", + "maxPerCycle": "Wiederholungen", "memo": "Nachricht", "name": "Name", "newContributionLink": "Neuer Beitragslink", @@ -30,7 +30,8 @@ } }, "validFrom": "Startdatum", - "validTo": "Enddatum" + "validTo": "Enddatum", + "deleteNow":"Automatische Creations wirklich löschen?" }, "creation": "Schöpfung", "creationList": "Schöpfungsliste", diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index 34baa1a5b..c24120756 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -12,7 +12,7 @@ "memo": "Memo", "name": "Name", "newContributionLink": "New contribution link", - "noContributionLinks": "No contribution links have been created.", + "noContributionLinks": "No contribution link has been created.", "noDateSelected": "No date selected", "noEndDate": "No end-date", "noStartDate": "No start-date", @@ -21,7 +21,7 @@ "daily": "daily", "hourly": "hourly", "monthly": "monthly", - "once": "unique", + "once": "once", "weekly": "weekly", "yearly": "yearly" }, @@ -30,7 +30,8 @@ } }, "validFrom": "Start-date", - "validTo": "End-Date" + "validTo": "End-Date", + "deleteNow":"Do you really delete automatic creations?" }, "creation": "Creation", "creationList": "Creation list",