Skip to content

Fix 3985 add catalog autosearch#3988

Merged
tdipisa merged 3 commits intogeosolutions-it:masterfrom
MV88:3895_autosearch_catalog
Jul 23, 2019
Merged

Fix 3985 add catalog autosearch#3988
tdipisa merged 3 commits intogeosolutions-it:masterfrom
MV88:3895_autosearch_catalog

Conversation

@MV88
Copy link
Copy Markdown
Contributor

@MV88 MV88 commented Jul 19, 2019

Description

This pr adds AutoSearch to the filter of catalog form
Also loading state has been moved from local to the global state
The delay can be configured in the initialState of localConfig, for example:

"initialState": {
  "defaultState": {
    "catalog": {
      "delayAutoSearch" : 1000
    }
  }
}

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)
When you type in the filter you have to click on "search button" in order to trigger the search

What is the new behavior?
after 1 second it triggers automatically the search when idle for 1s

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:
notes this could be harmful for projects that are customizing the catalog plugin (components and plugin changes needs to be ported too)

@MV88 MV88 requested review from mbarto and offtherailz July 19, 2019 12:50
@MV88 MV88 self-assigned this Jul 19, 2019
@MV88 MV88 changed the title Fix 3895 add catalog autosearch Fix 3985 add catalog autosearch Jul 19, 2019
const pageSize = pageSizeSelector(state);
const {type, url} = selectedCatalogSelector(state);
return Rx.Observable.of(textSearch(type, url, 1, pageSize, text))
.startWith(setLoading(true));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this needed? It looks like textSearch already dispatches setLoading(true)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, on a second thought this can be removed

@@ -59,15 +60,17 @@ function catalog(state = {
}, action) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would add the new state property loading here too

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And also pageSize, maybe?

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 19, 2019

Coverage Status

Coverage decreased (-0.03%) to 82.06% when pulling a2ba6af on MV88:3895_autosearch_catalog into 3e18c17 on geosolutions-it:master.

* test was hard to provide since it is using a thunk
* anyway it has been tested so i removed the test for epic
selectedService: "",
newService: {}
},
delayAutoSearch: 1000,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

