From 5e03f803de44ce1b2308c368bbc4867f04f6aaa9 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 6 Sep 2016 15:14:07 -0300 Subject: [PATCH 01/12] Fix bitpay card. Replaces the app-name in desktop --- app-template/package.json | 4 +- public/views/bitpayCard.html | 85 +++++++++++---------- public/views/modals/tx-status.html | 8 +- public/views/preferencesBitpayCard.html | 4 +- src/js/controllers/bitpayCard.js | 3 +- src/js/controllers/preferencesBitpayCard.js | 21 +++-- src/sass/main.scss | 1 + src/sass/views/bitpayCard.scss | 16 ++++ src/sass/views/walletDetails.scss | 1 + 9 files changed, 84 insertions(+), 59 deletions(-) create mode 100644 src/sass/views/bitpayCard.scss diff --git a/app-template/package.json b/app-template/package.json index 3e19f4248..bd5b5dac6 100644 --- a/app-template/package.json +++ b/app-template/package.json @@ -13,14 +13,14 @@ ], "main": "public/index.html", "window": { - "title": "Copay - A multisignature bitcoin wallet", + "title": "*NAMECASE* - *DESCRIPTION*", "icon": "./public/img/icons/icon-256.png", "toolbar": false, "show": true, "visible": true, "resizable": true, "frame": true, - "width": 800, + "width": 400, "height": 600, "position": "center", "fullscreen": false diff --git a/public/views/bitpayCard.html b/public/views/bitpayCard.html index 758f2bd01..9e10307a7 100644 --- a/public/views/bitpayCard.html +++ b/public/views/bitpayCard.html @@ -1,13 +1,13 @@ - BitPay Card - @@ -93,8 +93,8 @@
-
-
+
+
${{bitpayCard.bitpayCardCurrentBalance}}
Available balance
@@ -110,7 +110,7 @@
- @@ -127,40 +127,41 @@
-
-
- -
- -
-
- {{tx.merchant.name}} -
-
- {{tx.merchant.city}}, {{tx.merchant.state}} -
-
+
- {{desc}} -
-
- - -
-
-
- {{tx.amount | currency:'$':2 }} + ng-repeat="tx in bitpayCard.bitpayCardTransactionHistory | orderBy: ['pending','-timestamp']" + class="item row" + ng-init="bitpayCard.getMerchantInfo(tx)"> +
+ +
+ +
+
+ {{tx.merchant.name}} +
+
+ {{tx.merchant.city}}, {{tx.merchant.state}} +
+
+
+ {{desc}} +
+
+ + +
+
+
+ {{tx.amount | currency:'$':2 }} +
+
-
@@ -171,7 +172,7 @@ ng-submit="bitpayCard.sendFunds()" novalidate> -
+
@@ -19,7 +19,7 @@ Payment Proposal Created
- OKAY + OKAY
@@ -31,7 +31,7 @@ Payment Accepted
- OKAY + OKAY
@@ -41,7 +41,7 @@ Payment Rejected
- OKAY + OKAY
diff --git a/public/views/preferencesBitpayCard.html b/public/views/preferencesBitpayCard.html index 99f31f893..c3dfe26c0 100644 --- a/public/views/preferencesBitpayCard.html +++ b/public/views/preferencesBitpayCard.html @@ -8,9 +8,9 @@ Preferences
- +
    -
  • +
  • Log out
diff --git a/src/js/controllers/bitpayCard.js b/src/js/controllers/bitpayCard.js index d04118af0..fe199d85d 100644 --- a/src/js/controllers/bitpayCard.js +++ b/src/js/controllers/bitpayCard.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('bitpayCardController', function($scope, $timeout, $log, lodash, bitpayCardService, configService, profileService, walletService, ongoingProcess, pbkdf2Service, moment, popupService) { +angular.module('copayApp.controllers').controller('bitpayCardController', function($scope, $timeout, $log, lodash, bitpayCardService, configService, profileService, walletService, ongoingProcess, pbkdf2Service, moment, popupService, gettextCatalog, bwcError) { var self = this; var wallet; @@ -168,6 +168,7 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi }; walletService.createTx(wallet, txp, function(err, createdTxp) { + ongoingProcess.set('Processing Transaction...', false); if (err) { popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err)); return; diff --git a/src/js/controllers/preferencesBitpayCard.js b/src/js/controllers/preferencesBitpayCard.js index 991d91c74..8a297c8aa 100644 --- a/src/js/controllers/preferencesBitpayCard.js +++ b/src/js/controllers/preferencesBitpayCard.js @@ -1,15 +1,20 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesBitpayCardController', - function($scope, $ionicModal, bitpayCardService) { + function($scope, $state, $timeout, bitpayCardService, popupService) { - this.logout = function() { - $ionicModal.fromTemplateUrl('views/modals/bitpay-card-confirmation.html', { - scope: $scope, - animation: 'slide-in-up' - }).then(function(modal) { - $scope.bitpayCardConfirmationModal = modal; - $scope.bitpayCardConfirmationModal.show(); + $scope.logout = function() { + var title = 'Are you sure you would like to log out of your Bitpay Card account?'; + popupService.showConfirm(title, null, function(res) { + if (res) logout(); + }); + }; + + var logout = function() { + bitpayCardService.logout(function() { + $timeout(function() { + $state.go('bitpayCard.main'); + }, 100); }); }; diff --git a/src/sass/main.scss b/src/sass/main.scss index 0f218dd75..56ca04354 100644 --- a/src/sass/main.scss +++ b/src/sass/main.scss @@ -995,5 +995,6 @@ input[type=number] { @import "views/add"; @import "views/tab-home"; @import "views/walletDetails"; +@import "views/bitpayCard"; @import 'views/onboarding/onboarding'; @import "views/includes/walletActivity"; diff --git a/src/sass/views/bitpayCard.scss b/src/sass/views/bitpayCard.scss new file mode 100644 index 000000000..4d431a4d4 --- /dev/null +++ b/src/sass/views/bitpayCard.scss @@ -0,0 +1,16 @@ +#bitpayCard { + .amount { + width: 100%; + text-align: center; + padding: 2rem 1rem 1.5rem 1rem; + min-height: 115px; + margin-bottom: 25px; + border-color: #172565; + background-color: #1e3186; + background-image: linear-gradient(0deg, #172565, #172565 0%, transparent 0%); + color: #fff; + } + strong { + line-height: 100%; + } +} diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index 633f076ee..dc2ac38eb 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -1,6 +1,7 @@ #walletDetails { .bar-header { border: 0; + background: none; .title, .button { color: #fff; } From 42a8eaa1199e1302055da4af0f6905a4ea6cadf2 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 7 Sep 2016 10:49:47 -0300 Subject: [PATCH 02/12] Fix button to skip onboarding-email --- public/views/onboarding/collectEmail.html | 8 +++----- src/sass/views/onboarding/onboard-collect-email.scss | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/public/views/onboarding/collectEmail.html b/public/views/onboarding/collectEmail.html index 5145b53e7..7505add47 100644 --- a/public/views/onboarding/collectEmail.html +++ b/public/views/onboarding/collectEmail.html @@ -16,11 +16,9 @@ -
- -
+
diff --git a/src/sass/views/onboarding/onboard-collect-email.scss b/src/sass/views/onboarding/onboard-collect-email.scss index ea71241ee..41edf34bf 100644 --- a/src/sass/views/onboarding/onboard-collect-email.scss +++ b/src/sass/views/onboarding/onboard-collect-email.scss @@ -14,14 +14,14 @@ opacity: 1; background: #fff; color: rgb(108, 108, 108); - height: 13rem; + height: 14rem; animation-name: topBottom; animation-iteration-count: 1; animation-timing-function: ease-in; animation-duration: 1s; animation-delay: 2s; position: absolute; - bottom: -13rem; + bottom: -14rem; animation-fill-mode: forwards; z-index: 5; margin-top: 0; From dd9e48df1497bb384256e37bf10a87ac872d882c Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 7 Sep 2016 12:23:09 -0300 Subject: [PATCH 03/12] complete export process --- public/views/export.html | 29 ++-- public/views/preferencesAdvanced.html | 2 +- public/views/tab-export-file.html | 189 ++++++++++++-------------- public/views/tab-export-qrCode.html | 33 ++--- src/js/controllers/export.js | 53 +++++--- src/js/routes.js | 19 --- 6 files changed, 150 insertions(+), 175 deletions(-) diff --git a/public/views/export.html b/public/views/export.html index 563513f03..0d17c0124 100644 --- a/public/views/export.html +++ b/public/views/export.html @@ -1,13 +1,22 @@ - - + + + {{'Export wallet' | translate}} + + + + - - - + +
+
+ File/Text +
+
+ QR Code +
+
- - - - -
+
+
+
diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index e2a87c140..e63d6eb8c 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -17,7 +17,7 @@ Sweep paper wallet - + Export Wallet diff --git a/public/views/tab-export-file.html b/public/views/tab-export-file.html index 6e64f2fce..70fc041c4 100644 --- a/public/views/tab-export-file.html +++ b/public/views/tab-export-file.html @@ -1,104 +1,93 @@ - - - {{'Export Wallet' | translate}} - - - - +
+
+ + Failed to export +
- +
+
+ -
-
- - Failed to export -
- - - - - - - - Show advanced options - Hide advanced options - - - - Do not include private key - - -
- - - - WARNING: The private key of this wallet is not available. The export allows to check the wallet balance, transaction history, and create spend proposals from the export. However, does not allow to approve (sign) proposals, so funds will not be accessible from the export. - - -
- -
- - - - WARNING: Not including the private key allows to check the wallet balance, transaction history, and create spend proposals from the export. However, does not allow to approve (sign) proposals, so funds will not be accessible from the export. - - -
- - - - -
-

Export options

- - -
+
+ -
-
-

Wallet Export

-
- -
-
- - Copy this text as it is to a safe place (notepad or email) -
-
-
- - + + Show advanced options + Hide advanced options + + +
+ + Do not include private key + +
+ +
+ + + + WARNING: The private key of this wallet is not available. The export allows to check the wallet balance, transaction history, and create spend proposals from the export. However, does not allow to approve (sign) proposals, so funds will not be accessible from the export. + + +
+ +
+ + + + WARNING: Not including the private key allows to check the wallet balance, transaction history, and create spend proposals from the export. However, does not allow to approve (sign) proposals, so funds will not be accessible from the export. + + +
+ + + + + +
+

Export options

+ + +
+
+ +
+ +
+ +

Copy this text as it is to a safe place (notepad or email)

+
+
\ No newline at end of file diff --git a/public/views/tab-export-qrCode.html b/public/views/tab-export-qrCode.html index b6254e42d..18ca08122 100644 --- a/public/views/tab-export-qrCode.html +++ b/public/views/tab-export-qrCode.html @@ -1,25 +1,10 @@ - - - {{'Export Wallet' | translate}} - - - - +
+
+ +
+
From the destination device, go to Add wallet > Import wallet and scan this QR code
+
- - -
-
- -
-
From the destination device, go to Add wallet > Import wallet and scan this QR code
-
- -
-
Exporting via QR not supported for this wallet
-
- -
-
+
+
Exporting via QR not supported for this wallet
+
diff --git a/src/js/controllers/export.js b/src/js/controllers/export.js index 1e4d78e47..c68443750 100644 --- a/src/js/controllers/export.js +++ b/src/js/controllers/export.js @@ -5,16 +5,14 @@ angular.module('copayApp.controllers').controller('exportController', var prevState; var isWP = platformInfo.isWP; var isAndroid = platformInfo.isAndroid; - var wallet = profileService.getWallet($stateParams.walletId); - $scope.isEncrypted = wallet.isPrivKeyEncrypted(); - $scope.isCordova = platformInfo.isCordova; - $scope.isSafari = platformInfo.isSafari; $scope.init = function() { - $scope.supported = true; - $scope.exportQR = false; - $scope.noSignEnabled = false; + $scope.formData = {}; + $scope.isEncrypted = wallet.isPrivKeyEncrypted(); + $scope.isCordova = platformInfo.isCordova; + $scope.isSafari = platformInfo.isSafari; + $scope.formData.noSignEnabled = false; $scope.showAdvanced = false; $scope.wallet = wallet; $scope.canSign = wallet.canSign(); @@ -22,13 +20,15 @@ angular.module('copayApp.controllers').controller('exportController', walletService.getEncodedWalletInfo(wallet, function(err, code) { if (err || !code) { $log.warn(err); - return $state.go('wallet.preferencesAdvanced') + return $ionicHistory.goBack(); } if (!code) - $scope.supported = false; - else - $scope.exportWalletInfo = code; + $scope.formData.supported = false; + else { + $scope.formData.supported = true; + $scope.formData.exportWalletInfo = code; + } $timeout(function() { $scope.$apply(); @@ -38,14 +38,25 @@ angular.module('copayApp.controllers').controller('exportController', /* EXPORT WITHOUT PRIVATE KEY - PENDING + */ $scope.noSignEnabledChange = function() { - $scope.exportWalletInfo = encodeWalletInfo(); - $timeout(function() { - $scope.$apply(); - }, 1); + if (!$scope.supported) return; + + walletService.getEncodedWalletInfo(wallet, function(err, code) { + if (err) { + $log.error(err); + $scope.formData.supported = false; + $scope.formData.exportWalletInfo = null; + } else { + $scope.formData.supported = true; + $scope.formData.exportWalletInfo = code; + } + $timeout(function() { + $scope.$apply(); + }, 1); + }); }; - */ $scope.downloadWalletBackup = function() { $scope.getAddressbook(function(err, localAddressBook) { @@ -54,11 +65,11 @@ angular.module('copayApp.controllers').controller('exportController', return; } var opts = { - noSign: $scope.noSignEnabled, + noSign: $scope.formData.noSignEnabled, addressBook: localAddressBook }; - backupService.walletDownload($scope.password, opts, function(err) { + backupService.walletDownload($scope.formData.password, opts, function(err) { if (err) { popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Failed to export')); return; @@ -91,11 +102,11 @@ angular.module('copayApp.controllers').controller('exportController', return cb(null); } var opts = { - noSign: $scope.noSignEnabled, + noSign: $scope.formData.noSignEnabled, addressBook: localAddressBook }; - var ew = backupService.walletExport($scope.password, opts); + var ew = backupService.walletExport($scope.formData.password, opts); if (!ew) { popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Failed to export')); } @@ -132,7 +143,7 @@ angular.module('copayApp.controllers').controller('exportController', var ew = backup; if (!ew) return; - if ($scope.noSignEnabled) + if ($scope.formData.noSignEnabled) name = name + '(No Private Key)'; var subject = 'Copay Wallet Backup: ' + name; diff --git a/src/js/routes.js b/src/js/routes.js index 1b8f754d0..70a2041e6 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -459,7 +459,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }) .state('tabs.preferences.export', { - abstract: true, url: '/export', views: { 'preferences': { @@ -467,24 +466,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } } }) - .state('tabs.preferences.export.file', { - url: '/tab-export-file', - needProfile: true, - views: { - 'tab-export-file': { - templateUrl: 'views/tab-export-file.html', - }, - } - }) - .state('tabs.preferences.export.qrCode', { - url: '/tab-export-qrCode', - needProfile: true, - views: { - 'tab-export-qrCode': { - templateUrl: 'views/tab-export-qrCode.html', - }, - } - }) .state('tabs.preferences.preferencesBwsUrl', { url: '/preferencesBwsUrl', views: { From 419c1e617bb5a37d89e17ac6c14c98121f77646e Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 7 Sep 2016 12:27:28 -0300 Subject: [PATCH 04/12] clean --- src/js/controllers/export.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/js/controllers/export.js b/src/js/controllers/export.js index c68443750..5dd718955 100644 --- a/src/js/controllers/export.js +++ b/src/js/controllers/export.js @@ -1,10 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('exportController', - function($rootScope, $scope, $timeout, $log, $ionicHistory, lodash, backupService, walletService, storageService, profileService, platformInfo, gettext, gettextCatalog, $state, $stateParams, popupService) { - var prevState; - var isWP = platformInfo.isWP; - var isAndroid = platformInfo.isAndroid; + function($scope, $timeout, $log, $ionicHistory, backupService, walletService, storageService, profileService, platformInfo, gettextCatalog, $state, $stateParams, popupService) { var wallet = profileService.getWallet($stateParams.walletId); $scope.init = function() { @@ -41,7 +38,7 @@ angular.module('copayApp.controllers').controller('exportController', */ $scope.noSignEnabledChange = function() { - if (!$scope.supported) return; + if (!$scope.formData.supported) return; walletService.getEncodedWalletInfo(wallet, function(err, code) { if (err) { From 040b2e6627c7af1d2b4d2c88c4557852c9c2ba6c Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 7 Sep 2016 13:34:47 -0300 Subject: [PATCH 05/12] Fix modals tx, txp and search --- public/views/modals/search.html | 70 +++---- public/views/modals/tx-details.html | 288 +++++++++++++-------------- public/views/modals/txp-details.html | 174 +++++++--------- public/views/tab-settings.html | 3 +- public/views/walletDetails.html | 102 +++++----- src/sass/common.scss | 4 + src/sass/main.scss | 2 +- src/sass/views/walletDetails.scss | 12 +- 8 files changed, 309 insertions(+), 346 deletions(-) diff --git a/public/views/modals/search.html b/public/views/modals/search.html index 0f9bd863a..497061603 100644 --- a/public/views/modals/search.html +++ b/public/views/modals/search.html @@ -1,11 +1,11 @@ - -
- - Close - + + +
+ Search Transactions
-

Search Transactions

@@ -18,14 +18,33 @@
-
-
- sync - sync - sync -
+
-
+ + + + + - + + (possible double spend) + + + {{btx.amountStr}} + + +

+ + + Unconfirmed + +

+
+ + sync + sync + sync + +

{{btx.note.body}}

@@ -49,31 +68,8 @@
Invalid -

+ -
- - + - - - - (possible double spend) - - - {{btx.amountStr}} - - -

- - - Unconfirmed - -

-
- -
- -
{{filteredTxHistory.length - txHistorySearchResults.length}} more diff --git a/public/views/modals/tx-details.html b/public/views/modals/tx-details.html index 48a92f8c6..3052c391d 100644 --- a/public/views/modals/tx-details.html +++ b/public/views/modals/tx-details.html @@ -1,163 +1,159 @@ - -
- - Close - + + +
+ Transaction
-

Transaction

- -