From 67f922fcd4ff78f59f2f82512eb9c9ef80167787 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 3 Apr 2022 10:46:38 +0200 Subject: [PATCH 01/20] transaction type remains when jumping from the verification back --- .../components/GddSend/TransactionForm.vue | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/GddSend/TransactionForm.vue b/frontend/src/components/GddSend/TransactionForm.vue index 5e683d132..e0f332c52 100644 --- a/frontend/src/components/GddSend/TransactionForm.vue +++ b/frontend/src/components/GddSend/TransactionForm.vue @@ -6,28 +6,38 @@ - + {{ $t('send_gdd') }} - + {{ $t('send_per_link') }} -
+

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

{{ $t('gdd_per_link.choose-amount') }}
-
+
- {{ selected === sendTypes.send ? $t('form.send_now') : $t('form.generate_now') }} + {{ + radio_selected === sendTypes.send + ? $t('form.send_now') + : $t('form.generate_now') + }} @@ -159,6 +173,7 @@ export default { email: { type: String, default: '' }, amount: { type: Number, default: 0 }, memo: { type: String, default: '' }, + selected: { type: String, default: 'send' }, }, inject: ['getTunneledEmail'], data() { @@ -171,14 +186,14 @@ export default { memo: this.memo, amountValue: 0.0, }, - selected: SEND_TYPES.send, + radio_selected: this.selected, } }, methods: { onSubmit() { this.normalizeAmount(true) this.$emit('set-transaction', { - selected: this.selected, + selected: this.radio_selected, email: this.form.email, amount: this.form.amountValue, memo: this.form.memo, From b6b8baf2f8b670d2d6e0d473ab893a6fa5f95eda Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 3 Apr 2022 11:13:09 +0200 Subject: [PATCH 02/20] fixed tests, change selected to radio_selected --- frontend/src/components/GddSend/TransactionForm.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/GddSend/TransactionForm.spec.js b/frontend/src/components/GddSend/TransactionForm.spec.js index db971a2bc..cfca93023 100644 --- a/frontend/src/components/GddSend/TransactionForm.spec.js +++ b/frontend/src/components/GddSend/TransactionForm.spec.js @@ -68,7 +68,7 @@ describe('TransactionForm', () => { }) it('has SEND_TYPES = send', () => { - expect(wrapper.vm.selected).toBe(SEND_TYPES.send) + expect(wrapper.vm.radio_selected).toBe(SEND_TYPES.send) }) describe('transaction form', () => { @@ -300,7 +300,7 @@ Die ganze Welt bezwingen.“`) }) it('has SEND_TYPES = link', () => { - expect(wrapper.vm.selected).toBe(SEND_TYPES.link) + expect(wrapper.vm.radio_selected).toBe(SEND_TYPES.link) }) it('has no input field of id input-group-1', () => { From a0bdecbe1a09156eeed461f88c3ef34e0987b7b7 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 3 Apr 2022 11:56:49 +0200 Subject: [PATCH 03/20] change text button --- .../src/components/GddSend/TransactionConfirmationLink.vue | 4 ++-- .../src/components/GddSend/TransactionConfirmationSend.vue | 4 ++-- frontend/src/components/GddSend/TransactionForm.vue | 6 +++--- frontend/src/locales/de.json | 5 +++-- frontend/src/locales/en.json | 1 + 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/GddSend/TransactionConfirmationLink.vue b/frontend/src/components/GddSend/TransactionConfirmationLink.vue index 78903deda..97ccc0428 100644 --- a/frontend/src/components/GddSend/TransactionConfirmationLink.vue +++ b/frontend/src/components/GddSend/TransactionConfirmationLink.vue @@ -39,10 +39,10 @@ - {{ $t('form.cancel') }} + {{ $t('form.edit') }} - + {{ $t('form.generate_now') }} diff --git a/frontend/src/components/GddSend/TransactionConfirmationSend.vue b/frontend/src/components/GddSend/TransactionConfirmationSend.vue index 25519f4ed..3485c33ff 100644 --- a/frontend/src/components/GddSend/TransactionConfirmationSend.vue +++ b/frontend/src/components/GddSend/TransactionConfirmationSend.vue @@ -55,11 +55,11 @@ - {{ $t('form.cancel') }} + {{ $t('form.edit') }} diff --git a/frontend/src/components/GddSend/TransactionForm.vue b/frontend/src/components/GddSend/TransactionForm.vue index 5e683d132..e079b55c2 100644 --- a/frontend/src/components/GddSend/TransactionForm.vue +++ b/frontend/src/components/GddSend/TransactionForm.vue @@ -129,12 +129,12 @@ - {{ $t('form.reset') }} + {{ $t('form.cancel') }} - - {{ selected === sendTypes.send ? $t('form.send_now') : $t('form.generate_now') }} + + {{ $t('form.check_now') }} diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index d204688db..91f60b1db 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -52,6 +52,7 @@ "amount": "Betrag", "at": "am", "cancel": "Abbrechen", + "check_now":"Jetzt prüfen", "close": "Schließen", "current_balance": "Aktueller Kontostand", "date": "Datum", @@ -60,7 +61,7 @@ "email": "E-Mail", "firstname": "Vorname", "from": "Von", - "generate_now": "jetzt generieren", + "generate_now": "Jetzt generieren", "lastname": "Nachname", "memo": "Nachricht", "message": "Nachricht", @@ -95,7 +96,7 @@ }, "GDD": "GDD", "gdd_per_link": { - "choose-amount": "Wähle einen Betrag aus, welchen du per Link versenden möchtest. Du kannst auch noch eine Nachricht eintragen. Beim Klick „jetzt generieren“ wird ein Link erstellt, den du versenden kannst.", + "choose-amount": "Wähle einen Betrag aus, welchen du per Link versenden möchtest. Du kannst auch noch eine Nachricht eintragen. Beim Klick „Jetzt generieren“ wird ein Link erstellt, den du versenden kannst.", "copy": "kopieren", "created": "Der Link wurde erstellt!", "decay-14-day": "Vergänglichkeit für 14 Tage", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index dfe1c6d2b..345d59fb8 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -52,6 +52,7 @@ "amount": "Amount", "at": "at", "cancel": "Cancel", + "check_now":"Check now", "close": "Close", "current_balance": "Current Balance", "date": "Date", From 00bb4a1abc5490dbf69d2c3eff3f1fdf949212a8 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 3 Apr 2022 11:57:54 +0200 Subject: [PATCH 04/20] fixed yarn lint --- frontend/src/locales/de.json | 2 +- frontend/src/locales/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 91f60b1db..ae7a84446 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -52,7 +52,7 @@ "amount": "Betrag", "at": "am", "cancel": "Abbrechen", - "check_now":"Jetzt prüfen", + "check_now": "Jetzt prüfen", "close": "Schließen", "current_balance": "Aktueller Kontostand", "date": "Datum", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 345d59fb8..5e624b4ce 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -52,7 +52,7 @@ "amount": "Amount", "at": "at", "cancel": "Cancel", - "check_now":"Check now", + "check_now": "Check now", "close": "Close", "current_balance": "Current Balance", "date": "Date", From d446afacbc0e77dc69125112da037bbdda2cf4d0 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 3 Apr 2022 12:03:56 +0200 Subject: [PATCH 05/20] change button.btn-success to button.btn-primary --- frontend/src/pages/Send.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/Send.spec.js b/frontend/src/pages/Send.spec.js index 1f7c9ca9f..dd32fdb09 100644 --- a/frontend/src/pages/Send.spec.js +++ b/frontend/src/pages/Send.spec.js @@ -101,7 +101,7 @@ describe('Send', () => { jest.clearAllMocks() await wrapper .findComponent({ name: 'TransactionConfirmationSend' }) - .find('button.btn-success') + .find('button.btn-primary') .trigger('click') }) @@ -135,7 +135,7 @@ describe('Send', () => { apolloMutationMock.mockRejectedValue({ message: 'recipient not known' }) await wrapper .findComponent({ name: 'TransactionConfirmationSend' }) - .find('button.btn-success') + .find('button.btn-primary') .trigger('click') }) @@ -182,7 +182,7 @@ describe('Send', () => { jest.clearAllMocks() await wrapper .findComponent({ name: 'TransactionConfirmationLink' }) - .find('button.btn-success') + .find('button.btn-primary') .trigger('click') }) @@ -264,7 +264,7 @@ describe('Send', () => { apolloMutationMock.mockRejectedValue({ message: 'OUCH!' }) await wrapper .findComponent({ name: 'TransactionConfirmationLink' }) - .find('button.btn-success') + .find('button.btn-primary') .trigger('click') }) From 0569680b35c341d0ceb719d41b5b5cd1089c42d3 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 3 Apr 2022 12:05:07 +0200 Subject: [PATCH 06/20] change button[type=reset] text from reset to cancel --- frontend/src/components/GddSend/TransactionForm.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/GddSend/TransactionForm.spec.js b/frontend/src/components/GddSend/TransactionForm.spec.js index db971a2bc..3027ba7e7 100644 --- a/frontend/src/components/GddSend/TransactionForm.spec.js +++ b/frontend/src/components/GddSend/TransactionForm.spec.js @@ -249,7 +249,7 @@ Die ganze Welt bezwingen.“`) }) it('has the text "form.cancel"', () => { - expect(wrapper.find('button[type="reset"]').text()).toBe('form.reset') + expect(wrapper.find('button[type="reset"]').text()).toBe('form.cancel') }) it('clears all fields on click', async () => { From 75d339903e5475b0eada64e5a3cc463987140abe Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 3 Apr 2022 12:05:56 +0200 Subject: [PATCH 07/20] change text from button.btn-success to button.btn-primary --- .../components/GddSend/TransactionConfirmationSend.spec.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/GddSend/TransactionConfirmationSend.spec.js b/frontend/src/components/GddSend/TransactionConfirmationSend.spec.js index 21462ebab..b2abb10b7 100644 --- a/frontend/src/components/GddSend/TransactionConfirmationSend.spec.js +++ b/frontend/src/components/GddSend/TransactionConfirmationSend.spec.js @@ -53,7 +53,7 @@ describe('GddSend confirm', () => { describe('single click', () => { beforeEach(async () => { - await wrapper.find('button.btn-success').trigger('click') + await wrapper.find('button.btn-primary').trigger('click') }) it('emits send transaction one time', () => { @@ -63,8 +63,7 @@ describe('GddSend confirm', () => { describe('double click', () => { beforeEach(async () => { - await wrapper.find('button.btn-success').trigger('click') - await wrapper.find('button.btn-success').trigger('click') + await wrapper.find('button.btn-primary').trigger('click') }) it('emits send transaction one time', () => { From f33c9694ad5627b6c9142501db0ffa8c1734cda2 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 3 Apr 2022 12:53:24 +0200 Subject: [PATCH 08/20] if pending status true load spinner --- frontend/src/components/GddTransactionList.vue | 7 ++++++- frontend/src/components/Menu/Navbar.vue | 5 ++++- frontend/src/components/Status.vue | 3 ++- frontend/src/pages/Overview.vue | 1 + 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/GddTransactionList.vue b/frontend/src/components/GddTransactionList.vue index 37605711c..7c9e4dfe8 100644 --- a/frontend/src/components/GddTransactionList.vue +++ b/frontend/src/components/GddTransactionList.vue @@ -3,12 +3,14 @@
+ null nix da {{ $t('error.no-transactionlist') }}
+ nix da {{ $t('error.empty-transactionlist') }}
@@ -70,7 +72,9 @@ :total-rows="transactionCount" >
- {{ $t('transaction.nullTransactions') }} + + +
{{ $t('transaction.nullTransactions') }}
@@ -108,6 +112,7 @@ export default { transactionCount: { type: Number, default: 0 }, transactionLinkCount: { type: Number, default: 0 }, showPagination: { type: Boolean, default: false }, + pending: { type: Boolean }, }, methods: { updateTransactions() { diff --git a/frontend/src/components/Menu/Navbar.vue b/frontend/src/components/Menu/Navbar.vue index 3542c1cd1..f998783f7 100644 --- a/frontend/src/components/Menu/Navbar.vue +++ b/frontend/src/components/Menu/Navbar.vue @@ -10,7 +10,10 @@
- {{ pending ? $t('em-dash') : balance | amount }} {{ $t('GDD') }} + + +
{{ pending ? $t('em-dash') : balance | amount }} {{ $t('GDD') }}
+
{{ $store.state.firstName }} {{ $store.state.lastName }} diff --git a/frontend/src/components/Status.vue b/frontend/src/components/Status.vue index 9ebe48e09..59e5152f6 100644 --- a/frontend/src/components/Status.vue +++ b/frontend/src/components/Status.vue @@ -1,7 +1,8 @@ diff --git a/frontend/src/pages/Overview.vue b/frontend/src/pages/Overview.vue index d42576bf8..9723f6ade 100644 --- a/frontend/src/pages/Overview.vue +++ b/frontend/src/pages/Overview.vue @@ -21,6 +21,7 @@ :decayStartBlock="decayStartBlock" :transaction-count="transactionCount" :transactionLinkCount="transactionLinkCount" + :pending="pending" @update-transactions="updateTransactions" v-on="$listeners" /> From a5546826a54496cb4b12cedae83458734f30e739 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 3 Apr 2022 12:55:18 +0200 Subject: [PATCH 09/20] delete unused text --- frontend/src/components/GddTransactionList.vue | 2 -- frontend/src/components/Status.vue | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/GddTransactionList.vue b/frontend/src/components/GddTransactionList.vue index 7c9e4dfe8..72ecb76c6 100644 --- a/frontend/src/components/GddTransactionList.vue +++ b/frontend/src/components/GddTransactionList.vue @@ -3,14 +3,12 @@
- null nix da {{ $t('error.no-transactionlist') }}
- nix da {{ $t('error.empty-transactionlist') }}
diff --git a/frontend/src/components/Status.vue b/frontend/src/components/Status.vue index 59e5152f6..60b29834f 100644 --- a/frontend/src/components/Status.vue +++ b/frontend/src/components/Status.vue @@ -2,7 +2,9 @@
-
{{ pending || balance === null ? $t('em-dash') : $n(balance, 'decimal') }} {{ statusText }}
+
+ {{ pending || balance === null ? $t('em-dash') : $n(balance, 'decimal') }} {{ statusText }} +
From f1555b4a2743e297da90493bc60605f1a59a3714 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 3 Apr 2022 12:55:52 +0200 Subject: [PATCH 10/20] fixed yarn lint --- frontend/src/components/GddTransactionList.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/components/GddTransactionList.vue b/frontend/src/components/GddTransactionList.vue index 72ecb76c6..55a11063c 100644 --- a/frontend/src/components/GddTransactionList.vue +++ b/frontend/src/components/GddTransactionList.vue @@ -70,8 +70,7 @@ :total-rows="transactionCount" >
- - +
{{ $t('transaction.nullTransactions') }}
From 2f6ed90f1549ca8787753ea33acef42f2470d79c Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 3 Apr 2022 13:02:53 +0200 Subject: [PATCH 11/20] fixed test for pending animation icon --- frontend/src/components/Status.spec.js | 7 +++++-- frontend/src/components/Status.vue | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Status.spec.js b/frontend/src/components/Status.spec.js index ba7b03fa4..ca62d3bd3 100644 --- a/frontend/src/components/Status.spec.js +++ b/frontend/src/components/Status.spec.js @@ -26,8 +26,8 @@ describe('Status', () => { }) describe('balance is pending', () => { - it('it displays an en-dash', () => { - expect(wrapper.find('div.gdd-status-div').text()).toEqual('em-dash GDD') + it('it displays an animation icon test-pending-icon', () => { + expect(wrapper.find('.test-pending-icon').exists()).toBe(true) }) }) @@ -37,6 +37,9 @@ describe('Status', () => { pending: false, }) }) + it('it no displays an animation icon test-pending-icon', () => { + expect(wrapper.find('.test-pending-icon').exists()).toBe(false) + }) it('it displays the ammount of GDD', () => { expect(wrapper.find('div.gdd-status-div').text()).toEqual('1234 GDD') diff --git a/frontend/src/components/Status.vue b/frontend/src/components/Status.vue index 60b29834f..14d470fb3 100644 --- a/frontend/src/components/Status.vue +++ b/frontend/src/components/Status.vue @@ -1,7 +1,7 @@