Skip to content
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

Merged
merged 6 commits into from
Mar 31, 2017

Conversation

MV88
Copy link
Contributor

@MV88 MV88 commented Mar 30, 2017

Added also the support for geomService.
Fixed minor things.

@MV88 MV88 requested a review from offtherailz March 30, 2017 14:15
@coveralls
Copy link

Coverage Status

Coverage decreased (-5.4%) to 71.707% when pulling 6e126f1 on MV88:iss_1634_search_custom_service into 405b8f0 on geosolutions-it:master.

.then( response => response.features );
},
bzVie: (searchText, {pathname, lang}) => {
Copy link
Member

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

return [];
});
},
bzCivico: (searchText, {pathname, item}) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this too

// 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))
Copy link
Member

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

.then(
(response= []) => response.map(result => ({...result, __SERVICE__: service, __PRIORITY__: service.priority || 0}))
))
.retryWhen(errors => errors.delay(200).scan((count, err) => {
Copy link
Member

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

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
Copy link
Member

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

const searchItemSelected = action$ =>
action$.ofType(TEXT_SEARCH_ITEM_SELECTED)
.switchMap(action => {
const item = action.item;
let itemSelectionStream = Rx.Observable.of(action.item)
Copy link
Member

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

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) to 77.014% when pulling 28ba27a on MV88:iss_1634_search_custom_service into 405b8f0 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-5.3%) to 71.827% when pulling afdc3cd on MV88:iss_1634_search_custom_service into 405b8f0 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 77.122% when pulling 37bb493 on MV88:iss_1634_search_custom_service into 405b8f0 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 77.112% when pulling 1ad2e3a on MV88:iss_1634_search_custom_service into 405b8f0 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 77.112% when pulling 91553ae on MV88:iss_1634_search_custom_service into 405b8f0 on geosolutions-it:master.

@MV88 MV88 merged commit 966c6a5 into geosolutions-it:master Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants