Merge pull request #5077 from bitjson/master

Make it possible to show feedback card from advanced settings
This commit is contained in:
Jason Dreyzehner 2016-11-17 15:48:29 -05:00 committed by GitHub
commit 8222885364
4 changed files with 80 additions and 6 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('advancedSettingsController', function($scope, $rootScope, $log, $window, lodash, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService) {
angular.module('copayApp.controllers').controller('advancedSettingsController', function($scope, $rootScope, $log, $window, lodash, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService, storageService, $ionicHistory, $timeout) {
var updateConfig = function() {
@ -27,8 +27,42 @@ angular.module('copayApp.controllers').controller('advancedSettingsController',
$scope.frequentlyUsedEnabled = {
value: config.frequentlyUsed.enabled
};
$scope.developmentUtilitiesEnabled = {
value: false
};
};
$scope.toggledDevelopmentUtils = function (){
if($scope.developmentUtilitiesEnabled.value){
$log.debug('User enabled development utilities.');
} else {
$log.debug('User disabled development utilities.');
}
}
$scope.activateFeedbackCard = function () {
$scope.feedbackCardActivating = true;
storageService.getFeedbackInfo(function(error, info) {
var feedbackInfo = JSON.parse(info);
// hardcoding so we can distinguish from normal operation
feedbackInfo.time = 1231006505; // genesis block time
feedbackInfo.version = window.version;
feedbackInfo.sent = false;
storageService.setFeedbackInfo(JSON.stringify(feedbackInfo), function() {
$log.debug('Activated feedback card with: ' + JSON.stringify(feedbackInfo));
$ionicHistory.clearCache();
$timeout(function(){
$scope.feedbackCardActivating = false;
$scope.feedbackCardActivated = true;
}, 500);
});
});
}
$scope.resetActivateFeedbackCard = function(){
$scope.feedbackCardActivated = false;
}
$scope.spendUnconfirmedChange = function() {
var opts = {
wallet: {

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('rateCardController', function($scope, $state, $timeout, gettextCatalog, platformInfo, storageService) {
angular.module('copayApp.controllers').controller('rateCardController', function($scope, $state, $timeout, $log, gettextCatalog, platformInfo, storageService) {
$scope.isCordova = platformInfo.isCordova;
$scope.score = 0;
@ -43,6 +43,7 @@ angular.module('copayApp.controllers').controller('rateCardController', function
};
$scope.hideCard = function() {
$log.debug('Feedback card dismissed.')
storageService.getFeedbackInfo(function(error, info) {
var feedbackInfo = JSON.parse(info);
feedbackInfo.sent = true;

View file

@ -63,6 +63,13 @@
.item-note {
color: $light-gray;
}
.item-toggle .toggle,
.item-button-right > .button {
top: 16px;
}
.item-button-right > .button {
font-size: 16px;
}
}
}

View file

@ -33,8 +33,8 @@
<ion-toggle class="has-comment" ng-model="spendUnconfirmed.value" toggle-class="toggle-balanced" ng-change="spendUnconfirmedChange()">
<span class="toggle-label" translate>Use Unconfirmed Funds</span>
</ion-toggle>
<div class="comment">
<span translate>If enabled, wallets will also try to spend unconfirmed funds. This option may cause transaction delays.</span>
<div class="comment" translate>
If enabled, wallets will also try to spend unconfirmed funds. This option may cause transaction delays.
</div>
<div class="item item-divider" translate>Experimental Features</div>
@ -47,8 +47,15 @@
<ion-toggle class="has-comment" ng-show="!isWP" ng-model="recentTransactionsEnabled.value" toggle-class="toggle-balanced" ng-change="recentTransactionsChange()">
<span class="toggle-label" translate>Recent Transaction Card</span>
</ion-toggle>
<div class="comment">
<span transaction>If enabled, the Recent Transactions card - a list of transactions occuring across all wallets - will appear in the Home tab.</span>
<div class="comment" translate>
If enabled, the Recent Transactions card - a list of transactions occuring across all wallets - will appear in the Home tab.
</div>
<ion-toggle class="has-comment" ng-model="developmentUtilitiesEnabled.value" toggle-class="toggle-balanced" ng-change="toggledDevelopmentUtils()">
<span class="toggle-label" translate>Development Utilities</span>
</ion-toggle>
<div class="comment" translate>
These features make it easier to test complex functionality on all devices. They may be unstable.
</div>
<!-- disable frequently used for this release -->
@ -60,6 +67,31 @@
<span transaction>If enabled, the Frequently Used card - a list of the most commonly chosen recipients - will appear in the Send tab.</span>
</div> -->
<div ng-show="developmentUtilitiesEnabled.value">
<div class="item item-divider" translate>Development Utilities</div>
<div class="settings-explanation">
<div class="settings-description" translate>
These utilities may be unstable. Proceed at your own risk.
</div>
</div>
<div class="item has-comment item-button-right">
Feedback Card
<button class="button" ng-click="activateFeedbackCard()" ng-show="!feedbackCardActivating && !feedbackCardActivated">
Activate
</button>
<button class="button button-clear" disabled ng-show="feedbackCardActivating">
<ion-spinner></ion-spinner>
</button>
<button class="button" ng-show="feedbackCardActivated" ng-click="resetActivateFeedbackCard()">
Activated
</button>
</div>
<div class="comment">
<span transaction>The feedback card is displayed on the Home tab at certain times. You can activate it immediately here.</span>
</div>
</div>
</div>
</ion-content>
</ion-view>