From fd068bcd0f9284562ce9f24adc51b8676813bb74 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 23 Nov 2021 10:10:06 +0100 Subject: [PATCH] update creation data --- admin/src/components/CreationFormular.spec.js | 9 --- admin/src/components/CreationFormular.vue | 79 ++++++++++++++++--- admin/src/components/NavBar.spec.js | 8 -- admin/src/components/UserTable.spec.js | 14 ---- admin/src/components/UserTable.vue | 25 +++++- admin/src/views/CreationConfirm.vue | 48 ++++++++--- 6 files changed, 126 insertions(+), 57 deletions(-) diff --git a/admin/src/components/CreationFormular.spec.js b/admin/src/components/CreationFormular.spec.js index e02103608..f218cf8e2 100644 --- a/admin/src/components/CreationFormular.spec.js +++ b/admin/src/components/CreationFormular.spec.js @@ -2,7 +2,6 @@ import { mount } from '@vue/test-utils' import CreationFormular from './CreationFormular.vue' const localVue = global.localVue -<<<<<<< HEAD const mocks = { $moment: jest.fn(() => { @@ -23,14 +22,6 @@ const propsData = { creation: {}, itemsMassCreation: {}, } -======= -const propsData = { - type: 'STRING', - creation: [100, 500, 1000], - itemUser: [], -} -const mocks = { $moment: jest.fn() } ->>>>>>> ddaaab9c (add Tests, CreationFormular.spec.js, NavBar.spec.js, UserTable.spec.js) describe('CreationFormular', () => { let wrapper diff --git a/admin/src/components/CreationFormular.vue b/admin/src/components/CreationFormular.vue index 995640c72..a810528d6 100644 --- a/admin/src/components/CreationFormular.vue +++ b/admin/src/components/CreationFormular.vue @@ -26,7 +26,7 @@ size="lg" @change="updateRadioSelected(beforeLastMonth, 0, creation[0])" > - {{ beforeLastMonth }} {{ creation[0] != null ? creation[0] + ' GDD' : '' }} + {{ beforeLastMonth.short }} {{ creation[0] != null ? creation[0] + ' GDD' : '' }} @@ -36,7 +36,7 @@ size="lg" @change="updateRadioSelected(lastMonth, 1, creation[1])" > - {{ lastMonth }} {{ creation[1] != null ? creation[1] + ' GDD' : '' }} + {{ lastMonth.short }} {{ creation[1] != null ? creation[1] + ' GDD' : '' }} @@ -46,7 +46,7 @@ size="lg" @change="updateRadioSelected(currentMonth, 2, creation[2])" > - {{ currentMonth }} {{ creation[2] != null ? creation[2] + ' GDD' : '' }} + {{ currentMonth.short }} {{ creation[2] != null ? creation[2] + ' GDD' : '' }} @@ -73,6 +73,7 @@ :min="rangeMin" :max="rangeMax" step="10" + @load="checkFormForUpdate('range')" > @@ -83,6 +84,7 @@ v-model="text" :state="text.length >= 10" placeholder="Mindestens 10 Zeichen eingeben" + @load="checkFormForUpdate('text')" rows="3" > @@ -96,6 +98,18 @@
+ Update Schöpfung ({{ type }},{{ pagetype }}) + {{ creationUserData }} + + + > ' + this.item.first_name + '') - // $store - offene Schöpfungen hochzählen - this.$store.commit('openCreationsPlus', 1) + + if (this.pagetype === 'PageCreationConfirm') { + // hinweis das eine ein einzelne Schöpfung abgesendet wird an (email) + alert('UPDATE EINZEL SCHÖPFUNG ABSENDEN FÜR >> ') + // umschreiben, update eine bestehende Schöpfung eine + + this.creationUserData.datum = this.radioSelected.long + this.creationUserData.creation_gdd = this.value + this.creationUserData.text = this.text + + // this.$store.commit('update-creation-user-data', this.submitObj) + } else { + // hinweis das eine ein einzelne Schöpfung abgesendet wird an (email) + alert('EINZEL SCHÖPFUNG ABSENDEN FÜR >> ' + this.item.first_name + '') + // $store - offene Schöpfungen hochzählen + this.$store.commit('openCreationsPlus', 1) + } } // das absendeergebniss im string ansehen diff --git a/admin/src/components/NavBar.spec.js b/admin/src/components/NavBar.spec.js index 55998bddd..1d68b16ad 100644 --- a/admin/src/components/NavBar.spec.js +++ b/admin/src/components/NavBar.spec.js @@ -6,11 +6,7 @@ const localVue = global.localVue const mocks = { $store: { state: { -<<<<<<< HEAD openCreations: 1, -======= - openCreations: 0, ->>>>>>> ddaaab9c (add Tests, CreationFormular.spec.js, NavBar.spec.js, UserTable.spec.js) }, }, } @@ -19,11 +15,7 @@ describe('NavBar', () => { let wrapper const Wrapper = () => { -<<<<<<< HEAD - return mount(NavBar, { localVue, mocks }) -======= return mount(NavBar, { mocks, localVue }) ->>>>>>> ddaaab9c (add Tests, CreationFormular.spec.js, NavBar.spec.js, UserTable.spec.js) } describe('mount', () => { diff --git a/admin/src/components/UserTable.spec.js b/admin/src/components/UserTable.spec.js index e1d6e7bdd..a87497d81 100644 --- a/admin/src/components/UserTable.spec.js +++ b/admin/src/components/UserTable.spec.js @@ -7,24 +7,10 @@ describe('UserTable', () => { let wrapper const propsData = { -<<<<<<< HEAD type: 'Type', itemsUser: [], fieldsTable: [], creation: {}, -======= - type: 'TableName', - itemUser: [ - { - id: 1, - email: 'dickerson@web.de', - first_name: 'Dickerson', - last_name: 'Macdonald', - creation: '450,200,700', - }, - ], - creation: [null, null, null], ->>>>>>> ddaaab9c (add Tests, CreationFormular.spec.js, NavBar.spec.js, UserTable.spec.js) } const Wrapper = () => { diff --git a/admin/src/components/UserTable.vue b/admin/src/components/UserTable.vue index b4b173782..d96438bcb 100644 --- a/admin/src/components/UserTable.vue +++ b/admin/src/components/UserTable.vue @@ -37,7 +37,12 @@ stacked="md" > @@ -30,9 +29,21 @@ export default { { key: 'email', label: 'Email' }, { key: 'first_name', label: 'Vorname' }, { key: 'last_name', label: 'Nachname' }, - { key: 'creation_gdd', label: 'GDD' }, + { + key: 'creation_gdd', + label: 'Schöpfung', + formatter: (value) => { + return value + ' GDD' + }, + }, { key: 'text', label: 'Text' }, - { key: 'creation_date', label: 'Datum' }, + { + key: 'creation_date', + label: 'Datum', + formatter: (value) => { + return value.long + }, + }, { key: 'creation_moderator', label: 'Moderator' }, { key: 'edit_creation', label: 'ändern' }, { key: 'confirm', label: 'speichern' }, @@ -47,7 +58,10 @@ export default { creation_gdd: '1000', text: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam ', - creation_date: '01/11/2021', + creation_date: { + short: 'November', + long: '22/11/2021', + }, creation_moderator: 'Manuela Gast', }, { @@ -59,7 +73,10 @@ export default { creation_gdd: '1000', text: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam ', - creation_date: '01/11/2021', + creation_date: { + short: 'November', + long: '03/11/2021', + }, creation_moderator: 'Manuela Gast', }, { @@ -70,7 +87,10 @@ export default { creation: '350,200,900', creation_gdd: '1000', text: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam', - creation_date: '01/11/2021', + creation_date: { + short: 'September', + long: '27/09/2021', + }, creation_moderator: 'Manuela Gast', }, { @@ -80,8 +100,10 @@ export default { last_name: 'Takker', creation_gdd: '500', text: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo ', - - creation_date: '01/10/2021', + creation_date: { + short: 'Oktober', + long: '12/10/2021', + }, creation_moderator: 'Evelyn Roller', }, { @@ -92,16 +114,18 @@ export default { creation: '100,400,800', creation_gdd: '200', text: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At', - creation_date: '01/09/2021', + creation_date: { + short: 'September', + long: '05/09/2021', + }, creation_moderator: 'Manuela Gast', }, ], - creation: [null, null, null], } }, methods: { - updateConfirmResult(e, event) { + removeConfirmResult(e, event) { if (event === 'remove') { let index = 0 let findArr = {}