diff --git a/frontend/src/components/GddSend/TransactionForm.spec.js b/frontend/src/components/GddSend/TransactionForm.spec.js index 49b2174e0..cf7e1b05e 100644 --- a/frontend/src/components/GddSend/TransactionForm.spec.js +++ b/frontend/src/components/GddSend/TransactionForm.spec.js @@ -4,7 +4,7 @@ import flushPromises from 'flush-promises' const localVue = global.localVue -describe('GddSend', () => { +describe('TransactionForm', () => { let wrapper const mocks = { @@ -25,7 +25,16 @@ describe('GddSend', () => { } const Wrapper = () => { - return mount(TransactionForm, { localVue, mocks, propsData }) + return mount(TransactionForm, { + localVue, + mocks, + propsData, + provide: { + getTunneledEmail() { + return null + }, + }, + }) } describe('mount', () => { diff --git a/frontend/src/components/GddSend/TransactionForm.vue b/frontend/src/components/GddSend/TransactionForm.vue index 4f611fbaf..65fea3d61 100644 --- a/frontend/src/components/GddSend/TransactionForm.vue +++ b/frontend/src/components/GddSend/TransactionForm.vue @@ -162,12 +162,13 @@ export default { balance: { type: Number, default: 0 }, email: { type: String, default: null }, }, + inject: ['getTunneledEmail'], data() { return { amountFocused: false, emailFocused: false, form: { - email: this.email ? this.email : '', + email: '', amount: '', memo: '', amountValue: 0.0, @@ -209,6 +210,12 @@ export default { sendTypes() { return SEND_TYPES }, + recipientEmail() { + return this.getTunneledEmail() + }, + }, + created() { + this.form.email = this.recipientEmail ? this.recipientEmail : '' }, } diff --git a/frontend/src/components/GddTransactionList.vue b/frontend/src/components/GddTransactionList.vue index 004204954..2f8ea2549 100644 --- a/frontend/src/components/GddTransactionList.vue +++ b/frontend/src/components/GddTransactionList.vue @@ -23,6 +23,7 @@ class="list-group-item" v-bind="transactions[index]" :decayStartBlock="decayStartBlock" + v-on="$listeners" /> @@ -31,6 +32,7 @@ class="list-group-item" v-bind="transactions[index]" :decayStartBlock="decayStartBlock" + v-on="$listeners" /> diff --git a/frontend/src/components/TransactionRows/AmountAndNameRow.spec.js b/frontend/src/components/TransactionRows/AmountAndNameRow.spec.js index 157aa93af..172f5f401 100644 --- a/frontend/src/components/TransactionRows/AmountAndNameRow.spec.js +++ b/frontend/src/components/TransactionRows/AmountAndNameRow.spec.js @@ -60,10 +60,13 @@ describe('AmountAndNameRow', () => { await wrapper.find('div.gdd-transaction-list-item-name').find('a').trigger('click') }) - it('pushes the rpute with query for email', () => { + it('emits set tunneled email', () => { + expect(wrapper.emitted('set-tunneled-email')).toEqual([['bibi@bloxberg.de']]) + }) + + it('pushes the route with query for email', () => { expect(mocks.$router.push).toBeCalledWith({ path: '/send', - query: { email: 'bibi@bloxberg.de' }, }) }) }) diff --git a/frontend/src/components/TransactionRows/AmountAndNameRow.vue b/frontend/src/components/TransactionRows/AmountAndNameRow.vue index f295af26d..be71b57f6 100644 --- a/frontend/src/components/TransactionRows/AmountAndNameRow.vue +++ b/frontend/src/components/TransactionRows/AmountAndNameRow.vue @@ -10,10 +10,7 @@
- + {{ itemText }} {{ itemText }} @@ -39,6 +36,12 @@ export default { required: false, }, }, + methods: { + tunnelEmail() { + this.$emit('set-tunneled-email', this.linkedUser.email) + this.$router.push({ path: '/send' }) + }, + }, computed: { itemText() { return this.linkedUser diff --git a/frontend/src/components/Transactions/TransactionReceive.vue b/frontend/src/components/Transactions/TransactionReceive.vue index eade4a30c..d1947a91a 100644 --- a/frontend/src/components/Transactions/TransactionReceive.vue +++ b/frontend/src/components/Transactions/TransactionReceive.vue @@ -13,7 +13,7 @@ - + diff --git a/frontend/src/components/Transactions/TransactionSend.vue b/frontend/src/components/Transactions/TransactionSend.vue index 8183a5734..dfe50225a 100644 --- a/frontend/src/components/Transactions/TransactionSend.vue +++ b/frontend/src/components/Transactions/TransactionSend.vue @@ -13,7 +13,7 @@ - + diff --git a/frontend/src/layouts/DashboardLayout_gdd.vue b/frontend/src/layouts/DashboardLayout_gdd.vue index 9c7cf9c0c..87ce91dd4 100755 --- a/frontend/src/layouts/DashboardLayout_gdd.vue +++ b/frontend/src/layouts/DashboardLayout_gdd.vue @@ -29,6 +29,7 @@ :decayStartBlock="decayStartBlock" @update-balance="updateBalance" @update-transactions="updateTransactions" + @set-tunneled-email="setTunneledEmail" >
@@ -64,6 +65,12 @@ export default { pending: true, visible: false, decayStartBlock: new Date(), + tunneledEmail: null, + } + }, + provide() { + return { + getTunneledEmail: () => this.tunneledEmail, } }, methods: { @@ -122,6 +129,9 @@ export default { setVisible(bool) { this.visible = bool }, + setTunneledEmail(email) { + this.tunneledEmail = email + }, }, computed: { elopageUri() { diff --git a/frontend/src/pages/Overview.vue b/frontend/src/pages/Overview.vue index 93344b3ee..d42576bf8 100644 --- a/frontend/src/pages/Overview.vue +++ b/frontend/src/pages/Overview.vue @@ -22,6 +22,7 @@ :transaction-count="transactionCount" :transactionLinkCount="transactionLinkCount" @update-transactions="updateTransactions" + v-on="$listeners" /> diff --git a/frontend/src/pages/Send.spec.js b/frontend/src/pages/Send.spec.js index ad1234dd3..93698b801 100644 --- a/frontend/src/pages/Send.spec.js +++ b/frontend/src/pages/Send.spec.js @@ -39,7 +39,16 @@ describe('Send', () => { } const Wrapper = () => { - return mount(Send, { localVue, mocks, propsData }) + return mount(Send, { + localVue, + mocks, + propsData, + provide: { + getTunneledEmail() { + return null + }, + }, + }) } describe('mount', () => { diff --git a/frontend/src/pages/Send.vue b/frontend/src/pages/Send.vue index c650b96ae..a894facc0 100644 --- a/frontend/src/pages/Send.vue +++ b/frontend/src/pages/Send.vue @@ -3,11 +3,7 @@