Skip to content
Snippets Groups Projects
Commit 49cadf5f authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

- Finish revocation (add confirmation) - fix #51

parent 5a3d96da
No related branches found
No related tags found
No related merge requests found
...@@ -267,8 +267,8 @@ ...@@ -267,8 +267,8 @@
"LOGIN_FAILED": "Error while sign in.", "LOGIN_FAILED": "Error while sign in.",
"LOAD_IDENTITY_FAILED": "Could not load identity.", "LOAD_IDENTITY_FAILED": "Could not load identity.",
"LOAD_REQUIREMENTS_FAILED": "Could not load identity requirements.", "LOAD_REQUIREMENTS_FAILED": "Could not load identity requirements.",
"SEND_MEMBERSHIP_IN_FAILED": "Error while registering as member.", "SEND_MEMBERSHIP_IN_FAILED": "Error while sending registration as member.",
"SEND_MEMBERSHIP_OUT_FAILED": "Error while registering out.", "SEND_MEMBERSHIP_OUT_FAILED": "Error while sending membership revocation.",
"REFRESH_WALLET_DATA": "Could not refresh wallet.", "REFRESH_WALLET_DATA": "Could not refresh wallet.",
"GET_CURRENCY_PARAMETER": "Could not get currency parameters.", "GET_CURRENCY_PARAMETER": "Could not get currency parameters.",
"GET_CURRENCIES_FAILED": "Unable to load currencies. Please retry later.", "GET_CURRENCIES_FAILED": "Unable to load currencies. Please retry later.",
...@@ -298,14 +298,16 @@ ...@@ -298,14 +298,16 @@
"INFO": { "INFO": {
"POPUP_TITLE": "Information", "POPUP_TITLE": "Information",
"CERTIFICATION_DONE": "Identity successfully signed", "CERTIFICATION_DONE": "Identity successfully signed",
"NOT_ENOUGH_CREDIT": "Not enough credit.", "NOT_ENOUGH_CREDIT": "Not enough credit",
"TRANSFER_SENT": "Transfer request successfully sent.", "TRANSFER_SENT": "Transfer request successfully sent",
"COPY_TO_CLIPBOARD_DONE": "Copy succeed." "COPY_TO_CLIPBOARD_DONE": "Copy succeed",
"MEMBERSHIP_OUT_SENT": "Membership revocation sent"
}, },
"CONFIRM": { "CONFIRM": {
"POPUP_TITLE": "<b>Confirmation</b>", "POPUP_TITLE": "<b>Confirmation</b>",
"CERTIFY_RULES_TITLE_UID": "Certify {{uid}}", "CERTIFY_RULES_TITLE_UID": "Certify {{uid}}",
"CERTIFY_RULES": "<b>Security warning:</b><br/><br/><b class=\"assertive\">Don't certify an account</b> if you believe that: <ul><li>1.) the issuers identity might be faked.<li>2.) the issuer already has another certified account.<li>3.) the issuer purposely or carelessly violates rule 1 or 2 (he certifies faked or double accounts).</ul></small><br/>Are you sure you want to certify this identity ?", "CERTIFY_RULES": "<b>Security warning:</b><br/><br/><b class=\"assertive\">Don't certify an account</b> if you believe that: <ul><li>1.) the issuers identity might be faked.<li>2.) the issuer already has another certified account.<li>3.) the issuer purposely or carelessly violates rule 1 or 2 (he certifies faked or double accounts).</ul></small><br/>Are you sure you want to certify this identity ?",
"TRANSFER": "<b>Transfer summary:</b><br/><br/><ul><li> - From: <b>{{from}}</b></li><li> - To: <b>{{to}}</b></li><li> - Amount: <b>{{amount}} {{unit}}</b></li><li> - Comment: <i>{{comment}}</i></li></ul><br/><b>Are-you sure you want to do this transfer ?</b>" "TRANSFER": "<b>Transfer summary:</b><br/><br/><ul><li> - From: <b>{{from}}</b></li><li> - To: <b>{{to}}</b></li><li> - Amount: <b>{{amount}} {{unit}}</b></li><li> - Comment: <i>{{comment}}</i></li></ul><br/><b>Are-you sure you want to do this transfer ?</b>",
"MEMBERSHIP_OUT": "<b>Warning</b>:<br/>You are going to terminate your membership. This operation is irreversible<br/></br/><b>Are you sure you want to continue ?</b>"
} }
} }
...@@ -297,15 +297,17 @@ ...@@ -297,15 +297,17 @@
}, },
"INFO": { "INFO": {
"POPUP_TITLE": "Information", "POPUP_TITLE": "Information",
"CERTIFICATION_DONE": "Certification envoyée avec succès.", "CERTIFICATION_DONE": "Certification envoyée avec succès",
"NOT_ENOUGH_CREDIT": "Crédit insuffisant.", "NOT_ENOUGH_CREDIT": "Crédit insuffisant",
"TRANSFER_SENT": "Demande de virement envoyée avec succès.", "TRANSFER_SENT": "Demande de virement envoyée avec succès",
"COPY_TO_CLIPBOARD_DONE": "Copie effectuée." "COPY_TO_CLIPBOARD_DONE": "Copie effectuée",
"MEMBERSHIP_OUT_SENT": "Résiliation envoyée avec succès"
}, },
"CONFIRM": { "CONFIRM": {
"POPUP_TITLE": "<b>Confirmation</b>", "POPUP_TITLE": "<b>Confirmation</b>",
"CERTIFY_RULES_TITLE_UID": "Certifier {{uid}}", "CERTIFY_RULES_TITLE_UID": "Certifier {{uid}}",
"CERTIFY_RULES": "<b>Avertissement de sécurité :</b><br/><br/><b class=\"assertive\">Ne pas certifier</b> un compte si vous pensez que :<ul><li>1.) il ne correspond pas à une personne physique vivante.<li>2.) son propriétaire possède un autre compte déjà certifié.<li>3.) son propriétaire viole (volontairement ou non) la règle 1 ou 2 (par exemple en certifiant des comptes factices ou en double).</ul><br/><b>Etes-vous sûr de vouloir néanmoins certifier cette identité ?</b>", "CERTIFY_RULES": "<b>Avertissement de sécurité :</b><br/><br/><b class=\"assertive\">Ne pas certifier</b> un compte si vous pensez que :<ul><li>1.) il ne correspond pas à une personne physique vivante.<li>2.) son propriétaire possède un autre compte déjà certifié.<li>3.) son propriétaire viole (volontairement ou non) la règle 1 ou 2 (par exemple en certifiant des comptes factices ou en double).</ul><br/><b>Etes-vous sûr de vouloir néanmoins certifier cette identité ?</b>",
"TRANSFER": "<b>Récapitulatif du virement</b> :<br/><br/><ul><li> - De : {{from}}</li><li> - A : <b>{{to}}</b></li><li> - Montant : <b>{{amount}} {{unit}}</b></li><li> - Commentaire : <i>{{comment}}</i></li></ul><br/><b>Etes-vous sûr de vouloir effectuer ce virement ?</b>" "TRANSFER": "<b>Récapitulatif du virement</b> :<br/><br/><ul><li> - De : {{from}}</li><li> - A : <b>{{to}}</b></li><li> - Montant : <b>{{amount}} {{unit}}</b></li><li> - Commentaire : <i>{{comment}}</i></li></ul><br/><b>Etes-vous sûr de vouloir effectuer ce virement ?</b>",
"MEMBERSHIP_OUT": "<b>Avertissement</b> :<br/>Vous allez résilier votre adhésion comme membre. Cette opération est <b>irréversible</b>.<br/></br/><b>Etes-vous sûr de vouloir continuer ?</b>"
} }
} }
...@@ -262,15 +262,26 @@ function WalletController($scope, $q, $ionicPopup, $timeout, $state, $ionicHisto ...@@ -262,15 +262,26 @@ function WalletController($scope, $q, $ionicPopup, $timeout, $state, $ionicHisto
//.catch(UIUtils.onError('ERROR.SEND_MEMBERSHIP_IN_FAILED')); //.catch(UIUtils.onError('ERROR.SEND_MEMBERSHIP_IN_FAILED'));
}; };
// Send membership IN // Send membership OUT
$scope.membershipOut = function() { $scope.membershipOut = function(confirm) {
if ($scope.actionsPopover) { if ($scope.actionsPopover) {
$scope.actionsPopover.hide(); $scope.actionsPopover.hide();
} }
// TODO Add confirmation message
// Ask user confirmation
if (!confirm) {
return UIUtils.alert.confirm('CONFIRM.MEMBERSHIP_OUT')
.then(function(confirm) {
if (confirm) $scope.membershipOut(true); // loop with confirmation
});
}
UIUtils.loading.show(); UIUtils.loading.show();
Wallet.membership.out() return Wallet.membership.out()
.then(function() {
UIUtils.loading.hide();
UIUtils.toast.show('INFO.MEMBERSHIP_OUT_SENT');
})
.catch(UIUtils.onError('ERROR.SEND_MEMBERSHIP_OUT_FAILED')); .catch(UIUtils.onError('ERROR.SEND_MEMBERSHIP_OUT_FAILED'));
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment