fix(feedback): improve design of feedback flow, correct several logic issues

This commit is contained in:
Jason Dreyzehner 2016-11-16 18:15:55 -05:00
commit f7e6f30d12
13 changed files with 85 additions and 75 deletions

View file

@ -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

View file

@ -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
});
};
});

View file

@ -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

View file

@ -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;
}

View file

@ -3,8 +3,9 @@
.close-button {
color: $dark-gray;
position: absolute;
top: 10px;
right: 15px;
top: 5px;
right: 10px;
padding: 15px;
font-size: 36px;
}
.complete-layout {
@ -13,11 +14,22 @@
height: 100%;
&__expand {
display: flex;
flex-direction: column;
flex-grow: 1;
align-items: center;
justify-content: center;
text-align: center;
opacity: 0;
transition: opacity .3s;
&.fade-in {
opacity: 1;
}
}
}
.share-the-love-illustration {
width: 5rem;
margin: 1rem;
}
.title {
font-size: 20px;
font-weight: bold;
@ -45,14 +57,23 @@
height: 50px;
}
.share-buttons {
padding: 50px 10px;
padding: 50px 10px 30px;
background-color: $subtle-gray;
text-align: center;
transition: transform .3s cubic-bezier(0.4, 0.0, 0.2, 1) .2s, opacity .5s ease-in .2s;
transform: translateY(100%);
opacity: 0;
&.slide-up {
transform: translateY(0);
opacity: 1;
}
}
.share-buttons__action {
display: inline-block;
color: #667;
font-size: .9rem;
width: 90px;
height: 90px;
margin-bottom: 20px;
}
}

View file

@ -28,9 +28,11 @@
}
.user-feedback {
border-top: 1px solid $subtle-gray;
border-bottom: 1px solid $subtle-gray;
padding: 20px;
width: 100%;
margin-bottom: 20px;
-webkit-appearance: none;
}
.send-feedback-star {
height: 1rem;