diff --git a/www/js/config.js b/www/js/config.js index 6b8baa41db5bf8994bb66a7d824450b5ac275744..f5e82e2d4c012e9618ff9f4b5079db32b7e5ad82 100644 --- a/www/js/config.js +++ b/www/js/config.js @@ -28,8 +28,8 @@ angular.module("cesium.config", []) "port": "9203" } }, - "version": "0.1.29", - "build": "2016-08-20T15:50:56.272Z", + "version": "0.2.0", + "build": "2016-08-20T16:08:23.561Z", "newIssueUrl": "https://github.com/duniter/cesium/issues/new?labels=bug" }) diff --git a/www/js/controllers/currency-controllers.js b/www/js/controllers/currency-controllers.js index 18a3368520cae1f32149e6a30c4b1a04461c3526..cacaf007913498933057d2a0fe5f7cb458f7f97a 100644 --- a/www/js/controllers/currency-controllers.js +++ b/www/js/controllers/currency-controllers.js @@ -266,14 +266,14 @@ function CurrencyViewController($scope, $q, $translate, $timeout, BMA, UIUtils, // Network $scope.loadingPeers = true; csNetwork.getPeers() - .then(function(peers) { - $scope.peers = peers; - $scope.loadingPeers = false; - }) - .catch(function(err) { - $scope.peers = []; - $scope.loadingPeers = false; - }) + .then(function(peers) { + $scope.peers = peers; + $scope.loadingPeers = false; + }) + .catch(function(err) { + $scope.peers = []; + $scope.loadingPeers = false; + }); }); }; } diff --git a/www/plugins/es/js/controllers/market-controllers.js b/www/plugins/es/js/controllers/market-controllers.js index 11cf8c6404b02344d66ce1149ad3773d84a838f6..ef7d0779c2a01898512bcffa6e4a5130df9bccf9 100644 --- a/www/plugins/es/js/controllers/market-controllers.js +++ b/www/plugins/es/js/controllers/market-controllers.js @@ -103,7 +103,7 @@ function ESMarketLookupController($scope, $rootScope, esMarket, $state, $focus, // Search on category if ($state.stateParams && $state.stateParams.category) { - esMarket.category.get($state.stateParams.category) + esMarket.category.get({id: $state.stateParams.category}) .then(function(cat) { $scope.search.category = cat; hasOptions = runSearch = true; diff --git a/www/plugins/es/js/controllers/registry-controllers.js b/www/plugins/es/js/controllers/registry-controllers.js index 1373b18a76c6fe540a302755410324466f467dc7..46940cbe45e6005aefad48e7301b88bcb7effc60 100644 --- a/www/plugins/es/js/controllers/registry-controllers.js +++ b/www/plugins/es/js/controllers/registry-controllers.js @@ -57,7 +57,7 @@ angular.module('cesium.es.registry.controllers', ['cesium.es.services', 'cesium. ; -function ESRegistryLookupController($scope, $state, $focus, $q, $timeout, esRegistry, UIUtils, $sanitize, ModalUtils, $filter, BMA) { +function ESRegistryLookupController($scope, $state, $focus, $timeout, esRegistry, UIUtils, ModalUtils, $filter, BMA) { 'ngInject'; $scope.search = { @@ -109,7 +109,7 @@ function ESRegistryLookupController($scope, $state, $focus, $q, $timeout, esRegi // Search on category if ($state.stateParams && $state.stateParams.category) { - esRegistry.category.get($state.stateParams.category) + esRegistry.category.get({id: $state.stateParams.category}) .then(function(cat) { $scope.search.category = cat; hasOptions = runSearch = true; diff --git a/www/plugins/es/js/controllers/settings-controllers.js b/www/plugins/es/js/controllers/settings-controllers.js index 893a7640822310902447f438e403b74f6c86f205..da91a34fada31198fb98ba133ec70867a2d32fb3 100644 --- a/www/plugins/es/js/controllers/settings-controllers.js +++ b/www/plugins/es/js/controllers/settings-controllers.js @@ -181,5 +181,5 @@ function ESPluginSettingsController ($scope, $q, $translate, $ionicPopup, UIUti $scope.getServer = function() { return csHttp.getServer($scope.formData.host, $scope.formData.port); - } + }; } diff --git a/www/plugins/es/js/services/comment-services.js b/www/plugins/es/js/services/comment-services.js index 72971588557ecaaf03af46741b2614aab2946001..f3eff7ec5c3e4c522613abee27e4e74e94aad78b 100644 --- a/www/plugins/es/js/services/comment-services.js +++ b/www/plugins/es/js/services/comment-services.js @@ -13,57 +13,56 @@ angular.module('cesium.es.comment.services', ['ngResource', 'cesium.bma.services ; function getCommentsByRecordRequest() { - - return function(recordId, size) { - if (!size) { - size = 10; - } - else if (size < 0) { - size = 1000; - } - return $q(function(resolve, reject) { - var errorFct = function(err) { - reject(err); - }; - var request = { - sort : [ - { "time" : {"order" : "desc"}} - ], - query : { - constant_score:{ - filter: { - term: { record : recordId} - } + return function(recordId, size) { + if (!size) { + size = 10; + } + else if (size < 0) { + size = 1000; + } + return $q(function(resolve, reject) { + var errorFct = function(err) { + reject(err); + }; + var request = { + sort : [ + { "time" : {"order" : "desc"}} + ], + query : { + constant_score:{ + filter: { + term: { record : recordId} } - }, - from: 0, - size: size, - _source: fields.commons - }; - - postSearchCommentsRequest(request) - .then(function(res){ - if (res.hits.total === 0) { - resolve([]); } - else { - BMA.wot.member.uids(true/*cache*/) - .then(function(uids){ - var result = res.hits.hits.reduce(function(result, hit) { - var comment = hit._source; - comment.id = hit._id; - comment.uid = uids[comment.issuer]; - return result.concat(comment); - }, []); + }, + from: 0, + size: size, + _source: fields.commons + }; - resolve(result); - }) - .catch(errorFct); - } - }) - .catch(errorFct); - }); - } + postSearchCommentsRequest(request) + .then(function(res){ + if (res.hits.total === 0) { + resolve([]); + } + else { + BMA.wot.member.uids(true/*cache*/) + .then(function(uids){ + var result = res.hits.hits.reduce(function(result, hit) { + var comment = hit._source; + comment.id = hit._id; + comment.uid = uids[comment.issuer]; + return result.concat(comment); + }, []); + + resolve(result); + }) + .catch(errorFct); + } + }) + .catch(errorFct); + }); + }; } return { diff --git a/www/plugins/es/js/services/market-services.js b/www/plugins/es/js/services/market-services.js index e5801ace21ddd7baae08ccdb4d62e227cc3bf51e..88030ceb7447d27af66ffa37cf2f938b872a1ae7 100644 --- a/www/plugins/es/js/services/market-services.js +++ b/www/plugins/es/js/services/market-services.js @@ -54,7 +54,7 @@ angular.module('cesium.es.market.services', ['ngResource', 'cesium.services', 'c reject(err); }); }); - } + }; } @@ -67,7 +67,7 @@ angular.module('cesium.es.market.services', ['ngResource', 'cesium.services', 'c res.id = hit._id; return res; }); - } + }; } function getRecordCommonsRequest() { diff --git a/www/plugins/es/js/services/registry-services.js b/www/plugins/es/js/services/registry-services.js index 2e4f0d0a4f145d15b0badb81c8c03d11c948308e..656e98760daa52b15e8159e8545ff76bac968f7e 100644 --- a/www/plugins/es/js/services/registry-services.js +++ b/www/plugins/es/js/services/registry-services.js @@ -56,7 +56,7 @@ angular.module('cesium.es.registry.services', ['ngResource', 'cesium.services', reject(err); }); }); - } + }; } function getCategoryRequest() { @@ -68,7 +68,7 @@ angular.module('cesium.es.registry.services', ['ngResource', 'cesium.services', res.id = hit._id; return res; }); - } + }; } function getCommonsRequest() {