From 703256d92f5b8657fc38ee5354af7b0b6682f4f8 Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Fri, 28 Oct 2016 11:45:23 -0400 Subject: [PATCH 01/18] fix(design): use max balance on home view, display available/confirming better in wallet Fixes #4881 --- src/js/services/walletService.js | 1 + www/views/tab-home.html | 2 +- www/views/walletDetails.html | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index 65b644ebb..e53a3b1d0 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -220,6 +220,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim cache.totalBalanceStr = txFormatService.formatAmount(cache.totalBalanceSat) + ' ' + cache.unitName; cache.lockedBalanceStr = txFormatService.formatAmount(cache.lockedBalanceSat) + ' ' + cache.unitName; cache.availableBalanceStr = txFormatService.formatAmount(cache.availableBalanceSat) + ' ' + cache.unitName; + cache.pendingBalanceStr = txFormatService.formatAmount(cache.totalBalanceSat + cache.pendingAmount) + ' ' + cache.unitName; if (cache.pendingAmount) { cache.pendingAmountStr = txFormatService.formatAmount(cache.pendingAmount) + ' ' + cache.unitName; diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 865afc0bc..1b4c611f1 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -83,7 +83,7 @@ Incomplete - {{wallet.status.availableBalanceStr}} + {{wallet.status.pendingBalanceStr}} [Balance Hidden] {{wallet.m}}-of-{{wallet.n}} diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 1526a0688..d9ee9e4ae 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -37,10 +37,11 @@
- {{status.totalBalanceStr}} -
{{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
-
- Pending Confirmation: {{status.pendingAmountStr}} + {{status.totalBalanceStr}} +
{{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
+
+
Available: {{status.totalBalanceStr}}
+
Confirming: {{status.pendingAmountStr}}
From 98ab684b05554b13940986efa2bcf1b66dca3bf1 Mon Sep 17 00:00:00 2001 From: Jamal Jackson Date: Fri, 28 Oct 2016 15:27:29 -0400 Subject: [PATCH 02/18] turned icon checkbox from on boarding into svgs --- .../views/onboarding/onboard-disclaimer.scss | 28 +++++++++---------- www/img/onboarding-checkbox-checked.svg | 8 ++++++ www/img/onboarding-checkbox-unchecked.svg | 7 +++++ 3 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 www/img/onboarding-checkbox-checked.svg create mode 100644 www/img/onboarding-checkbox-unchecked.svg diff --git a/src/sass/views/onboarding/onboard-disclaimer.scss b/src/sass/views/onboarding/onboard-disclaimer.scss index 68ca6ec7c..a4e409531 100644 --- a/src/sass/views/onboarding/onboard-disclaimer.scss +++ b/src/sass/views/onboarding/onboard-disclaimer.scss @@ -49,24 +49,23 @@ color: #fff; text-align: left; .checkbox input:before, + .checkbox .checkbox-icon:before, + .checkbox input:after, + .checkbox-icon:after, + .checkbox input:checked:after, + input:checked + .checkbox-icon:after{ + border:none; + } + .checkbox input:before, .checkbox .checkbox-icon:before { - border-radius: 50% !important; - background: none; - border-width: 2px; - padding: .9rem; + padding: 1.1rem; position: relative; - left: -7px; - top: -8px; + background:url("../img/onboarding-checkbox-unchecked.svg") top center no-repeat; } .checkbox input:checked:before, .checkbox input:checked + .checkbox-icon:before { - border-color: rgb(19, 229, 182); - } - .checkbox input:checked:after, - input:checked + .checkbox-icon:after { - border-color: rgb(19, 229, 182); - top: 4px; - left: 3px; + border:none; + background:url("../img/onboarding-checkbox-checked.svg") top center no-repeat; } .item-content { width: 90%; @@ -76,7 +75,8 @@ } .item-checkbox .checkbox { margin-left: 3%; - top:44%; + top:30%; + left:0; } #agree-to-terms { background: #fff; diff --git a/www/img/onboarding-checkbox-checked.svg b/www/img/onboarding-checkbox-checked.svg new file mode 100644 index 000000000..bf54b2aab --- /dev/null +++ b/www/img/onboarding-checkbox-checked.svg @@ -0,0 +1,8 @@ + + Created with Sketch. + + + + + + diff --git a/www/img/onboarding-checkbox-unchecked.svg b/www/img/onboarding-checkbox-unchecked.svg new file mode 100644 index 000000000..48c3adfae --- /dev/null +++ b/www/img/onboarding-checkbox-unchecked.svg @@ -0,0 +1,7 @@ + + + + Created with Sketch. + + + From 2dace508162fcf1431bfa8e84bb629aea9113d97 Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 31 Oct 2016 14:08:52 -0300 Subject: [PATCH 03/18] move to notification settings --- .../controllers/preferencesNotifications.js | 128 ++++++++++++------ src/js/services/configService.js | 4 + src/js/services/emailService.js | 40 ++++++ www/views/preferencesNotifications.html | 31 ++++- www/views/tab-settings.html | 2 +- 5 files changed, 161 insertions(+), 44 deletions(-) create mode 100644 src/js/services/emailService.js diff --git a/src/js/controllers/preferencesNotifications.js b/src/js/controllers/preferencesNotifications.js index 5cf80a4af..f273bc403 100644 --- a/src/js/controllers/preferencesNotifications.js +++ b/src/js/controllers/preferencesNotifications.js @@ -1,49 +1,97 @@ 'use strict'; -angular.module('copayApp.controllers').controller('preferencesNotificationsController', - function($scope, $rootScope, $log, $window, lodash, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService) { +angular.module('copayApp.controllers').controller('preferencesNotificationsController', function($scope, $log, $timeout, $window, lodash, configService, platformInfo, pushNotificationsService, profileService, emailService) { + var updateConfig = function() { + var config = configService.getSync(); + $scope.appName = $window.appConfig.nameCase; + $scope.PNEnabledByUser = true; + $scope.usePushNotifications = platformInfo.isCordova && !platformInfo.isWP; + $scope.isIOSApp = platformInfo.isIOS && platformInfo.isCordova; - var updateConfig = function() { - - var config = configService.getSync(); - var isCordova = platformInfo.isCordova; - var isIOS = platformInfo.isIOS; - - $scope.appName = $window.appConfig.nameCase; - $scope.PNEnabledByUser = true; - $scope.isIOSApp = isIOS && isCordova; - if ($scope.isIOSApp) { - try { - PushNotification.hasPermission(function(data) { - $scope.PNEnabledByUser = data.isEnabled; - }); - } catch(e) { - $log.error(e); - }; - } - - $scope.pushNotifications = { - value: config.pushNotifications.enabled - }; + $scope.pushNotifications = { + value: config.pushNotifications.enabled }; - $scope.pushNotificationsChange = function() { - if (!$scope.pushNotifications) return; - var opts = { - pushNotifications: { - enabled: $scope.pushNotifications.value - } - }; - configService.set(opts, function(err) { - if (opts.pushNotifications.enabled) - profileService.pushNotificationsInit(); - else - pushNotificationsService.disableNotifications(profileService.getWallets()); - if (err) $log.debug(err); - }); + $scope.latestEmail = { + value: getLatestEmailConfig() }; - $scope.$on("$ionicView.enter", function(event, data) { - updateConfig(); + $scope.newEmail = lodash.clone($scope.latestEmail); + var isEmailEnabled = config.emailNotifications ? config.emailNotifications.enabled : false; + + $scope.emailNotifications = { + value: isEmailEnabled && $scope.newEmail.value ? true : false + }; + + $timeout(function() { + $scope.$apply(); }); + }; + + $scope.pushNotificationsChange = function() { + if (!$scope.pushNotifications) return; + var opts = { + pushNotifications: { + enabled: $scope.pushNotifications.value + } + }; + configService.set(opts, function(err) { + if (opts.pushNotifications.enabled) + profileService.pushNotificationsInit(); + else + pushNotificationsService.disableNotifications(profileService.getWallets()); + if (err) $log.debug(err); + }); + }; + + $scope.emailNotificationsChange = function() { + var opts = { + emailNotifications: { + enabled: $scope.emailNotifications.value + } + }; + configService.set(opts, function(err) { + if (err) $log.debug(err); + }); + + $scope.latestEmail = { + value: getLatestEmailConfig() + }; + + $scope.newEmail = lodash.clone($scope.latestEmail); + + if (!$scope.emailNotifications.value) { + emailService.enableEmailNotifications({ + enabled: $scope.emailNotifications.value, + email: null + }); + } + $timeout(function() { + $scope.$apply(); + }); + }; + + $scope.save = function() { + emailService.enableEmailNotifications({ + enabled: $scope.emailNotifications.value, + email: $scope.newEmail.value + }); + + $scope.latestEmail = { + value: $scope.newEmail.value + }; + + $timeout(function() { + $scope.$apply(); + }); + }; + + function getLatestEmailConfig() { + var config = configService.getSync(); + return config.emailFor ? lodash.values(config.emailFor)[0] : null; + }; + + $scope.$on("$ionicView.enter", function(event, data) { + updateConfig(); }); +}); diff --git a/src/js/services/configService.js b/src/js/services/configService.js index c766c0582..618118e35 100644 --- a/src/js/services/configService.js +++ b/src/js/services/configService.js @@ -85,6 +85,10 @@ angular.module('copayApp.services').factory('configService', function(storageSer windows: {}, } }, + + emailNotifications: { + enabled: false, + }, }; var configCache = null; diff --git a/src/js/services/emailService.js b/src/js/services/emailService.js new file mode 100644 index 000000000..4712c77e4 --- /dev/null +++ b/src/js/services/emailService.js @@ -0,0 +1,40 @@ +'use strict'; + +angular.module('copayApp.services').factory('emailService', function($log, configService, profileService, lodash, walletService) { + var root = {}; + + root.enableEmailNotifications = function(opts) { + opts = opts || {}; + + var wallets = profileService.getWallets(); + var keys = lodash.map(wallets, function(w) { + return w.credentials.walletId; + }); + + lodash.each(wallets, function(w) { + walletService.updateRemotePreferences(w, { + email: opts.enabled ? opts.email : null + }, function(err) { + if (err) $log.warn(err); + }); + }); + + var config = configService.getSync(); + if (!config.emailFor) + config.emailFor = {}; + + lodash.each(keys, function(k) { + config.emailFor[k] = opts.email; + }); + + if (!opts.enabled) return; + + configService.set({ + emailFor: config.emailFor + }, function(err) { + if (err) $log.debug(err); + }); + }; + + return root; +}); diff --git a/www/views/preferencesNotifications.html b/www/views/preferencesNotifications.html index 7385fd380..527b99edc 100644 --- a/www/views/preferencesNotifications.html +++ b/www/views/preferencesNotifications.html @@ -7,15 +7,40 @@
-
+
Notifications
- + Enable push notifications + + + Enable email notifications + + +
+
+
+ You'll receive email notifications about payments sent and received from {{wallet.name}}. +
+
+ +
+
+ +
+ +
+
-
+
Notifications
Push notifications for {{appName}} are currently disabled. Enable them in the Settings app. diff --git a/www/views/tab-settings.html b/www/views/tab-settings.html index f624537e4..075ff0a81 100644 --- a/www/views/tab-settings.html +++ b/www/views/tab-settings.html @@ -39,7 +39,7 @@
Preferences
- + From bbfda41f66d57bc78e5d5f4e50157b761a2cd957 Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 31 Oct 2016 15:54:59 -0300 Subject: [PATCH 04/18] remove unused files --- src/js/controllers/preferencesEmail.js | 32 -------------------------- www/views/preferences.html | 8 ------- www/views/preferencesEmail.html | 30 ------------------------ 3 files changed, 70 deletions(-) delete mode 100644 src/js/controllers/preferencesEmail.js delete mode 100644 www/views/preferencesEmail.html diff --git a/src/js/controllers/preferencesEmail.js b/src/js/controllers/preferencesEmail.js deleted file mode 100644 index c865c67dc..000000000 --- a/src/js/controllers/preferencesEmail.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -angular.module('copayApp.controllers').controller('preferencesEmailController', function($scope, $ionicHistory, $stateParams, gettextCatalog, profileService, walletService, configService) { - - $scope.wallet = profileService.getWallet($stateParams.walletId); - var walletId = $scope.wallet.credentials.walletId; - - var config = configService.getSync(); - config.emailFor = config.emailFor || {}; - $scope.emailForExist = config.emailFor && config.emailFor[walletId]; - $scope.email = { - value: config.emailFor && config.emailFor[walletId] - }; - - - $scope.save = function(val) { - var opts = { - emailFor: {} - }; - opts.emailFor[walletId] = val; - - walletService.updateRemotePreferences($scope.wallet, { - email: val, - }, function(err) { - if (err) $log.warn(err); - configService.set(opts, function(err) { - if (err) $log.warn(err); - $ionicHistory.goBack(); - }); - }); - }; -}); diff --git a/www/views/preferences.html b/www/views/preferences.html index 81fb6a19a..35b787557 100644 --- a/www/views/preferences.html +++ b/www/views/preferences.html @@ -29,14 +29,6 @@ - - Email Notifications - - Disabled - {{wallet.email}} - - -
Security
diff --git a/www/views/preferencesEmail.html b/www/views/preferencesEmail.html deleted file mode 100644 index 4b97bdd6f..000000000 --- a/www/views/preferencesEmail.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - {{'Email Notifications'|translate}} - - - - - -
-
- You'll receive email notifications about payments sent and received from {{wallet.name}}. -
- Remove email notifications -
-
-
- -
- -
-
-
From 5f8e3c1f778e80c15fca8d665871157260a4941e Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 31 Oct 2016 16:13:56 -0300 Subject: [PATCH 05/18] fix description --- www/views/preferencesNotifications.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/views/preferencesNotifications.html b/www/views/preferencesNotifications.html index 527b99edc..5a5b95927 100644 --- a/www/views/preferencesNotifications.html +++ b/www/views/preferencesNotifications.html @@ -21,7 +21,7 @@
- You'll receive email notifications about payments sent and received from {{wallet.name}}. + You'll receive email notifications about payments sent and received from your wallets.
From 2de90013f7f543e59f9bba63e53de85c82ef02c5 Mon Sep 17 00:00:00 2001 From: homeopatchy Date: Mon, 31 Oct 2016 20:29:48 +0100 Subject: [PATCH 06/18] Add webkit prefixed transforms (android 4) --- src/sass/mixins/layout.scss | 3 ++- src/sass/views/includes/actionSheet.scss | 2 ++ src/sass/views/includes/clickToAccept.scss | 4 ++++ src/sass/views/includes/modals/modals.scss | 1 + src/sass/views/includes/slideToAccept.scss | 7 +++++++ src/sass/views/includes/slideToAcceptSuccess.scss | 7 +++++++ src/sass/views/includes/txp-details.scss | 2 ++ src/sass/views/includes/wallets.scss | 1 + src/sass/views/tab-receive.scss | 4 ++++ 9 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/sass/mixins/layout.scss b/src/sass/mixins/layout.scss index 4d1934eae..b03d53800 100644 --- a/src/sass/mixins/layout.scss +++ b/src/sass/mixins/layout.scss @@ -5,6 +5,7 @@ @mixin absolute-center() { position: absolute; + -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%; left: 50%; @@ -16,4 +17,4 @@ .absolute-center{ @include absolute-center(); -} \ No newline at end of file +} diff --git a/src/sass/views/includes/actionSheet.scss b/src/sass/views/includes/actionSheet.scss index 5e9fb7fd4..75319e2b1 100644 --- a/src/sass/views/includes/actionSheet.scss +++ b/src/sass/views/includes/actionSheet.scss @@ -8,6 +8,7 @@ action-sheet { position: fixed; bottom: 0; left: 50%; + -webkit-transform: translateY(100%) translateX(-50%); transform: translateY(100%) translateX(-50%); transition: transform 250ms cubic-bezier(0.4, 0.0, 0.2, 1); z-index: 100; @@ -21,6 +22,7 @@ action-sheet { overflow: scroll; &.slide-up { + -webkit-transform: translateY(0) translateX(-50%); transform: translateY(0) translateX(-50%); box-shadow: 0px 2px 13px 3px rgba(0, 0, 0, .3); } diff --git a/src/sass/views/includes/clickToAccept.scss b/src/sass/views/includes/clickToAccept.scss index f5822b0fe..9eb8098e0 100644 --- a/src/sass/views/includes/clickToAccept.scss +++ b/src/sass/views/includes/clickToAccept.scss @@ -14,12 +14,14 @@ click-to-accept { width: 100%; z-index: 4; text-transform: capitalize; + -webkit-transform: translateY(2rem); transform: translateY(2rem); opacity: 0; pointer-events: none; &.enter { transition: transform 250ms ease, opacity 250ms ease; + -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; } @@ -37,9 +39,11 @@ click-to-accept { @keyframes spin { from { + -webkit-transform:rotate(0deg); transform:rotate(0deg); } to { + -webkit-transform:rotate(360deg); transform:rotate(360deg); } } diff --git a/src/sass/views/includes/modals/modals.scss b/src/sass/views/includes/modals/modals.scss index 742148e01..af025f0c5 100644 --- a/src/sass/views/includes/modals/modals.scss +++ b/src/sass/views/includes/modals/modals.scss @@ -6,6 +6,7 @@ z-index: 10; width: 90%; max-width: 350px; + -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); border-radius: $unmistakable-radius; text-align: center; diff --git a/src/sass/views/includes/slideToAccept.scss b/src/sass/views/includes/slideToAccept.scss index 55ef91f06..3a2062b31 100644 --- a/src/sass/views/includes/slideToAccept.scss +++ b/src/sass/views/includes/slideToAccept.scss @@ -27,6 +27,7 @@ slide-to-accept { height: 100%; width: 100%; background: $slider-bg-color; + -webkit-transform: translateX(0); transform: translateX(0); margin-left: -100%; z-index: 2; @@ -55,6 +56,7 @@ slide-to-accept { right: -71px; border-radius: 50%; top: 50%; + -webkit-transform: translateY(-47%); transform: translateY(-47%); } @@ -65,6 +67,7 @@ slide-to-accept { z-index: 3; > img { + -webkit-transform: rotateZ(-5deg); transform: rotateZ(-5deg); } } @@ -91,11 +94,13 @@ slide-to-accept { font-size: 17px; letter-spacing: 0.02rem; text-transform: capitalize; + -webkit-transform: translateY(2rem); transform: translateY(2rem); opacity: 0; &.enter { transition: transform 250ms ease, opacity 250ms ease; + -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; } @@ -117,9 +122,11 @@ slide-to-accept { @keyframes spin { from { + -webkit-transform:rotate(0deg); transform:rotate(0deg); } to { + -webkit-transform:rotate(360deg); transform:rotate(360deg); } } diff --git a/src/sass/views/includes/slideToAcceptSuccess.scss b/src/sass/views/includes/slideToAcceptSuccess.scss index fe9b75969..cd825766a 100644 --- a/src/sass/views/includes/slideToAcceptSuccess.scss +++ b/src/sass/views/includes/slideToAcceptSuccess.scss @@ -27,6 +27,7 @@ slide-to-accept-success { transition: transform $duration*1.5 ease, background $duration*1.5 ease; &.fill-screen { + -webkit-transform: scale3d($scale-factor, $scale-factor, 1) translateY(-40%); transform: scale3d($scale-factor, $scale-factor, 1) translateY(-40%); background: $success-bg-color; } @@ -39,12 +40,14 @@ slide-to-accept-success { > img { margin-bottom: 1.8rem; + -webkit-transform: translateY(5rem); transform: translateY(5rem); opacity: 0; transition: transform $duration ease, opacity $duration ease; transition-delay: 200ms; &.reveal { + -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; } @@ -53,12 +56,14 @@ slide-to-accept-success { &__header { color: #FFFFFF; font-size: 26px; + -webkit-transform: translateY(5rem); transform: translateY(5rem); opacity: 0; transition: transform $duration ease, opacity $duration ease; transition-delay: 250ms; &.reveal { + -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; } @@ -71,12 +76,14 @@ slide-to-accept-success { bottom: 0; padding: 0 1.75rem; width: 100%; + -webkit-transform: translateY(5rem); transform: translateY(5rem); opacity: 0; transition: transform $duration ease, opacity $duration ease; transition-delay: 250ms; &.reveal { + -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; } diff --git a/src/sass/views/includes/txp-details.scss b/src/sass/views/includes/txp-details.scss index 5bb8fd467..8c5e7c723 100644 --- a/src/sass/views/includes/txp-details.scss +++ b/src/sass/views/includes/txp-details.scss @@ -179,6 +179,7 @@ width: 1px; position: absolute; left: 50%; + -webkit-transform: translateX(-50%) translateY(-100%); transform: translateX(-50%) translateY(-100%); top: 0; } @@ -190,6 +191,7 @@ width: 1px; position: absolute; left: 50%; + -webkit-transform: translateX(-50%) translateY(100%); transform: translateX(-50%) translateY(100%); bottom: 0; } diff --git a/src/sass/views/includes/wallets.scss b/src/sass/views/includes/wallets.scss index 677486c6b..a3e1a4320 100644 --- a/src/sass/views/includes/wallets.scss +++ b/src/sass/views/includes/wallets.scss @@ -60,6 +60,7 @@ &.swiper-slide-prev, &.swiper-slide-next { opacity: .3; + -webkit-transform: scale(.8); transform: scale(.8); } &.swiper-slide-prev { diff --git a/src/sass/views/tab-receive.scss b/src/sass/views/tab-receive.scss index d63300fa0..1b18083c0 100644 --- a/src/sass/views/tab-receive.scss +++ b/src/sass/views/tab-receive.scss @@ -99,6 +99,7 @@ .qr{ padding:6vh 0 0; div{ + -webkit-transform: scale(.7); transform: scale(.7); } } @@ -119,6 +120,7 @@ top: -9px; position: absolute; left: 50%; + -webkit-transform: translateX(-50%); transform: translateX(-50%); z-index: 2; } @@ -171,9 +173,11 @@ position: absolute; left: 50%; top: 50%; + -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); @media (max-height: 600px){ &{ + -webkit-transform: translate(-50%, -58%); transform: translate(-50%, -58%); } } From a4ee470a3c3687af0e226570d490a23cf24f7d0f Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Mon, 31 Oct 2016 15:33:32 -0400 Subject: [PATCH 07/18] fix(walletService): handle cache.pendingAmount === null properly --- src/js/services/walletService.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index e53a3b1d0..8ea473cf5 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -220,9 +220,9 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim cache.totalBalanceStr = txFormatService.formatAmount(cache.totalBalanceSat) + ' ' + cache.unitName; cache.lockedBalanceStr = txFormatService.formatAmount(cache.lockedBalanceSat) + ' ' + cache.unitName; cache.availableBalanceStr = txFormatService.formatAmount(cache.availableBalanceSat) + ' ' + cache.unitName; - cache.pendingBalanceStr = txFormatService.formatAmount(cache.totalBalanceSat + cache.pendingAmount) + ' ' + cache.unitName; + cache.pendingBalanceStr = txFormatService.formatAmount(cache.totalBalanceSat + (cache.pendingAmount === null? 0 : cache.pendingAmount)) + ' ' + cache.unitName; - if (cache.pendingAmount) { + if (cache.pendingAmount !== null) { cache.pendingAmountStr = txFormatService.formatAmount(cache.pendingAmount) + ' ' + cache.unitName; } else { cache.pendingAmountStr = null; From d64cd5413b9ef3c5eab17fa6222e7914a19aed3f Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Mon, 31 Oct 2016 15:43:37 -0400 Subject: [PATCH 08/18] fix(walletService): cache.pendingAmount can be 0 --- src/js/services/walletService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index 8ea473cf5..a2dea86dc 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -222,7 +222,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim cache.availableBalanceStr = txFormatService.formatAmount(cache.availableBalanceSat) + ' ' + cache.unitName; cache.pendingBalanceStr = txFormatService.formatAmount(cache.totalBalanceSat + (cache.pendingAmount === null? 0 : cache.pendingAmount)) + ' ' + cache.unitName; - if (cache.pendingAmount !== null) { + if (cache.pendingAmount !== null && cache.pendingAmount !== 0) { cache.pendingAmountStr = txFormatService.formatAmount(cache.pendingAmount) + ' ' + cache.unitName; } else { cache.pendingAmountStr = null; From b481a0cdfa519834213742abf66e5bdcef83a712 Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 31 Oct 2016 16:46:45 -0300 Subject: [PATCH 09/18] remote unnecessary email route --- src/js/routes.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/js/routes.js b/src/js/routes.js index dde598bd4..6903a097b 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -276,7 +276,9 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr templateUrl: 'views/confirm.html' } }, - params: { paypro: null } + params: { + paypro: null + } }) .state('tabs.send.addressbook', { url: '/addressbook/add/:fromSendTab/:addressbookEntry', @@ -465,15 +467,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } } }) - .state('tabs.preferences.preferencesEmail', { - url: '/preferencesEmail', - views: { - 'tab-settings@tabs': { - controller: 'preferencesEmailController', - templateUrl: 'views/preferencesEmail.html' - } - } - }) .state('tabs.preferences.backupWarning', { url: '/backupWarning/:from', views: { @@ -892,7 +885,9 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr templateUrl: 'views/confirm.html' } }, - params: { paypro: null } + params: { + paypro: null + } }) .state('tabs.bitpayCard.preferences', { url: '/preferences', From 342c8e7ea6fce4177beccc468360060c61b7b531 Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 31 Oct 2016 16:52:16 -0300 Subject: [PATCH 10/18] fix display options --- www/views/preferencesNotifications.html | 55 ++++++++++++------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/www/views/preferencesNotifications.html b/www/views/preferencesNotifications.html index 5a5b95927..e380cd442 100644 --- a/www/views/preferencesNotifications.html +++ b/www/views/preferencesNotifications.html @@ -7,45 +7,44 @@
-
-
Notifications
+
Notifications
+
Enable push notifications - - - Enable email notifications - - -
-
-
- You'll receive email notifications about payments sent and received from your wallets. -
-
- -
-
- -
- -
-
-
Notifications
Push notifications for {{appName}} are currently disabled. Enable them in the Settings app.
+ + + Enable email notifications + + +
+
+
+ You'll receive email notifications about payments sent and received from your wallets. +
+
+ +
+
+ +
+ +
+
From 172ae4ae526fb1c0d68e215d5775140e5220fc6d Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 1 Nov 2016 12:03:24 -0300 Subject: [PATCH 11/18] fix amount --- src/js/controllers/amount.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index af7e7b9fd..a5ebe62df 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -239,10 +239,10 @@ angular.module('copayApp.controllers').controller('amountController', function($ }); } else { - var amount = $scope.showAlternativeAmount ? fromFiat(_amount).toFixed(unitDecimals) : _amount.toFixed(unitDecimals); + var amount = $scope.showAlternativeAmount ? fromFiat(_amount) : _amount; $state.transitionTo('tabs.send.confirm', { isWallet: $scope.isWallet, - toAmount: amount * unitToSatoshi, + toAmount: (amount * unitToSatoshi).toFixed(unitDecimals), toAddress: $scope.toAddress, toName: $scope.toName, toEmail: $scope.toEmail From e92d5a03334910850a1b70ff6898e4f68b183139 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 1 Nov 2016 13:47:57 -0300 Subject: [PATCH 12/18] fix decimal --- src/js/controllers/amount.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index a5ebe62df..5eee4d003 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -242,7 +242,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ var amount = $scope.showAlternativeAmount ? fromFiat(_amount) : _amount; $state.transitionTo('tabs.send.confirm', { isWallet: $scope.isWallet, - toAmount: (amount * unitToSatoshi).toFixed(unitDecimals), + toAmount: (amount * unitToSatoshi).toFixed(0), toAddress: $scope.toAddress, toName: $scope.toName, toEmail: $scope.toEmail From 00b193a47f6e086b2249fef5235dd059794c7bdc Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 1 Nov 2016 18:56:30 -0300 Subject: [PATCH 13/18] Fix slide to pay for desktop after click on registered uri --- src/js/controllers/confirm.js | 4 +--- www/views/confirm.html | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 4351b9369..3c8ac591d 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( var cachedTxp = {}; var isChromeApp = platformInfo.isChromeApp; var countDown = null; + $scope.isCordova = platformInfo.isCordova; $ionicConfig.views.swipeBackEnabled(false); $scope.$on("$ionicView.beforeEnter", function(event, data) { @@ -30,9 +31,6 @@ angular.module('copayApp.controllers').controller('confirmController', function( $log.error('Bad params at amount'); throw ('bad params'); } - $scope.isCordova = platformInfo.isCordova; - $scope.hasClick = platformInfo.hasClick; - $scope.data = {}; var config = configService.getSync().wallet; $scope.feeLevel = config.settings && config.settings.feeLevel ? config.settings.feeLevel : 'normal'; diff --git a/www/views/confirm.html b/www/views/confirm.html index 94bea675c..6c8dd10ac 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -7,7 +7,7 @@ - +
@@ -79,13 +79,13 @@
Click to pay Slide to pay From d3ee16e05b887849647a7b704c78a6f93e42d8d7 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 1 Nov 2016 18:58:00 -0300 Subject: [PATCH 14/18] Adds uri handler for macOS (Info.plist) --- Gruntfile.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 3c2064c2c..65e831f8f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -224,7 +224,15 @@ module.exports = function(grunt) { buildDir: './webkitbuilds', version: '0.16.0', macIcns: './resources/<%= pkg.name %>/mac/app.icns', - exeIco: './www/img/app/logo.ico' + exeIco: './www/img/app/logo.ico', + macPlist: { + 'CFBundleURLTypes': [ + { + 'CFBundleURLName' : 'URI Handler', + 'CFBundleURLSchemes' : ['bitcoin', '<%= pkg.name %>'] + } + ] + } }, src: ['./package.json', './www/**/*'] }, @@ -254,6 +262,7 @@ module.exports = function(grunt) { grunt.registerTask('translate', ['nggettext_extract']); grunt.registerTask('desktop', ['prod', 'nwjs', 'copy:linux', 'compress:linux']); grunt.registerTask('macos', ['prod', 'nwjs', 'exec:macos']); + grunt.registerTask('macos-debug', ['default', 'nwjs']); grunt.registerTask('chrome', ['exec:chrome']); grunt.registerTask('wp', ['prod', 'exec:wp']); grunt.registerTask('wp-copy', ['default', 'exec:wpcopy']); From ccfe998b9d60ef5b4adcd40a7917d22266671bda Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 1 Nov 2016 19:00:00 -0300 Subject: [PATCH 15/18] Fix hidden back button --- src/js/routes.js | 4 +++- src/js/services/incomingData.js | 16 ++++++++-------- src/js/services/openURL.js | 3 ++- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/js/routes.js b/src/js/routes.js index dde598bd4..f3e584a48 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -907,7 +907,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr .run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, $window, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService, scannerService) { uxLanguage.init(); - openURLService.init(); $ionicPlatform.ready(function() { if (platformInfo.isCordova) { @@ -999,6 +998,9 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr $log.debug('Profile loaded ... Starting UX.'); scannerService.gentleInitialize(); $state.go('tabs.home'); + $timeout(function() { + openURLService.init(); + }, 1000); } }); }); diff --git a/src/js/services/incomingData.js b/src/js/services/incomingData.js index 326fa4794..2db4832a7 100644 --- a/src/js/services/incomingData.js +++ b/src/js/services/incomingData.js @@ -40,7 +40,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat // data extensions for Payment Protocol with non-backwards-compatible request if ((/^bitcoin:\?r=[\w+]/).exec(data)) { data = decodeURIComponent(data.replace('bitcoin:?r=', '')); - $state.go('tabs.send').then(function() { + $state.go('tabs.send', {}, {'reload': true, 'notify': $state.current.name == 'tabs.send' ? false : true}).then(function() { $state.transitionTo('tabs.send.confirm', {paypro: data}); }); return true; @@ -62,7 +62,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat handlePayPro(details); }); } else { - $state.go('tabs.send'); + $state.go('tabs.send', {}, {'reload': true, 'notify': $state.current.name == 'tabs.send' ? false : true}); // Timeout is required to enable the "Back" button $timeout(function() { if (amount) { @@ -70,7 +70,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat } else { $state.transitionTo('tabs.send.amount', {toAddress: addr}); } - }); + }, 100); } return true; @@ -102,7 +102,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat var secret = getParameterByName('secret', data); var email = getParameterByName('email', data); var otp = getParameterByName('otp', data); - $state.go('tabs.home').then(function() { + $state.go('tabs.home', {}, {'reload': true, 'notify': $state.current.name == 'tabs.home' ? false : true}).then(function() { $state.transitionTo('tabs.bitpayCardIntro', { secret: secret, email: email, @@ -113,14 +113,14 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat // Join } else if (data && data.match(/^copay:[0-9A-HJ-NP-Za-km-z]{70,80}$/)) { - $state.go('tabs.home').then(function() { + $state.go('tabs.home', {}, {'reload': true, 'notify': $state.current.name == 'tabs.home' ? false : true}).then(function() { $state.transitionTo('tabs.add.join', {url: data}); }); return true; // Old join } else if (data && data.match(/^[0-9A-HJ-NP-Za-km-z]{70,80}$/)) { - $state.go('tabs.home').then(function() { + $state.go('tabs.home', {}, {'reload': true, 'notify': $state.current.name == 'tabs.home' ? false : true}).then(function() { $state.transitionTo('tabs.add.join', {url: data}); }); return true; @@ -136,7 +136,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat }; function goToAmountPage(toAddress) { - $state.go('tabs.send'); + $state.go('tabs.send', {}, {'reload': true, 'notify': $state.current.name == 'tabs.send' ? false : true}); $timeout(function() { $state.transitionTo('tabs.send.amount', {toAddress: toAddress}); }, 100); @@ -150,7 +150,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat paypro: payProDetails }; scannerService.pausePreview(); - $state.go('tabs.send').then(function() { + $state.go('tabs.send', {}, {'reload': true, 'notify': $state.current.name == 'tabs.send' ? false : true}).then(function() { $timeout(function() { $state.transitionTo('tabs.send.confirm', stateParams); }); diff --git a/src/js/services/openURL.js b/src/js/services/openURL.js index 1eb6d1c8f..adc4c6f72 100644 --- a/src/js/services/openURL.js +++ b/src/js/services/openURL.js @@ -8,9 +8,10 @@ angular.module('copayApp.services').factory('openURLService', function($rootScop // Stop it from caching the first view as one to return when the app opens $ionicHistory.nextViewOptions({ historyRoot: true, - disableBack: true, + disableBack: false, disableAnimation: true }); + var url = args.url; if (!url) { $log.error('No url provided'); From 549e86e872e03b66f8b503606bbc3370f95fbabc Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 2 Nov 2016 10:33:14 -0300 Subject: [PATCH 16/18] Fix handler url after first installation --- src/js/routes.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/routes.js b/src/js/routes.js index f3e584a48..674aa7b43 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -998,10 +998,12 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr $log.debug('Profile loaded ... Starting UX.'); scannerService.gentleInitialize(); $state.go('tabs.home'); - $timeout(function() { - openURLService.init(); - }, 1000); } + + // After everything have been loaded, initialize handler URL + $timeout(function() { + openURLService.init(); + }, 1000); }); }); From 26092af067814f3afc5fbfef4af5cca2e8a2f49b Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 2 Nov 2016 12:36:13 -0300 Subject: [PATCH 17/18] Adds confirmation to tx-details --- www/views/modals/tx-details.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/www/views/modals/tx-details.html b/www/views/modals/tx-details.html index 82f560c8c..fff546ddf 100644 --- a/www/views/modals/tx-details.html +++ b/www/views/modals/tx-details.html @@ -60,6 +60,20 @@ {{btx.feeStr}}
+
+ Confirmations + + + Unconfirmed + + + {{btx.confirmations}} + + + {{btx.safeConfirmed}} + + +
Timeline
From 85f20e2fdb96615c68327d20f15c6b390414e0a7 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 2 Nov 2016 18:01:40 -0300 Subject: [PATCH 18/18] Removes "Created by" from tx details (Received) --- www/views/modals/tx-details.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/views/modals/tx-details.html b/www/views/modals/tx-details.html index fff546ddf..6297683d2 100644 --- a/www/views/modals/tx-details.html +++ b/www/views/modals/tx-details.html @@ -41,7 +41,7 @@
{{wallet.name}}
-
+
Created by {{btx.creatorName}}