Merge pull request #5061 from cmgustavo/feat/adds-share-app

Fix animation after send feedback (back). Adds Share BitPay option in…
This commit is contained in:
Jason Dreyzehner 2016-11-16 14:59:51 -05:00 committed by GitHub
commit 57ab21dd55
5 changed files with 27 additions and 12 deletions

View File

@ -1,8 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('completeController', function($scope, $stateParams, $timeout, $log, $ionicHistory, $state, platformInfo, configService, storageService, lodash) { 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; $scope.isCordova = platformInfo.isCordova;
var config = configService.getSync(); var config = configService.getSync();
@ -32,6 +30,9 @@ angular.module('copayApp.controllers').controller('completeController', function
$scope.$on("$ionicView.beforeEnter", function(event, data) { $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;
storageService.getFeedbackInfo(function(error, info) { storageService.getFeedbackInfo(function(error, info) {
var feedbackInfo = lodash.isString(info) ? JSON.parse(info) : null; var feedbackInfo = lodash.isString(info) ? JSON.parse(info) : null;
feedbackInfo.sent = true; feedbackInfo.sent = true;
@ -92,13 +93,10 @@ angular.module('copayApp.controllers').controller('completeController', function
}); });
$scope.close = function() { $scope.close = function() {
$ionicHistory.clearHistory();
$ionicHistory.nextViewOptions({ $ionicHistory.nextViewOptions({
disableAnimate: true, disableAnimate: false,
historyRoot: true historyRoot: true
}); });
$timeout(function() { $ionicHistory.goBack(-2);
$state.go('tabs.home');
}, 100);
}; };
}); });

View File

@ -26,13 +26,10 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
popupService.showAlert(gettextCatalog.getString('Thank you!'), gettextCatalog.getString('A member of the team will review your feedback as soon as possible.'), function() { popupService.showAlert(gettextCatalog.getString('Thank you!'), gettextCatalog.getString('A member of the team will review your feedback as soon as possible.'), function() {
$scope.feedback.value = ''; $scope.feedback.value = '';
$ionicHistory.nextViewOptions({ $ionicHistory.nextViewOptions({
disableAnimate: true, disableAnimate: false,
historyRoot: true historyRoot: true
}); });
$ionicHistory.clearHistory(); $ionicHistory.goBack();
$timeout(function() {
$state.go('tabs.settings');
});
}); });
return; return;
} }

View File

@ -9,6 +9,7 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
var isWP = platformInfo.isWP; var isWP = platformInfo.isWP;
$scope.usePushNotifications = isCordova && !isWP; $scope.usePushNotifications = isCordova && !isWP;
$scope.isCordova = isCordova;
$scope.appName = $window.appConfig.nameCase; $scope.appName = $window.appConfig.nameCase;

View File

@ -752,6 +752,18 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
} }
}) })
.state('tabs.feedback.shareApp', {
url: '/shareApp/:score/:skipped',
views: {
'tab-settings@tabs': {
controller: 'completeController',
templateUrl: 'views/feedback/complete.html'
}
},
customConfig: {
hideStatusBar: true
}
})
.state('tabs.rate', { .state('tabs.rate', {
url: '/rate', url: '/rate',
abstract: true abstract: true

View File

@ -36,6 +36,13 @@
<span translate>Send Feedback</span> <span translate>Send Feedback</span>
<i class="icon bp-arrow-right"></i> <i class="icon bp-arrow-right"></i>
</a> </a>
<a ng-if="isCordova" class="item item-icon-left item-icon-right" ui-sref="tabs.feedback.shareApp({score: 4, skipped: true})">
<i class="icon big-icon-svg">
<img src="img/icon-send-feedback.svg" class="bg"/>
</i>
<span translate>Share {{appName}}</span>
<i class="icon bp-arrow-right"></i>
</a>
<div class="item item-divider" translate>Preferences</div> <div class="item item-divider" translate>Preferences</div>