Merge pull request #5053 from cmgustavo/bug/feedback-02

Fix feedback issues
This commit is contained in:
Gustavo Maximiliano Cortez 2016-11-16 11:43:20 -03:00 committed by GitHub
commit 7b0d8cb2a7
12 changed files with 101 additions and 98 deletions

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('completeController', function($scope, $stateParams, $timeout, $log, platformInfo, configService, storageService) { angular.module('copayApp.controllers').controller('completeController', function($scope, $stateParams, $timeout, $log, $ionicHistory, $state, platformInfo, configService, storageService, lodash) {
$scope.score = parseInt($stateParams.score); $scope.score = parseInt($stateParams.score);
$scope.skipped = $stateParams.skipped == 'false' ? false : true; $scope.skipped = $stateParams.skipped == 'false' ? false : true;
$scope.isCordova = platformInfo.isCordova; $scope.isCordova = platformInfo.isCordova;
@ -37,7 +37,7 @@ angular.module('copayApp.controllers').controller('completeController', function
} }
storageService.getFeedbackInfo(function(error, info) { storageService.getFeedbackInfo(function(error, info) {
var feedbackInfo = JSON.parse(info); var feedbackInfo = lodash.isString(info) ? JSON.parse(info) : null;
feedbackInfo.sent = true; feedbackInfo.sent = true;
storageService.setFeedbackInfo(JSON.stringify(feedbackInfo), function() {}); storageService.setFeedbackInfo(JSON.stringify(feedbackInfo), function() {});
}); });
@ -90,4 +90,15 @@ angular.module('copayApp.controllers').controller('completeController', function
StatusBar.show(); StatusBar.show();
} }
}); });
$scope.close = function() {
$ionicHistory.clearHistory();
$ionicHistory.nextViewOptions({
disableAnimate: true,
historyRoot: true
});
$timeout(function() {
$state.go('tabs.home');
}, 100);
};
}); });

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('rateAppController', function($scope, $state, $stateParams, lodash, externalLinkService, configService, gettextCatalog, platformInfo, feedbackService, ongoingProcess) { angular.module('copayApp.controllers').controller('rateAppController', function($scope, $state, $stateParams, lodash, externalLinkService, configService, gettextCatalog, platformInfo, feedbackService, ongoingProcess, popupService) {
$scope.score = parseInt($stateParams.score); $scope.score = parseInt($stateParams.score);
var isAndroid = platformInfo.isAndroid; var isAndroid = platformInfo.isAndroid;
var isIOS = platformInfo.isIOS; var isIOS = platformInfo.isIOS;
@ -22,7 +22,7 @@ angular.module('copayApp.controllers').controller('rateAppController', function(
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Could not send feedback')); popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Could not send feedback'));
return; return;
} }
$state.go('feedback.complete', { $state.go('tabs.rate.complete', {
score: $stateParams.score, score: $stateParams.score,
skipped: true skipped: true
}); });
@ -44,7 +44,7 @@ angular.module('copayApp.controllers').controller('rateAppController', function(
}); });
$scope.sendFeedback = function() { $scope.sendFeedback = function() {
$state.go('feedback.send', { $state.go('tabs.rate.send', {
score: $scope.score score: $scope.score
}); });
}; };

View File

