Fix feedback issues

This commit is contained in:
Gustavo Maximiliano Cortez 2016-11-16 11:16:20 -03:00
commit e7bb449b6e
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
11 changed files with 98 additions and 93 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>'
})
.state('feedback.send', {
url: '/send/:score',
views: {
'feedback': {
controller: 'sendController',
templateUrl: 'views/feedback/send.html'
'tab-settings@tabs': {
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',
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;