@@ -213,6 +198,13 @@
}
return [ button ]
+ },
+ tabs() {
+ let tabs = [ 'wallet.receipts', 'wallet.history' ]
+ if (this.showPendingPayments) {
+ tabs.push('wallet.pending-payments')
+ }
+ return tabs
}
},
mounted() {
@@ -224,7 +216,7 @@
.then(response => {
this.wallet = response.data
- axios.get('/api/v4/wallets/' + this.walletId + '/receipts', { loader: '#wallet-receipts' })
+ axios.get('/api/v4/wallets/' + this.walletId + '/receipts', { loader: '#receipts' })
.then(response => {
this.receipts = response.data.list
})
@@ -241,17 +233,9 @@
.then(response => {
this.showPendingPayments = response.data.hasPending
})
- },
- updated() {
- $(this.$el).find('ul.nav-tabs a').on('click', e => {
- this.$root.tab(e)
-
- if ($(e.target).is('#tab-history')) {
- this.loadTransactions = true
- } else if ($(e.target).is('#tab-payments')) {
- this.loadPayments = true
- }
- })
+
+ this.$refs.tabs.clickHandler('history', () => { this.loadTransactions = true })
+ this.$refs.tabs.clickHandler('payments', () => { this.loadPayments = true })
},
methods: {
loadMandate() {
diff --git a/src/resources/vue/Widgets/Tabs.vue b/src/resources/vue/Widgets/Tabs.vue
new file mode 100644
--- /dev/null
+++ b/src/resources/vue/Widgets/Tabs.vue
@@ -0,0 +1,65 @@
+
+
+
+
+
diff --git a/src/tests/Browser/Admin/SharedFolderTest.php b/src/tests/Browser/Admin/SharedFolderTest.php
--- a/src/tests/Browser/Admin/SharedFolderTest.php
+++ b/src/tests/Browser/Admin/SharedFolderTest.php
@@ -70,9 +70,9 @@
->on(new Dashboard())
->visit($user_page)
->on($user_page)
- ->click('@nav #tab-shared-folders')
+ ->click('@nav #tab-folders')
->pause(1000)
- ->click('@user-shared-folders table tbody tr:first-child td:first-child a')
+ ->click('@user-folders table tbody tr:first-child td:first-child a')
->on($folder_page)
->assertSeeIn('@folder-info .card-title', $folder->email)
->with('@folder-info form', function (Browser $browser) use ($folder) {
diff --git a/src/tests/Browser/Admin/UserTest.php b/src/tests/Browser/Admin/UserTest.php
--- a/src/tests/Browser/Admin/UserTest.php
+++ b/src/tests/Browser/Admin/UserTest.php
@@ -178,9 +178,9 @@
});
// Assert Shared folders tab
- $browser->assertSeeIn('@nav #tab-shared-folders', 'Shared folders (0)')
- ->click('@nav #tab-shared-folders')
- ->with('@user-shared-folders', function (Browser $browser) {
+ $browser->assertSeeIn('@nav #tab-folders', 'Shared folders (0)')
+ ->click('@nav #tab-folders')
+ ->with('@user-folders', function (Browser $browser) {
$browser->assertElementsCount('table tbody tr', 0)
->assertSeeIn('table tfoot tr td', 'There are no shared folders in this account.');
});
@@ -327,9 +327,9 @@
});
// Assert Shared folders tab
- $browser->assertSeeIn('@nav #tab-shared-folders', 'Shared folders (2)')
- ->click('@nav #tab-shared-folders')
- ->with('@user-shared-folders', function (Browser $browser) {
+ $browser->assertSeeIn('@nav #tab-folders', 'Shared folders (2)')
+ ->click('@nav #tab-folders')
+ ->with('@user-folders', function (Browser $browser) {
$browser->assertElementsCount('table tbody tr', 2)
->assertSeeIn('table tbody tr:nth-child(1) td:first-child', 'Calendar')
->assertSeeIn('table tbody tr:nth-child(1) td:nth-child(2)', 'Calendar')
@@ -449,9 +449,9 @@
});
// We don't expect John's folders here
- $browser->assertSeeIn('@nav #tab-shared-folders', 'Shared folders (0)')
- ->click('@nav #tab-shared-folders')
- ->with('@user-shared-folders', function (Browser $browser) {
+ $browser->assertSeeIn('@nav #tab-folders', 'Shared folders (0)')
+ ->click('@nav #tab-folders')
+ ->with('@user-folders', function (Browser $browser) {
$browser->assertElementsCount('table tbody tr', 0)
->assertSeeIn('table tfoot tr td', 'There are no shared folders in this account.');
});
diff --git a/src/tests/Browser/Pages/Admin/Distlist.php b/src/tests/Browser/Pages/Admin/Distlist.php
--- a/src/tests/Browser/Pages/Admin/Distlist.php
+++ b/src/tests/Browser/Pages/Admin/Distlist.php
@@ -51,7 +51,7 @@
return [
'@app' => '#app',
'@distlist-info' => '#distlist-info',
- '@distlist-settings' => '#distlist-settings',
+ '@distlist-settings' => '#settings',
];
}
}
diff --git a/src/tests/Browser/Pages/Admin/Domain.php b/src/tests/Browser/Pages/Admin/Domain.php
--- a/src/tests/Browser/Pages/Admin/Domain.php
+++ b/src/tests/Browser/Pages/Admin/Domain.php
@@ -52,8 +52,8 @@
'@app' => '#app',
'@domain-info' => '#domain-info',
'@nav' => 'ul.nav-tabs',
- '@domain-config' => '#domain-config',
- '@domain-settings' => '#domain-settings',
+ '@domain-config' => '#config',
+ '@domain-settings' => '#settings',
];
}
}
diff --git a/src/tests/Browser/Pages/Admin/Resource.php b/src/tests/Browser/Pages/Admin/Resource.php
--- a/src/tests/Browser/Pages/Admin/Resource.php
+++ b/src/tests/Browser/Pages/Admin/Resource.php
@@ -51,7 +51,7 @@
return [
'@app' => '#app',
'@resource-info' => '#resource-info',
- '@resource-settings' => '#resource-settings',
+ '@resource-settings' => '#settings',
];
}
}
diff --git a/src/tests/Browser/Pages/Admin/SharedFolder.php b/src/tests/Browser/Pages/Admin/SharedFolder.php
--- a/src/tests/Browser/Pages/Admin/SharedFolder.php
+++ b/src/tests/Browser/Pages/Admin/SharedFolder.php
@@ -51,8 +51,8 @@
return [
'@app' => '#app',
'@folder-info' => '#folder-info',
- '@folder-settings' => '#folder-settings',
- '@folder-aliases' => '#folder-aliases',
+ '@folder-settings' => '#settings',
+ '@folder-aliases' => '#aliases',
];
}
}
diff --git a/src/tests/Browser/Pages/Admin/User.php b/src/tests/Browser/Pages/Admin/User.php
--- a/src/tests/Browser/Pages/Admin/User.php
+++ b/src/tests/Browser/Pages/Admin/User.php
@@ -53,15 +53,15 @@
'@app' => '#app',
'@user-info' => '#user-info',
'@nav' => 'ul.nav-tabs',
- '@user-finances' => '#user-finances',
- '@user-aliases' => '#user-aliases',
- '@user-subscriptions' => '#user-subscriptions',
- '@user-distlists' => '#user-distlists',
- '@user-domains' => '#user-domains',
- '@user-resources' => '#user-resources',
- '@user-shared-folders' => '#user-shared-folders',
- '@user-users' => '#user-users',
- '@user-settings' => '#user-settings',
+ '@user-finances' => '#finances',
+ '@user-aliases' => '#aliases',
+ '@user-subscriptions' => '#subscriptions',
+ '@user-distlists' => '#distlists',
+ '@user-domains' => '#domains',
+ '@user-resources' => '#resources',
+ '@user-folders' => '#folders',
+ '@user-users' => '#users',
+ '@user-settings' => '#settings',
];
}
}
diff --git a/src/tests/Browser/Pages/Wallet.php b/src/tests/Browser/Pages/Wallet.php
--- a/src/tests/Browser/Pages/Wallet.php
+++ b/src/tests/Browser/Pages/Wallet.php
@@ -42,8 +42,9 @@
'@main' => '#wallet',
'@payment-dialog' => '#payment-dialog',
'@nav' => 'ul.nav-tabs',
- '@history-tab' => '#wallet-history',
- '@receipts-tab' => '#wallet-receipts',
+ '@history-tab' => '#history',
+ '@receipts-tab' => '#receipts',
+ '@payments-tab' => '#payments',
];
}
}
diff --git a/src/tests/Browser/Reseller/PaymentMollieTest.php b/src/tests/Browser/Reseller/PaymentMollieTest.php
--- a/src/tests/Browser/Reseller/PaymentMollieTest.php
+++ b/src/tests/Browser/Reseller/PaymentMollieTest.php
@@ -61,10 +61,10 @@
->click('@main button')
->with(new Dialog('@payment-dialog'), function (Browser $browser) {
$browser->assertSeeIn('@title', 'Top up your wallet')
- ->waitFor('#payment-method-selection #creditcard')
- ->waitFor('#payment-method-selection #paypal')
- ->waitFor('#payment-method-selection #banktransfer')
- ->click('#creditcard');
+ ->waitFor('#payment-method-selection .link-creditcard svg')
+ ->waitFor('#payment-method-selection .link-paypal svg')
+ ->waitFor('#payment-method-selection .link-banktransfer svg')
+ ->click('#payment-method-selection .link-creditcard');
})
->with(new Dialog('@payment-dialog'), function (Browser $browser) {
$browser->assertSeeIn('@title', 'Top up your wallet')
diff --git a/src/tests/Browser/Reseller/SharedFolderTest.php b/src/tests/Browser/Reseller/SharedFolderTest.php
--- a/src/tests/Browser/Reseller/SharedFolderTest.php
+++ b/src/tests/Browser/Reseller/SharedFolderTest.php
@@ -70,9 +70,9 @@
->on(new Dashboard())
->visit($user_page)
->on($user_page)
- ->click('@nav #tab-shared-folders')
+ ->click('@nav #tab-folders')
->pause(1000)
- ->click('@user-shared-folders table tbody tr:first-child td:first-child a')
+ ->click('@user-folders table tbody tr:first-child td:first-child a')
->on($folder_page)
->assertSeeIn('@folder-info .card-title', $folder->email)
->with('@folder-info form', function (Browser $browser) use ($folder) {
diff --git a/src/tests/Browser/Reseller/UserTest.php b/src/tests/Browser/Reseller/UserTest.php
--- a/src/tests/Browser/Reseller/UserTest.php
+++ b/src/tests/Browser/Reseller/UserTest.php
@@ -175,9 +175,9 @@
});
// Assert Shared folders tab
- $browser->assertSeeIn('@nav #tab-shared-folders', 'Shared folders (0)')
- ->click('@nav #tab-shared-folders')
- ->with('@user-shared-folders', function (Browser $browser) {
+ $browser->assertSeeIn('@nav #tab-folders', 'Shared folders (0)')
+ ->click('@nav #tab-folders')
+ ->with('@user-folders', function (Browser $browser) {
$browser->assertElementsCount('table tbody tr', 0)
->assertSeeIn('table tfoot tr td', 'There are no shared folders in this account.');
});
@@ -323,9 +323,9 @@
});
// Assert Shared folders tab
- $browser->assertSeeIn('@nav #tab-shared-folders', 'Shared folders (2)')
- ->click('@nav #tab-shared-folders')
- ->with('@user-shared-folders', function (Browser $browser) {
+ $browser->assertSeeIn('@nav #tab-folders', 'Shared folders (2)')
+ ->click('@nav #tab-folders')
+ ->with('@user-folders', function (Browser $browser) {
$browser->assertElementsCount('table tbody tr', 2)
->assertSeeIn('table tbody tr:nth-child(1) td:first-child', 'Calendar')
->assertSeeIn('table tbody tr:nth-child(1) td:nth-child(2)', 'Calendar')
@@ -422,9 +422,9 @@
});
// Assert Shared folders tab
- $browser->assertSeeIn('@nav #tab-shared-folders', 'Shared folders (0)')
- ->click('@nav #tab-shared-folders')
- ->with('@user-shared-folders', function (Browser $browser) {
+ $browser->assertSeeIn('@nav #tab-folders', 'Shared folders (0)')
+ ->click('@nav #tab-folders')
+ ->with('@user-folders', function (Browser $browser) {
$browser->assertElementsCount('table tbody tr', 0)
->assertSeeIn('table tfoot tr td', 'There are no shared folders in this account.');
});