From f4783165cc1c1f78dd3c0c5652d1cc98f67ba381 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 15 Jun 2022 07:32:26 +0200 Subject: [PATCH 1/3] change data for database createContributionLink --- admin/.eslintrc.js | 2 +- .../components/ContributionLinkForm.spec.js | 20 +++--- admin/src/components/ContributionLinkForm.vue | 66 +++++++++---------- .../components/ContributionLinkList.spec.js | 16 ++--- admin/src/components/ContributionLinkList.vue | 8 +-- admin/src/graphql/createContributionLink.js | 16 ++--- admin/src/graphql/listContributionLinks.js | 8 +-- admin/src/graphql/showContributionLink.js | 8 +-- admin/src/locales/de.json | 8 +-- admin/src/locales/en.json | 8 +-- admin/src/pages/Overview.vue | 24 +++---- 11 files changed, 92 insertions(+), 92 deletions(-) diff --git a/admin/.eslintrc.js b/admin/.eslintrc.js index 33ab3c0c5..e83beb40d 100644 --- a/admin/.eslintrc.js +++ b/admin/.eslintrc.js @@ -39,7 +39,7 @@ module.exports = { { src: './src', extensions: ['.js', '.vue'], - ignores: ['contributionLink.options.repetition.null'], + ignores: ['contributionLink.options.maxPerCycle.null'], enableFix: false, }, ], diff --git a/admin/src/components/ContributionLinkForm.spec.js b/admin/src/components/ContributionLinkForm.spec.js index 195664a62..22eff5a70 100644 --- a/admin/src/components/ContributionLinkForm.spec.js +++ b/admin/src/components/ContributionLinkForm.spec.js @@ -36,24 +36,24 @@ describe('ContributionLinkForm', () => { name: 'name', memo: 'memo', amount: 100, - startDate: 'startDate', - endDate: 'endDate', - cycle: 'once', - repetition: '1', - maxAmount: 100, + validFrom: 'validFrom', + validTo: 'validTo', + cycle: 'ONCE', + maxPerCycle: '1', + maxAmountPerMonth: 100, }, }) wrapper.vm.onReset() }) expect(wrapper.vm.form).toEqual({ amount: null, - cycle: 'once', - endDate: null, - maxAmount: null, + cycle: 'ONCE', + validTo: null, + maxAmountPerMonth: null, memo: null, name: null, - repetition: null, - startDate: null, + maxPerCycle: null, + validFrom: null, }) }) diff --git a/admin/src/components/ContributionLinkForm.vue b/admin/src/components/ContributionLinkForm.vue index 386ac8f9e..34190a1c8 100644 --- a/admin/src/components/ContributionLinkForm.vue +++ b/admin/src/components/ContributionLinkForm.vue @@ -7,9 +7,9 @@ - + - + - + - - + + - + { @@ -183,8 +183,8 @@ export default { }, onReset() { this.$refs.contributionLinkForm.reset() - this.form.startDate = null - this.form.endDate = null + this.form.validFrom = null + this.form.validTo = null }, }, computed: { @@ -192,7 +192,7 @@ export default { return this.contributionLinkData }, disabled() { - if (this.form.cycle === 'once') return true + if (this.form.cycle === 'ONCE') return true return false }, }, @@ -201,11 +201,11 @@ export default { this.form.name = this.contributionLinkData.name this.form.memo = this.contributionLinkData.memo this.form.amount = this.contributionLinkData.amount - this.form.startDate = this.contributionLinkData.startDate - this.form.endDate = this.contributionLinkData.endDate + this.form.validFrom = this.contributionLinkData.validFrom + this.form.validTo = this.contributionLinkData.validTo this.form.cycle = this.contributionLinkData.cycle - this.form.repetition = this.contributionLinkData.repetition - this.form.maxAmount = this.contributionLinkData.maxAmount + this.form.maxPerCycle = this.contributionLinkData.maxPerCycle + this.form.maxAmountPerMonth = this.contributionLinkData.maxAmountPerMonth }, }, } diff --git a/admin/src/components/ContributionLinkList.spec.js b/admin/src/components/ContributionLinkList.spec.js index 99847aa12..2ce5fb542 100644 --- a/admin/src/components/ContributionLinkList.spec.js +++ b/admin/src/components/ContributionLinkList.spec.js @@ -21,11 +21,11 @@ const propsData = { name: 'Meditation', memo: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut l', amount: '200', - startDate: '2022-04-01', - endDate: '2022-08-01', + validFrom: '2022-04-01', + validTo: '2022-08-01', cycle: 'täglich', - repetition: '3', - maxAmount: 0, + maxPerCycle: '3', + maxAmountPerMonth: 0, link: 'https://localhost/redeem/CL-1a2345678', }, ], @@ -130,11 +130,11 @@ describe('ContributionLinkList', () => { name: 'Meditation', memo: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut l', amount: '200', - startDate: '2022-04-01', - endDate: '2022-08-01', + validFrom: '2022-04-01', + validTo: '2022-08-01', cycle: 'täglich', - repetition: '3', - maxAmount: 0, + maxPerCycle: '3', + maxAmountPerMonth: 0, link: 'https://localhost/redeem/CL-1a2345678', }, ], diff --git a/admin/src/components/ContributionLinkList.vue b/admin/src/components/ContributionLinkList.vue index 7483124fa..ed322fcfa 100644 --- a/admin/src/components/ContributionLinkList.vue +++ b/admin/src/components/ContributionLinkList.vue @@ -57,10 +57,10 @@ export default { 'name', 'memo', 'amount', - 'cycle', - 'repetition', - { key: 'startDate', label: 'Start' }, - { key: 'endDate', label: 'Ende' }, + { key: 'cycle', label: 'Zyklus' }, + { key: 'maxPerCycle', label: 'Wiederholung' }, + { key: 'validFrom', label: 'Start' }, + { key: 'validTo', label: 'Ende' }, 'delete', 'edit', 'show', diff --git a/admin/src/graphql/createContributionLink.js b/admin/src/graphql/createContributionLink.js index aaccf29b0..2e1241f43 100644 --- a/admin/src/graphql/createContributionLink.js +++ b/admin/src/graphql/createContributionLink.js @@ -2,24 +2,24 @@ import gql from 'graphql-tag' export const createContributionLink = gql` mutation ( - $startDate: String! - $endDate: String! + $validFrom: String! + $validTo: String! $name: String! $amount: Decimal! $memo: String! $cycle: String - $repetition: String - $maxAmount: Decimal + $maxPerCycle: String + $maxAmountPerMonth: Decimal ) { createContributionLink( - startDate: $startDate - endDate: $endDate + validFrom: $validFrom + validTo: $validTo name: $name amount: $amount memo: $memo cycle: $cycle - repetition: $repetition - maxAmount: $maxAmount + maxPerCycle: $maxPerCycle + maxAmountPerMonth: $maxAmountPerMonth ) { link } diff --git a/admin/src/graphql/listContributionLinks.js b/admin/src/graphql/listContributionLinks.js index d46564942..f04fdf2c6 100644 --- a/admin/src/graphql/listContributionLinks.js +++ b/admin/src/graphql/listContributionLinks.js @@ -4,14 +4,14 @@ export const listContributionLinks = gql` query { listContributionLinks { id - startDate - endDate + validFrom + validTo name memo amount cycle - repetition - maxAmount + maxPerCycle + maxAmountPerMonth link } } diff --git a/admin/src/graphql/showContributionLink.js b/admin/src/graphql/showContributionLink.js index 99dd4faef..8042db6b5 100644 --- a/admin/src/graphql/showContributionLink.js +++ b/admin/src/graphql/showContributionLink.js @@ -4,14 +4,14 @@ export const showContributionLink = gql` query ($id: Int!) { showContributionLink { id - startDate - endDate + validFrom + validTo name memo amount cycle - repetition - maxAmount + maxPerCycle + maxAmountPerMonth code } } diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index 6bf09b382..f60416c5d 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -7,7 +7,7 @@ "contributionLinks": "Beitragslinks", "create": "Anlegen", "cycle": "Zyklus", - "endDate": "Enddatum", + "validTo": "Enddatum", "maximumAmount": "maximaler Betrag", "memo": "Nachricht", "name": "Name", @@ -25,12 +25,12 @@ "weekly": "wöchentlich", "yearly": "jährlich" }, - "repetition": { + "maxPerCycle": { "null": "Bitte wähle eine Wiederholung" } }, - "repetition": "Wiederholung", - "startDate": "Startdatum" + "maxPerCycle": "Wiederholung", + "validFrom": "Startdatum" }, "creation": "Schöpfung", "creationList": "Schöpfungsliste", diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index 58fb264b9..e839aebcb 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -7,7 +7,7 @@ "contributionLinks": "Contribution Links", "create": "Create", "cycle": "Cycle", - "endDate": "End-Date", + "validTo": "End-Date", "maximumAmount": "Maximum amount", "memo": "Memo", "name": "Name", @@ -25,12 +25,12 @@ "weekly": "weekly", "yearly": "yearly" }, - "repetition": { + "maxPerCycle": { "null": "please select a repetition" } }, - "repetition": "Repetition", - "startDate": "Start-date" + "maxPerCycle": "Repetition", + "validFrom": "Start-date" }, "creation": "Creation", "creationList": "Creation list", diff --git a/admin/src/pages/Overview.vue b/admin/src/pages/Overview.vue index 8cd1d559c..d62450d96 100644 --- a/admin/src/pages/Overview.vue +++ b/admin/src/pages/Overview.vue @@ -76,11 +76,11 @@ export default { name: 'Meditation', memo: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut l', amount: '200', - startDate: '2022-04-01', - endDate: '2022-08-01', + validFrom: '2022-04-01', + validTo: '2022-08-01', cycle: 'täglich', - repetition: '3', - maxAmount: 0, + maxPerCycle: '3', + maxAmountPerMonth: 0, link: 'https://localhost/redeem/CL-1a2345678', }, { @@ -88,11 +88,11 @@ export default { name: 'Teamarbeit', memo: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt', amount: '300', - startDate: '2022-04-01', - endDate: '2022-12-01', + validFrom: '2022-04-01', + validTo: '2022-12-01', cycle: 'monatlich', - repetition: '2', - maxAmount: 0, + maxPerCycle: '2', + maxAmountPerMonth: 0, link: 'https://localhost/redeem/CL-1b2345678', }, { @@ -100,11 +100,11 @@ export default { name: 'Documenta Kassel 2022', memo: 'New Account Register by Documenta Kassel, Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt', amount: '400', - startDate: '2022-06-18', - endDate: '2022-10-01', + validFrom: '2022-06-18', + validTo: '2022-10-01', cycle: 'null', - repetition: '1', - maxAmount: 0, + maxPerCycle: '1', + maxAmountPerMonth: 0, link: 'https://localhost/redeem/CL-1c2345678', }, ] From 60b6b82279538f829ea3befdcadf7c38b4e5c31f Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 15 Jun 2022 07:33:33 +0200 Subject: [PATCH 2/3] fix locales --- admin/src/locales/de.json | 6 +++--- admin/src/locales/en.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index f60416c5d..c6eaf9cb3 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -7,8 +7,8 @@ "contributionLinks": "Beitragslinks", "create": "Anlegen", "cycle": "Zyklus", - "validTo": "Enddatum", "maximumAmount": "maximaler Betrag", + "maxPerCycle": "Wiederholung", "memo": "Nachricht", "name": "Name", "newContributionLink": "Neuer Beitragslink", @@ -29,8 +29,8 @@ "null": "Bitte wähle eine Wiederholung" } }, - "maxPerCycle": "Wiederholung", - "validFrom": "Startdatum" + "validFrom": "Startdatum", + "validTo": "Enddatum" }, "creation": "Schöpfung", "creationList": "Schöpfungsliste", diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index e839aebcb..34baa1a5b 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -7,8 +7,8 @@ "contributionLinks": "Contribution Links", "create": "Create", "cycle": "Cycle", - "validTo": "End-Date", "maximumAmount": "Maximum amount", + "maxPerCycle": "Repetition", "memo": "Memo", "name": "Name", "newContributionLink": "New contribution link", @@ -29,8 +29,8 @@ "null": "please select a repetition" } }, - "maxPerCycle": "Repetition", - "validFrom": "Start-date" + "validFrom": "Start-date", + "validTo": "End-Date" }, "creation": "Creation", "creationList": "Creation list", From e074c99773d7fa9992b7adf09a61f74ecfbea4de Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 15 Jun 2022 07:41:31 +0200 Subject: [PATCH 3/3] fix test --- admin/src/components/ContributionLink.spec.js | 2 +- admin/src/components/ContributionLinkForm.spec.js | 4 ++-- admin/src/components/ContributionLinkList.spec.js | 2 +- admin/src/components/Tables/OpenCreationsTable.spec.js | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/admin/src/components/ContributionLink.spec.js b/admin/src/components/ContributionLink.spec.js index 66ea20ef9..3fa7c6f4d 100644 --- a/admin/src/components/ContributionLink.spec.js +++ b/admin/src/components/ContributionLink.spec.js @@ -20,7 +20,7 @@ describe('ContributionLink', () => { }) it('renders the Div Element ".contribution-link"', () => { - expect(wrapper.find('div.contribution-link').exists()).toBeTruthy() + expect(wrapper.find('div.contribution-link').exists()).toBe(true) }) it('emits toggle::collapse new Contribution', async () => { diff --git a/admin/src/components/ContributionLinkForm.spec.js b/admin/src/components/ContributionLinkForm.spec.js index 22eff5a70..c15673667 100644 --- a/admin/src/components/ContributionLinkForm.spec.js +++ b/admin/src/components/ContributionLinkForm.spec.js @@ -49,10 +49,10 @@ describe('ContributionLinkForm', () => { amount: null, cycle: 'ONCE', validTo: null, - maxAmountPerMonth: null, + maxAmountPerMonth: 0, memo: null, name: null, - maxPerCycle: null, + maxPerCycle: '1', validFrom: null, }) }) diff --git a/admin/src/components/ContributionLinkList.spec.js b/admin/src/components/ContributionLinkList.spec.js index 2ce5fb542..8b93dab7d 100644 --- a/admin/src/components/ContributionLinkList.spec.js +++ b/admin/src/components/ContributionLinkList.spec.js @@ -44,7 +44,7 @@ describe('ContributionLinkList', () => { }) it('renders the Div Element ".contribution-link-list"', () => { - expect(wrapper.find('div.contribution-link-list').exists()).toBeTruthy() + expect(wrapper.find('div.contribution-link-list').exists()).toBe(true) }) describe('edit contribution link', () => { diff --git a/admin/src/components/Tables/OpenCreationsTable.spec.js b/admin/src/components/Tables/OpenCreationsTable.spec.js index ad28a6fb5..6952288fb 100644 --- a/admin/src/components/Tables/OpenCreationsTable.spec.js +++ b/admin/src/components/Tables/OpenCreationsTable.spec.js @@ -102,7 +102,7 @@ describe('OpenCreationsTable', () => { }) it('has a DIV element with the class .open-creations-table', () => { - expect(wrapper.find('div.open-creations-table').exists()).toBeTruthy() + expect(wrapper.find('div.open-creations-table').exists()).toBe(true) }) it('has a table with three rows', () => { @@ -110,7 +110,7 @@ describe('OpenCreationsTable', () => { }) it('find first button.bi-pencil-square for open EditCreationFormular ', () => { - expect(wrapper.findAll('tr').at(1).find('.bi-pencil-square').exists()).toBeTruthy() + expect(wrapper.findAll('tr').at(1).find('.bi-pencil-square').exists()).toBe(true) }) describe('show edit details', () => { @@ -123,7 +123,7 @@ describe('OpenCreationsTable', () => { }) it.skip('renders the component component-edit-creation-formular', () => { - expect(wrapper.find('div.component-edit-creation-formular').exists()).toBeTruthy() + expect(wrapper.find('div.component-edit-creation-formular').exists()).toBe(true) }) })