From 18534f3179b5d01ac4dcc2fd818a470d79ce8c8e Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 8 Mar 2022 11:08:30 +0100 Subject: [PATCH 01/72] add first form version send gdd per link, add locales, add extra submit button --- frontend/src/locales/de.json | 9 +++ frontend/src/locales/en.json | 9 +++ frontend/src/views/Pages/SendOverview.vue | 4 ++ .../SendOverview/GddSend/TransactionForm.vue | 57 ++++++++++++++++++- 4 files changed, 78 insertions(+), 1 deletion(-) diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 748bffe25..4fcde6f94 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -67,6 +67,7 @@ "email": "E-Mail", "firstname": "Vorname", "from": "Von", + "generate_now": "jetzt generieren", "lastname": "Nachname", "memo": "Nachricht", "message": "Nachricht", @@ -99,6 +100,14 @@ }, "your_amount": "Dein Betrag" }, + "gdd_per_link": { + "header": "Gradidos verschenken per Link", + "sentence_1":"Wähle einen Betrag, aus welchen du per Link verschenken möchtest. Du kannst auch noch eine Nachricht eintragen. Beim Klick „jetzt generieren“ wird ein Link erstellt, den du versenden kannst.", + "sentence_2":"Der Link ist 14 Tage gültig!", + "sentence_3":"Wird der Link nicht innerhalb der 14 Tage Frist abgerufen, wird er automatisch gelöscht. Der Betrag wird dann wieder deinem Konto gutgeschrieben.", + "sentence_4":"Wer den Link klick aktiviert, erhält die Zahlung von deinem Konto. Wer noch nicht Mitglied bei Gradido ist, wird durch den Registrierungsprozess geleitet und bekommt den GDD Betrag nach Registrierung / Bestätigung seines Gradido Kontos gut geschrieben.", + "sentence_5":"Der Vergänglichkeitsbetrag wird von dir getragen und für die maximale Gültigkeit deinem Betrag aufgerechnet. Dir wird aber nur der Betrag als Vergänglichkeit berechnet, je nachdem wie viel Tage bis zum Einlösen des Links vergangen sind. Der Restbetrag wird dir wieder zurückerstattet." + }, "gdt": { "action": "Aktion", "calculation": "Berechnung der GradidoTransform", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 557c0a42c..d00a93c33 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -67,6 +67,7 @@ "email": "Email", "firstname": "Firstname", "from": "from", + "generate_now": "Generate now", "lastname": "Lastname", "memo": "Message", "message": "Message", @@ -98,6 +99,14 @@ "usernmae-unique": "This username is already taken." }, "your_amount": "Your amount" + }, + "gdd_per_link": { + "header": "Give away Gradidos by link", + "satz_1":"Select an amount that you would like to give away via a link. You can also enter a message. Click 'Generate now' to create a link that you can send.", + "sentence_2":"The link is valid for 14 days!", + "sentence_3":"If the link is not called up within the 14-day period, it will be deleted automatically. The amount will then be credited to your account.", + "sentence_4":"Whoever activates the link will receive the payment from your account. If you are not yet a member of Gradido, you will be guided through the registration process and will get the GDD amount credited to your account after registration / confirmation of your Gradido account.", + "sentence_5":"The transience amount will be borne by you and will be added to your amount for the maximum validity. However, you will only be charged the amount as transience depending on how many days have passed until the link is redeemed. The remaining amount will be refunded to you." }, "gdt": { "action": "Action", diff --git a/frontend/src/views/Pages/SendOverview.vue b/frontend/src/views/Pages/SendOverview.vue index d247e1bbe..adb6e8a25 100644 --- a/frontend/src/views/Pages/SendOverview.vue +++ b/frontend/src/views/Pages/SendOverview.vue @@ -76,6 +76,10 @@ export default { this.transactionData = { ...data } this.currentTransactionStep = 1 }, + setTransactionPerLink(data) { + this.transactionData = { ...data } + this.currentTransactionStep = 1 + }, async sendTransaction() { this.loading = true this.error = false diff --git a/frontend/src/views/Pages/SendOverview/GddSend/TransactionForm.vue b/frontend/src/views/Pages/SendOverview/GddSend/TransactionForm.vue index 0f5650543..724d59bf2 100644 --- a/frontend/src/views/Pages/SendOverview/GddSend/TransactionForm.vue +++ b/frontend/src/views/Pages/SendOverview/GddSend/TransactionForm.vue @@ -10,9 +10,47 @@
--> + + + + GDD versenden + + + + + GDD verschenken per Link + + + +
({{ selected }})
+ + +

{{ $t('gdd_per_link.header') }}

+

+ {{ $t('gdd_per_link.sentence_1') }} +

+

+ - + {{ $t('gdd_per_link.sentence_2') }} +

+

+ - + {{ $t('gdd_per_link.sentence_3') }} +

+

+ - + {{ $t('gdd_per_link.sentence_4') }} +

+ +
+

+ {{ $t('gdd_per_link.sentence_5') }} +

+
- {{ $t('form.send_now') }} + {{ selected === 'send' ? $t('form.send_now') : $t('form.generate_now') }} @@ -165,11 +203,28 @@ export default { memo: '', amountValue: 0.0, }, + selected: 'send', } }, methods: { onSubmit() { this.normalizeAmount(true) + switch (this.selected) { + case 'send': + this.$emit('set-transaction', { + email: this.form.email, + amount: this.form.amountValue, + memo: this.form.memo, + }) + break + case 'gift': + this.$emit('set-transaction-per-link', { + selected: this.selected, + amount: this.form.amountValue, + memo: this.form.memo, + }) + break + } this.$emit('set-transaction', { email: this.form.email, amount: this.form.amountValue, From 6cc6c3476a51e6f93e20b5765524ba9352b5d2d6 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 8 Mar 2022 13:22:47 +0100 Subject: [PATCH 02/72] seperate confirm send GDD per link, add function sendTransactionPerLink() --- frontend/src/views/Pages/SendOverview.vue | 28 +++++++-- .../GddSend/TransactionConfirmation.vue | 60 +++++++++++++++++-- .../SendOverview/GddSend/TransactionForm.vue | 43 ++----------- 3 files changed, 82 insertions(+), 49 deletions(-) diff --git a/frontend/src/views/Pages/SendOverview.vue b/frontend/src/views/Pages/SendOverview.vue index adb6e8a25..6ce507f8d 100644 --- a/frontend/src/views/Pages/SendOverview.vue +++ b/frontend/src/views/Pages/SendOverview.vue @@ -9,11 +9,13 @@ @@ -34,7 +36,7 @@ import GddSend from './SendOverview/GddSend.vue' import TransactionForm from './SendOverview/GddSend/TransactionForm.vue' import TransactionConfirmation from './SendOverview/GddSend/TransactionConfirmation.vue' import TransactionResult from './SendOverview/GddSend/TransactionResult.vue' -import { sendCoins } from '../../graphql/mutations.js' +import { sendCoins, sendCoinsPerLink } from '../../graphql/mutations.js' const EMPTY_TRANSACTION_DATA = { email: '', @@ -76,10 +78,6 @@ export default { this.transactionData = { ...data } this.currentTransactionStep = 1 }, - setTransactionPerLink(data) { - this.transactionData = { ...data } - this.currentTransactionStep = 1 - }, async sendTransaction() { this.loading = true this.error = false @@ -99,6 +97,26 @@ export default { this.currentTransactionStep = 2 this.loading = false }, + async sendTransactionPerLink() { + alert('sendTransactionPerLink: TODO : lege sendCoinsPerLink als mutation an!') + this.loading = true + this.error = false + this.$apollo + .mutate({ + mutation: sendCoinsPerLink, + variables: this.transactionData, + }) + .then(() => { + this.error = false + this.$emit('update-balance', this.transactionData.amount) + }) + .catch((err) => { + this.errorResult = err.message + this.error = true + }) + this.currentTransactionStep = 2 + this.loading = false + }, onReset() { this.currentTransactionStep = 0 }, diff --git a/frontend/src/views/Pages/SendOverview/GddSend/TransactionConfirmation.vue b/frontend/src/views/Pages/SendOverview/GddSend/TransactionConfirmation.vue index 4acb95dcd..aa3b067e2 100644 --- a/frontend/src/views/Pages/SendOverview/GddSend/TransactionConfirmation.vue +++ b/frontend/src/views/Pages/SendOverview/GddSend/TransactionConfirmation.vue @@ -1,6 +1,16 @@ From a4c2ff33091696fd6aff6e86d39afa02e26f4062 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 8 Mar 2022 07:35:34 +0100 Subject: [PATCH 20/72] remove unnecesesary divs --- .../DecayInformation-DecayStartblock.vue | 16 ++++------------ .../DecayInformations/DecayInformation-Long.vue | 16 ++++------------ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue b/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue index 9bde154ae..6f7e3f466 100644 --- a/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue +++ b/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue @@ -33,24 +33,16 @@ {{ $t(`decay.${typeId.toLowerCase()}`) }} - -
{{ amount | GDD }}
-
+ {{ amount | GDD }}
- -
{{ $t('decay.decay') }}
-
- -
{{ decay.decay | GDD }}
-
+ {{ $t('decay.decay') }} + {{ decay.decay | GDD }}
- -
{{ $t('decay.total') }}
-
+ {{ $t('decay.total') }} {{ (Number(amount) + Number(decay.decay)) | GDD }} diff --git a/frontend/src/components/DecayInformations/DecayInformation-Long.vue b/frontend/src/components/DecayInformations/DecayInformation-Long.vue index fad50ddab..6a0b6a1c1 100644 --- a/frontend/src/components/DecayInformations/DecayInformation-Long.vue +++ b/frontend/src/components/DecayInformations/DecayInformation-Long.vue @@ -34,9 +34,7 @@
{{ $t('decay.decay') }}
- -
{{ decay.decay | GDD }}
-
+ {{ decay.decay | GDD }}

@@ -47,18 +45,12 @@ {{ $t(`decay.${typeId.toLowerCase()}`) }} - -
{{ amount | GDD }}
-
+ {{ amount | GDD }}
- -
{{ $t('decay.decay') }}
-
- -
{{ decay.decay | GDD }}
-
+ {{ $t('decay.decay') }} + {{ decay.decay | GDD }}
From 5fb81a629c6e5211dd91d8eb372c364e1bbec163 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 8 Mar 2022 07:37:28 +0100 Subject: [PATCH 21/72] less divs --- .../DecayInformation-DecayStartblock.vue | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue b/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue index 6f7e3f466..2ee9ecc2c 100644 --- a/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue +++ b/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue @@ -17,12 +17,8 @@ - -
{{ $t('decay.decay') }}
-
- -
{{ decay.decay | GDD }}
-
+ {{ $t('decay.decay') }} + {{ decay.decay | GDD }}

From ddaa1634a095c14c4a6fa54fd0a3dd1eed05c8ab Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 9 Mar 2022 11:29:06 +0100 Subject: [PATCH 22/72] change i18n locales to en, change test date contain without text --- frontend/src/components/GddTransactionList.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/GddTransactionList.spec.js b/frontend/src/components/GddTransactionList.spec.js index fd94760b2..b4d61c4a6 100644 --- a/frontend/src/components/GddTransactionList.spec.js +++ b/frontend/src/components/GddTransactionList.spec.js @@ -19,7 +19,7 @@ describe('GddTransactionList', () => { $t: jest.fn((t) => t), $d: jest.fn((d) => d), $i18n: { - locale: () => 'de', + locale: () => 'en', }, } @@ -256,7 +256,7 @@ describe('GddTransactionList', () => { it('shows the date of the transaction', () => { expect(transaction.findAll('.gdd-transaction-list-item-date').at(0).text()).toContain( - 'Mon Feb 28 2022 13:55:47', + 'Mon Feb 28 2022 13:55:47 GMT+0000', ) }) @@ -321,7 +321,7 @@ describe('GddTransactionList', () => { it('shows the date of the transaction', () => { expect(transaction.findAll('.gdd-transaction-list-item-date').at(0).text()).toContain( - 'Fri Feb 25 2022 07:29:26', + 'Fri Feb 25 2022 07:29:26 GMT+0000', ) }) }) @@ -383,7 +383,7 @@ describe('GddTransactionList', () => { it('shows the date of the transaction', () => { expect(transaction.findAll('.gdd-transaction-list-item-date').at(0).text()).toContain( - 'Wed Feb 23 2022 10:55:30', + 'Wed Feb 23 2022 10:55:30 GMT+0000', ) }) From 441333209c81807241a1c12524629eaf2cdf7488 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 9 Mar 2022 13:44:35 +0100 Subject: [PATCH 23/72] removed selected value gift, change gift to link --- frontend/src/components/GddSend/TransactionConfirmation.vue | 6 +++--- frontend/src/components/GddSend/TransactionForm.spec.js | 4 ++-- frontend/src/components/GddSend/TransactionForm.vue | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/GddSend/TransactionConfirmation.vue b/frontend/src/components/GddSend/TransactionConfirmation.vue index 3fa59c93a..1867597e5 100644 --- a/frontend/src/components/GddSend/TransactionConfirmation.vue +++ b/frontend/src/components/GddSend/TransactionConfirmation.vue @@ -1,6 +1,6 @@