1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-22 17:02:17 -05:00

[WO-490] add bug reporting to error dialog

This commit is contained in:
Felix Hammerl 2014-08-05 16:13:54 +02:00 committed by Tankred Hase
parent 6bc2ee54f3
commit 275a602274
12 changed files with 25 additions and 9 deletions

View File

@ -89,6 +89,7 @@ define(function(require) {
message: message,
positiveBtnStr: str.updatePublicKeyPosBtn,
negativeBtnStr: str.updatePublicKeyNegBtn,
showBugReporter: false,
showNegativeBtn: true,
callback: callback
});

View File

@ -65,6 +65,7 @@ define(function(require) {
$scope.state.account.toggle(false);
$scope.$apply();
$scope.onError({
showBugReporter: false,
title: 'Success',
message: 'Exported keypair to file.'
});

View File

@ -61,7 +61,8 @@ define(function(require) {
// verifiy public key string
if (publicKeyArmored.indexOf('-----BEGIN PGP PUBLIC KEY BLOCK-----') < 0) {
$scope.onError({
errMsg: 'Invalid public key!'
showBugReporter: false,
message: 'Invalid public key!'
});
return;
}

View File

@ -25,6 +25,7 @@ define(function(require) {
$scope.importKey = function() {
if (!$scope.state.agree) {
$scope.onError({
showBugReporter: false,
message: termsMsg
});
return;
@ -42,6 +43,7 @@ define(function(require) {
$scope.setPassphrase = function() {
if (!$scope.state.agree) {
$scope.onError({
showBugReporter: false,
message: termsMsg
});
return;

View File

@ -32,7 +32,10 @@ define(function(require) {
$scope.verifyRecoveryToken = function(callback) {
if (!$scope.recoveryToken) {
$scope.onError(new Error('Please set the recovery token!'));
$scope.onError({
message: 'Please set the recovery token!',
showBugReporter: false
});
return;
}
@ -65,7 +68,10 @@ define(function(require) {
var inputCode = '' + $scope.code0 + $scope.code1 + $scope.code2 + $scope.code3 + $scope.code4 + $scope.code5;
if (!inputCode) {
$scope.onError(new Error('Please enter the keychain code!'));
$scope.onError({
message: 'Please enter the keychain code!',
showBugReporter: false
});
return;
}

View File

@ -27,7 +27,8 @@ define(function(require) {
// show message
$scope.onError({
title: 'Info',
message: 'Your PGP key has already been synced.'
message: 'Your PGP key has already been synced.',
showBugReporter: false
});
return;
}
@ -181,7 +182,8 @@ define(function(require) {
// show success message
$scope.onError({
title: 'Success',
message: 'Whiteout Keychain setup successful!'
message: 'Whiteout Keychain setup successful!',
showBugReporter: false
});
});
});

View File

@ -74,7 +74,8 @@ define(function(require) {
$scope.$apply();
$scope.onError({
title: 'Success',
message: 'Passphrase change complete.'
message: 'Passphrase change complete.',
showBugReporter: false
});
}
};

View File

@ -21,6 +21,7 @@ define(function(require) {
positiveBtnStr: options.positiveBtnStr || 'Ok',
negativeBtnStr: options.negativeBtnStr || 'Cancel',
showNegativeBtn: options.showNegativeBtn || false,
showBugReporter: (typeof options.showBugReporter !== 'undefined' ? options.showBugReporter : true),
callback: options.callback
};
// don't call apply for synchronous calls

View File

@ -13,7 +13,7 @@
.control {
button {
width: 100px;
min-width: 100px;
}
}
}

View File

@ -6,7 +6,7 @@
<li class="google enabled" popover="#google-info" wo-touch="connectToGoogle()">
<div><img src="img/google_logo.png" alt="Google Mail"></div>
</li>
<li class="whiteout disabled" popover="#whiteout-info" wo-touch="onError({message:'Whiteout Mailbox coming soon!', sync:true})">
<li class="whiteout disabled" popover="#whiteout-info" wo-touch="onError({message:'Whiteout Mailbox coming soon!', sync:true, showBugReporter:false})">
<div><img src="img/whiteout_logo.svg" alt="Whiteout Mailbox"></div>
</li>
<li class="tonline" popover="#tonline-info" wo-touch="connectToTonline()">

View File

@ -7,6 +7,7 @@
<div class="content">
<p>{{state.dialog.message}} <a ng-show="state.dialog.faqLink" href="{{state.dialog.faqLink}}" target="_blank">Learn more</a></p>
<div class="control">
<button wo-touch="confirm(true); state.writer.reportBug()" class="btn btn-alt" ng-show="state.writer && state.dialog.showBugReporter">Report this bug</button><!-- only show if we can actually report a bug, i.e. the writer is attached to the scope -->
<button wo-touch="confirm(false)" class="btn btn-alt" ng-show="state.dialog.showNegativeBtn">{{state.dialog.negativeBtnStr}}</button>
<button wo-touch="confirm(true)" class="btn">{{state.dialog.positiveBtnStr}}</button>
</div>

View File

@ -18,7 +18,7 @@
<li><a href="#" wo-touch="state.account.toggle(true); $event.preventDefault()">Account</a></li>
<li><a href="#" wo-touch="state.contacts.toggle(true); $event.preventDefault()">Contacts</a></li>
<li><a href="#" wo-touch="state.privateKeyUpload.toggle(true); $event.preventDefault()">Key sync (experimental)</a></li>
<li><a href="#" wo-touch="state.writer.reportBug(); $event.preventDefault()">Report a bug</button>
<li><a href="#" wo-touch="state.writer.reportBug(); $event.preventDefault()">Report a bug</a></li>
<li><a href="#" wo-touch="state.about.toggle(true); $event.preventDefault()">About</a></li>
</ul>