and loading?

});

});
it('autoSearchEpic', (done) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why this has been removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it was dispatching only a thunk that is tested in the actions/tests/catalog-test.js
one way to test it here is to transform the thunk into an epic, if you think is worth the shot, i'll do it

@tdipisa tdipisa added this to the 2019.02.01 milestone Jul 22, 2019
@tdipisa tdipisa added Blocked and removed Blocked labels Jul 22, 2019
@tdipisa tdipisa merged commit 4416a5c into geosolutions-it:master Jul 23, 2019
mbarto added a commit that referenced this pull request Aug 5, 2019
* 3523 manage exponential number coord editor (#3907)

* Fixed exponential problem with input type number for coordiante entry

* 'e' and 'E' chars are disabled for coordinate entry
* both on aeronautical or decimal
* updated doc
* restored onkeyDown prop, and added more tests to check that is called
* removed comment

* Fix #3908 Time sync support for FeatureGrid (#3909)

* Fix for #3845. Restored Identify and other plugins doc (#3921)

* FIx #3785 Implemented Layer Filter (#3898)

* Closes #3785 #3778 #3779 #3788

* Fixed lint error and added layerfilter tests

* Fixes on Lorenzo's review

* Added comments and fixed query tooltip string

* Fixesx after Lorenzo's second review

* Fixess on Lorenzo's last review

* Removed console.log

* Fixed btntooltip

* use protocol-relative URL for CartoDB provider (#3938)

* Fix 3945 zoom to feature for point now zooms correctly (#3946)

* Fix 3945 zoom to feature for point now zooms correctly

* fix max zoom default

* added a todo for max zoom customization

* fix #3915 wrong overflow in feature info settings (#3941)

* Fix Glich of query panels roi styles (#3948)

* Fix Glith of query panels roi styles

* remove onmount double call in feature editor

* Fix 3942 with correct positioning of tutorial for GFI step (#3943)

* Fix 3942 with correct positioning of tutorial for GFI step

* changed implementation

* Fix #3928 widget builder color selector box shows wrong labels (#3937)

* Fix dashboard autoreload (#3951)

* Fix thematic maps color labels (#3952)

* Fixes #3955 filter layer minor issues (#3956)

* Fix fr-FR translation for options menu (#3961)

* Fix #3913 GFI window does not close when opening the catalog (#3913) (#3944)

* Fix #3913 GFI window does not close when opening the catalog (#3913)

fix #3913

* move the epic to their more appropriate file

* Fix #3910 Text annotations - wrong text align in preview (#3954)

fix #3910

* Fix link on quickstart page (#3968)

* Add infoFormat to Identify plugin documentation (#3966)

* Add infoFormat to Identify plugin documentation

* changed documentation message

* Fix 3960 Template editor of feature info settings has slow response on typing (#3965)

* add internal state to feature info editor to reduce on change calls

* add default state in feature info editor component

* Added missing Croatian translations & fix typos (#3959)

* Added missing Croatian translations & fix typos

* Fix typo

* Added missing strings that were not added automatically by devs

* Fix #3957 Avoid showing the MapStore version number (2) in translations (#3971)

fix #3957

* #3950: the whole group containing the annotations layer disappears in 3d mode, also if it contains other layers (#3974)

* #3863: improved Print plugin documentation with info on printing usin… (#3975)

* #3863: improved Print plugin documentation with info on printing using custom scales

* #3863: fixed typo

* Fix #3940 Integrate the tooltip for metadata with missing params (#3973)

* Fix #3940 Integrate the tooltip for metadata with missing params

fix #3940

* sort the templateMetadata in translation

* Fix #3906  the 'back' button does not undo the annotation creation (#3967)

* Fix #3906  the 'back' button does not undo the annotation creation

fix #3906

* improve test coverage

* Fix 3976 Search Plugin improved (#3977)

* Fix 3976 Search Plugin improved
* sort is correct
* maxRsults is configurable and limits the results size
* add test to check results sorting
* Update web/client/epics/search.js
Co-Authored-By: Lorenzo Natali <offtherailz@gmail.com>
* Update web/client/epics/__tests__/search-test.js
Co-Authored-By: Lorenzo Natali <offtherailz@gmail.com>

* #3972: fixed print of vector layers for solid dash stroke (#3978)

* update style of annotation text symbolizer to avoid horizontal scrollbar (#3979)

* #3962: removed old examples (#3986)

* fix #3969 annotation description field is not clickable in safari (#3982)

* #3784 Activate Sync Map by default (#3984)

* Fix #3958 hide layer related buttons when removing a layer from the map (#3980)

* Fix WidgetLegend preview (#3994)

* Fix WidgetLegend preview

* Update web/client/components/widgets/enhancers/legendWidget.js

* Ewsterrenburg vietnamese translations (#3999)

* Add Vietnamese translation

* Removed erroneous comma

* Fixing tests

* removed console.log

* Update featuregrid.js

* Fix 3985 add catalog autosearch (#3988)

* Fix 3895 catalog autosearch

* Fix reducer default, fix epic for autosearch

* test was hard to provide since it is using a thunk
* anyway it has been tested so i removed the test for epic

* added missing default in catalog reducer

* #3989: fixed the broken examples (#4003)

* Fix #3934 Cross layer filter: some wfs requests fails (#3991)

* Fix 3817 map info url (#4000)

* Wip 3817 mapinfo on map loading

* Wip GetFeatureInfo after GetFeature

* wip

* moved queryparam logic in a separate epic

* changed main comp to fetch new epic
* added whitelist
* add error handling for map info from url

* added a generic api for queryparam actions

* added possibility to restrict list of queriable layers to perform GFI
* added possibility to override some request param for specific layers
*

* Added documentation

* fix doc link

* fix german translations

* fix others translations

* Fix documentation and make whitelist configurable

* update doc

* Save filterLayer in layer object (#4010)

* Fix Print tool with vendor param (CQL_FILTER) (#4006)

* Fix 2749 search urls for cross layer filter are compared ignoring "dirty" chars (#4004)

* Fix 2749 search urls for cross layer filter are compared ignoring "dirty" url

* fix test and check for dirty chars

* Fix 4007 hide filter layer when no layers are present in TOC (#4008)

* Fix 4007 hide filter layer whne no layers are present

* even if a group is present with no layers
* Fix tests

* Fixed issues due to sameURL check in #4004 (#4013)

* Fix #3805 User edit password field retain value across users (#4016)

On editing user, the form use to retain password field across editing
session. This commit fix and enable password field reset on close edit
dialog

*  #3929 Cross layer filter cannot be disabled when filled (#3998)

#3929 Cross layer filter cannot be disabled when filled

* refix #2953 to work along #3929

* [docs] Update User Guide (#3995)

* [docs] Update TOC section

* [docs] filtering layers

* [docs] Search tool updates

* [docs] metadata template for CSW services

* [docs] custom tooltip in layer settings

* [docs] updating 'quering objects' section with coordinates editor

* [docs] updating annotations section

* [docs] layer filter persistence

* [docs] crs selector section (#4012)

* #3622: some fixes to involved documentations (#4018)

* Some updates to the CRS selector documentation (#4019)

* #3817 Fixing documentation (#4023)

* #3817 fixing documentation

* Update docs/developer-guide/map-query-parameters.md

Co-Authored-By: mbarto <maurobartolomeoli@gmail.com>

* Update docs/developer-guide/map-query-parameters.md

Co-Authored-By: mbarto <maurobartolomeoli@gmail.com>

* Update .travis.yml (#4027)

* Remove IN PROGRESS (#4026)

* Close #3025 Add boundary for draggable dialog (#4025)

* Close #3025 Add boundary for draggable dialog

* simplification of dialog boundary solution

* make snapshot dialog draggable
offtherailz pushed a commit to offtherailz/MapStore2 that referenced this pull request Aug 9, 2019
* Fix 3895 catalog autosearch

* Fix reducer default, fix epic for autosearch

* test was hard to provide since it is using a thunk
* anyway it has been tested so i removed the test for epic

* added missing default in catalog reducer
@offtherailz offtherailz mentioned this pull request Aug 9, 2019
offtherailz added a commit that referenced this pull request Aug 12, 2019
 Portings for the following PRs from master b to branch 2019.02.xx:

- #3988
- #4016
- #3998
- #4003
- #3991
- #4004
- #4006
- #4008
- #4025
- #4071
- #4019
- #4076
- #4077
- #4081

Target release is o add them to 2019.02.01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants