From dd7b95b9afd0912cdd751c66902f482730a0f7c5 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 25 Jan 2022 17:25:58 +0100 Subject: [PATCH] create radio buttons in mixin --- .github/workflows/test.yml | 2 +- admin/src/components/CreationFormular.vue | 14 -------------- admin/src/mixins/creationMonths.js | 11 +++++++++++ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d927c64b1..4dc2be992 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -470,7 +470,7 @@ jobs: report_name: Coverage Admin Interface type: lcov result_path: ./coverage/lcov.info - min_coverage: 78 + min_coverage: 79 token: ${{ github.token }} ############################################################################## diff --git a/admin/src/components/CreationFormular.vue b/admin/src/components/CreationFormular.vue index 490996f0c..f939605ad 100644 --- a/admin/src/components/CreationFormular.vue +++ b/admin/src/components/CreationFormular.vue @@ -199,16 +199,12 @@ export default { }), ) this.$store.commit('openCreationsPlus', 1) - // das creation Formular reseten this.$refs.creationForm.reset() - // Den geschöpften Wert auf o setzen this.value = 0 }) .catch((error) => { this.$toasted.error(error.message) - // das creation Formular reseten this.$refs.creationForm.reset() - // Den geschöpften Wert auf o setzen this.value = 0 }) } @@ -219,15 +215,5 @@ export default { this.updateRadioSelected(this.selected) }, }, - computed: { - radioOptions() { - return this.creationDateObjects.map((obj, idx) => { - return { - item: { ...obj, creation: this.creation[idx] }, - name: obj.short + (this.creation[idx] ? ' ' + this.creation[idx] + ' GDD' : ''), - } - }) - }, - }, } diff --git a/admin/src/mixins/creationMonths.js b/admin/src/mixins/creationMonths.js index 56dca5c56..a2bbdcd1a 100644 --- a/admin/src/mixins/creationMonths.js +++ b/admin/src/mixins/creationMonths.js @@ -1,4 +1,7 @@ export const creationMonths = { + props: { + creation: [1000, 1000, 1000], + }, computed: { creationDates() { const now = new Date(Date.now()) @@ -20,5 +23,13 @@ export const creationMonths = { }) return result }, + radioOptions() { + return this.creationDateObjects.map((obj, idx) => { + return { + item: { ...obj, creation: this.creation[idx] }, + name: obj.short + (this.creation[idx] ? ' ' + this.creation[idx] + ' GDD' : ''), + } + }) + }, }, }