From 18534f3179b5d01ac4dcc2fd818a470d79ce8c8e Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 8 Mar 2022 11:08:30 +0100 Subject: [PATCH 01/96] 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/96] 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/96] 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/96] 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/96] 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/96] 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 @@
@@ -91,6 +95,7 @@ export default { pageSize: { type: Number, default: 25 }, timestamp: { type: Number, default: 0 }, transactionCount: { type: Number, default: 0 }, + transactionLinkCount: { type: Number, default: 0 }, showPagination: { type: Boolean, default: false }, }, methods: { diff --git a/frontend/src/components/TransactionRows/LinkCountRow.vue b/frontend/src/components/TransactionRows/LinkCountRow.vue index fdb4c7089..5535efde1 100644 --- a/frontend/src/components/TransactionRows/LinkCountRow.vue +++ b/frontend/src/components/TransactionRows/LinkCountRow.vue @@ -15,7 +15,7 @@ export default { name: 'LinkCountRow', props: { count: { - type: String, + type: Number, required: true, }, }, diff --git a/frontend/src/components/Transactions/TransactionLink.vue b/frontend/src/components/Transactions/TransactionLink.vue index 0919716a7..9799a1365 100644 --- a/frontend/src/components/Transactions/TransactionLink.vue +++ b/frontend/src/components/Transactions/TransactionLink.vue @@ -15,7 +15,7 @@ - + @@ -54,6 +54,9 @@ export default { decay: { type: Object, }, + transactionLinkCount: { + type: Number, + }, }, data() { return { diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index 94a5e59f3..b81663248 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -57,6 +57,7 @@ export const transactionsQuery = gql` ) { balanceGDT count + linkCount balance decayStartBlock transactions { diff --git a/frontend/src/layouts/DashboardLayout_gdd.vue b/frontend/src/layouts/DashboardLayout_gdd.vue index 66221993f..e35faab2a 100755 --- a/frontend/src/layouts/DashboardLayout_gdd.vue +++ b/frontend/src/layouts/DashboardLayout_gdd.vue @@ -24,6 +24,7 @@ :gdt-balance="GdtBalance" :transactions="transactions" :transactionCount="transactionCount" + :transactionLinkCount="transactionLinkCount" :pending="pending" :decayStartBlock="decayStartBlock" @update-balance="updateBalance" @@ -59,6 +60,7 @@ export default { transactions: [], bookedBalance: 0, transactionCount: 0, + transactionLinkCount: 0, pending: true, visible: false, decayStartBlock: new Date(), @@ -99,6 +101,7 @@ export default { this.transactions = transactionList.transactions this.balance = Number(transactionList.balance) this.transactionCount = transactionList.count + this.transactionLinkCount = transactionList.linkCount this.decayStartBlock = new Date(transactionList.decayStartBlock) this.pending = false }) diff --git a/frontend/src/pages/Overview.vue b/frontend/src/pages/Overview.vue index 842f6d2d5..93344b3ee 100644 --- a/frontend/src/pages/Overview.vue +++ b/frontend/src/pages/Overview.vue @@ -20,6 +20,7 @@ :timestamp="timestamp" :decayStartBlock="decayStartBlock" :transaction-count="transactionCount" + :transactionLinkCount="transactionLinkCount" @update-transactions="updateTransactions" /> @@ -51,6 +52,7 @@ export default { default: () => [], }, transactionCount: { type: Number, default: 0 }, + transactionLinkCount: { type: Number, default: 0 }, pending: { type: Boolean, default: true, diff --git a/frontend/src/pages/Transactions.vue b/frontend/src/pages/Transactions.vue index 31094e454..6fc588b10 100644 --- a/frontend/src/pages/Transactions.vue +++ b/frontend/src/pages/Transactions.vue @@ -7,6 +7,7 @@ [], }, transactionCount: { type: Number, default: 0 }, + transactionLinkCount: { type: Number, default: 0 }, decayStartBlock: { type: Date }, }, data() { From f53bc38eb6701f5276063f83d83af400cb2b0de9 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 14 Mar 2022 08:42:12 +0100 Subject: [PATCH 49/96] test update of transactoin link count --- frontend/src/layouts/DashboardLayout_gdd.spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/layouts/DashboardLayout_gdd.spec.js b/frontend/src/layouts/DashboardLayout_gdd.spec.js index 8765c95e7..2a8b7bf42 100644 --- a/frontend/src/layouts/DashboardLayout_gdd.spec.js +++ b/frontend/src/layouts/DashboardLayout_gdd.spec.js @@ -155,6 +155,7 @@ describe('DashboardLayoutGdd', () => { transactionList: { balanceGDT: 100, count: 4, + linkCount: 8, balance: 1450, decay: 1250, transactions: ['transaction', 'transaction', 'transaction', 'transaction'], @@ -198,6 +199,10 @@ describe('DashboardLayoutGdd', () => { it('updates transaction count', () => { expect(wrapper.vm.transactionCount).toBe(4) }) + + it('updates transaction link count', () => { + expect(wrapper.vm.transactionLinkCount).toBe(8) + }) }) describe('update transactions returns error', () => { From bb14c07747c6834c31875ebf24b8720039598f35 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 14 Mar 2022 08:56:26 +0100 Subject: [PATCH 50/96] sum of hold available and hold available decay is negative --- backend/src/graphql/resolver/TransactionResolver.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/graphql/resolver/TransactionResolver.ts b/backend/src/graphql/resolver/TransactionResolver.ts index b90bf46c7..f64ba19e9 100644 --- a/backend/src/graphql/resolver/TransactionResolver.ts +++ b/backend/src/graphql/resolver/TransactionResolver.ts @@ -217,9 +217,9 @@ export class TransactionResolver { transactions.push( virtualLinkTransaction( lastTransaction.balance.minus(sumHoldAvailableAmount.toString()), - sumAmount, - sumHoldAvailableAmount, - sumHoldAvailableAmount.minus(sumAmount.toString()), + sumAmount.mul(-1), + sumHoldAvailableAmount.mul(-1), + sumHoldAvailableAmount.minus(sumAmount.toString()).mul(-1), firstDate || now, lastDate || now, self, From ca031ae17f1fddbd490c0a777a0c5e148a8d6b96 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Mar 2022 10:08:12 +0100 Subject: [PATCH 51/96] add component src/components/GddSend/TransactionConfirmationSend.vue --- .../GddSend/TransactionConfirmationSend.vue | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 frontend/src/components/GddSend/TransactionConfirmationSend.vue diff --git a/frontend/src/components/GddSend/TransactionConfirmationSend.vue b/frontend/src/components/GddSend/TransactionConfirmationSend.vue new file mode 100644 index 000000000..f712713ac --- /dev/null +++ b/frontend/src/components/GddSend/TransactionConfirmationSend.vue @@ -0,0 +1,97 @@ + + + From 07f094560f64249a87993e6f64f46e05238d76fd Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Mar 2022 10:08:49 +0100 Subject: [PATCH 52/96] add component TransactionConfirmationLink.vue --- .../GddSend/TransactionConfirmationLink.vue | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 frontend/src/components/GddSend/TransactionConfirmationLink.vue diff --git a/frontend/src/components/GddSend/TransactionConfirmationLink.vue b/frontend/src/components/GddSend/TransactionConfirmationLink.vue new file mode 100644 index 000000000..f02b7a063 --- /dev/null +++ b/frontend/src/components/GddSend/TransactionConfirmationLink.vue @@ -0,0 +1,73 @@ + + + From ef8fe45c23e78b5214766649235e3cc9191c4622 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Mar 2022 10:09:24 +0100 Subject: [PATCH 53/96] add component TransactionConfirmationSend.spec.js --- .../TransactionConfirmationSend.spec.js | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 frontend/src/components/GddSend/TransactionConfirmationSend.spec.js diff --git a/frontend/src/components/GddSend/TransactionConfirmationSend.spec.js b/frontend/src/components/GddSend/TransactionConfirmationSend.spec.js new file mode 100644 index 000000000..a0e334ae5 --- /dev/null +++ b/frontend/src/components/GddSend/TransactionConfirmationSend.spec.js @@ -0,0 +1,51 @@ +import { mount } from '@vue/test-utils' +import TransactionConfirmationSend from './TransactionConfirmationSend' + +const localVue = global.localVue + +describe('GddSend confirm', () => { + let wrapper + + const mocks = { + $t: jest.fn((t) => t), + $i18n: { + locale: jest.fn(() => 'en'), + }, + $n: jest.fn((n) => String(n)), + } + + const propsData = { + balance: 1234, + email: 'user@example.org', + amount: 12.34, + memo: 'Pessimisten stehen im Regen, Optimisten duschen unter den Wolken.', + loading: false, + selected: 'send', + } + + const Wrapper = () => { + return mount(TransactionConfirmationSend, { localVue, mocks, propsData }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders the component div.transaction-confirm-send', () => { + expect(wrapper.find('div.transaction-confirm-send').exists()).toBeTruthy() + }) + + describe('has selected "send"', () => { + beforeEach(async () => { + await wrapper.setProps({ + selected: 'send', + }) + }) + + it('renders the component div.confirm-box-send', () => { + expect(wrapper.find('div.confirm-box-send').exists()).toBeTruthy() + }) + }) + }) +}) From 114cd52bf9caa28365769805c8b036df1d278bbf Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Mar 2022 10:09:55 +0100 Subject: [PATCH 54/96] add component TransactionConfirmationLink.spec.js --- .../TransactionConfirmationLink.spec.js | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 frontend/src/components/GddSend/TransactionConfirmationLink.spec.js diff --git a/frontend/src/components/GddSend/TransactionConfirmationLink.spec.js b/frontend/src/components/GddSend/TransactionConfirmationLink.spec.js new file mode 100644 index 000000000..9aa74b574 --- /dev/null +++ b/frontend/src/components/GddSend/TransactionConfirmationLink.spec.js @@ -0,0 +1,51 @@ +import { mount } from '@vue/test-utils' +import TransactionConfirmationLink from './TransactionConfirmationLink' + +const localVue = global.localVue + +describe('GddSend confirm', () => { + let wrapper + + const mocks = { + $t: jest.fn((t) => t), + $i18n: { + locale: jest.fn(() => 'en'), + }, + $n: jest.fn((n) => String(n)), + } + + const propsData = { + balance: 1234, + email: 'user@example.org', + amount: 12.34, + memo: 'Pessimisten stehen im Regen, Optimisten duschen unter den Wolken.', + loading: false, + selected: 'send', + } + + const Wrapper = () => { + return mount(TransactionConfirmationLink, { localVue, mocks, propsData }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders the component div.transaction-confirm-link', () => { + expect(wrapper.find('div.transaction-confirm-link').exists()).toBeTruthy() + }) + + describe('has selected "link"', () => { + beforeEach(async () => { + await wrapper.setProps({ + selected: 'link', + }) + }) + + it('renders the component div.confirm-box-link', () => { + expect(wrapper.findAll('div.confirm-box-link').at(0).exists()).toBeTruthy() + }) + }) + }) +}) From fdcc0891db59ead7d88598841926638f83e722a2 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Mar 2022 10:10:59 +0100 Subject: [PATCH 55/96] add component TransactionResultSendSuccess.vue --- .../GddSend/TransactionResultSendSuccess.vue | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 frontend/src/components/GddSend/TransactionResultSendSuccess.vue diff --git a/frontend/src/components/GddSend/TransactionResultSendSuccess.vue b/frontend/src/components/GddSend/TransactionResultSendSuccess.vue new file mode 100644 index 000000000..7e4400025 --- /dev/null +++ b/frontend/src/components/GddSend/TransactionResultSendSuccess.vue @@ -0,0 +1,32 @@ + + From d3107f229422b7d0bd063c4a2520eefb48ef52d0 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Mar 2022 10:11:26 +0100 Subject: [PATCH 56/96] add component TransactionResultSendError.vue --- .../GddSend/TransactionResultSendError.vue | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 frontend/src/components/GddSend/TransactionResultSendError.vue diff --git a/frontend/src/components/GddSend/TransactionResultSendError.vue b/frontend/src/components/GddSend/TransactionResultSendError.vue new file mode 100644 index 000000000..d3e589967 --- /dev/null +++ b/frontend/src/components/GddSend/TransactionResultSendError.vue @@ -0,0 +1,40 @@ + + From f15fe1d7cbb40c6db2fd3c0e63085d7052e61dbb Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Mar 2022 10:11:53 +0100 Subject: [PATCH 57/96] add component TransactionResultLink.vue --- .../GddSend/TransactionResultLink.vue | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 frontend/src/components/GddSend/TransactionResultLink.vue diff --git a/frontend/src/components/GddSend/TransactionResultLink.vue b/frontend/src/components/GddSend/TransactionResultLink.vue new file mode 100644 index 000000000..5170423bb --- /dev/null +++ b/frontend/src/components/GddSend/TransactionResultLink.vue @@ -0,0 +1,36 @@ + + From 15f8ed3ca04b3e77bda37ca7232d59be2cb93fd2 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Mar 2022 10:13:30 +0100 Subject: [PATCH 58/96] yarn lint --fix --- frontend/src/components/GddSend.vue | 9 +- .../GddSend/TransactionConfirmation.spec.js | 2 +- .../GddSend/TransactionConfirmation.vue | 108 ------------------ .../components/GddSend/TransactionResult.vue | 80 ------------- frontend/src/pages/Send.vue | 64 +++++++++-- 5 files changed, 61 insertions(+), 202 deletions(-) delete mode 100644 frontend/src/components/GddSend/TransactionConfirmation.vue delete mode 100644 frontend/src/components/GddSend/TransactionResult.vue diff --git a/frontend/src/components/GddSend.vue b/frontend/src/components/GddSend.vue index cfab0899a..7896b6e85 100644 --- a/frontend/src/components/GddSend.vue +++ b/frontend/src/components/GddSend.vue @@ -8,7 +8,14 @@ export default { name: 'GddSend', data() { return { - transactionSteps: ['transaction-form', 'transaction-confirmation', 'transaction-result'], + transactionSteps: [ + 'transaction-form', + 'transaction-confirmation-send', + 'transaction-confirmation-link', + 'transaction-result-send-success', + 'transaction-result-send-error', + 'transaction-result-link', + ], } }, props: { diff --git a/frontend/src/components/GddSend/TransactionConfirmation.spec.js b/frontend/src/components/GddSend/TransactionConfirmation.spec.js index af746b6ff..95c478c73 100644 --- a/frontend/src/components/GddSend/TransactionConfirmation.spec.js +++ b/frontend/src/components/GddSend/TransactionConfirmation.spec.js @@ -1,5 +1,5 @@ import { mount } from '@vue/test-utils' -import TransactionConfirmation from './TransactionConfirmation' +import TransactionConfirmation from './TransactionConfirmationLink' const localVue = global.localVue diff --git a/frontend/src/components/GddSend/TransactionConfirmation.vue b/frontend/src/components/GddSend/TransactionConfirmation.vue deleted file mode 100644 index 71ecc88d7..000000000 --- a/frontend/src/components/GddSend/TransactionConfirmation.vue +++ /dev/null @@ -1,108 +0,0 @@ - - - diff --git a/frontend/src/components/GddSend/TransactionResult.vue b/frontend/src/components/GddSend/TransactionResult.vue deleted file mode 100644 index 479ad7ae8..000000000 --- a/frontend/src/components/GddSend/TransactionResult.vue +++ /dev/null @@ -1,80 +0,0 @@ - - diff --git a/frontend/src/pages/Send.vue b/frontend/src/pages/Send.vue index 2776a0978..9314600c2 100644 --- a/frontend/src/pages/Send.vue +++ b/frontend/src/pages/Send.vue @@ -5,8 +5,8 @@ - - + + +
@@ -33,8 +58,11 @@ diff --git a/frontend/src/components/GddSend/TransactionResultSendError.vue b/frontend/src/components/GddSend/TransactionResultSendError.vue index d3e589967..ba6b4a238 100644 --- a/frontend/src/components/GddSend/TransactionResultSendError.vue +++ b/frontend/src/components/GddSend/TransactionResultSendError.vue @@ -1,6 +1,6 @@