Merge pull request #5066 from bitjson/master

fix(feedback): improve design of feedback flow, correct several logic issues
This commit is contained in:
Jason Dreyzehner 2016-11-17 10:52:25 -05:00 committed by GitHub
commit b18dcc4734
17 changed files with 172 additions and 123 deletions

View File

@ -4,40 +4,60 @@ angular.module('copayApp.controllers').controller('completeController', function
$scope.isCordova = platformInfo.isCordova;
var config = configService.getSync();
function quickFeedback(cb){
window.plugins.spinnerDialog.show();
$timeout(window.plugins.spinnerDialog.hide, 300);
$timeout(cb, 20);
}
$scope.shareFacebook = function() {
window.plugins.socialsharing.shareVia($scope.shareFacebookVia, null, null, null, config.download.url);
quickFeedback(function(){
window.plugins.socialsharing.shareVia($scope.shareFacebookVia, null, null, null, config.download.url);
});
};
$scope.shareTwitter = function() {
window.plugins.socialsharing.shareVia($scope.shareTwitterVia, null, null, null, config.download.url);
quickFeedback(function(){
window.plugins.socialsharing.shareVia($scope.shareTwitterVia, null, null, null, config.download.url);
});
};
$scope.shareGooglePlus = function() {
window.plugins.socialsharing.shareVia($scope.shareGooglePlusVia, config.download.url);
quickFeedback(function(){
window.plugins.socialsharing.shareVia($scope.shareGooglePlusVia, config.download.url);
});
};
$scope.shareEmail = function() {
window.plugins.socialsharing.shareViaEmail(config.download.url);
quickFeedback(function(){
window.plugins.socialsharing.shareViaEmail(config.download.url);
});
};
$scope.shareWhatsapp = function() {
window.plugins.socialsharing.shareViaWhatsApp(config.download.url);
quickFeedback(function(){
window.plugins.socialsharing.shareViaWhatsApp(config.download.url);
});
};
$scope.shareMessage = function() {
window.plugins.socialsharing.shareViaSMS(config.download.url);
quickFeedback(function(){
window.plugins.socialsharing.shareViaSMS(config.download.url);
});
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$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;
$scope.fromSettings = (data.stateParams && data.stateParams.fromSettings) ? true : false;
if (!$scope.fromSettings) {
$ionicNavBarDelegate.showBackButton(false);
$ionicConfig.views.swipeBackEnabled(false);
} else $ionicNavBarDelegate.showBackButton(true);
} else {
$ionicNavBarDelegate.showBackButton(true);
$ionicConfig.views.swipeBackEnabled(true);
}
storageService.getFeedbackInfo(function(error, info) {
var feedbackInfo = lodash.isString(info) ? JSON.parse(info) : null;
@ -46,6 +66,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,7 +8,6 @@ angular.module('copayApp.controllers').controller('rateAppController', function(
var config = configService.getSync();
$scope.skip = function() {
var dataSrc = {
"Email": lodash.values(config.emailFor)[0] || ' ',
"Feedback": ' ',
@ -17,18 +16,15 @@ angular.module('copayApp.controllers').controller('rateAppController', function(
"Platform": ionic.Platform.platform(),
"DeviceVersion": ionic.Platform.version()
};
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
});
};
@ -45,5 +41,10 @@ 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,
skipped: true,
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) {
@ -45,9 +54,8 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
$scope.feedback = {};
if ($scope.score) {
$ionicNavBarDelegate.showBackButton(false);
$ionicConfig.views.swipeBackEnabled(false);
} else $ionicNavBarDelegate.showBackButton(true);
}
switch ($scope.score) {
case 1:
@ -71,7 +79,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.justFeedback = true;
$scope.comment = gettextCatalog.getString("We're always looking for ways to improve BitPay. How could we improve your experience?");
break;
}
@ -81,4 +89,12 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
$scope.showForm = true;
});
$scope.goBack = function() {
$ionicHistory.nextViewOptions({
disableAnimate: false,
historyRoot: true
});
$ionicHistory.goBack();
};
});

View File

