From 164c775a79bf31d270b80b30ff2f61422454ec5d Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 9 Nov 2016 10:40:18 -0300 Subject: [PATCH 01/16] Adds historic fiat rate to tx-details --- src/js/controllers/tx-details.js | 23 ++++++++++++++++++++++- www/views/tx-details.html | 8 +++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/tx-details.js b/src/js/controllers/tx-details.js index e41cca9c2..c84304700 100644 --- a/src/js/controllers/tx-details.js +++ b/src/js/controllers/tx-details.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('txDetailsController', function($log, $timeout, $ionicHistory, $scope, $stateParams, walletService, lodash, gettextCatalog, profileService, configService, externalLinkService, popupService) { +angular.module('copayApp.controllers').controller('txDetailsController', function($log, $ionicHistory, $scope, $stateParams, walletService, lodash, gettextCatalog, profileService, externalLinkService, popupService) { $scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.title = gettextCatalog.getString('Transaction'); @@ -130,6 +130,27 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio return n.substring(0, 4); }; + $scope.getFiatRate = function() { + if ($scope.rateDate) return; + var alternativeIsoCode = $scope.wallet.status.alternativeIsoCode; + $scope.loadingRate = true; + $scope.wallet.getFiatRate({ + code: alternativeIsoCode, + ts: $scope.btx.time * 1000 + }, function(err, res) { + $scope.loadingRate = false; + if (err) { + $log.debug('Could not get historic rate'); + return; + } + if (res && res.rate) { + $scope.rateDate = res.fetchedOn; + $scope.rateStr = res.rate + ' ' + alternativeIsoCode; + $scope.$apply(); + } + }); + }; + $scope.cancel = function() { $scope.txDetailsModal.hide(); }; diff --git a/www/views/tx-details.html b/www/views/tx-details.html index 790a34c50..c855b7180 100644 --- a/www/views/tx-details.html +++ b/www/views/tx-details.html @@ -16,7 +16,13 @@
{{displayAmount}} {{displayUnit}}
-
{{btx.alternativeAmountStr}}
+
+ {{btx.alternativeAmountStr}} + + {{rateStr}} ({{rateDate | amDateFormat:'MM/DD/YYYY HH:mm a'}}) + ... + +
From 5ead443c2405af41ced8d2bc36617fb26052524b Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 10 Nov 2016 13:47:57 -0300 Subject: [PATCH 02/16] Fix recent transactions. Show the latest transactions within 24 hours --- src/js/controllers/activity.js | 36 ++----------- src/js/controllers/tab-home.js | 90 +++++++++---------------------- src/js/controllers/tx-details.js | 8 +-- src/js/services/profileService.js | 41 +++++++------- www/views/activity.html | 6 +-- www/views/tab-home.html | 4 -- 6 files changed, 57 insertions(+), 128 deletions(-) diff --git a/src/js/controllers/activity.js b/src/js/controllers/activity.js index 29721ca3b..9ea9a31e9 100644 --- a/src/js/controllers/activity.js +++ b/src/js/controllers/activity.js @@ -26,7 +26,10 @@ angular.module('copayApp.controllers').controller('activityController', $scope.openNotificationModal = function(n) { if (n.txid) { - openTxModal(n); + $state.transitionTo('tabs.wallet.tx-details', { + txid: n.txid, + walletId: n.walletId + }); } else { var txp = lodash.find($scope.txps, { id: n.txpId @@ -46,35 +49,4 @@ angular.module('copayApp.controllers').controller('activityController', } } }; - - var openTxModal = function(n) { - var wallet = profileService.getWallet(n.walletId); - - ongoingProcess.set('loadingTxInfo', true); - walletService.getTx(wallet, n.txid, function(err, tx) { - ongoingProcess.set('loadingTxInfo', false); - - if (err) { - $log.error(err); - return popupService.showAlert(gettextCatalog.getString('Error'), err); - } - - if (!tx) { - $log.warn('No tx found'); - return popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Transaction not found')); - } - - $scope.wallet = wallet; - $scope.btx = lodash.cloneDeep(tx); - $state.transitionTo('tabs.wallet.tx-details', { - txid: $scope.btx.txid, - walletId: $scope.walletId - }); - - walletService.getTxNote(wallet, n.txid, function(err, note) { - if (err) $log.warn('Could not fetch transaction note: ' + err); - $scope.btx.note = note; - }); - }); - }; }); diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 656949602..08d136573 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -43,7 +43,10 @@ angular.module('copayApp.controllers').controller('tabHomeController', wallet = profileService.getWallet(n.walletId); if (n.txid) { - openTxModal(n); + $state.transitionTo('tabs.wallet.tx-details', { + txid: n.txid, + walletId: n.walletId + }); } else { var txp = lodash.find($scope.txps, { id: n.txpId @@ -65,37 +68,6 @@ angular.module('copayApp.controllers').controller('tabHomeController', } }; - var openTxModal = function(n) { - wallet = profileService.getWallet(n.walletId); - - ongoingProcess.set('loadingTxInfo', true); - walletService.getTx(wallet, n.txid, function(err, tx) { - ongoingProcess.set('loadingTxInfo', false); - - if (err) { - $log.error(err); - return popupService.showAlert(gettextCatalog.getString('Error'), err); - } - - if (!tx) { - $log.warn('No tx found'); - return popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Transaction not found')); - } - - $scope.wallet = wallet; - $scope.btx = lodash.cloneDeep(tx); - $state.transitionTo('tabs.wallet.tx-details', { - txid: $scope.btx.txid, - walletId: $scope.walletId - }); - - walletService.getTxNote(wallet, n.txid, function(err, note) { - if (err) $log.warn('Could not fetch transaction note: ' + err); - $scope.btx.note = note; - }); - }); - }; - $scope.openWallet = function(wallet) { if (!wallet.isComplete()) { return $state.go('tabs.copayers', { @@ -117,6 +89,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', $scope.txpsN = n; $timeout(function() { $ionicScrollDelegate.resize(); + $scope.$apply(); }, 100); }) }; @@ -141,25 +114,6 @@ angular.module('copayApp.controllers').controller('tabHomeController', } }); }); - - if (!$scope.recentTransactionsEnabled) return; - $scope.fetchingNotifications = true; - profileService.getNotifications({ - limit: 3 - }, function(err, n) { - if (err) { - $log.error(err); - return; - } - $scope.fetchingNotifications = false; - $scope.notifications = n; - - $timeout(function() { - $ionicScrollDelegate.resize(); - $scope.$apply(); - }, 100); - - }) }; var updateWallet = function(wallet) { @@ -171,20 +125,22 @@ angular.module('copayApp.controllers').controller('tabHomeController', } wallet.status = status; updateTxps(); + }); + }; - if (!$scope.recentTransactionsEnabled) return; - - $scope.fetchingNotifications = true; - profileService.getNotifications({ - limit: 3 - }, function(err, notifications) { - $scope.fetchingNotifications = false; - if (err) { - $log.error(err); - return; - } - $scope.notifications = notifications; - }); + var getNotifications = function() { + profileService.getNotifications({ + limit: 3 + }, function(err, n) { + if (err) { + $log.error(err); + return; + } + $scope.notifications = n; + $timeout(function() { + $ionicScrollDelegate.resize(); + $scope.$apply(); + }, 100); }); }; @@ -242,7 +198,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', updateAllWallets(); }; - $scope.$on("$ionicView.enter", function(event, data) { + $scope.$on("$ionicView.beforeEnter", function(event, data) { updateAllWallets(); addressbookService.list(function(err, ab) { @@ -254,11 +210,13 @@ angular.module('copayApp.controllers').controller('tabHomeController', $rootScope.$on('bwsEvent', function(e, walletId, type, n) { var wallet = profileService.getWallet(walletId); updateWallet(wallet); + if ($scope.recentTransactionsEnabled) getNotifications(); }), $rootScope.$on('Local/TxAction', function(e, walletId) { $log.debug('Got action for wallet ' + walletId); var wallet = profileService.getWallet(walletId); updateWallet(wallet); + if ($scope.recentTransactionsEnabled) getNotifications(); }) ]; @@ -279,6 +237,8 @@ angular.module('copayApp.controllers').controller('tabHomeController', $scope.nextStepEnabled = buyAndSellEnabled || amazonEnabled || bitpayCardEnabled; $scope.recentTransactionsEnabled = config.recentTransactions.enabled; + if ($scope.recentTransactionsEnabled) getNotifications(); + if ($scope.bitpayCardEnabled) bitpayCardCache(); $timeout(function() { $ionicScrollDelegate.resize(); diff --git a/src/js/controllers/tx-details.js b/src/js/controllers/tx-details.js index c84304700..1b6beb58b 100644 --- a/src/js/controllers/tx-details.js +++ b/src/js/controllers/tx-details.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('txDetailsController', function($log, $ionicHistory, $scope, $stateParams, walletService, lodash, gettextCatalog, profileService, externalLinkService, popupService) { +angular.module('copayApp.controllers').controller('txDetailsController', function($log, $ionicHistory, $scope, walletService, lodash, gettextCatalog, profileService, configService, externalLinkService, popupService, ongoingProcess) { $scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.title = gettextCatalog.getString('Transaction'); @@ -9,11 +9,13 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio $scope.copayerId = $scope.wallet.credentials.copayerId; $scope.isShared = $scope.wallet.credentials.n > 1; - walletService.getTx($scope.wallet, $stateParams.txid, function(err, tx) { + ongoingProcess.set('loadingTxInfo', true); + walletService.getTx($scope.wallet, data.stateParams.txid, function(err, tx) { + ongoingProcess.set('loadingTxInfo', false); if (err) { $log.warn('Could not get tx'); $ionicHistory.goBack(); - return; + return popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Transaction not found')); } $scope.btx = tx; if ($scope.btx.action != 'invalid') { diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 4c65a3f48..8d660cb16 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -795,7 +795,7 @@ angular.module('copayApp.services') root.getNotifications = function(opts, cb) { opts = opts || {}; - var TIME_STAMP = 60 * 60 * 24 * 7; + var TIME_STAMP = 60 * 60 * 24; var MAX = 100; var typeFilter = { @@ -861,26 +861,25 @@ angular.module('copayApp.services') var finale = shown; // GROUPING DISABLED! - // var finale = [], - // prev; - // - // - // // Item grouping... DISABLED. - // - // // REMOVE (if we want 1-to-1 notification) ???? - // lodash.each(shown, function(x) { - // if (prev && prev.walletId === x.walletId && prev.txpId && prev.txpId === x.txpId && prev.creatorId && prev.creatorId === x.creatorId) { - // prev.types.push(x.type); - // prev.data = lodash.assign(prev.data, x.data); - // prev.txid = prev.txid || x.txid; - // prev.amountStr = prev.amountStr || x.amountStr; - // prev.creatorName = prev.creatorName || x.creatorName; - // } else { - // finale.push(x); - // prev = x; - // } - // }); - // + var finale = [], + prev; + + + // Item grouping... DISABLED. + + // REMOVE (if we want 1-to-1 notification) ???? + lodash.each(shown, function(x) { + if (prev && prev.walletId === x.walletId && prev.txpId && prev.txpId === x.txpId && prev.creatorId && prev.creatorId === x.creatorId) { + prev.types.push(x.type); + prev.data = lodash.assign(prev.data, x.data); + prev.txid = prev.txid || x.txid; + prev.amountStr = prev.amountStr || x.amountStr; + prev.creatorName = prev.creatorName || x.creatorName; + } else { + finale.push(x); + prev = x; + } + }); var u = bwcService.getUtils(); lodash.each(finale, function(x) { diff --git a/www/views/activity.html b/www/views/activity.html index fb84142dc..8586e97e9 100644 --- a/www/views/activity.html +++ b/www/views/activity.html @@ -1,7 +1,7 @@ - {{'Recent Activity'|translate}} + {{'Recent Transactions'|translate}} @@ -11,7 +11,7 @@
-
Updating activity. Please stand by
+
Updating... Please stand by
@@ -22,7 +22,7 @@
- No recent activity + No recent transactions
diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 1b4c611f1..41bd57b63 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -47,10 +47,6 @@ Recent Transactions - - -
Updating activity...
-
From 171b8001d6d1c06ca7d6f46a6d58662626c9bb18 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 10 Nov 2016 14:49:07 -0300 Subject: [PATCH 03/16] Recent transactions within 6 hours --- src/js/services/profileService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 8d660cb16..78f99a86b 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -795,7 +795,7 @@ angular.module('copayApp.services') root.getNotifications = function(opts, cb) { opts = opts || {}; - var TIME_STAMP = 60 * 60 * 24; + var TIME_STAMP = 60 * 60 * 6; var MAX = 100; var typeFilter = { From b64e80478e2bc0cff55b8eca796ce9a21c70722c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 1 Nov 2016 14:21:35 -0300 Subject: [PATCH 04/16] feedback feature --- src/js/controllers/feedback/rateAppStore.js | 22 +++++++++++ src/js/controllers/feedback/sendFeedback.js | 42 ++++++++++++++++++++ src/js/controllers/feedback/thanks.js | 6 +++ src/js/controllers/tab-home.js | 35 +++++++++++++++++ src/js/routes.js | 43 +++++++++++++++++++-- src/sass/views/feedback/rateAppStore.scss | 12 ++++++ src/sass/views/feedback/sendFeedBack.scss | 33 ++++++++++++++++ src/sass/views/feedback/thanks.scss | 12 ++++++ src/sass/views/tab-home.scss | 17 ++++++++ src/sass/views/views.scss | 3 ++ www/views/feedback/rateAppStore.html | 33 ++++++++++++++++ www/views/feedback/sendFeedback.html | 34 ++++++++++++++++ www/views/feedback/thanks.html | 37 ++++++++++++++++++ www/views/tab-home.html | 18 +++++++++ 14 files changed, 344 insertions(+), 3 deletions(-) create mode 100644 src/js/controllers/feedback/rateAppStore.js create mode 100644 src/js/controllers/feedback/sendFeedback.js create mode 100644 src/js/controllers/feedback/thanks.js create mode 100644 src/sass/views/feedback/rateAppStore.scss create mode 100644 src/sass/views/feedback/sendFeedBack.scss create mode 100644 src/sass/views/feedback/thanks.scss create mode 100644 www/views/feedback/rateAppStore.html create mode 100644 www/views/feedback/sendFeedback.html create mode 100644 www/views/feedback/thanks.html diff --git a/src/js/controllers/feedback/rateAppStore.js b/src/js/controllers/feedback/rateAppStore.js new file mode 100644 index 000000000..0d291bc01 --- /dev/null +++ b/src/js/controllers/feedback/rateAppStore.js @@ -0,0 +1,22 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('rateAppStoreController', function($scope, $state, $stateParams) { + $scope.score = parseInt($stateParams.score); + + $scope.skip = function() { + $state.go('feedback.thanks', { + score: $scope.score, + skip: true + }); + }; + + $scope.sendFeedback = function() { + $state.go('feedback.sendFeedback', { + score: $scope.score + }); + }; + + $scope.goAppStore = function() { + + }; +}); diff --git a/src/js/controllers/feedback/sendFeedback.js b/src/js/controllers/feedback/sendFeedback.js new file mode 100644 index 000000000..d53d3cef3 --- /dev/null +++ b/src/js/controllers/feedback/sendFeedback.js @@ -0,0 +1,42 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('sendFeedbackController', function($scope, $state, $timeout, $stateParams, gettextCatalog) { + $scope.score = parseInt($stateParams.score); + switch ($scope.score) { + case 1: + $scope.reaction = gettextCatalog.getString("Ouch!"); + $scope.comment = gettextCatalog.getString("There's obviously something we're doing wrong. Is there anything we could do to improve your experience?"); + break; + case 2: + $scope.reaction = gettextCatalog.getString("Oh no!"); + $scope.comment = gettextCatalog.getString("There's obviously something we're doing wrong. Is there anything we could do to improve your experience?"); + break; + case 3: + $scope.reaction = gettextCatalog.getString("Thanks!"); + $scope.comment = gettextCatalog.getString("We're always looking for ways to improve BitPay wallet. Is there anything we could do to improve your experience?"); + break; + case 4: + $scope.reaction = gettextCatalog.getString("Thanks!"); + $scope.comment = gettextCatalog.getString("That's exciting to hear. We'd love to earn that fifth star from you - how could we improve your experience?"); + break; + case 5: + $scope.reaction = gettextCatalog.getString("Feedback!"); + $scope.comment = gettextCatalog.getString("We're always looking for ways to improve BitPay wallet. Is there anything we could do to improve your experience?"); + break; + } + + $scope.sendFeedback = function() { + //Feedback entered in feedback flow should be sent to BWS, and BWS should send a plain-text email to feedback@bitpay.com with a reply-to going to the user's email address. (From the onboarding process) + $state.go('feedback.thanks', { + score: $stateParams.score + }); + }; + + $scope.skip = function() { + $state.go('feedback.thanks', { + score: $scope.score, + skip: true + }); + }; + +}); diff --git a/src/js/controllers/feedback/thanks.js b/src/js/controllers/feedback/thanks.js new file mode 100644 index 000000000..babdd0526 --- /dev/null +++ b/src/js/controllers/feedback/thanks.js @@ -0,0 +1,6 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('thanksController', function($scope, $state, $stateParams) { + $scope.score = parseInt($stateParams.score); + $scope.skip = $stateParams.skip && $scope.score == 5; +}); diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 08d136573..1d1005e97 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -39,6 +39,41 @@ angular.module('copayApp.controllers').controller('tabHomeController', externalLinkService.open(url, optIn, title, message, okText, cancelText); }; + $scope.setScore = function(score) { + $scope.score = score; + switch ($scope.score) { + case 1: + $scope.button_title = gettextCatalog.getString("I think this app is terrible"); + break; + case 2: + $scope.button_title = gettextCatalog.getString("I don't like it"); + break; + case 3: + $scope.button_title = gettextCatalog.getString("Meh - it's alright"); + break; + case 4: + $scope.button_title = gettextCatalog.getString("I like the app"); + break; + case 5: + $scope.button_title = gettextCatalog.getString("This app is fantastic"); + break; + } + $timeout(function() { + $scope.$apply(); + }); + }; + + $scope.goFeedbackFlow = function() { + if ($scope.score != 5) + $state.go('feedback.sendFeedback', { + score: $scope.score + }); + else + $state.go('feedback.rateAppStore', { + score: $scope.score + }); + }; + $scope.openNotificationModal = function(n) { wallet = profileService.getWallet(n.walletId); diff --git a/src/js/routes.js b/src/js/routes.js index 2b92f5af2..b6ecfb4d4 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -720,13 +720,50 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr }, }) - /* * - * Buy or Sell Bitcoin + * Feedback * */ + .state('feedback', { + url: '/feedback', + abstract: true, + template: '' + }) + .state('feedback.sendFeedback', { + url: '/sendFeedback/:score', + views: { + 'feedback': { + controller: 'sendFeedbackController', + templateUrl: 'views/feedback/sendFeedback.html' + } + } + }) + .state('feedback.thanks', { + url: '/thanks/:score/:skip', + views: { + 'feedback': { + controller: 'thanksController', + templateUrl: 'views/feedback/thanks.html' + } + } + }) + .state('feedback.rateAppStore', { + url: '/rateAppStore/:score', + views: { + 'feedback': { + controller: 'rateAppStoreController', + templateUrl: 'views/feedback/rateAppStore.html' + } + } + }) + /* + * + * Buy or Sell Bitcoin + * + */ + .state('tabs.buyandsell', { url: '/buyandsell', views: { @@ -992,7 +1029,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr profileService.storeProfileIfDirty(); $log.debug('Profile loaded ... Starting UX.'); scannerService.gentleInitialize(); - $state.go('tabs.home'); + // $state.go('tabs.home'); } // After everything have been loaded, initialize handler URL diff --git a/src/sass/views/feedback/rateAppStore.scss b/src/sass/views/feedback/rateAppStore.scss new file mode 100644 index 000000000..a393477bf --- /dev/null +++ b/src/sass/views/feedback/rateAppStore.scss @@ -0,0 +1,12 @@ +#rate-app-store { + .title { + font-size: 20px; + font-weight: bold; + color: $dark-gray; + margin: 20px 10px; + text-align: center; + } + .subtitle { + padding: 10px 30px 20px 40px; + } +} diff --git a/src/sass/views/feedback/sendFeedBack.scss b/src/sass/views/feedback/sendFeedBack.scss new file mode 100644 index 000000000..9c8ea6295 --- /dev/null +++ b/src/sass/views/feedback/sendFeedBack.scss @@ -0,0 +1,33 @@ +#send-feedback { + background-color: #fff; + .title { + font-size: 20px; + font-weight: bold; + color: $dark-gray; + margin: 20px 10px; + } + .star { + margin: 20px 0px; + } + a { + font-size: 25px; + padding: 12px; + .gold { + color: #ffd700 !important; + } + .grey { + color: #667 !important; + } + } + .comment { + padding: 20px; + font-size: 1rem; + line-height: 1.5em; + font-weight: 300; + color: $dark-gray; + } + textarea { + padding: 10px; + width: 100%; + } +} diff --git a/src/sass/views/feedback/thanks.scss b/src/sass/views/feedback/thanks.scss new file mode 100644 index 000000000..3ab9c4ca0 --- /dev/null +++ b/src/sass/views/feedback/thanks.scss @@ -0,0 +1,12 @@ +#thanks-feedback { + .title { + font-size: 20px; + font-weight: bold; + color: $dark-gray; + margin: 20px 10px; + text-align: center; + } + .subtitle { + padding: 10px 30px 20px 40px; + } +} diff --git a/src/sass/views/tab-home.scss b/src/sass/views/tab-home.scss index 2d5368a8d..0479a2d75 100644 --- a/src/sass/views/tab-home.scss +++ b/src/sass/views/tab-home.scss @@ -116,6 +116,23 @@ font-size: 20px; margin-left: 10px; position: absolute; + } } + .starts { + display: flex; + border-bottom: none; + .button { + background-color: #fff; + width: 100%; + } + .gold { + color: #ffd700 !important; + } + .grey { + color: #667 !important; + } + } + .continue-button { + padding: 20px; } } diff --git a/src/sass/views/views.scss b/src/sass/views/views.scss index c449d07db..0e3f21ae9 100644 --- a/src/sass/views/views.scss +++ b/src/sass/views/views.scss @@ -17,6 +17,9 @@ @import "wallet-backup-phrase"; @import "zero-state"; @import "onboarding/onboarding"; +@import "feedback/sendFeedback"; +@import "feedback/thanks"; +@import "feedback/rateAppStore"; @import "includes/actionSheet"; @import "export"; @import "import"; diff --git a/www/views/feedback/rateAppStore.html b/www/views/feedback/rateAppStore.html new file mode 100644 index 000000000..eca714e32 --- /dev/null +++ b/www/views/feedback/rateAppStore.html @@ -0,0 +1,33 @@ + + + + + + + +
+ Thank you! +
+ + + +
+
+
+ 5-star ratings help us get BitPay Wallet into more hands, and more users means more resoucers can be committed to the app! +
+
+ Would you be willing to rate BitPay Wallet in the app store? +
+
+ + +
+
+
diff --git a/www/views/feedback/sendFeedback.html b/www/views/feedback/sendFeedback.html new file mode 100644 index 000000000..23a1e2150 --- /dev/null +++ b/www/views/feedback/sendFeedback.html @@ -0,0 +1,34 @@ + + + + + + + +
+
+ {{reaction}} +
+
+ + + + + +
+
+
+ {{comment}} +
+
+ +
+
+ +
+
+
diff --git a/www/views/feedback/thanks.html b/www/views/feedback/thanks.html new file mode 100644 index 000000000..3922cedad --- /dev/null +++ b/www/views/feedback/thanks.html @@ -0,0 +1,37 @@ + + + + + + + +
+
+ Thank you! +
+
+ A member of the team will review your feedback as soon as possible. +
+
+ If you have additional feedback, please let us know by tapping the "Send feedback" option in the Settings tab. +
+ + + +
+
+
+
+ Invite friends to BitPay Wallet! +
+ + + +
+
+
+ Share the love by inviting your friends. +
+
+
diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 41bd57b63..4ce90293b 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -13,6 +13,24 @@
An update to this app is available
+
+
+ How do you like BitPay Wallet? + +
+
+ + + + + +
+
+ +
+
From a2e20ee75de7abe934c84deb7a58e2e2b60d37e6 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 1 Nov 2016 15:35:52 -0300 Subject: [PATCH 05/16] share wallet --- src/js/controllers/feedback/thanks.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/feedback/thanks.js b/src/js/controllers/feedback/thanks.js index babdd0526..97e914e4c 100644 --- a/src/js/controllers/feedback/thanks.js +++ b/src/js/controllers/feedback/thanks.js @@ -1,6 +1,12 @@ 'use strict'; -angular.module('copayApp.controllers').controller('thanksController', function($scope, $state, $stateParams) { +angular.module('copayApp.controllers').controller('thanksController', function($scope, $state, $stateParams, platformInfo) { $scope.score = parseInt($stateParams.score); $scope.skip = $stateParams.skip && $scope.score == 5; + + $scope.$on("$ionicView.beforeEnter", function(event, data) { + if (platformInfo.isCordova) { + window.plugins.socialsharing.share('https://bitpay.com/wallet', null, null, null); + } + }); }); From 9e3f627c58d1e55419a188e9e73e2110b4ef322d Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 2 Nov 2016 10:18:10 -0300 Subject: [PATCH 06/16] rate the app --- src/js/controllers/feedback/rateAppStore.js | 17 +++++++++++++++-- src/js/controllers/feedback/thanks.js | 5 +++-- src/js/routes.js | 2 +- src/js/services/configService.js | 10 ++++++++++ www/views/feedback/rateAppStore.html | 4 ++-- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/js/controllers/feedback/rateAppStore.js b/src/js/controllers/feedback/rateAppStore.js index 0d291bc01..58377d0a2 100644 --- a/src/js/controllers/feedback/rateAppStore.js +++ b/src/js/controllers/feedback/rateAppStore.js @@ -1,7 +1,12 @@ 'use strict'; -angular.module('copayApp.controllers').controller('rateAppStoreController', function($scope, $state, $stateParams) { +angular.module('copayApp.controllers').controller('rateAppStoreController', function($scope, $state, $stateParams, externalLinkService, configService, gettextCatalog, platformInfo) { $scope.score = parseInt($stateParams.score); + $scope.isCordova = platformInfo.isCordova; + var isAndroid = platformInfo.isAndroid; + var isIOS = platformInfo.isIOS; + var isWP = platformInfo.isWP; + var config = configService.getSync(); $scope.skip = function() { $state.go('feedback.thanks', { @@ -17,6 +22,14 @@ angular.module('copayApp.controllers').controller('rateAppStoreController', func }; $scope.goAppStore = function() { - + var url; + if (isAndroid) url = config.rateApp.android; + if (isIOS) url = config.rateApp.ios; + // if (isWP) url = config.rateApp.ios; TODO + var title = gettextCatalog.getString('Rate the app'); + var message = gettextCatalog.getString('You must go to the official website of the app to rate it'); + var okText = gettextCatalog.getString('Go'); + var cancelText = gettextCatalog.getString('Cancel'); + externalLinkService.open(url, true, title, message, okText, cancelText); }; }); diff --git a/src/js/controllers/feedback/thanks.js b/src/js/controllers/feedback/thanks.js index 97e914e4c..31c445468 100644 --- a/src/js/controllers/feedback/thanks.js +++ b/src/js/controllers/feedback/thanks.js @@ -1,12 +1,13 @@ 'use strict'; -angular.module('copayApp.controllers').controller('thanksController', function($scope, $state, $stateParams, platformInfo) { +angular.module('copayApp.controllers').controller('thanksController', function($scope, $state, $stateParams, platformInfo, configService) { $scope.score = parseInt($stateParams.score); $scope.skip = $stateParams.skip && $scope.score == 5; $scope.$on("$ionicView.beforeEnter", function(event, data) { if (platformInfo.isCordova) { - window.plugins.socialsharing.share('https://bitpay.com/wallet', null, null, null); + var config = configService.getSync(); + window.plugins.socialsharing.share(config.download.url, null, null, null); } }); }); diff --git a/src/js/routes.js b/src/js/routes.js index b6ecfb4d4..91d4cd6d0 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -1029,7 +1029,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr profileService.storeProfileIfDirty(); $log.debug('Profile loaded ... Starting UX.'); scannerService.gentleInitialize(); - // $state.go('tabs.home'); + $state.go('tabs.home'); } // After everything have been loaded, initialize handler URL diff --git a/src/js/services/configService.js b/src/js/services/configService.js index 618118e35..a51906f82 100644 --- a/src/js/services/configService.js +++ b/src/js/services/configService.js @@ -15,6 +15,16 @@ angular.module('copayApp.services').factory('configService', function(storageSer url: 'https://bws.bitpay.com/bws/api', }, + download: { + url: 'https://bitpay.com/wallet', + }, + + rateApp: { + ios: 'https://itunes.apple.com/app/bitpay-secure-bitcoin-wallet/id1149581638', + android: 'https://play.google.com/store/apps/details?id=com.bitpay.wallet', + wp: '' + }, + // wallet default config wallet: { requiredCopayers: 2, diff --git a/www/views/feedback/rateAppStore.html b/www/views/feedback/rateAppStore.html index eca714e32..8ca841b05 100644 --- a/www/views/feedback/rateAppStore.html +++ b/www/views/feedback/rateAppStore.html @@ -22,11 +22,11 @@ Would you be willing to rate BitPay Wallet in the app store?
-
From 7b2d3b1df0780a26e70d523e3dbdf3b4cf714f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 2 Nov 2016 10:52:04 -0300 Subject: [PATCH 07/16] add rate card flag --- src/js/controllers/feedback/rateAppStore.js | 1 - src/js/controllers/feedback/sendFeedback.js | 2 +- src/js/controllers/feedback/thanks.js | 9 +- src/js/controllers/tab-home.js | 163 +++++++++++--------- src/js/services/storageService.js | 8 + www/views/feedback/rateAppStore.html | 4 +- www/views/feedback/thanks.html | 2 +- www/views/tab-home.html | 6 +- 8 files changed, 112 insertions(+), 83 deletions(-) diff --git a/src/js/controllers/feedback/rateAppStore.js b/src/js/controllers/feedback/rateAppStore.js index 58377d0a2..3bc49f140 100644 --- a/src/js/controllers/feedback/rateAppStore.js +++ b/src/js/controllers/feedback/rateAppStore.js @@ -2,7 +2,6 @@ angular.module('copayApp.controllers').controller('rateAppStoreController', function($scope, $state, $stateParams, externalLinkService, configService, gettextCatalog, platformInfo) { $scope.score = parseInt($stateParams.score); - $scope.isCordova = platformInfo.isCordova; var isAndroid = platformInfo.isAndroid; var isIOS = platformInfo.isIOS; var isWP = platformInfo.isWP; diff --git a/src/js/controllers/feedback/sendFeedback.js b/src/js/controllers/feedback/sendFeedback.js index d53d3cef3..cce2b9d06 100644 --- a/src/js/controllers/feedback/sendFeedback.js +++ b/src/js/controllers/feedback/sendFeedback.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('sendFeedbackController', function($scope, $state, $timeout, $stateParams, gettextCatalog) { +angular.module('copayApp.controllers').controller('sendFeedbackController', function($scope, $state, $stateParams, gettextCatalog) { $scope.score = parseInt($stateParams.score); switch ($scope.score) { case 1: diff --git a/src/js/controllers/feedback/thanks.js b/src/js/controllers/feedback/thanks.js index 31c445468..0ccdae254 100644 --- a/src/js/controllers/feedback/thanks.js +++ b/src/js/controllers/feedback/thanks.js @@ -1,13 +1,12 @@ 'use strict'; -angular.module('copayApp.controllers').controller('thanksController', function($scope, $state, $stateParams, platformInfo, configService) { +angular.module('copayApp.controllers').controller('thanksController', function($scope, $stateParams, configService, storageService) { $scope.score = parseInt($stateParams.score); $scope.skip = $stateParams.skip && $scope.score == 5; + storageService.setRateCardFlag('true', function() {}); $scope.$on("$ionicView.beforeEnter", function(event, data) { - if (platformInfo.isCordova) { - var config = configService.getSync(); - window.plugins.socialsharing.share(config.download.url, null, null, null); - } + var config = configService.getSync(); + window.plugins.socialsharing.share(config.download.url, null, null, null); }); }); diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 1d1005e97..be2c5d8b9 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -18,27 +18,107 @@ angular.module('copayApp.controllers').controller('tabHomeController', startupService.ready(); }); - if (!$scope.homeTip) { - storageService.getHomeTipAccepted(function(error, value) { - $scope.homeTip = (value == 'accepted') ? false : true; - }); - } + $scope.$on("$ionicView.beforeEnter", function(event, data) { + if (!$scope.homeTip) { + storageService.getHomeTipAccepted(function(error, value) { + $scope.homeTip = (value == 'accepted') ? false : true; + }); + } - if ($scope.isNW) { - latestReleaseService.checkLatestRelease(function(err, newRelease) { - if (err) { - $log.warn(err); - return; - } + if ($scope.isNW) { + latestReleaseService.checkLatestRelease(function(err, newRelease) { + if (err) { + $log.warn(err); + return; + } - if (newRelease) $scope.newRelease = true; + if (newRelease) $scope.newRelease = true; + }); + } + + $scope.hideRateCard = $stateParams.fromAppRate || !$scope.isCordova; + if (!$scope.hideRateCard) { + storageService.getRateCardFlag(function(error, value) { + $scope.hideRateCard = (value == 'true') ? true : false; + }); + } + }); + + $scope.$on("$ionicView.enter", function(event, data) { + updateAllWallets(); + + addressbookService.list(function(err, ab) { + if (err) $log.error(err); + $scope.addressbook = ab || {}; }); - } + + listeners = [ + $rootScope.$on('bwsEvent', function(e, walletId, type, n) { + var wallet = profileService.getWallet(walletId); + updateWallet(wallet); + if ($scope.recentTransactionsEnabled) getNotifications(); + }), + $rootScope.$on('Local/TxAction', function(e, walletId) { + $log.debug('Got action for wallet ' + walletId); + var wallet = profileService.getWallet(walletId); + updateWallet(wallet); + if ($scope.recentTransactionsEnabled) getNotifications(); + }) + ]; + + configService.whenAvailable(function() { + nextStep(function() { + var config = configService.getSync(); + var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova; + + $scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp; + $scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp; + $scope.amazonEnabled = config.amazon.enabled; + $scope.bitpayCardEnabled = config.bitpayCard.enabled; + + var buyAndSellEnabled = !$scope.externalServices.BuyAndSell && ($scope.glideraEnabled || $scope.coinbaseEnabled); + var amazonEnabled = !$scope.externalServices.AmazonGiftCards && $scope.amazonEnabled; + var bitpayCardEnabled = !$scope.externalServices.BitpayCard && $scope.bitpayCardEnabled; + + $scope.nextStepEnabled = buyAndSellEnabled || amazonEnabled || bitpayCardEnabled; + $scope.recentTransactionsEnabled = config.recentTransactions.enabled; + + if ($scope.recentTransactionsEnabled) getNotifications(); + + if ($scope.bitpayCardEnabled) bitpayCardCache(); + $timeout(function() { + $ionicScrollDelegate.resize(); + $scope.$apply(); + }, 10); + }); + }); + }); + + $scope.$on("$ionicView.leave", function(event, data) { + lodash.each(listeners, function(x) { + x(); + }); + }); + + $scope.$on("$ionicView.leave", function(event, data) { + lodash.each(listeners, function(x) { + x(); + }); + }); $scope.openExternalLink = function(url, optIn, title, message, okText, cancelText) { externalLinkService.open(url, optIn, title, message, okText, cancelText); }; + $scope.hideCard = function() { + storageService.setRateCardFlag('true', function() { + $scope.hideRateCard = true; + $timeout(function() { + $scope.$apply(); + }) + }); + } + $scope.setScore = function(score) { $scope.score = score; switch ($scope.score) { @@ -232,61 +312,4 @@ angular.module('copayApp.controllers').controller('tabHomeController', }, 300); updateAllWallets(); }; - - $scope.$on("$ionicView.beforeEnter", function(event, data) { - updateAllWallets(); - - addressbookService.list(function(err, ab) { - if (err) $log.error(err); - $scope.addressbook = ab || {}; - }); - - listeners = [ - $rootScope.$on('bwsEvent', function(e, walletId, type, n) { - var wallet = profileService.getWallet(walletId); - updateWallet(wallet); - if ($scope.recentTransactionsEnabled) getNotifications(); - }), - $rootScope.$on('Local/TxAction', function(e, walletId) { - $log.debug('Got action for wallet ' + walletId); - var wallet = profileService.getWallet(walletId); - updateWallet(wallet); - if ($scope.recentTransactionsEnabled) getNotifications(); - }) - ]; - - configService.whenAvailable(function() { - nextStep(function() { - var config = configService.getSync(); - var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova; - - $scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp; - $scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp; - $scope.amazonEnabled = config.amazon.enabled; - $scope.bitpayCardEnabled = config.bitpayCard.enabled; - - var buyAndSellEnabled = !$scope.externalServices.BuyAndSell && ($scope.glideraEnabled || $scope.coinbaseEnabled); - var amazonEnabled = !$scope.externalServices.AmazonGiftCards && $scope.amazonEnabled; - var bitpayCardEnabled = !$scope.externalServices.BitpayCard && $scope.bitpayCardEnabled; - - $scope.nextStepEnabled = buyAndSellEnabled || amazonEnabled || bitpayCardEnabled; - $scope.recentTransactionsEnabled = config.recentTransactions.enabled; - - if ($scope.recentTransactionsEnabled) getNotifications(); - - if ($scope.bitpayCardEnabled) bitpayCardCache(); - $timeout(function() { - $ionicScrollDelegate.resize(); - $scope.$apply(); - }, 10); - }); - }); - }); - - $scope.$on("$ionicView.leave", function(event, data) { - lodash.each(listeners, function(x) { - x(); - }); - }); - }); diff --git a/src/js/services/storageService.js b/src/js/services/storageService.js index 4184f8454..e68f28df0 100644 --- a/src/js/services/storageService.js +++ b/src/js/services/storageService.js @@ -203,6 +203,14 @@ angular.module('copayApp.services') storage.set('homeTip', val, cb); }; + root.getRateCardFlag = function(cb) { + storage.get('rateCardFlag', cb); + }; + + root.setRateCardFlag = function(val, cb) { + storage.set('rateCardFlag', val, cb); + }; + root.setHideBalanceFlag = function(walletId, val, cb) { storage.set('hideBalance-' + walletId, val, cb); }; diff --git a/www/views/feedback/rateAppStore.html b/www/views/feedback/rateAppStore.html index 8ca841b05..eca714e32 100644 --- a/www/views/feedback/rateAppStore.html +++ b/www/views/feedback/rateAppStore.html @@ -22,11 +22,11 @@ Would you be willing to rate BitPay Wallet in the app store?
-
diff --git a/www/views/feedback/thanks.html b/www/views/feedback/thanks.html index 3922cedad..a76b5afda 100644 --- a/www/views/feedback/thanks.html +++ b/www/views/feedback/thanks.html @@ -1,7 +1,7 @@ - diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 4ce90293b..005d0cb75 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -10,13 +10,13 @@ spinner="ios-small" on-refresh="onRefresh()"> -
+
An update to this app is available
-
+
How do you like BitPay Wallet? - +
From 9668870a07be75ed59f67b5322412fd760940735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 2 Nov 2016 15:30:14 -0300 Subject: [PATCH 08/16] new flow for NW.js --- src/js/controllers/feedback/rateAppStore.js | 2 +- src/js/controllers/feedback/sendFeedback.js | 5 +- src/js/controllers/feedback/thanks.js | 73 +++++++++++++++++++-- src/js/controllers/tab-home.js | 21 +++--- src/js/routes.js | 2 +- src/sass/views/feedback/thanks.scss | 11 ++++ www/views/feedback/thanks.html | 73 +++++++++++++++++---- 7 files changed, 153 insertions(+), 34 deletions(-) diff --git a/src/js/controllers/feedback/rateAppStore.js b/src/js/controllers/feedback/rateAppStore.js index 3bc49f140..b659fa516 100644 --- a/src/js/controllers/feedback/rateAppStore.js +++ b/src/js/controllers/feedback/rateAppStore.js @@ -10,7 +10,7 @@ angular.module('copayApp.controllers').controller('rateAppStoreController', func $scope.skip = function() { $state.go('feedback.thanks', { score: $scope.score, - skip: true + skipped: true }); }; diff --git a/src/js/controllers/feedback/sendFeedback.js b/src/js/controllers/feedback/sendFeedback.js index cce2b9d06..d26b2e2ff 100644 --- a/src/js/controllers/feedback/sendFeedback.js +++ b/src/js/controllers/feedback/sendFeedback.js @@ -28,14 +28,15 @@ angular.module('copayApp.controllers').controller('sendFeedbackController', func $scope.sendFeedback = function() { //Feedback entered in feedback flow should be sent to BWS, and BWS should send a plain-text email to feedback@bitpay.com with a reply-to going to the user's email address. (From the onboarding process) $state.go('feedback.thanks', { - score: $stateParams.score + score: $stateParams.score, + skipped: false }); }; $scope.skip = function() { $state.go('feedback.thanks', { score: $scope.score, - skip: true + skipped: true }); }; diff --git a/src/js/controllers/feedback/thanks.js b/src/js/controllers/feedback/thanks.js index 0ccdae254..80f3f6218 100644 --- a/src/js/controllers/feedback/thanks.js +++ b/src/js/controllers/feedback/thanks.js @@ -1,12 +1,75 @@ 'use strict'; -angular.module('copayApp.controllers').controller('thanksController', function($scope, $stateParams, configService, storageService) { +angular.module('copayApp.controllers').controller('thanksController', function($scope, $stateParams, platformInfo, configService, storageService) { $scope.score = parseInt($stateParams.score); - $scope.skip = $stateParams.skip && $scope.score == 5; - storageService.setRateCardFlag('true', function() {}); + $scope.skipped = $stateParams.skipped == 'false' ? false : true; + $scope.isCordova = platformInfo.isCordova; + var config = configService.getSync(); + + $scope.shareFacebook = function() { + window.plugins.socialsharing.shareViaFacebook(config.download.url, null, null, null); + }; + + $scope.shareTwitter = function() { + window.plugins.socialsharing.shareVia('com.apple.social.twitter', config.download.url, null, null, 'http://www.x-services.nl', null, null); + }; + + $scope.shareGooglePlus = function() { + window.plugins.socialsharing.shareVia('com.google.android.apps.plus', config.download.url, null, null, null); + }; + + $scope.shareEmail = function() { + window.plugins.socialsharing.shareViaEmail(config.download.url, null, null, null); + }; + + $scope.shareWhatsapp = function() { + window.plugins.socialsharing.shareViaWhatsApp(config.download.url, null, null, null); + }; + + $scope.shareMessage = function() { + window.plugins.socialsharing.shareViaSMS(config.download.url, null, null, null); + }; $scope.$on("$ionicView.beforeEnter", function(event, data) { - var config = configService.getSync(); - window.plugins.socialsharing.share(config.download.url, null, null, null); + storageService.setRateCardFlag('true', function() {}); + if (!$scope.isCordova) return; + + window.plugins.socialsharing.available(function(isAvailable) { + // the boolean is only false on iOS < 6 + $scope.socialsharing = isAvailable; + if (isAvailable) { + + window.plugins.socialsharing.canShareVia('com.apple.social.facebook', 'msg', null, null, null, function(e) { + $scope.facebook = true; + }, function(e) { + $scope.facebook = false; + }); + window.plugins.socialsharing.canShareVia('com.apple.social.twitter', 'msg', null, null, null, function(e) { + $scope.twitter = true; + }, function(e) { + $scope.twitter = false; + }); + window.plugins.socialsharing.canShareVia('com.google.android.apps.plus', 'msg', null, null, null, function(e) { + $scope.googleplus = true; + }, function(e) { + $scope.googleplus = false; + }) + window.plugins.socialsharing.canShareViaEmail(function(e) { + $scope.email = true; + }, function(e) { + $scope.email = false; + }) + window.plugins.socialsharing.canShareVia('whatsapp', 'msg', null, null, null, function(e) { + $scope.whatsapp = true; + }, function(e) { + $scope.whatsapp = false; + }) + window.plugins.socialsharing.canShareVia('sms', 'msg', null, null, null, function(e) { + $scope.sms = true; + }, function(e) { + $scope.sms = false; + }) + } + }); }); }); diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index be2c5d8b9..ca77a1838 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -36,12 +36,10 @@ angular.module('copayApp.controllers').controller('tabHomeController', }); } - $scope.hideRateCard = $stateParams.fromAppRate || !$scope.isCordova; - if (!$scope.hideRateCard) { - storageService.getRateCardFlag(function(error, value) { - $scope.hideRateCard = (value == 'true') ? true : false; - }); - } + storageService.getRateCardFlag(function(error, value) { + $scope.hideRateCard = (value == 'true') ? true : false; + }); + }); $scope.$on("$ionicView.enter", function(event, data) { @@ -144,14 +142,15 @@ angular.module('copayApp.controllers').controller('tabHomeController', }; $scope.goFeedbackFlow = function() { - if ($scope.score != 5) - $state.go('feedback.sendFeedback', { - score: $scope.score - }); - else + if ($scope.isCordova && $scope.score == 5) { $state.go('feedback.rateAppStore', { score: $scope.score }); + } else { + $state.go('feedback.sendFeedback', { + score: $scope.score + }); + } }; $scope.openNotificationModal = function(n) { diff --git a/src/js/routes.js b/src/js/routes.js index 91d4cd6d0..ee65083d3 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -741,7 +741,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }) .state('feedback.thanks', { - url: '/thanks/:score/:skip', + url: '/thanks/:score/:skipped', views: { 'feedback': { controller: 'thanksController', diff --git a/src/sass/views/feedback/thanks.scss b/src/sass/views/feedback/thanks.scss index 3ab9c4ca0..2a92e173b 100644 --- a/src/sass/views/feedback/thanks.scss +++ b/src/sass/views/feedback/thanks.scss @@ -9,4 +9,15 @@ .subtitle { padding: 10px 30px 20px 40px; } + .row { + margin: 20px 0px 20px; + span { + margin-top: 15px; + display: block; + } + div { + text-align: center; + width: 100%; + } + } } diff --git a/www/views/feedback/thanks.html b/www/views/feedback/thanks.html index a76b5afda..3a82a99d5 100644 --- a/www/views/feedback/thanks.html +++ b/www/views/feedback/thanks.html @@ -1,19 +1,28 @@ - -
-
- Thank you! +
+
Invite friends to BitPay Wallet!
+
+ + +
+
+ Share the love by inviting your friends. +
+
+
+
Thank you!
A member of the team will review your feedback as soon as possible.
-
+
If you have additional feedback, please let us know by tapping the "Send feedback" option in the Settings tab.
@@ -21,17 +30,53 @@
-
-
- Invite friends to BitPay Wallet! -
- - - +
+ Share the love by inviting your friends.
-
- Share the love by inviting your friends. +
+
+
+
+ + + + Facebook +
+
+ + + + Twitter +
+
+ + + + Google+ +
+
+
+
+ + + + Email +
+
+ + + + Whatsapp +
+
+ + + + Message +
+
+
From 1727b7c20aa158f0e11a48d2e9e83de889a7c6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Thu, 3 Nov 2016 11:43:34 -0300 Subject: [PATCH 09/16] fixes --- src/js/controllers/feedback/thanks.js | 31 ++++++++++++++------------- www/views/feedback/thanks.html | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/js/controllers/feedback/thanks.js b/src/js/controllers/feedback/thanks.js index 80f3f6218..e85d926c7 100644 --- a/src/js/controllers/feedback/thanks.js +++ b/src/js/controllers/feedback/thanks.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('thanksController', function($scope, $stateParams, platformInfo, configService, storageService) { +angular.module('copayApp.controllers').controller('thanksController', function($scope, $stateParams, $timeout, $log, platformInfo, configService, storageService) { $scope.score = parseInt($stateParams.score); $scope.skipped = $stateParams.skipped == 'false' ? false : true; $scope.isCordova = platformInfo.isCordova; @@ -11,11 +11,11 @@ angular.module('copayApp.controllers').controller('thanksController', function($ }; $scope.shareTwitter = function() { - window.plugins.socialsharing.shareVia('com.apple.social.twitter', config.download.url, null, null, 'http://www.x-services.nl', null, null); + window.plugins.socialsharing.shareVia($scope.shareTwitterVia, config.download.url, null, null, null, null, null); }; $scope.shareGooglePlus = function() { - window.plugins.socialsharing.shareVia('com.google.android.apps.plus', config.download.url, null, null, null); + window.plugins.socialsharing.shareVia($scope.shareGooglePlusVia, config.download.url, null, null, null); }; $scope.shareEmail = function() { @@ -31,45 +31,46 @@ angular.module('copayApp.controllers').controller('thanksController', function($ }; $scope.$on("$ionicView.beforeEnter", function(event, data) { - storageService.setRateCardFlag('true', function() {}); if (!$scope.isCordova) return; window.plugins.socialsharing.available(function(isAvailable) { + storageService.setRateCardFlag('true', function() {}); // the boolean is only false on iOS < 6 $scope.socialsharing = isAvailable; if (isAvailable) { - window.plugins.socialsharing.canShareVia('com.apple.social.facebook', 'msg', null, null, null, function(e) { $scope.facebook = true; }, function(e) { + $log.debug('facebook error: ' + e); $scope.facebook = false; }); - window.plugins.socialsharing.canShareVia('com.apple.social.twitter', 'msg', null, null, null, function(e) { + window.plugins.socialsharing.canShareVia('com.twitter.android', 'msg', null, null, null, function(e) { + $scope.shareTwitterVia = 'com.twitter.android'; $scope.twitter = true; }, function(e) { + $log.debug('twitter error: ' + e); $scope.twitter = false; }); window.plugins.socialsharing.canShareVia('com.google.android.apps.plus', 'msg', null, null, null, function(e) { + $scope.shareGooglePlusVia = 'com.google.android.apps.plus'; $scope.googleplus = true; }, function(e) { + $log.debug('googlePlus error: ' + e); $scope.googleplus = false; - }) + }); window.plugins.socialsharing.canShareViaEmail(function(e) { $scope.email = true; }, function(e) { + $log.debug('email error: ' + e); $scope.email = false; - }) + }); window.plugins.socialsharing.canShareVia('whatsapp', 'msg', null, null, null, function(e) { $scope.whatsapp = true; }, function(e) { + $log.debug('whatsapp error: ' + e); $scope.whatsapp = false; - }) - window.plugins.socialsharing.canShareVia('sms', 'msg', null, null, null, function(e) { - $scope.sms = true; - }, function(e) { - $scope.sms = false; - }) + }); } - }); + }, 100); }); }); diff --git a/www/views/feedback/thanks.html b/www/views/feedback/thanks.html index 3a82a99d5..f6a9b9557 100644 --- a/www/views/feedback/thanks.html +++ b/www/views/feedback/thanks.html @@ -69,7 +69,7 @@ Whatsapp
-
+
From 11b4ec1fcc719c848d8ad6e4f92ba01423b524e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Thu, 3 Nov 2016 13:39:01 -0300 Subject: [PATCH 10/16] styling --- src/js/controllers/feedback/sendFeedback.js | 10 +++--- src/sass/views/feedback/rateAppStore.scss | 17 +++++++++- src/sass/views/feedback/sendFeedBack.scss | 30 ++++++++++-------- src/sass/views/feedback/thanks.scss | 35 +++++++++++++++------ src/sass/views/tab-home.scss | 15 +++++---- www/views/feedback/rateAppStore.html | 14 +++------ www/views/feedback/sendFeedback.html | 24 ++++++-------- www/views/feedback/thanks.html | 11 +++---- www/views/tab-home.html | 14 ++++----- 9 files changed, 97 insertions(+), 73 deletions(-) diff --git a/src/js/controllers/feedback/sendFeedback.js b/src/js/controllers/feedback/sendFeedback.js index d26b2e2ff..d33c755e9 100644 --- a/src/js/controllers/feedback/sendFeedback.js +++ b/src/js/controllers/feedback/sendFeedback.js @@ -5,23 +5,23 @@ angular.module('copayApp.controllers').controller('sendFeedbackController', func switch ($scope.score) { case 1: $scope.reaction = gettextCatalog.getString("Ouch!"); - $scope.comment = gettextCatalog.getString("There's obviously something we're doing wrong. Is there anything we could do to improve your experience?"); + $scope.comment = gettextCatalog.getString("There's obviously something we're doing wrong."); break; case 2: $scope.reaction = gettextCatalog.getString("Oh no!"); - $scope.comment = gettextCatalog.getString("There's obviously something we're doing wrong. Is there anything we could do to improve your experience?"); + $scope.comment = gettextCatalog.getString("There's obviously something we're doing wrong."); break; case 3: $scope.reaction = gettextCatalog.getString("Thanks!"); - $scope.comment = gettextCatalog.getString("We're always looking for ways to improve BitPay wallet. Is there anything we could do to improve your experience?"); + $scope.comment = gettextCatalog.getString("We're always looking for ways to improve BitPay wallet."); break; case 4: $scope.reaction = gettextCatalog.getString("Thanks!"); - $scope.comment = gettextCatalog.getString("That's exciting to hear. We'd love to earn that fifth star from you - how could we improve your experience?"); + $scope.comment = gettextCatalog.getString("That's exciting to hear. We'd love to earn that fifth star from you"); break; case 5: $scope.reaction = gettextCatalog.getString("Feedback!"); - $scope.comment = gettextCatalog.getString("We're always looking for ways to improve BitPay wallet. Is there anything we could do to improve your experience?"); + $scope.comment = gettextCatalog.getString("We're always looking for ways to improve BitPay wallet."); break; } diff --git a/src/sass/views/feedback/rateAppStore.scss b/src/sass/views/feedback/rateAppStore.scss index a393477bf..5003e6b02 100644 --- a/src/sass/views/feedback/rateAppStore.scss +++ b/src/sass/views/feedback/rateAppStore.scss @@ -1,12 +1,27 @@ #rate-app-store { + background-color: #ffffff; + .skip { + margin: 10px; + color: #667; + } .title { font-size: 20px; font-weight: bold; color: $dark-gray; - margin: 20px 10px; + margin: 40px 10px; text-align: center; } .subtitle { padding: 10px 30px 20px 40px; } + .buttons { + bottom: 0; + width: 100%; + position: absolute; + background-color: $subtle-gray; + .button { + margin-top: 40px; + margin-bottom: 30px; + } + } } diff --git a/src/sass/views/feedback/sendFeedBack.scss b/src/sass/views/feedback/sendFeedBack.scss index 9c8ea6295..8e3060984 100644 --- a/src/sass/views/feedback/sendFeedBack.scss +++ b/src/sass/views/feedback/sendFeedBack.scss @@ -1,22 +1,25 @@ #send-feedback { - background-color: #fff; + background-color: #ffffff; + .skip { + margin: 10px; + color: #667; + } .title { font-size: 20px; font-weight: bold; color: $dark-gray; - margin: 20px 10px; + margin-left: 10px; } .star { - margin: 20px 0px; - } - a { - font-size: 25px; - padding: 12px; - .gold { - color: #ffd700 !important; - } - .grey { - color: #667 !important; + a { + font-size: 25px; + padding: 12px; + .gold { + color: #ffd700; + } + .subtle-gray { + color: $subtle-gray; + } } } .comment { @@ -27,7 +30,8 @@ color: $dark-gray; } textarea { - padding: 10px; + border-top: 1px solid $subtle-gray; + padding: 20px; width: 100%; } } diff --git a/src/sass/views/feedback/thanks.scss b/src/sass/views/feedback/thanks.scss index 2a92e173b..bd4d3ccab 100644 --- a/src/sass/views/feedback/thanks.scss +++ b/src/sass/views/feedback/thanks.scss @@ -1,4 +1,15 @@ #thanks-feedback { + background-color: #ffffff; + .item-heading { + border-style: none; + margin-top: 5px; + a { + color: $dark-gray; + } + i { + font-size: 40px; + } + } .title { font-size: 20px; font-weight: bold; @@ -9,15 +20,21 @@ .subtitle { padding: 10px 30px 20px 40px; } - .row { - margin: 20px 0px 20px; - span { - margin-top: 15px; - display: block; - } - div { - text-align: center; - width: 100%; + .share-buttons { + bottom: 0; + width: 100%; + position: absolute; + background-color: $subtle-gray; + .row { + margin: 20px 0px 20px; + span { + margin-top: 15px; + display: block; + } + div { + text-align: center; + width: 100%; + } } } } diff --git a/src/sass/views/tab-home.scss b/src/sass/views/tab-home.scss index 0479a2d75..6e1314294 100644 --- a/src/sass/views/tab-home.scss +++ b/src/sass/views/tab-home.scss @@ -118,21 +118,24 @@ position: absolute; } } - .starts { + .stars { display: flex; border-bottom: none; .button { background-color: #fff; - width: 100%; + outline: none; + border: none; + height:10px; + width:10px; } .gold { - color: #ffd700 !important; + color: #ffd700; } - .grey { - color: #667 !important; + .subtle-gray { + color: $subtle-gray; } } - .continue-button { + .feedback-flow-button { padding: 20px; } } diff --git a/www/views/feedback/rateAppStore.html b/www/views/feedback/rateAppStore.html index eca714e32..3da6ed36b 100644 --- a/www/views/feedback/rateAppStore.html +++ b/www/views/feedback/rateAppStore.html @@ -1,12 +1,6 @@ - - - - - +
Thank you!
@@ -19,13 +13,13 @@ 5-star ratings help us get BitPay Wallet into more hands, and more users means more resoucers can be committed to the app!
- Would you be willing to rate BitPay Wallet in the app store? + Would you be willing to rate BitPay Wallet in the app store?
-
+
-
diff --git a/www/views/feedback/sendFeedback.html b/www/views/feedback/sendFeedback.html index 23a1e2150..e240d50d6 100644 --- a/www/views/feedback/sendFeedback.html +++ b/www/views/feedback/sendFeedback.html @@ -1,29 +1,23 @@ - - - - - +
-
+
{{reaction}}
-
- - - - - +
+ + + + +
{{comment}}
- +
- - +
+ +
Invite friends to BitPay Wallet!
@@ -34,7 +31,7 @@ Share the love by inviting your friends.
-
+