@ -7,11 +7,11 @@ angular.module('copayApp.controllers').controller('rateCardController', function
$scope.goFeedbackFlow = function() { $scope.goFeedbackFlow = function() {
if ($scope.isCordova && $scope.score == 5) { if ($scope.isCordova && $scope.score == 5) {
$state.go('feedback.rateApp', { $state.go('tabs.rate.rateApp', {
score: $scope.score score: $scope.score
}); });
} else { } else {
$state.go('feedback.send', { $state.go('tabs.rate.send', {
score: $scope.score score: $scope.score
}); });
} }

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('sendController', function($scope, $state, $log, $timeout, $stateParams, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, popupService, configService, lodash, feedbackService, ongoingProcess) { angular.module('copayApp.controllers').controller('sendController', function($scope, $state, $log, $timeout, $stateParams, $ionicNavBarDelegate, $ionicHistory, $ionicConfig, gettextCatalog, popupService, configService, lodash, feedbackService, ongoingProcess) {
$scope.sendFeedback = function(feedback, skip) { $scope.sendFeedback = function(feedback, skip) {
@ -33,7 +33,7 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
}); });
return; return;
} }
$state.go('feedback.complete', { $state.go('tabs.rate.complete', {
score: $stateParams.score, score: $stateParams.score,
skipped: skip skipped: skip
}); });
@ -41,9 +41,15 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
}; };
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.score = parseInt($stateParams.score); $scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;
$scope.feedback = {}; $scope.feedback = {};
if ($scope.score) {
$ionicNavBarDelegate.showBackButton(false);
$ionicConfig.views.swipeBackEnabled(false);
}
else $ionicNavBarDelegate.showBackButton(true);
switch ($scope.score) { switch ($scope.score) {
case 1: case 1:
$scope.reaction = gettextCatalog.getString("Ouch!"); $scope.reaction = gettextCatalog.getString("Ouch!");

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('txDetailsController', function($log, $ionicHistory, $scope, walletService, lodash, gettextCatalog, profileService, configService, externalLinkService, popupService, ongoingProcess) { angular.module('copayApp.controllers').controller('txDetailsController', function($log, $ionicHistory, $scope, $timeout, walletService, lodash, gettextCatalog, profileService, configService, externalLinkService, popupService, ongoingProcess) {
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.title = gettextCatalog.getString('Transaction'); $scope.title = gettextCatalog.getString('Transaction');
@ -29,6 +29,9 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
updateMemo(); updateMemo();
initActionList(); initActionList();
$timeout(function() {
$scope.$apply();
});
}); });
}); });

View File

