From a2a959a9b421b98a4bce768f144b2e458fc012d3 Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Thu, 13 Apr 2017 16:34:46 +0200 Subject: [PATCH 1/2] Use inifinite scroll for transactions list --- src/app/components/transactions/transactions.js | 6 +++++- src/app/components/transactions/transactions.less | 14 -------------- src/app/components/transactions/transactions.pug | 7 +++---- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/app/components/transactions/transactions.js b/src/app/components/transactions/transactions.js index 9d9eaae13..3dff24b1c 100644 --- a/src/app/components/transactions/transactions.js +++ b/src/app/components/transactions/transactions.js @@ -42,7 +42,11 @@ app.component('transactions', { reset() { this.loaded = false; } - + showMore() { + if (this.more) { + this.update(true, true); + } + } update(show, more) { this.loading = true; diff --git a/src/app/components/transactions/transactions.less b/src/app/components/transactions/transactions.less index ac3cd53c8..9f036b790 100644 --- a/src/app/components/transactions/transactions.less +++ b/src/app/components/transactions/transactions.less @@ -11,20 +11,6 @@ transactions { height: 40px; } - .loading { - height: 5px; - - .md-container { - background-color: #fff; - border-top-left-radius: 2px; - border-top-right-radius: 2px; - } - - .md-dashed { - background-color: #0288d1; - } - } - md-table-container { width: 100%; } diff --git a/src/app/components/transactions/transactions.pug b/src/app/components/transactions/transactions.pug index 1336dacfc..e371dd86b 100644 --- a/src/app/components/transactions/transactions.pug +++ b/src/app/components/transactions/transactions.pug @@ -1,7 +1,5 @@ md-card.offline-hide md-card-content - .loading - md-progress-linear(md-mode='indeterminate', ng-show='$ctrl.loading_show || !$ctrl.loaded') md-content(layout='row', layout-align='start center', layout-padding) span.title.md-title Transactions div(flex) @@ -17,7 +15,7 @@ md-card.offline-hide th(md-column) th(md-column) Amount th(md-column) Fee - tbody(md-body) + tbody(md-body, infinite-scroll='$ctrl.showMore()') tr(md-row, ng-repeat="transaction in $ctrl.transactions track by transaction.id | orderBy:'-timestamp'") td(md-cell) timestamp(data='transaction.timestamp', ng-show='transaction.confirmations') @@ -45,4 +43,5 @@ md-card.offline-hide td(md-cell) .fee lsk(amount='transaction.fee') - md-button.more(ng-show='$ctrl.more', ng-disabled='$ctrl.loading_show', ng-click='$ctrl.update(true, true)') Load More + .loading + md-progress-linear(md-mode='indeterminate', ng-show='$ctrl.loading_show || !$ctrl.loaded') From 0af972ddca126c74199d58abd666d0edf53df946 Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Thu, 13 Apr 2017 16:41:21 +0200 Subject: [PATCH 2/2] Remove e2e test of "More transactions" button because the button was removed in the previous commit --- src/spec/spec.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/spec/spec.js b/src/spec/spec.js index d73704e22..53a2c862d 100644 --- a/src/spec/spec.js +++ b/src/spec/spec.js @@ -173,17 +173,6 @@ function testShowTransactions() { expect(element.all(by.css('transactions table tbody tr')).count()).toEqual(10); } -function testLoadMoreTransactions() { - login(masterAccount); - - const moreButton = element(by.css('transactions button.more')); - browser.wait(EC.presenceOf(moreButton), waitTime); - moreButton.click(); - browser.sleep(200); - - expect(element.all(by.css('transactions table tbody tr')).count()).toEqual(20); -} - describe('Lisk Nano functionality', () => { it('should allow to login', testLogin); it('should allow to logout', testLogout); @@ -195,6 +184,5 @@ describe('Lisk Nano functionality', () => { it('should not allow to send transaction when not enough funds', testSendWithNotEnoughFunds); it('should not allow to send transaction when invalid address', testSendWithInvalidAddress); it('should show transactions', testShowTransactions); - it('should allow to load more transactions', testLoadMoreTransactions); it('should allow to create a new account', testNewAccount); });