fix(feedback): improve design of feedback flow, correct several logic issues
This commit is contained in:
parent
57ab21dd55
commit
f7e6f30d12
13 changed files with 85 additions and 75 deletions
|
|
@ -32,6 +32,7 @@ angular.module('copayApp.controllers').controller('completeController', function
|
|||
|
||||
$scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;
|
||||
$scope.skipped = (data.stateParams && data.stateParams.skipped) ? true : false;
|
||||
$scope.rated = (data.stateParams && data.stateParams.rated) ? true : false;
|
||||
|
||||
storageService.getFeedbackInfo(function(error, info) {
|
||||
var feedbackInfo = lodash.isString(info) ? JSON.parse(info) : null;
|
||||
|
|
@ -40,6 +41,7 @@ angular.module('copayApp.controllers').controller('completeController', function
|
|||
});
|
||||
|
||||
if (!$scope.isCordova) return;
|
||||
$scope.animate = true;
|
||||
|
||||
window.plugins.socialsharing.available(function(isAvailable) {
|
||||
// the boolean is only false on iOS < 6
|
||||
|
|
|
|||
|
|
@ -8,24 +8,20 @@ angular.module('copayApp.controllers').controller('rateAppController', function(
|
|||
var config = configService.getSync();
|
||||
|
||||
$scope.skip = function() {
|
||||
|
||||
var dataSrc = {
|
||||
"Email": lodash.values(config.emailFor)[0] || ' ',
|
||||
"Feedback": ' ',
|
||||
"Score": $stateParams.score
|
||||
};
|
||||
|
||||
ongoingProcess.set('sendingFeedback', true);
|
||||
feedbackService.send(dataSrc, function(err) {
|
||||
ongoingProcess.set('sendingFeedback', false);
|
||||
if (err) {
|
||||
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Could not send feedback'));
|
||||
return;
|
||||
// try to send, but not essential, since the user didn't add a message
|
||||
$log.warn('Could not send feedback.');
|
||||
}
|
||||
$state.go('tabs.rate.complete', {
|
||||
score: $stateParams.score,
|
||||
skipped: true
|
||||
});
|
||||
});
|
||||
$state.go('tabs.rate.complete', {
|
||||
score: $stateParams.score,
|
||||
skipped: true
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -42,5 +38,9 @@ angular.module('copayApp.controllers').controller('rateAppController', function(
|
|||
if (isIOS) url = defaults.rateApp.ios;
|
||||
// if (isWP) url = defaults.rateApp.windows; // TODO
|
||||
externalLinkService.open(url);
|
||||
$state.go('tabs.rate.complete', {
|
||||
score: $stateParams.score,
|
||||
rated: true
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ angular.module('copayApp.controllers').controller('rateCardController', function
|
|||
$scope.score = 0;
|
||||
|
||||
$scope.goFeedbackFlow = function() {
|
||||
$scope.hideCard();
|
||||
if ($scope.isCordova && $scope.score == 5) {
|
||||
$state.go('tabs.rate.rateApp', {
|
||||
score: $scope.score
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('sendController', function($scope, $state, $log, $timeout, $stateParams, $ionicNavBarDelegate, $ionicHistory, $ionicConfig, $window, gettextCatalog, popupService, configService, lodash, feedbackService, ongoingProcess) {
|
||||
|
||||
$scope.sendFeedback = function(feedback, skip) {
|
||||
$scope.sendFeedback = function(feedback, skip, goHome) {
|
||||
|
||||
var config = configService.getSync();
|
||||
|
||||
|
|
@ -15,11 +15,12 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
|
|||
"DeviceVersion": ionic.Platform.version()
|
||||
};
|
||||
|
||||
ongoingProcess.set('sendingFeedback', true);
|
||||
if(!(goHome || skip)) ongoingProcess.set('sendingFeedback', true);
|
||||
feedbackService.send(dataSrc, function(err) {
|
||||
if(goHome || skip) return;
|
||||
ongoingProcess.set('sendingFeedback', false);
|
||||
if (err) {
|
||||
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Could not send feedback'));
|
||||
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Feedback could not be submitted. Please try again later.'));
|
||||
return;
|
||||
}
|
||||
if (!$stateParams.score) {
|
||||
|
|
@ -30,7 +31,7 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
|
|||
historyRoot: true
|
||||
});
|
||||
$ionicHistory.goBack();
|
||||
});
|
||||
}, gettextCatalog.getString('Finish'));
|
||||
return;
|
||||
}
|
||||
$state.go('tabs.rate.complete', {
|
||||
|
|
@ -38,6 +39,14 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
|
|||
skipped: skip
|
||||
});
|
||||
});
|
||||
if(goHome){
|
||||
$state.go('tabs.home');
|
||||
} else if(skip) {
|
||||
$state.go('tabs.rate.complete', {
|
||||
score: $stateParams.score,
|
||||
skipped: skip
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
|
|
@ -71,7 +80,7 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
|
|||
$scope.comment = gettextCatalog.getString("We're always looking for ways to improve BitPay.") + ' ' + gettextCatalog.getString("Is there anything we could do better?");
|
||||
break;
|
||||
default:
|
||||
$scope.reaction = gettextCatalog.getString("Feedback!");
|
||||
$scope.reaction = gettextCatalog.getString("Send Feedback");
|
||||
$scope.comment = gettextCatalog.getString("We're always looking for ways to improve BitPay. How could we improve your experience?");
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue