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

- ES wot : when initPhase=true (in config) to not add more result in pendings...

 - ES wot : when initPhase=true (in config) to not add more result in pendings identities, from ES node
parent a544812a
No related branches found
No related tags found
No related merge requests found
......@@ -563,11 +563,15 @@ angular.module('cesium.wot.services', ['ngResource', 'ngApi', 'cesium.bma.servic
});
},
search = function(text) {
search = function(text, options) {
if (!text || text.trim() !== text) {
return $q.when(undefined);
}
options = options || {};
options.addUniqueId = angular.isDefined(options.addUniqueId) ? options.addUniqueId : true;
options.allowExtension = angular.isDefined(options.allowExtension) ? options.allowExtension : true;
return BMA.wot.lookup({ search: text })
.then(function(res){
return res.results.reduce(function(idties, res) {
......@@ -594,12 +598,16 @@ angular.module('cesium.wot.services', ['ngResource', 'ngApi', 'cesium.bma.servic
}
})
.then(function(idties) {
if (!options.allowExtension) {
return options.addUniqueId ? _addUniqueIds(idties) : idties;
}
// call extension point
return api.data.raisePromise.search(text, idties)
.then(function() {
idties = _addUniqueIds(idties);
return idties;
});
.then(function(idties) {
return options.addUniqueId ? _addUniqueIds(idties) : idties;
});
})
;
},
getNewcomers = function(offset, size) {
......@@ -779,7 +787,13 @@ angular.module('cesium.wot.services', ['ngResource', 'ngApi', 'cesium.bma.servic
getAll = function() {
var letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','u','v','w','x','y','z'];
return getAllRecursive(letters, 0, BMA.constants.LIMIT_REQUEST_COUNT);
return getAllRecursive(letters, 0, BMA.constants.LIMIT_REQUEST_COUNT)
.then(function(idties) {
return api.data.raisePromise.search(null, idties)
.then(function() {
return _addUniqueIds(idties);
});
});
},
getAllRecursive = function(letters, offset, size) {
......@@ -789,7 +803,10 @@ angular.module('cesium.wot.services', ['ngResource', 'ngApi', 'cesium.bma.servic
var jobs = [];
_.each(letters.slice(offset, offset+size), function(letter) {
jobs.push(
search(letter)
search(letter, {
addUniqueId: false, // will be done in parent method
allowExtension: false // extension point will be called in parent method
})
.then(function(idties){
if (!idties || !idties.length) return;
result = idties.reduce(function(res, idty) {
......
......@@ -102,8 +102,10 @@
</span>
<b class="ion-key"></b>
{{::identity.pubkey | formatPubkey}}
<span ng-if="identity.events"
ng-repeat="event in identity.events"
<span ng-if="!identity.uid" class="assertive" translate>WOT.NOT_MEMBER_PARENTHESIS</span>
</h4>
<h4 ng-if="identity.events">
<span ng-repeat="event in identity.events"
class="assertive">
<i class="ion-alert-circled " ng-if="!identity.valid"></i>
<span ng-bind-html="event.message|translate:event.messageParams"></span>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment