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: '
+
+
+
+
+
+