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

Fix #2169 added autocomplete combobox as cell editor in the feature grid #2228

Merged

Conversation

MV88
Copy link
Contributor

@MV88 MV88 commented Sep 27, 2017

Description

This PR introduce the autocomplete combobox as editor for the feature grid. It also adds a reusable and enhanced component used in the attributeEditor of the feature grid.

Issues

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Feature

What is the current behavior? (You can also link to an open issue here)
Actually when you try to edit a string field is allows you to edit it without any autocomplete feature.

What is the new behavior?
If there is there is enabled for that layer the wps getpageunique service and the datatype of a field is a string one it shows an autocomplete combobox that filter attributes remotely.

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 79.913% when pulling 5548913 on MV88:2169_featureeditor_autocomplete into 8a70613 on geosolutions-it:master.

@MV88 MV88 requested a review from offtherailz September 27, 2017 13:28
@geosolutions-it geosolutions-it deleted a comment Sep 27, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 80.051% when pulling ba22460 on MV88:2169_featureeditor_autocomplete into 8a70613 on geosolutions-it:master.

@geosolutions-it geosolutions-it deleted a comment Sep 27, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 80.123% when pulling 89335f6 on MV88:2169_featureeditor_autocomplete into 8a70613 on geosolutions-it:master.

* @memberof observables.autocomplete
* @return {external:Observable} the stream used for fetching data for the autocomplete editor
*/
const createPagedUniqueAutompleteStream = (props$) => props$.debounce(props => Rx.Observable.timer(props.delayDebounce || 0))
Copy link
Member

@offtherailz offtherailz Sep 28, 2017

Choose a reason for hiding this comment

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

You can improve with:

const createPagedUniqueAutompleteStream = (props$) => props$
    .distinctUntilChanged( ({value, currentPage}, newProps = {}) => !(newProps.value !== value || newProps.currentPage !== currentPage))
    // .debounce(props => Rx.Observable.timer(props.delayDebounce || 0))
    .throttle(props => Rx.Observable.timer(props.delayDebounce || 0))
    .merge(props$.debounce(props => Rx.Observable.timer(props.delayDebounce || 0))).distinctUntilChanged()

This will hide quickly "No Result" message and perform a faster search (start with first insert, then throttle and emit last). Also change default time to 500

@offtherailz
Copy link
Member

image
Sometimes (copying and pasting the same value I see no result. This because it sends a request like this:

<ogc:PropertyName>STATE_NAME</ogc:PropertyName>                 <ogc:Literal>*[object Object]*</ogc:Literal>               </ogc:PropertyIsLike> 

@MV88
Copy link
Contributor Author

MV88 commented Sep 28, 2017

the object problem was happening because sometimes the onchange event get an object and sometimes a string.. (thanks to react-witdgets)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 80.114% when pulling b10c49f on MV88:2169_featureeditor_autocomplete into 8a70613 on geosolutions-it:master.

@geosolutions-it geosolutions-it deleted a comment Sep 28, 2017
@offtherailz offtherailz merged commit 80d376c into geosolutions-it:master Sep 29, 2017
@allyoucanmap allyoucanmap mentioned this pull request Aug 9, 2024
5 tasks
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.

Introduce autocomplete editor into feature editor plugin
3 participants