diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index 26a93e35ac8f69e83ef11ab49a5bcc06ce652674..826fcac210c5f89202d1feb67cdcb6ab7d1aada7 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -729,6 +729,7 @@ "CERTIFY_RULES_TITLE_UID": "Certifier {{uid}}", "CERTIFY_RULES": "<b class=\"assertive\">Ne PAS certifier</b> un compte si vous pensez que :<br/><br/><ul><li>1.) il ne correspond pas à une personne <b>physique et vivante</b>.<li>2.) son propriétaire <b>possède un autre compte</b> 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</b> de vouloir néanmoins certifier cette identité ?", "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_ALL": "<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><br/><li> - Reste : <b>{{restAmount}} {{unit}}</b> à <b>{{restTo}}</b></li></ul><br/><b>Etes-vous sûr de vouloir effectuer ce virement ?</b>", "MEMBERSHIP_OUT": "Cette opération est <b>irréversible</b>.<br/></br/>Etes-vous sûr de vouloir <b>résilier votre compte membre</b> ?", "MEMBERSHIP_OUT_2": "Cette opération est <b>irreversible</b> !<br/><br/>Etes-vous vraiment sûr de vouloir <b>résilier votre adhésion</b> comme membre ?", "LOGIN_UNUSED_WALLET_TITLE": "Erreur de saisie ?", diff --git a/www/js/controllers/transfer-controllers.js b/www/js/controllers/transfer-controllers.js index 16bb09ba546210ebc3618a2fb9e7b71d1045087e..55da07c1281e94dc60423af1806e345c0211a7ff 100644 --- a/www/js/controllers/transfer-controllers.js +++ b/www/js/controllers/transfer-controllers.js @@ -6,7 +6,7 @@ angular.module('cesium.transfer.controllers', ['cesium.services', 'cesium.curren .state('app.new_transfer', { cache: false, - url: "/transfer?amount&udAmount&comment&restPub&useRest", + url: "/transfer?amount&udAmount&comment&restPub&all", views: { 'menuContent': { templateUrl: "templates/wallet/new_transfer.html", @@ -17,7 +17,7 @@ angular.module('cesium.transfer.controllers', ['cesium.services', 'cesium.curren .state('app.new_transfer_pubkey_uid', { cache: false, - url: "/transfer/:pubkey/:uid?amount&udAmount&comment&restPub&useRest", + url: "/transfer/:pubkey/:uid?amount&udAmount&comment&restPub&all", views: { 'menuContent': { templateUrl: "templates/wallet/new_transfer.html", @@ -28,7 +28,7 @@ angular.module('cesium.transfer.controllers', ['cesium.services', 'cesium.curren .state('app.new_transfer_pubkey', { cache: false, - url: "/transfer/:pubkey?amount&udAmount&comment&restPub&useRest", + url: "/transfer/:pubkey?amount&udAmount&comment&restPub&all", views: { 'menuContent': { templateUrl: "templates/wallet/new_transfer.html", @@ -72,8 +72,8 @@ function TransferController($scope, $controller, UIUtils, csWot, csWallet) { if (state.stateParams.restPub) { parameters.restPub = state.stateParams.restPub; } - else if (state.stateParams.useRest) { - parameters.useRest = state.stateParams.useRest; + else if (state.stateParams.all) { + parameters.all = state.stateParams.all; } } @@ -126,7 +126,7 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc comment: null, useRelative: csSettings.data.useRelative, useComment: false, - useRest: false, + all: false, restPub: null, restAmount: null }; @@ -176,16 +176,16 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc $scope.formData.useComment=true; $scope.formData.comment = parameters.comment; } - if (parameters.restPub || parameters.useRest) { + if (parameters.restPub || parameters.all) { $scope.restUid = ''; $scope.restPub = parameters.restPub; $scope.formData.restPub = parameters.restPub; - $scope.formData.useRest = true; + $scope.formData.all = true; $scope.$watch('walletData.balance', $scope.onAmountChanged, true); $scope.$watch('formData.amount', $scope.onAmountChanged, true); } else { - $scope.formData.useRest = false; + $scope.formData.all = false; } }; // Read default parameters @@ -230,7 +230,7 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc $scope.$watch('walletData.balance', $scope.onUseRelativeChanged, true); $scope.onAmountChanged = function() { - if (!$scope.formData.useRest || !$scope.formData.amount) { + if (!$scope.formData.all || !$scope.formData.amount) { $scope.formData.restAmount = undefined; return; } @@ -313,7 +313,7 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc comment = null; } - if ($scope.formData.useRest) { + if ($scope.formData.all) { return csWallet.transferAll($scope.formData.destPub, amount, comment, $scope.formData.useRelative, $scope.formData.restPub); } else { @@ -341,12 +341,14 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc $scope.askTransferConfirm = function() { return $translate(['COMMON.UD', 'COMMON.EMPTY_PARENTHESIS']) .then(function(translations) { - return $translate('CONFIRM.TRANSFER', { + return $translate($scope.formData.all ? 'CONFIRM.TRANSFER_ALL' : 'CONFIRM.TRANSFER', { from: csWallet.data.isMember ? csWallet.data.uid : $filter('formatPubkey')(csWallet.data.pubkey), - to: $scope.destUid ? $scope.destUid : $scope.destPub, + to: $scope.destUid || $scope.destPub, amount: $scope.formData.amount, unit: $scope.formData.useRelative ? translations['COMMON.UD'] : $filter('abbreviate')($scope.currency), - comment: (!$scope.formData.comment || $scope.formData.comment.trim().length === 0) ? translations['COMMON.EMPTY_PARENTHESIS'] : $scope.formData.comment + comment: (!$scope.formData.comment || $scope.formData.comment.trim().length === 0) ? translations['COMMON.EMPTY_PARENTHESIS'] : $scope.formData.comment, + restAmount: $scope.formData.all && $filter('formatAmount')($scope.formData.restAmount, {useRelative: $scope.formData.useRelative}), + restTo: ($scope.restUid || $scope.restPub) }); }) .then(UIUtils.alert.confirm); diff --git a/www/js/services/wallet-services.js b/www/js/services/wallet-services.js index db86d0d686b9b34568e0506c766b3314f9fd66b9..807b9a38c10a4744af0bffe1778fc310645d2e7b 100644 --- a/www/js/services/wallet-services.js +++ b/www/js/services/wallet-services.js @@ -523,6 +523,12 @@ angular.module('cesium.wallet.services', ['ngApi', 'ngFileSaver', 'cesium.bma.se data.sigStock = 0; resolve(); // not found } + /*FIXME: workaround for Duniter issue #1309 */ + else if (!!err && err.ucode == 1002) { + console.warn("[wallet-service] Detecting Duniter issue #1309 ! Applying workaround... "); + data.sigStock = 0; + resolve(); // not found + } else { reject(err); } diff --git a/www/js/services/wot-services.js b/www/js/services/wot-services.js index eaf473c83121e9a140ee1b9a6aa7fdfc26358453..2c97becf76a547ccf8db17168465245f317d44ca 100644 --- a/www/js/services/wot-services.js +++ b/www/js/services/wot-services.js @@ -333,6 +333,12 @@ angular.module('cesium.wot.services', ['ngApi', 'cesium.bma.services', 'cesium.c return identity; } else { + // FIXME workaround for issue #1304 ? + /* + if (identity.revocationNumber) { + identity.revocationTime = identity.revocationNumber; + return identity; + }*/ throw err; } }); diff --git a/www/templates/wallet/transfer_form.html b/www/templates/wallet/transfer_form.html index e4fbd94fda88ac2d51d0f69365b19e2643de1bc0..7c187d2c978575fce7000eae7af53ef43ea3c451 100644 --- a/www/templates/wallet/transfer_form.html +++ b/www/templates/wallet/transfer_form.html @@ -96,7 +96,7 @@ <a class="item item-icon-right gray ink" ng-class="{'item-input-error': form.$submitted && !formData.destPub}" ng-click="showWotLookupModal('restPub')" - ng-if="formData.useRest && formData.restAmount > 0"> + ng-if="formData.all && formData.restAmount > 0"> <span class="gray"> <i translate>TRANSFER.REST</i> <ng-if ng-if="formData.restAmount">(<i ng-bind-html="formData.restAmount|formatAmount:{useRelative: formData.useRelative, currency:currency}"></i>)</ng-if> @@ -111,7 +111,7 @@ <i class="gray icon ion-ios-arrow-right"></i> </a> <div class="form-errors" - ng-if="form.$submitted && formData.useRest && !formData.restPub && formData.restAmount"> + ng-if="form.$submitted && formData.all && !formData.restPub && formData.restAmount > 0"> <div class="form-error"> <span translate="ERROR.FIELD_REQUIRED"></span> </div>