-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #1634 added support to custom search services and minor fixes #1664
Fixed #1634 added support to custom search services and minor fixes #1664
Conversation
web/client/api/searchText.js
Outdated
.then( response => response.features ); | ||
}, | ||
bzVie: (searchText, {pathname, lang}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a custom service. Please remove it from pull request
web/client/api/searchText.js
Outdated
return []; | ||
}); | ||
}, | ||
bzCivico: (searchText, {pathname, item}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this too
web/client/epics/search.js
Outdated
// merge all results from the streams | ||
.mergeAll() | ||
.scan( (oldRes, newRes) => [...oldRes, ...newRes].sort( (a, b) => get(b, "__PRIORITY__") - get(a, "__PRIORITY__") ) .slice(0, 15)) | ||
.map((results) => searchResultLoaded(results, false, services)) | ||
.map((results) => searchResultLoaded(results, false, API.Services)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably API.Services is not needed
web/client/epics/search.js
Outdated
.then( | ||
(response= []) => response.map(result => ({...result, __SERVICE__: service, __PRIORITY__: service.priority || 0})) | ||
)) | ||
.retryWhen(errors => errors.delay(200).scan((count, err) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent back, retryWhen is applied to the Observable, not to the service's promise
web/client/epics/search.js
Outdated
const searchItemSelected = action$ => | ||
action$.ofType(TEXT_SEARCH_ITEM_SELECTED) | ||
.switchMap(action => { | ||
const item = action.item; | ||
let itemSelectionStream = Rx.Observable.of(action.item) | ||
// retrieve geometry from geomService or pass the item directly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is relative to the function code. Move inside the function
web/client/epics/search.js
Outdated
const searchItemSelected = action$ => | ||
action$.ofType(TEXT_SEARCH_ITEM_SELECTED) | ||
.switchMap(action => { | ||
const item = action.item; | ||
let itemSelectionStream = Rx.Observable.of(action.item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can comment itemSelectionStream
with something like :
// emits actions for zoom and marker add
Added also the support for geomService.
Fixed minor things.