From d3c951a28c33ab78ee7e4eaf1baed592d719ca30 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 29 Aug 2016 10:11:08 +0100 Subject: [PATCH 001/354] Allow for a fee of zero --- src/js/services/feeService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/services/feeService.js b/src/js/services/feeService.js index de1caa722..5142edf66 100644 --- a/src/js/services/feeService.js +++ b/src/js/services/feeService.js @@ -30,7 +30,7 @@ angular.module('copayApp.services').factory('feeService', function($log, $stateP var feeLevelValue = lodash.find(levels, { level: feeLevel }); - if (!feeLevelValue || !feeLevelValue.feePerKB) + if (!feeLevelValue || feeLevelValue.feePerKB == null) return cb({ message: 'Could not get dynamic fee for level: ' + feeLevel }); From 26ad0cc110ce411de791175cbd801be614b42765 Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Tue, 1 Nov 2016 14:56:53 -0400 Subject: [PATCH 002/354] better spacing for tx description --- src/js/directives/gravatar.js | 4 ++-- src/sass/views/walletDetails.scss | 5 ++++- www/views/walletDetails.html | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/directives/gravatar.js b/src/js/directives/gravatar.js index c76817b5e..2f85fe0eb 100644 --- a/src/js/directives/gravatar.js +++ b/src/js/directives/gravatar.js @@ -16,6 +16,6 @@ angular.module('copayApp.directives') scope.emailHash = md5.createHash(scope.email.toLowerCase() || ''); } }, - template: '{{ name }}' - } + template: '{{ name }}' + }; }); diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index 37438bc1d..6c265fe58 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -21,7 +21,10 @@ } &__tx-icon { float: left; - margin-right: 10px; + margin-right: 25px; + } + &__tx-message { + margin-right: 1rem; } } diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 1526a0688..4579ec229 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -156,7 +156,7 @@
-
{{btx.message}}
+
{{btx.message}}
{{btx.note.body}}
{{addressbook[btx.addressTo].name || addressbook[btx.addressTo]}} From d83114f292be27c23b5f910dd39dc1881c59060e Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Tue, 1 Nov 2016 16:47:44 -0400 Subject: [PATCH 003/354] refactor tx detail list item to use flexbox --- src/sass/views/walletDetails.scss | 30 ++++++++++++++++- www/views/walletDetails.html | 56 ++++++++++++++++++++++++++++++- 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index 6c265fe58..ab99e6d6e 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -14,10 +14,13 @@ } &__tx-time { color: $light-gray; + font-size: 14px; } &__tx-title { - padding-top: 10px; + //padding-top: 10px; + flex-grow: 1; color: $dark-gray; + overflow: hidden; } &__tx-icon { float: left; @@ -26,6 +29,31 @@ &__tx-message { margin-right: 1rem; } + + &__list { + + } + + &__item { + display: flex; + align-items: center; + background: #fff; + padding-left: 1rem; + } + + &__tx-content { + display: flex; + align-items: center; + flex-grow: 1; + padding: 1rem 0; + padding-right: 1rem; + border-bottom: 1px solid rgb(245, 245, 245); + overflow: hidden; + } + + &__tx-amount { + white-space: nowrap; + } } #walletDetails { diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 4579ec229..6fe91f2a0 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -125,7 +125,7 @@
-
+ + +
+
+ + + + + +
+
+
+
{{btx.note.body}}
+
Received
+
+ +
+
{{btx.message}}
+
{{btx.note.body}}
+
+ {{addressbook[btx.addressTo].name || addressbook[btx.addressTo]}} +
+
Sent
+
+ +
+
{{btx.note.body}}
+
Moved
+
+ Invalid +
+ + + + + + (possible double spend) + + + {{btx.amountStr}} + + +
+ + + Unconfirmed + +
+
+
+
Date: Tue, 1 Nov 2016 17:32:18 -0400 Subject: [PATCH 004/354] prelim group divider style --- src/sass/views/walletDetails.scss | 7 +++ www/views/walletDetails.html | 83 ++++++++++++++++--------------- 2 files changed, 50 insertions(+), 40 deletions(-) diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index ab99e6d6e..1644d63c8 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -54,6 +54,13 @@ &__tx-amount { white-space: nowrap; } + + &__group-label { + font-size: 14px; + font-weight: 300; + color: #727272; + padding: 2px 1rem; + } } #walletDetails { diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 6fe91f2a0..de748befe 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -175,53 +175,56 @@
-->
-
+
+
June
- - - +
+ + + -
-
-
-
{{btx.note.body}}
-
Received
-
- -
-
{{btx.message}}
-
{{btx.note.body}}
-
- {{addressbook[btx.addressTo].name || addressbook[btx.addressTo]}} +
+
+
+
{{btx.note.body}}
+
Received
-
Sent
+ +
+
{{btx.message}}
+
{{btx.note.body}}
+
+ {{addressbook[btx.addressTo].name || addressbook[btx.addressTo]}} +
+
Sent
+
+ +
+
{{btx.note.body}}
+
Moved
+
+ Invalid
-
-
{{btx.note.body}}
-
Moved
-
- Invalid -
- - - - - - (possible double spend) - - - {{btx.amountStr}} + + + + + (possible double spend) + + + {{btx.amountStr}} + +
+ + + Unconfirmed + +
-
- - - Unconfirmed - -
-
+
From 74a15b824abf5f70c2d0567d2bb301d425db4149 Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Tue, 1 Nov 2016 17:47:07 -0400 Subject: [PATCH 005/354] wire actual month to group label component --- src/js/controllers/walletDetails.js | 5 +++++ src/sass/views/walletDetails.scss | 1 + www/views/walletDetails.html | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 6fd7a8b30..aeec92930 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -149,6 +149,11 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun $scope.txHistory = $scope.completeTxHistory.slice(0, (currentTxHistoryPage + 1) * HISTORY_SHOW_LIMIT); $scope.txHistoryShowMore = $scope.completeTxHistory.length > $scope.txHistory.length; } + console.log('$scope.completeTxHistory', $scope.completeTxHistory); + }; + + $scope.getDate = function(txCreated) { + return new Date(txCreated * 1000); }; $scope.showMore = function() { diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index 1644d63c8..009614072 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -64,6 +64,7 @@ } #walletDetails { + background: #F8F8F9; .bar-header { border: 0; background: none; diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index de748befe..027d008d5 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -176,7 +176,7 @@
-
June
+
{{getDate(btx.time) | date:'MMMM'}}
From e41b46b42d19f7b08ab3182fa23e8428aae4e434 Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Wed, 2 Nov 2016 16:35:05 -0400 Subject: [PATCH 006/354] add logic to display grouping labels appropriately --- src/js/controllers/walletDetails.js | 17 +++++++++++++++++ www/views/walletDetails.html | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index aeec92930..af297c720 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -156,6 +156,23 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun return new Date(txCreated * 1000); }; + $scope.showGroupHeader = function(index) { + if(index === 0) { + return true; + } + var curTx = $scope.txHistory[index]; + var prevTx = $scope.txHistory[index - 1]; + return !createdDuringSameMonth(curTx, prevTx); + }; + + function createdDuringSameMonth(tx1, tx2) { + var date1 = new Date(tx1.time * 1000); + var date2 = new Date(tx2.time * 1000); + var date1MonthYear = date1.getMonth() + date1.getFullYear(); + var date2MonthYear = date2.getMonth() + date2.getFullYear(); + return date1MonthYear === date2MonthYear; + } + $scope.showMore = function() { $timeout(function() { currentTxHistoryPage++; diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 027d008d5..1b8530518 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -176,7 +176,7 @@
-
{{getDate(btx.time) | date:'MMMM'}}
+
{{getDate(btx.time) | date:'MMMM'}}
From 19554b94b6cd77ae4688cc1599b6071c04555066 Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Wed, 2 Nov 2016 17:01:32 -0400 Subject: [PATCH 007/354] mark the current month as recent --- src/js/controllers/walletDetails.js | 16 ++++++++++++---- www/views/walletDetails.html | 9 ++++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index af297c720..bb2506ff4 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -153,7 +153,8 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun }; $scope.getDate = function(txCreated) { - return new Date(txCreated * 1000); + var date = new Date(txCreated * 1000); + return date; }; $scope.showGroupHeader = function(index) { @@ -168,9 +169,16 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun function createdDuringSameMonth(tx1, tx2) { var date1 = new Date(tx1.time * 1000); var date2 = new Date(tx2.time * 1000); - var date1MonthYear = date1.getMonth() + date1.getFullYear(); - var date2MonthYear = date2.getMonth() + date2.getFullYear(); - return date1MonthYear === date2MonthYear; + return getMonthYear(date1) === getMonthYear(date2); + } + + $scope.isDateInCurrentMonth = function(date) { + var now = new Date(); + return getMonthYear(now) === getMonthYear(date); + }; + + function getMonthYear(date) { + return date.getMonth() + date.getFullYear(); } $scope.showMore = function() { diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 1b8530518..278e10c68 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -176,7 +176,14 @@
-
{{getDate(btx.time) | date:'MMMM'}}
+
+ + Recent + + + {{getDate(btx.time) | date:'MMMM'}} + +
From 1a12ef181a5ae592a3a71b7a9ba382d0e04d0cf0 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 3 Nov 2016 13:39:03 -0300 Subject: [PATCH 008/354] Fix error if backView does not exist --- src/js/controllers/copayers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/controllers/copayers.js b/src/js/controllers/copayers.js index d5ae4c41e..cc4a97c69 100644 --- a/src/js/controllers/copayers.js +++ b/src/js/controllers/copayers.js @@ -79,8 +79,8 @@ angular.module('copayApp.controllers').controller('copayersController', }; $scope.goHome = function() { - $ionicHistory.removeBackView(); $state.go('tabs.home'); + $ionicHistory.clearHistory(); }; }); From 691600e1161a59dfc034d6a41d7d0dad5c6c2f25 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 3 Nov 2016 13:40:45 -0300 Subject: [PATCH 009/354] Updates info when a copayer accept/reject --- src/js/controllers/modals/txpDetails.js | 172 +++++++++++++----------- 1 file changed, 90 insertions(+), 82 deletions(-) diff --git a/src/js/controllers/modals/txpDetails.js b/src/js/controllers/modals/txpDetails.js index d67c2f7a4..7d8918e18 100644 --- a/src/js/controllers/modals/txpDetails.js +++ b/src/js/controllers/modals/txpDetails.js @@ -1,13 +1,11 @@ 'use strict'; -angular.module('copayApp.controllers').controller('txpDetailsController', function($scope, $rootScope, $timeout, $interval, $ionicModal, $log, ongoingProcess, platformInfo, $ionicScrollDelegate, txFormatService, fingerprintService, bwcError, gettextCatalog, lodash, walletService, popupService, $state, $ionicHistory) { - var self = $scope.self; - var tx = $scope.tx; - var copayers = $scope.copayers; +angular.module('copayApp.controllers').controller('txpDetailsController', function($scope, $rootScope, $timeout, $interval, $log, ongoingProcess, platformInfo, $ionicScrollDelegate, txFormatService, bwcError, gettextCatalog, lodash, walletService, popupService, $ionicHistory) { var isGlidera = $scope.isGlidera; var GLIDERA_LOCK_TIME = 6 * 60 * 60; var now = Math.floor(Date.now() / 1000); var countDown; + var listeners = []; $scope.init = function() { $scope.loading = null; @@ -18,8 +16,8 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi $scope.color = $scope.wallet.color; $scope.data = {}; $scope.hasClick = platformInfo.hasClick; - $scope.displayAmount = getDisplayAmount(tx.amountStr); - $scope.displayUnit = getDisplayUnit(tx.amountStr); + $scope.displayAmount = getDisplayAmount($scope.tx.amountStr); + $scope.displayUnit = getDisplayUnit($scope.tx.amountStr); initActionList(); checkPaypro(); } @@ -46,12 +44,12 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi $scope.actionList.push({ type: 'created', - time: tx.createdOn, + time: $scope.tx.createdOn, description: actionDescriptions['created'], - by: tx.creatorName + by: $scope.tx.creatorName }); - lodash.each(tx.actions, function(action) { + lodash.each($scope.tx.actions, function(action) { $scope.actionList.push({ type: action.type, time: action.createdOn, @@ -61,38 +59,70 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi }); }; + function checkPaypro() { + if ($scope.tx.payProUrl && !platformInfo.isChromeApp) { + $scope.wallet.fetchPayPro({ + payProUrl: $scope.tx.payProUrl, + }, function(err, paypro) { + if (err) return; + $scope.tx.paypro = paypro; + paymentTimeControl($scope.tx.paypro.expires); + $timeout(function() { + $ionicScrollDelegate.resize(); + }, 10); + }); + } + }; + + function paymentTimeControl(expirationTime) { + $scope.paymentExpired = false; + setExpirationTime(); + + countDown = $interval(function() { + setExpirationTime(); + }, 1000); + + function setExpirationTime() { + var now = Math.floor(Date.now() / 1000); + if (now > expirationTime) { + $scope.paymentExpired = true; + if (countDown) $interval.cancel(countDown); + return; + } + var totalSecs = expirationTime - now; + var m = Math.floor(totalSecs / 60); + var s = totalSecs % 60; + $scope.expires = ('0' + m).slice(-2) + ":" + ('0' + s).slice(-2); + }; + }; + $scope.$on('accepted', function(event) { $scope.sign(); }); // ToDo: use tx.customData instead of tx.message - if (tx.message === 'Glidera transaction' && isGlidera) { - tx.isGlidera = true; - if (tx.canBeRemoved) { - tx.canBeRemoved = (Date.now() / 1000 - (tx.ts || tx.createdOn)) > GLIDERA_LOCK_TIME; + if ($scope.tx.message === 'Glidera transaction' && isGlidera) { + $scope.tx.isGlidera = true; + if ($scope.tx.canBeRemoved) { + $scope.tx.canBeRemoved = (Date.now() / 1000 - ($scope.tx.ts || $scope.tx.createdOn)) > GLIDERA_LOCK_TIME; } } - var setSendError = function(msg) { + var setError = function (err, prefix) { $scope.sendStatus = ''; - var error = msg || gettextCatalog.getString('Could not send payment'); - popupService.showAlert(gettextCatalog.getString('Error'), error); - } + $scope.loading = false; + popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err, prefix)); + }; $scope.sign = function(onSendStatusChange) { $scope.loading = true; walletService.publishAndSign($scope.wallet, $scope.tx, function(err, txp) { $scope.$emit('UpdateTx'); - if (err) return setSendError(err); + if (err) return setError(err, gettextCatalog.getString('Could not send payment')); success(); }, onSendStatusChange); }; - function setError(err, prefix) { - $scope.loading = false; - popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err, prefix)); - }; - $scope.reject = function(txp) { var title = gettextCatalog.getString('Warning!'); var msg = gettextCatalog.getString('Are you sure you want to reject this transaction?'); @@ -150,69 +180,46 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi return $scope.wallet.credentials.networkName.substring(0, 4); }; - function checkPaypro() { - if (tx.payProUrl && !platformInfo.isChromeApp) { - $scope.wallet.fetchPayPro({ - payProUrl: tx.payProUrl, - }, function(err, paypro) { - if (err) return; - tx.paypro = paypro; - paymentTimeControl(tx.paypro.expires); - $timeout(function() { - $ionicScrollDelegate.resize(); - }, 10); - }); - } - }; - - function paymentTimeControl(expirationTime) { - $scope.paymentExpired = false; - setExpirationTime(); - - countDown = $interval(function() { - setExpirationTime(); - }, 1000); - - function setExpirationTime() { - var now = Math.floor(Date.now() / 1000); - if (now > expirationTime) { - $scope.paymentExpired = true; - if (countDown) $interval.cancel(countDown); + var updateTxInfo = function(eventName) { + $scope.wallet.getTx($scope.tx.id, function(err, tx) { + if (err) { + if (err.message && err.message == 'TX_NOT_FOUND' && + (eventName == 'transactionProposalRemoved' || eventName == 'TxProposalRemoved')) { + $scope.tx.removed = true; + $scope.tx.canBeRemoved = false; + $scope.tx.pendingForUs = false; + $scope.$apply(); + } return; } - var totalSecs = expirationTime - now; - var m = Math.floor(totalSecs / 60); - var s = totalSecs % 60; - $scope.expires = ('0' + m).slice(-2) + ":" + ('0' + s).slice(-2); - }; + + var action = lodash.find(tx.actions, { + copayerId: $scope.wallet.credentials.copayerId + }); + + $scope.tx = txFormatService.processTx(tx); + + if (!action && tx.status == 'pending') + $scope.tx.pendingForUs = true; + + $scope.updateCopayerList(); + initActionList(); + $scope.$apply(); + }); }; - lodash.each(['TxProposalRejectedBy', 'TxProposalAcceptedBy', 'transactionProposalRemoved', 'TxProposalRemoved', 'NewOutgoingTx', 'UpdateTx'], function(eventName) { - $rootScope.$on(eventName, function() { - $scope.wallet.getTx($scope.tx.id, function(err, tx) { - if (err) { - if (err.message && err.message == 'TX_NOT_FOUND' && - (eventName == 'transactionProposalRemoved' || eventName == 'TxProposalRemoved')) { - $scope.tx.removed = true; - $scope.tx.canBeRemoved = false; - $scope.tx.pendingForUs = false; - $scope.$apply(); - } - return; - } - - var action = lodash.find(tx.actions, { - copayerId: $scope.wallet.credentials.copayerId - }); - - $scope.tx = txFormatService.processTx(tx); - - if (!action && tx.status == 'pending') - $scope.tx.pendingForUs = true; - - $scope.updateCopayerList(); - $scope.$apply(); - }); + var bwsEvent = $rootScope.$on('bwsEvent', function(e, walletId, type, n) { + lodash.each([ + 'TxProposalRejectedBy', + 'TxProposalAcceptedBy', + 'transactionProposalRemoved', + 'TxProposalRemoved', + 'NewOutgoingTx', + 'UpdateTx' + ], function(eventName) { + if (walletId == $scope.wallet.id && type == eventName) { + updateTxInfo(eventName); + } }); }); @@ -252,6 +259,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi }; $scope.close = function() { + bwsEvent(); $scope.loading = null; $scope.txpDetailsModal.hide(); }; From cc88ddf295a908ca3119704ac5688acddc744d3e Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 3 Nov 2016 13:49:37 -0300 Subject: [PATCH 010/354] Adds confirmation before delete transaction. Fix delete transaction --- src/js/controllers/modals/txpDetails.js | 32 +++++++++++++------------ 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/js/controllers/modals/txpDetails.js b/src/js/controllers/modals/txpDetails.js index 7d8918e18..975132f42 100644 --- a/src/js/controllers/modals/txpDetails.js +++ b/src/js/controllers/modals/txpDetails.js @@ -141,22 +141,24 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi }; $scope.remove = function() { - $scope.loading = true; + var title = gettextCatalog.getString('Warning!'); + var msg = gettextCatalog.getString('Are you sure you want to remove this transaction?'); + popupService.showConfirm(title, msg, null, null, function(res) { + if (res) { + ongoingProcess.set('removeTx', true); + walletService.removeTx($scope.wallet, $scope.tx, function(err) { + ongoingProcess.set('removeTx', false); - $timeout(function() { - ongoingProcess.set('removeTx', true); - walletService.removeTx($scope.wallet, $scope.tx, function(err) { - ongoingProcess.set('removeTx', false); + // Hacky: request tries to parse an empty response + if (err && !(err.message && err.message.match(/Unexpected/))) { + $scope.$emit('UpdateTx'); + return setError(err, gettextCatalog.getString('Could not delete payment proposal')); + } - // Hacky: request tries to parse an empty response - if (err && !(err.message && err.message.match(/Unexpected/))) { - $scope.$emit('UpdateTx'); - return setError(err, gettextCatalog.getString('Could not delete payment proposal')); - } - - $scope.close(); - }); - }, 10); + $scope.close(); + }); + } + }); }; $scope.broadcast = function(txp) { @@ -183,7 +185,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi var updateTxInfo = function(eventName) { $scope.wallet.getTx($scope.tx.id, function(err, tx) { if (err) { - if (err.message && err.message == 'TX_NOT_FOUND' && + if (err.message && err.message == 'Transaction proposal not found' && (eventName == 'transactionProposalRemoved' || eventName == 'TxProposalRemoved')) { $scope.tx.removed = true; $scope.tx.canBeRemoved = false; From ff4041b5e5801c11a8e3b6777b7f8a43afb20d1a Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 3 Nov 2016 16:02:47 -0300 Subject: [PATCH 011/354] Removes unused variable --- src/js/controllers/modals/txpDetails.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/js/controllers/modals/txpDetails.js b/src/js/controllers/modals/txpDetails.js index 975132f42..eb88b5d02 100644 --- a/src/js/controllers/modals/txpDetails.js +++ b/src/js/controllers/modals/txpDetails.js @@ -5,7 +5,6 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi var GLIDERA_LOCK_TIME = 6 * 60 * 60; var now = Math.floor(Date.now() / 1000); var countDown; - var listeners = []; $scope.init = function() { $scope.loading = null; From 82e3a4af7c7adc427a6c76a4c6eaef066d60212e Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Thu, 3 Nov 2016 15:11:06 -0400 Subject: [PATCH 012/354] add confirming state --- www/img/icon-confirming.svg | 22 ++++++++++++++++++++++ www/views/walletDetails.html | 18 ++++++++++++++---- 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 www/img/icon-confirming.svg diff --git a/www/img/icon-confirming.svg b/www/img/icon-confirming.svg new file mode 100644 index 000000000..989af61aa --- /dev/null +++ b/www/img/icon-confirming.svg @@ -0,0 +1,22 @@ + + + + Group 2 + Created with Sketch. + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 278e10c68..9e8fa7887 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -186,12 +186,16 @@
- - - + + + + + +
-
+ +
{{btx.note.body}}
Received
@@ -213,6 +217,12 @@ Invalid
+
+
+ Confirming +
+
+ From 77b59d93fa08a15e9d7b7aed9e5318f068934de3 Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Thu, 3 Nov 2016 15:24:39 -0400 Subject: [PATCH 013/354] add confirmations item to tx-details --- www/views/modals/tx-details.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/www/views/modals/tx-details.html b/www/views/modals/tx-details.html index 82f560c8c..4acb712b0 100644 --- a/www/views/modals/tx-details.html +++ b/www/views/modals/tx-details.html @@ -54,12 +54,21 @@ -
+
Fee {{btx.feeStr}}
+
+ Confirmations + + {{btx.confirmations}} + + + 6+ + +
Timeline
From bddfdac0b12e937dc5b74dc3b05177170576e17d Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Thu, 3 Nov 2016 15:30:41 -0400 Subject: [PATCH 014/354] add confirming status to tx details view --- www/views/modals/tx-details.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/views/modals/tx-details.html b/www/views/modals/tx-details.html index 4acb712b0..a01d744bf 100644 --- a/www/views/modals/tx-details.html +++ b/www/views/modals/tx-details.html @@ -10,10 +10,14 @@
-
+
{{btx.action | translate}}
+
+ + Confirming +
{{displayAmount}} {{displayUnit}}
{{btx.alternativeAmountStr}}
From b0e23b72316e908ef744bc2740e512261ec7f8c1 Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Thu, 3 Nov 2016 15:50:22 -0400 Subject: [PATCH 015/354] show full date in wallet detail list if the transaction occured more than a day ago --- src/js/controllers/walletDetails.js | 6 ++++++ www/views/walletDetails.html | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index bb2506ff4..c01673915 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -172,6 +172,12 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun return getMonthYear(date1) === getMonthYear(date2); } + $scope.createdWithinPastDay = function(tx) { + var now = new Date(); + var date = new Date(tx.time * 1000); + return (now.getTime() - date.getTime()) < (1000 * 60 * 60 * 24); + }; + $scope.isDateInCurrentMonth = function(date) { var now = new Date(); return getMonthYear(now) === getMonthYear(date); diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 9e8fa7887..9d933ca79 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -234,7 +234,9 @@
- + + + Unconfirmed From 073b063a48dd4e39362d35df233c6bc82711d34e Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Thu, 3 Nov 2016 17:29:29 -0400 Subject: [PATCH 016/354] improve tx proposal list item styling --- src/js/controllers/walletDetails.js | 8 +++-- src/sass/views/walletDetails.scss | 8 +++++ www/img/icon-proposal-pending.svg | 23 ++++++++++++ www/views/includes/txp.html | 54 +++++++++++++++++++++++++++-- www/views/tab-home.html | 8 +++-- www/views/walletDetails.html | 20 +++++------ 6 files changed, 105 insertions(+), 16 deletions(-) create mode 100644 www/img/icon-proposal-pending.svg diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index c01673915..64c5b2c35 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -172,9 +172,9 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun return getMonthYear(date1) === getMonthYear(date2); } - $scope.createdWithinPastDay = function(tx) { + $scope.createdWithinPastDay = function(time) { var now = new Date(); - var date = new Date(tx.time * 1000); + var date = new Date(time * 1000); return (now.getTime() - date.getTime()) < (1000 * 60 * 60 * 24); }; @@ -187,6 +187,10 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun return date.getMonth() + date.getFullYear(); } + $scope.isUnconfirmed = function(tx) { + return !tx.time && (!tx.confirmations || tx.confirmations === 0); + }; + $scope.showMore = function() { $timeout(function() { currentTxHistoryPage++; diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index 009614072..58ece2d10 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -39,6 +39,14 @@ align-items: center; background: #fff; padding-left: 1rem; + + &__marker { + position: absolute; + height: 100%; + width: 3px; + background: #F5A623; + left: 0; + } } &__tx-content { diff --git a/www/img/icon-proposal-pending.svg b/www/img/icon-proposal-pending.svg new file mode 100644 index 000000000..6314b99ff --- /dev/null +++ b/www/img/icon-proposal-pending.svg @@ -0,0 +1,23 @@ + + + + Group + Created with Sketch. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/views/includes/txp.html b/www/views/includes/txp.html index 107c0046c..6a66a5d8f 100644 --- a/www/views/includes/txp.html +++ b/www/views/includes/txp.html @@ -1,4 +1,4 @@ - + +
+ + +
+ +
+ + + {{addressbook[tx.toAddress].name || addressbook[tx.toAddress]}} + + + {{tx.message}} + + + Sending + + + + {{tx.merchant.domain}} + {{tx.merchant.domain}} + +
+ +
+
+ Confirming +
+
+ + + + + + (possible double spend) + + + {{tx.amountStr}} + + +
+ + + + +
+
+
diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 865afc0bc..783442eb3 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -37,9 +37,13 @@ {{txpsN}} - + + +
+
+
diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 9d933ca79..4b8e4799b 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -96,8 +96,8 @@ Payment Proposals Unsent transactions
-
- +
+
- - + + @@ -195,7 +195,7 @@
-
+
{{btx.note.body}}
Received
@@ -217,7 +217,7 @@ Invalid
-
+
Confirming
@@ -234,13 +234,13 @@
- - + + - Unconfirmed - + -->
From 155697e0877d89ecbafcd5343f3c23262e9cb149 Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Thu, 3 Nov 2016 17:38:46 -0400 Subject: [PATCH 017/354] update proposals header styling --- src/sass/views/walletDetails.scss | 4 ++++ www/views/walletDetails.html | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index 58ece2d10..f5bf701fc 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -40,6 +40,10 @@ background: #fff; padding-left: 1rem; + &.proposal { + position: relative; + } + &__marker { position: absolute; height: 100%; diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 4b8e4799b..a93092a32 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -92,12 +92,16 @@
-
+ +
+ Proposals + Unsent transactions
-
+