Skip to content

Commit 4ac1381

Browse files
author
matograine
committed
add a reminder for certification parameters, delays mostly.
1 parent d8c6bab commit 4ac1381

File tree

2 files changed

+58
-41
lines changed

2 files changed

+58
-41
lines changed

www/i18n/locale-fr-FR.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,8 @@
841841
"SAVE_BEFORE_LEAVE_TITLE": "Modifications non enregistrées",
842842
"LOGOUT": "Êtes-vous sûr de vouloir vous déconnecter ?",
843843
"USE_FALLBACK_NODE": "Nœud <b>{{old}}</b> injoignable ou adresse invalide.<br/><br/>Voulez-vous temporairement utiliser le nœud <b>{{new}}</b> ?",
844-
"ISSUE_524_SEND_LOG": "La transaction a été rejetée, à cause d'une anomalie connue (ticket #524) mais <b>non reproduite</b>.<br/><br/>Pour aider les développeurs à corriger cette erreur, <b>acceptez-vous la transmission de vos logs</b> par message ?<br/><small>(aucune donnée confidentielle n'est envoyée)</small>."
844+
"ISSUE_524_SEND_LOG": "La transaction a été rejetée, à cause d'une anomalie connue (ticket #524) mais <b>non reproduite</b>.<br/><br/>Pour aider les développeurs à corriger cette erreur, <b>acceptez-vous la transmission de vos logs</b> par message ?<br/><small>(aucune donnée confidentielle n'est envoyée)</small>.",
845+
"SHORT_LICENSE_REMINDER": "<p>Rappel des paramètres de certification.</p><p>- Chaque membre peut avoir émis 100 certifications valides au maximum.</p><p>- Les certifications sont enregistrées à un intervalle de 5 jours.</p><p>- Une nouvelle identité membre doit réunir au minimum 5 certifications en moins de deux mois.</p><p>- Un membre doit renouveler son adhésion chaque année.</p><p>- Les certifications sont valides durant deux ans.</p>"
845846
},
846847
"MODE": {
847848
"DEMO": {

www/js/controllers/wot-controllers.js

+56-40
Original file line numberDiff line numberDiff line change
@@ -788,25 +788,33 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $
788788
// Certification checklist before confirmation
789789
let answers_are_right = $q.defer();
790790
answers_are_right.promise.then(function(){
791-
UIUtils.loading.show();
792-
wallet.certify($scope.formData.uid,
793-
$scope.formData.pubkey,
794-
$scope.formData.blockUid || ($scope.formData.requirements && $scope.formData.requirements.meta && $scope.formData.requirements.meta.timestamp),
795-
$scope.formData.requirements && $scope.formData.requirements.meta && $scope.formData.requirements.meta.sig,
796-
$scope.formData.isMember,
797-
$scope.formData.wasMember)
798-
.then(function(cert) {
799-
UIUtils.loading.hide();
800-
if (cert) {
801-
$scope.prepareNewCert(wallet, cert);
802-
$scope.alreadyCertified = true;
803-
UIUtils.toast.show('INFO.CERTIFICATION_DONE');
804-
$scope.formData.received_cert_pending.unshift(cert);
805-
$scope.formData.requirements.pendingCertificationCount++;
806-
$scope.doMotion();
807-
}
808-
})
809-
.catch(UIUtils.onError('ERROR.SEND_CERTIFICATION_FAILED'));
791+
UIUtils.alert.confirm('CONFIRM.SHORT_LICENSE_REMINDER', 'CONFIRM.POPUP_TITLE', {
792+
cssClass: 'positive',
793+
okText: 'COMMON.BTN_OK',
794+
okType: 'button-positive'
795+
})
796+
.then(function(confirm){
797+
if (! confirm) {return}
798+
UIUtils.loading.show();
799+
wallet.certify($scope.formData.uid,
800+
$scope.formData.pubkey,
801+
$scope.formData.blockUid || ($scope.formData.requirements && $scope.formData.requirements.meta && $scope.formData.requirements.meta.timestamp),
802+
$scope.formData.requirements && $scope.formData.requirements.meta && $scope.formData.requirements.meta.sig,
803+
$scope.formData.isMember,
804+
$scope.formData.wasMember)
805+
.then(function(cert) {
806+
UIUtils.loading.hide();
807+
if (cert) {
808+
$scope.prepareNewCert(wallet, cert);
809+
$scope.alreadyCertified = true;
810+
UIUtils.toast.show('INFO.CERTIFICATION_DONE');
811+
$scope.formData.received_cert_pending.unshift(cert);
812+
$scope.formData.requirements.pendingCertificationCount++;
813+
$scope.doMotion();
814+
}
815+
})
816+
.catch(UIUtils.onError('ERROR.SEND_CERTIFICATION_FAILED'));
817+
})
810818
})
811819
.catch(
812820
UIUtils.onError('ACCOUNT.CERTIFICATION_MODAL.CHECKLIST_CONDITIONS_NOT_MET')
@@ -898,29 +906,37 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $
898906
// Certification checklist before confirmation
899907
let answers_are_right = $q.defer();
900908
answers_are_right.promise.then(function(){
901-
UIUtils.loading.show();
902-
// Send certification
903-
wallet.certify(identity.uid,
904-
identity.pubkey,
905-
identity.blockUid || (identity.requirements && identity.requirements.meta && identity.requirements.meta.timestamp),
906-
identity.requirements && identity.requirements.meta && identity.requirements.meta.sig,
907-
identity.isMember,
908-
identity.wasMember)
909-
.then(function (cert) {
910-
UIUtils.loading.hide();
911-
if (!cert) return;
912-
return csWot.extendAll([cert], 'pubkey')
913-
.then(function () {
914-
UIUtils.toast.show('INFO.CERTIFICATION_DONE');
915-
$scope.formData.given_cert_pending.unshift(cert);
916-
$scope.doMotion();
917-
});
918-
})
909+
UIUtils.alert.confirm('CONFIRM.SHORT_LICENSE_REMINDER', 'CONFIRM.POPUP_TITLE', {
910+
cssClass: 'positive',
911+
okText: 'COMMON.BTN_OK',
912+
okType: 'button-positive'
913+
})
914+
.then(function(confirm){
915+
if (! confirm) {return}
916+
UIUtils.loading.show();
917+
// Send certification
918+
wallet.certify(identity.uid,
919+
identity.pubkey,
920+
identity.blockUid || (identity.requirements && identity.requirements.meta && identity.requirements.meta.timestamp),
921+
identity.requirements && identity.requirements.meta && identity.requirements.meta.sig,
922+
identity.isMember,
923+
identity.wasMember)
924+
.then(function (cert) {
925+
UIUtils.loading.hide();
926+
if (!cert) return;
927+
return csWot.extendAll([cert], 'pubkey')
928+
.then(function () {
929+
UIUtils.toast.show('INFO.CERTIFICATION_DONE');
930+
$scope.formData.given_cert_pending.unshift(cert);
931+
$scope.doMotion();
932+
});
933+
})
919934
.catch(UIUtils.onError('ERROR.SEND_CERTIFICATION_FAILED'));
920935
})
921-
.catch(
922-
UIUtils.onError('ACCOUNT.CERTIFICATION_MODAL.CHECKLIST_CONDITIONS_NOT_MET')
923-
);
936+
})
937+
.catch(
938+
UIUtils.onError('ACCOUNT.CERTIFICATION_MODAL.CHECKLIST_CONDITIONS_NOT_MET')
939+
);
924940

925941
// Display cert checklist modal
926942
return Modals.showCertificationCheckList({

0 commit comments

Comments
 (0)