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';
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.skipped = $stateParams.skipped == 'false' ? false : true;
$scope.isCordova = platformInfo.isCordova;
@ -37,7 +37,7 @@ angular.module('copayApp.controllers').controller('completeController', function
}
storageService.getFeedbackInfo(function(error, info) {
var feedbackInfo = JSON.parse(info);
var feedbackInfo = lodash.isString(info) ? JSON.parse(info) : null;
feedbackInfo.sent = true;
storageService.setFeedbackInfo(JSON.stringify(feedbackInfo), function() {});
});
@ -90,4 +90,15 @@ angular.module('copayApp.controllers').controller('completeController', function
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';
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);
var isAndroid = platformInfo.isAndroid;
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'));
return;
}
$state.go('feedback.complete', {
$state.go('tabs.rate.complete', {
score: $stateParams.score,
skipped: true
});
@ -44,7 +44,7 @@ angular.module('copayApp.controllers').controller('rateAppController', function(
});
$scope.sendFeedback = function() {
$state.go('feedback.send', {
$state.go('tabs.rate.send', {
score: $scope.score
});
};

View File

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

View File

@ -1,6 +1,6 @@
'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) {
@ -33,7 +33,7 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
});
return;
}
$state.go('feedback.complete', {
$state.go('tabs.rate.complete', {
score: $stateParams.score,
skipped: skip
});
@ -41,9 +41,15 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
};
$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 = {};
if ($scope.score) {
$ionicNavBarDelegate.showBackButton(false);
$ionicConfig.views.swipeBackEnabled(false);
}
else $ionicNavBarDelegate.showBackButton(true);
switch ($scope.score) {
case 1:
$scope.reaction = gettextCatalog.getString("Ouch!");

View File

@ -1,6 +1,6 @@
'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.title = gettextCatalog.getString('Transaction');
@ -29,6 +29,9 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
updateMemo();
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',
abstract: true,
template: '<ion-nav-view name="feedback"></ion-nav-view>'
views: {
'tab-settings@tabs': {
templateUrl: 'views/feedback/send.html',
controller: 'sendController'
}
}
})
.state('feedback.send', {
.state('tabs.rate', {
url: '/rate',
abstract: true
})
.state('tabs.rate.send', {
url: '/send/:score',
views: {
'feedback': {
controller: 'sendController',
templateUrl: 'views/feedback/send.html'
'tab-home@tabs': {
templateUrl: 'views/feedback/send.html',
controller: 'sendController'
}
}
})
.state('feedback.complete', {
.state('tabs.rate.complete', {
url: '/complete/:score/:skipped',
views: {
'feedback': {
'tab-home@tabs': {
controller: 'completeController',
templateUrl: 'views/feedback/complete.html'
}
}
})
.state('feedback.rateApp', {
.state('tabs.rate.rateApp', {
url: '/rateApp/:score',
views: {
'feedback': {
'tab-home@tabs': {
controller: 'rateAppController',
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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<ion-view id="complete">
<ion-view id="complete" hide-tabs>
<ion-content scroll="false">
<div class="item item-icon-right item-heading">
<a ui-sref="tabs.home"><i class="icon ion-ios-close-empty close-home-tip"></i></a>
<div class="padding oh">
<a class="right size-36" ng-click="close()"><i class="icon ion-ios-close-empty close-home-tip"></i></a>
</div>
<div ng-show="skipped && isCordova">
<div ng-show="score > 3">
@ -53,45 +53,41 @@
</div>
<div class="share-buttons" ng-if="isCordova && score > 3">
<div class="ng-hide" ng-show="socialsharing" ng-if="score >= 4">
<div class="row">
<div class="ng-hide" ng-show="facebook" ng-click="shareFacebook()">
<div class="left text-center m10r ng-hide" ng-show="facebook" ng-click="shareFacebook()">
<i class="icon socialsharing-icon">
<img src="img/social-icons/ico-social-facebook.svg"/>
</i>
<span>Facebook</span>
<div>Facebook</div>
</div>
<div class="ng-hide" ng-show="twitter" ng-click="shareTwitter()">
<div class="left text-center m10r 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>Twitter</div>
</div>
<div class="ng-hide" ng-show="googleplus" ng-click="shareGooglePlus()">
<div class="left text-center m10r 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>Google+</div>
</div>
</div>
<div class="row">
<div class="ng-hide" ng-show="email" ng-click="shareEmail()">
<div class="left text-center m10r ng-hide" ng-show="email" ng-click="shareEmail()">
<i class="icon socialsharing-icon">
<img src="img/social-icons/ico-social-email.svg"/>
</i>
<span>Email</span>
<div>Email</div>
</div>
<div class="ng-hide" ng-show="whatsapp" ng-click="shareWhatsapp()">
<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>
<span>Whatsapp</span>
<div>Whatsapp</div>
</div>
<div ng-click="shareMessage()">
<div class="left text-center m10r" ng-click="shareMessage()">
<i class="icon socialsharing-icon">
<img src="img/social-icons/ico-social-message.svg"/>
</i>
<span>Message</span>
</div>
<div>Message</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">
<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">
<span translate>Thank you!</span>
<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-back-button ng-show="!score">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="right">
<button ng-show="score" class="button button-clear skip ng-hide" ng-click="sendFeedback(null, true)" translate>
<ion-nav-buttons side="secondary">
<button ng-show="score" class="button no-border" ng-click="sendFeedback(null, true)" translate>
Skip
</button>
</ion-nav-buttons>
@ -15,7 +15,7 @@
<span>{{reaction}}</span>
</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.svg"/>
<img class="send-feedback-star" ng-if="2 <= score" src="img/ico-star-filled.svg"/>
@ -31,8 +31,8 @@
<div class="comment">
<span translate>{{comment}}</span>
</div>
<textarea class="user-feedback" ng-model="feedback.value" 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>
<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
</button>
</ion-content>

View File

@ -29,7 +29,7 @@
<img src="img/icon-link.svg" class="bg just-a-hint"/>
</i>
</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">
<img src="img/icon-send-feedback.svg" class="bg"/>
</i>