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] 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? + +
+
+ + + + + +
+
+ +
+