@ -759,9 +759,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
controller: 'completeController',
templateUrl: 'views/feedback/complete.html'
}
},
customConfig: {
hideStatusBar: true
}
})
.state('tabs.rate', {

View File

@ -7,7 +7,8 @@
// Please include a description of the problem solved by the workaround.
// class to dynamically hide the ion-nav-bar for v1 Amazon flow
ion-nav-bar.hide { display: block !important; }
// Fix hide-nav-bar (true|false)
//ion-nav-bar.hide { display: block !important; }
// the ion tabs element never needs it's own background (backgrounds are
// rendered by the tabs), and the default background would cover the scanner

View File

@ -1,9 +1,11 @@
#complete {
background-color: #ffffff;
background-color: #fff;
.close-button {
color: #fff;
color: $dark-gray;
position: absolute;
right: 15px;
top: 5px;
right: 10px;
padding: 15px;
font-size: 36px;
}
.complete-layout {
@ -12,12 +14,27 @@
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;
}
}
}
.title {
.share-the-love-illustration {
width: 5rem;
margin: 1rem;
}
.send-feedback-illustration {
height: 21rem;
margin: 1rem;
}
.feedback-title {
font-size: 20px;
font-weight: bold;
color: $dark-gray;
@ -44,14 +61,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

@ -1,24 +1,29 @@
#rate-app {
background-color: #ffffff;
.skip {
margin-top: 15px;
color: #667;
}
text-align: center;
.skip-rating {
margin-right: 15px;
color: $dark-gray;
position: absolute;
top: 5px;
right: 10px;
padding: 15px;
}
.icon-svg > img {
width: 80px;
height: 80px;
margin-top: 15px;
}
.title {
.feedback-title {
font-size: 20px;
font-weight: bold;
color: $dark-gray;
margin: 80px 50px 10px;
text-align: center;
}
.share-the-love-illustration {
width: 5rem;
margin: 1rem;
}
.subtitle {
padding: 10px 30px 20px 40px;
color: #667;

View File

@ -9,7 +9,7 @@
.feedback-heading {
padding-top: 20px
}
.title {
.feedback-title {
padding-left: 10px;
font-size: 20px;
font-weight: bold;
@ -28,12 +28,26 @@
}
.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;
margin-left: 5px;
}
.form-fade-in {
opacity: 0;
animation-name: fadeIn;
animation-duration: .5s;
animation-fill-mode: forwards;
animation-timing-function: ease-in;
}
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}

View File

@ -5,7 +5,7 @@
<desc>Created with sketchtool.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Icons" transform="translate(-277.000000, -769.000000)" stroke="#8F8F90">
<g id="Icons" transform="translate(-277.000000, -769.000000)" stroke="#9b9bab">
<g id="icons/list-items/sync" transform="translate(278.000000, 770.000000)">
<g id="Group" transform="translate(0.347826, 0.378151)">
<path d="M14.889225,12.3491049 C16.1172023,11.0140665 16.8846881,9.34526854 16.8846881,7.50959079 C16.8846881,3.33759591 13.1240076,0 8.44234405,0 C3.76068053,0 0,3.33759591 0,7.50959079 C0,11.6815857 3.76068053,15.0191816 8.44234405,15.0191816 C9.28657845,15.0191816 10.0540643,14.9357417 10.8215501,14.685422 L15.3497164,16.6879795 L14.889225,12.3491049 L14.889225,12.3491049 Z" id="Shape"></path>
@ -13,4 +13,4 @@
</g>
</g>
</g>
</svg>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -5,7 +5,7 @@
<desc>Created with sketchtool.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Icons" transform="translate(-542.000000, -768.000000)" stroke="#8F8F90">
<g id="Icons" transform="translate(-542.000000, -768.000000)" stroke="#9b9bab">
<g id="icons/list-items/sync" transform="translate(543.000000, 769.000000)">
<g id="Group" transform="translate(0.392391, 0.413043)">
<path d="M6.28767826,13.3123913 C6.33555,14.6357826 7.36361522,15.6956522 8.6326087,15.6956522 C9.90160217,15.6956522 10.927313,14.6357826 10.9759696,13.3123913" id="Shape"></path>
@ -15,4 +15,4 @@
</g>
</g>
</g>
</svg>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -5,7 +5,7 @@
<desc>Created with sketchtool.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Icons" transform="translate(-666.000000, -770.000000)" stroke="#8F8F90">
<g id="Icons" transform="translate(-666.000000, -770.000000)" stroke="#9b9bab">
<g id="icons/list-items/sync" transform="translate(666.769231, 770.000000)">
<g id="Group" transform="translate(0.368286, 0.383523)">
<g id="holidays-24px-outline_message" transform="translate(0.298380, 0.949811)">
@ -20,4 +20,4 @@
</g>
</g>
</g>
</svg>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -1,87 +1,53 @@
<ion-view id="complete" hide-tabs>
<ion-view id="complete" hide-nav-bar="!fromSettings" hide-tabs>
<ion-nav-bar class="bar-royal">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="secondary">
<a ng-show="!fromSettings" class="close-button" ng-click="close()"><i class="icon ion-ios-close-empty close-home-tip"></i></a>
</ion-nav-buttons>
<ion-nav-title>{{'Share BitPay' | translate}}</ion-nav-title>
</ion-nav-bar>
<ion-content scroll="false">
<div ng-show="skipped && isCordova">
<div ng-show="score > 3">
<div class="title" translate>Invite friends to BitPay!</div>
<div class="text-center">
<i class="icon addressbook-icon-svg">
<img src="img/address-book-add.svg"/>
</i>
<ion-content scroll="false" has-header="fromSettings">
<a class="close-button ng-hide" ng-show="!fromSettings" ng-click="close()"><i class="icon ion-ios-close-empty close-home-tip"></i></a>
<div class="complete-layout">
<div class="complete-layout__expand" ng-class="{'fade-in': !animate || socialsharing}">
<div ng-show="fromSettings">
<img src="img/ico-positive-feedback.svg" class="share-the-love-illustration"/>
<div class="subtitle" translate>Share the love by inviting your friends.</div>
</div>
<div class="subtitle">
<span translate>Share the love by inviting your friends.</span>
</div>
</div>
<div ng-show="score <= 3">
<div class="title" translate>Thank you!</div>
<div class="subtitle">
<span translate>A member of the team will review your feedback as soon as possible.</span>
</div>
<div class="subtitle" ng-if="score <= 3 || !isCordova">
<span translate>If you have additional feedback, please let us know by tapping the "Send feedback" option in the Settings tab.</span>
</div>
<div ng-if="score <= 3 || !isCordova">
<div class="text-center">
<i class="icon icon-svg">
<img src="img/illustration-send-feedback.png"/>
</i>
<div ng-show="!fromSettings">
<div class="feedback-title" translate>Thank you!</div>
<div class="subtitle" ng-show="!skipped" translate>A member of the team will review your feedback as soon as possible.</div>
<div ng-if="score <= 3 || !socialsharing">
<div class="subtitle" translate>If you have additional feedback, please let us know by tapping the "Send feedback" option in the Settings tab.</div>
<img src="img/illustration-send-feedback.png" class="send-feedback-illustration"/>
</div>
<div class="subtitle" ng-if="score > 3 && socialsharing" translate>Share the love by inviting your friends.</div>
</div>
</div>
</div>
<div ng-show="!skipped || !isCordova">
<div class="title" translate>Thank you!</div>
<div class="subtitle">
<span translate>A member of the team will review your feedback as soon as possible.</span>
</div>
<div class="subtitle" ng-if="score <= 3 || !isCordova">
<span translate>If you have additional feedback, please let us know by tapping the "Send feedback" option in the Settings tab.</span>
</div>
<div ng-if="score <= 3 || !isCordova">
<div class="text-center">
<i class="icon icon-svg">
<img src="img/illustration-send-feedback.png"/>
</i>
</div>
</div>
<div class="text-center" ng-if="score > 3 && isCordova">
<span translate>Share the love by inviting your friends.</span>
</div>
</div>
<div class="share-buttons" ng-if="isCordova && score > 3">
<div class="ng-hide" ng-show="socialsharing" ng-if="score >= 4">
<div class="share-buttons__action ng-hide" ng-show="facebook" ng-click="shareFacebook()">
<div class="share-buttons" ng-if="score > 3 && socialsharing" ng-class="{'slide-up': socialsharing }">
<div class="share-buttons__action" ng-show="facebook" ng-click="shareFacebook()">
<i class="icon socialsharing-icon">
<img src="img/social-icons/ico-social-facebook.svg"/>
</i>
<div>Facebook</div>
</div>
<div class="share-buttons__action ng-hide" ng-show="twitter" ng-click="shareTwitter()">
<div class="share-buttons__action" ng-show="twitter" ng-click="shareTwitter()">
<i class="icon socialsharing-icon">
<img src="img/social-icons/ico-social-twitter.svg"/>
</i>
<div>Twitter</div>
</div>
<div class="share-buttons__action ng-hide" ng-show="googleplus" ng-click="shareGooglePlus()">
<div class="share-buttons__action" ng-show="googleplus" ng-click="shareGooglePlus()">
<i class="icon socialsharing-icon">
<img src="img/social-icons/ico-social-googleplus.svg"/>
</i>
<div>Google+</div>
</div>
<div class="share-buttons__action ng-hide" ng-show="email" ng-click="shareEmail()">
<div class="share-buttons__action" ng-show="email" ng-click="shareEmail()">
<i class="icon socialsharing-icon">
<img src="img/social-icons/ico-social-email.svg"/>
</i>
<div>Email</div>
</div>
<div class="share-buttons__action ng-hide" ng-show="whatsapp" ng-click="shareWhatsapp()">
<div class="share-buttons__action" ng-show="whatsapp" ng-click="shareWhatsapp()">
<i class="icon socialsharing-icon">
<img src="img/social-icons/ico-social-whatsapp.svg"/>
</i>

View File

@ -1,25 +1,19 @@
<ion-view id="rate-app" hide-tabs>
<ion-content scroll="false">
<a class="right skip skip-rating" ng-click="skip()" translate>Not now</a>
<div class="title">
<span translate>Thank you!</span>
<div>
<i class="icon icon-svg">
<img src="img/ico-positive-feedback.svg" class="bg"/>
</i>
</div>
</div>
<div class="subtitle text-center">
<a class="skip-rating" ng-click="skip()" translate>Not now</a>
<div class="feedback-title" translate>Thank you!</div>
<img src="img/ico-positive-feedback.svg" class="share-the-love-illustration"/>
<div class="subtitle">
<span translate>5-star ratings help us get BitPay into more hands, and more users means more resources can be committed to the app!</span>
</div>
<div class="subtitle text-center">
<div class="subtitle">
<span class="text-bold" translate>Would you be willing to rate BitPay in the app store?</span>
</div>
<div class="buttons">
<button type="submit" class="button button-standard button-primary" ng-click="goAppStore()">
<span translate>Rate on the app store</span>
</button>
<button type="submit" class="button button-standard button-primary button-clear" ng-click="sendFeedback()">
<button type="submit" class="button button-standard button-secondary button-clear" ng-click="sendFeedback()">
<span translate>Send us feedback instead</span>
</button>
</div>

View File

@ -1,17 +1,24 @@
<ion-view id="send-feedback" hide-tabs>
<ion-nav-bar class="bar-royal">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-title>{{'Send Feedback' | translate}}</ion-nav-title>
<ion-nav-buttons side="primary">
<button ng-show="score" class="button no-border ng-hide" ng-click="sendFeedback(null, true, true)" translate>
Cancel
</button>
<button ng-show="!score || fromSettings" class="button back-button button-clear ng-hide" ng-click="goBack()">
<i class="icon ion-ios-arrow-thin-left"></i>
</button>
</ion-nav-buttons>
<ion-nav-buttons side="secondary">
<button ng-show="score" class="button no-border" ng-click="sendFeedback(null, true)" translate>
Skip
<button ng-disabled="!feedback.value" class="button no-border" type="submit" ng-click="sendFeedback(feedback.value, false)" translate>
Send
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content class="has-header" scroll="false">
<div class="row item item-sub feedback-heading">
<div class="col col-50">
<div class="title">
<div class="feedback-title" ng-if="!justFeedback">
<span>{{reaction}}</span>
</div>
</div>
@ -31,7 +38,7 @@
<div class="comment">
<span translate>{{comment}}</span>
</div>
<div ng-if="showForm">
<div ng-if="showForm" class="form-fade-in">
<textarea class="user-feedback" ng-model="feedback.value" rows="5" placeholder="Your ideas, feedback, or comments" autofocus></textarea>
<button ng-disabled="!feedback.value" type="submit" class="button button-standard button-primary" ng-click="sendFeedback(feedback.value, false)" translate>
Send

View File

@ -31,7 +31,7 @@
</a>
<a class="item item-icon-left item-icon-right" ui-sref="tabs.feedback">
<i class="icon big-icon-svg">
<img src="img/icon-send-feedback.svg" class="bg"/>
<img src="img/icon-language.svg" class="bg"/>
</i>
<span translate>Send Feedback</span>
<i class="icon bp-arrow-right"></i>