@ -739,63 +739,51 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
/* /*
* *
* Feedback from home * Feedback
* *
*/ */
.state('feedback', { .state('tabs.feedback', {
url: '/feedback', url: '/feedback',
abstract: true,
template: '<ion-nav-view name="feedback"></ion-nav-view>'
})
.state('feedback.send', {
url: '/send/:score',
views: { views: {
'feedback': { 'tab-settings@tabs': {
controller: 'sendController', templateUrl: 'views/feedback/send.html',
templateUrl: 'views/feedback/send.html' controller: 'sendController'
} }
} }
}) })
.state('feedback.complete', { .state('tabs.rate', {
url: '/rate',
abstract: true
})
.state('tabs.rate.send', {
url: '/send/:score',
views: {
'tab-home@tabs': {
templateUrl: 'views/feedback/send.html',
controller: 'sendController'
}
}
})
.state('tabs.rate.complete', {
url: '/complete/:score/:skipped', url: '/complete/:score/:skipped',
views: { views: {
'feedback': { 'tab-home@tabs': {
controller: 'completeController', controller: 'completeController',
templateUrl: 'views/feedback/complete.html' templateUrl: 'views/feedback/complete.html'
} }
} }
}) })
.state('feedback.rateApp', { .state('tabs.rate.rateApp', {
url: '/rateApp/:score', url: '/rateApp/:score',
views: { views: {
'feedback': { 'tab-home@tabs': {
controller: 'rateAppController', controller: 'rateAppController',
templateUrl: 'views/feedback/rateApp.html' templateUrl: 'views/feedback/rateApp.html'
} }
} }
}) })
/*
*
* Feedback from settings
*
*/
.state('tabs.settings.feedback', {
url: '/feedback',
abstract: true,
template: '<ion-nav-view name="feedback"></ion-nav-view>'
})
.state('tabs.settings.feedback.send', {
url: '/send',
views: {
'tab-settings@tabs': {
controller: 'sendController',
templateUrl: 'views/feedback/send.html'
}
}
})
/* /*
* *
* Buy or Sell Bitcoin * Buy or Sell Bitcoin

View File

@ -42,6 +42,7 @@
bottom: 0; bottom: 0;
width: 100%; width: 100%;
position: absolute; position: absolute;
padding: 20px;
background-color: $subtle-gray; background-color: $subtle-gray;
.row { .row {
margin: 20px 0px 20px; margin: 20px 0px 20px;

View File

@ -28,9 +28,7 @@
} }
.user-feedback { .user-feedback {
border-top: 1px solid $subtle-gray; border-top: 1px solid $subtle-gray;
padding: 20px;
width: 100%; width: 100%;
height: 6rem;
} }
.send-feedback-star { .send-feedback-star {
height: 1rem; height: 1rem;

View File

@ -1,7 +1,7 @@
<ion-view id="complete"> <ion-view id="complete" hide-tabs>
<ion-content scroll="false"> <ion-content scroll="false">
<div class="item item-icon-right item-heading"> <div class="padding oh">
<a ui-sref="tabs.home"><i class="icon ion-ios-close-empty close-home-tip"></i></a> <a class="right size-36" ng-click="close()"><i class="icon ion-ios-close-empty close-home-tip"></i></a>
</div> </div>
<div ng-show="skipped && isCordova"> <div ng-show="skipped && isCordova">
<div ng-show="score > 3"> <div ng-show="score > 3">
@ -53,45 +53,41 @@
</div> </div>
<div class="share-buttons" ng-if="isCordova && score > 3"> <div class="share-buttons" ng-if="isCordova && score > 3">
<div class="ng-hide" ng-show="socialsharing" ng-if="score >= 4"> <div class="ng-hide" ng-show="socialsharing" ng-if="score >= 4">
<div class="row"> <div class="left text-center m10r ng-hide" ng-show="facebook" ng-click="shareFacebook()">
<div class="ng-hide" ng-show="facebook" ng-click="shareFacebook()"> <i class="icon socialsharing-icon">
<i class="icon socialsharing-icon"> <img src="img/social-icons/ico-social-facebook.svg"/>
<img src="img/social-icons/ico-social-facebook.svg"/> </i>
</i> <div>Facebook</div>
<span>Facebook</span>
</div>
<div class="ng-hide" ng-show="twitter" ng-click="shareTwitter()">
<i class="icon socialsharing-icon">
<img src="img/social-icons/ico-social-twitter.svg"/>
</i>
<span>Twitter</span>
</div>
<div class="ng-hide" ng-show="googleplus" ng-click="shareGooglePlus()">
<i class="icon socialsharing-icon">
<img src="img/social-icons/ico-social-googleplus.svg"/>
</i>
<span>Google+</span>
</div>
</div> </div>
<div class="row"> <div class="left text-center m10r ng-hide" ng-show="twitter" ng-click="shareTwitter()">
<div class="ng-hide" ng-show="email" ng-click="shareEmail()"> <i class="icon socialsharing-icon">
<i class="icon socialsharing-icon"> <img src="img/social-icons/ico-social-twitter.svg"/>
<img src="img/social-icons/ico-social-email.svg"/> </i>
</i> <div>Twitter</div>
<span>Email</span> </div>
</div> <div class="left text-center m10r ng-hide" ng-show="googleplus" ng-click="shareGooglePlus()">
<div class="ng-hide" ng-show="whatsapp" ng-click="shareWhatsapp()"> <i class="icon socialsharing-icon">
<i class="icon socialsharing-icon"> <img src="img/social-icons/ico-social-googleplus.svg"/>
<img src="img/social-icons/ico-social-whatsapp.svg"/> </i>
</i> <div>Google+</div>
<span>Whatsapp</span> </div>
</div> <div class="left text-center m10r ng-hide" ng-show="email" ng-click="shareEmail()">
<div ng-click="shareMessage()"> <i class="icon socialsharing-icon">
<i class="icon socialsharing-icon"> <img src="img/social-icons/ico-social-email.svg"/>
<img src="img/social-icons/ico-social-message.svg"/> </i>
</i> <div>Email</div>
<span>Message</span> </div>
</div> <div class="left text-center m10r ng-hide" ng-show="whatsapp" ng-click="shareWhatsapp()">
<i class="icon socialsharing-icon">
<img src="img/social-icons/ico-social-whatsapp.svg"/>
</i>
<div>Whatsapp</div>
</div>
<div class="left text-center m10r" ng-click="shareMessage()">
<i class="icon socialsharing-icon">
<img src="img/social-icons/ico-social-message.svg"/>
</i>
<div>Message</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,6 +1,6 @@
<ion-view id="rate-app"> <ion-view id="rate-app" hide-tabs>
<ion-content scroll="false"> <ion-content scroll="false">
<a class="right skip skip-rating" ng-click="skip()">Not now</a> <a class="right skip skip-rating" ng-click="skip()" translate>Not now</a>
<div class="title"> <div class="title">
<span translate>Thank you!</span> <span translate>Thank you!</span>
<div> <div>

View File

@ -1,9 +1,9 @@
<ion-view id="send-feedback"> <ion-view id="send-feedback" hide-tabs>
<ion-nav-bar class="bar-royal"> <ion-nav-bar class="bar-royal">
<ion-nav-back-button ng-show="!score"> <ion-nav-back-button>
</ion-nav-back-button> </ion-nav-back-button>
<ion-nav-buttons side="right"> <ion-nav-buttons side="secondary">
<button ng-show="score" class="button button-clear skip ng-hide" ng-click="sendFeedback(null, true)" translate> <button ng-show="score" class="button no-border" ng-click="sendFeedback(null, true)" translate>
Skip Skip
</button> </button>
</ion-nav-buttons> </ion-nav-buttons>
@ -15,7 +15,7 @@
<span>{{reaction}}</span> <span>{{reaction}}</span>
</div> </div>
</div> </div>
<div class="col col-50 rating"> <div class="col col-50 rating" ng-if="score">
<img class="send-feedback-star" ng-if="1 <= score" src="img/ico-star-filled.svg"/> <img class="send-feedback-star" ng-if="1 <= score" src="img/ico-star-filled.svg"/>
<img class="send-feedback-star" ng-if="1 > score" src="img/ico-star.svg"/> <img class="send-feedback-star" ng-if="1 > score" src="img/ico-star.svg"/>
<img class="send-feedback-star" ng-if="2 <= score" src="img/ico-star-filled.svg"/> <img class="send-feedback-star" ng-if="2 <= score" src="img/ico-star-filled.svg"/>
@ -31,8 +31,8 @@
<div class="comment"> <div class="comment">
<span translate>{{comment}}</span> <span translate>{{comment}}</span>
</div> </div>
<textarea class="user-feedback" ng-model="feedback.value" placeholder="Your ideas, feedback, or comments" autofocus></textarea> <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-full button-primary" ng-click="sendFeedback(feedback.value, false)" translate> <button ng-disabled="!feedback.value" type="submit" class="button button-standard button-primary" ng-click="sendFeedback(feedback.value, false)" translate>
Send Send
</button> </button>
</ion-content> </ion-content>

View File

@ -29,7 +29,7 @@
<img src="img/icon-link.svg" class="bg just-a-hint"/> <img src="img/icon-link.svg" class="bg just-a-hint"/>
</i> </i>
</a> </a>
<a class="item item-icon-left item-icon-right" ui-sref="tabs.settings.feedback.send"> <a class="item item-icon-left item-icon-right" ui-sref="tabs.feedback">
<i class="icon big-icon-svg"> <i class="icon big-icon-svg">
<img src="img/icon-send-feedback.svg" class="bg"/> <img src="img/icon-send-feedback.svg" class="bg"/>
</i> </i>