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

Query Panel isNull operator is buggy #9085

Closed
1 task done
offtherailz opened this issue Apr 11, 2023 · 6 comments · Fixed by #9086 or #9088
Closed
1 task done

Query Panel isNull operator is buggy #9085

offtherailz opened this issue Apr 11, 2023 · 6 comments · Fixed by #9086 or #9088

Comments

@offtherailz
Copy link
Member

offtherailz commented Apr 11, 2023

Description

The isNull operator in the query panel can not be applied alone

isNull1.webm

Event when used in couple, it is basically ignored on the map.

screencast-github.com-2023.04.11-11_17_06.webm

How to reproduce

Bug 1: The isNull filter can not be applied

  • Add a vector layer to the map
  • Open the query panel
  • add a isNull filter condition on an attribute

Expected Result

  • The filter can be applied

Current Result

  • The filter can not be applied

Bug 2: The isNull filter is ignored on the map.

  • Add a vector layer to the map
  • Open the query panel
  • Add a isNull filter condition
  • Add another attribute filter condition that should produce one or more result
  • Set the filter logic condition to "All" so the filter is something like ATTR isNull AND ATTR = "Alabama" so the filter should produce no results
  • Apply the filter
    Expected Result
    The map should show no result

Current Result
The map shows some results, as the "isNull" filter is not applied.

  • Not browser related
Browser info (use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Affected Version
Internet Explorer
Edge
Chrome
Firefox
Safari

Other useful information

@offtherailz offtherailz mentioned this issue Apr 11, 2023
12 tasks
MV88 added a commit that referenced this issue Apr 11, 2023
* WIP fixing isNull filter

* Improved fix

* Update build/tests.webpack.js

* Fixed tests

* Fixed lint

* Update build/tests.webpack.js

Co-authored-by: Matteo V. <[email protected]>

* Update web/client/utils/__tests__/FilterUtils-test.js

---------

Co-authored-by: Matteo V. <[email protected]>
@ale-cristofori
Copy link
Contributor

@ElenaGallo could you please test this on DEV? Any question let me know

@ElenaGallo
Copy link
Contributor

ElenaGallo commented Apr 11, 2023

Hi @offtherailz, the filter cannot be updated after isNull has been used:

filtro.mov
filtro2.mov

@ale-cristofori
Copy link
Contributor

The wps query sent to retrieve the drop down list unique values result, when there is a isNull condition, seems to contain the map filter (not sure it is correct)

<wps:Execute xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" service="WPS" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
	<ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">gs:PagedUnique</ows:Identifier>
	<wps:DataInputs>
		<wps:Input>
			<ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">features</ows:Identifier>
			<ows:Title xmlns:ows="http://www.opengis.net/ows/1.1">features</ows:Title>
			<wps:Data/>
			<wps:Reference xmlns:xlink="http://www.w3.org/1999/xlink" mimeType="text/xml" xlink:href="http://geoserver/wfs" method="POST">
				<wps:Body>
					<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0">
						<wfs:Query typeName="gs:us_states">
						
						<!-- this part seems to be redundant --> 
							<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
								<ogc:And>
									<ogc:And>
										<ogc:PropertyIsNull>
											<ogc:PropertyName>STATE_NAME</ogc:PropertyName>
										</ogc:PropertyIsNull>
										<ogc:PropertyIsEqualTo>
											<ogc:PropertyName>STATE_NAME</ogc:PropertyName>
											<ogc:Literal>Alabama</ogc:Literal>
										</ogc:PropertyIsEqualTo>
									</ogc:And>
									<ogc:PropertyIsLike matchCase="false" wildCard="*" singleChar="." escapeChar="!">
										<ogc:PropertyName>STATE_NAME</ogc:PropertyName>
										<ogc:Literal>*California*</ogc:Literal>
									</ogc:PropertyIsLike>
								</ogc:And>
							</ogc:Filter>
							<!-- this part seems to be redundant -->
							
							<ogc:SortBy xmlns:ogc="http://www.opengis.net/ogc">
								<ogc:SortProperty>
									<ogc:PropertyName>STATE_NAME</ogc:PropertyName>
								</ogc:SortProperty>
							</ogc:SortBy>
						</wfs:Query>
					</wfs:GetFeature>
				</wps:Body>
			</wps:Reference>
		</wps:Input>
		<wps:Input>
			<ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">fieldName</ows:Identifier>
			<ows:Title xmlns:ows="http://www.opengis.net/ows/1.1">fieldName</ows:Title>
			<wps:Data>
				<wps:LiteralData>STATE_NAME</wps:LiteralData>
			</wps:Data>
		</wps:Input>
		<wps:Input>
			<ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">maxFeatures</ows:Identifier>
			<ows:Title xmlns:ows="http://www.opengis.net/ows/1.1">maxFeatures</ows:Title>
			<wps:Data>
				<wps:LiteralData>5</wps:LiteralData>
			</wps:Data>
		</wps:Input>
		<wps:Input>
			<ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">startIndex</ows:Identifier>
			<ows:Title xmlns:ows="http://www.opengis.net/ows/1.1">startIndex</ows:Title>
			<wps:Data>
				<wps:LiteralData>0</wps:LiteralData>
			</wps:Data>
		</wps:Input>
	</wps:DataInputs>
	<wps:ResponseForm>
		<wps:RawDataOutput mimeType="application/json">
			<ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">result</ows:Identifier>
		</wps:RawDataOutput>
	</wps:ResponseForm>
</wps:Execute>

@offtherailz
Copy link
Member Author

offtherailz commented Apr 12, 2023

Hi, this is an existing bug, not strictly related to the isNull filter, but general.

Not sure but it is not new to me, so maybe an issue about this already exists. If no, we can create it.

Basically the WPS request for autocomplete applies the filter of the layer. Here an example with a different filter that causes the same behivior:

screencast--2023.04.12-12_53_52.webm

offtherailz added a commit to offtherailz/MapStore2 that referenced this issue Apr 12, 2023
* WIP fixing isNull filter

* Improved fix

* Update build/tests.webpack.js

* Fixed tests

* Fixed lint

* Update build/tests.webpack.js

Co-authored-by: Matteo V. <[email protected]>

* Update web/client/utils/__tests__/FilterUtils-test.js

---------

Co-authored-by: Matteo V. <[email protected]>
@offtherailz
Copy link
Member Author

offtherailz commented Apr 12, 2023

backport ready here: #9088

@ale-cristofori
Copy link
Contributor

@ElenaGallo, as assessed by @offtherailz. The remaning buggy behaviour, consisting in the extra layer filter applied to the autocomplete wps filter request, is a pre-existing buggy behaviour and we will deal with this last issue separately #9089

@offtherailz offtherailz linked a pull request Apr 12, 2023 that will close this issue
ale-cristofori pushed a commit that referenced this issue Apr 13, 2023
)

* WIP fixing isNull filter

* Improved fix

* Update build/tests.webpack.js

* Fixed tests

* Fixed lint

* Update build/tests.webpack.js

Co-authored-by: Matteo V. <[email protected]>

* Update web/client/utils/__tests__/FilterUtils-test.js

---------

Co-authored-by: Matteo V. <[email protected]>
ale-cristofori added a commit that referenced this issue Apr 13, 2023
) (#9090)

* backport C044-2022.02.xx - #9085 changes to the buildConfig calls (#9086)

* WIP fixing isNull filter

* Improved fix

* Update build/tests.webpack.js

* Fixed tests

* Fixed lint

* Update build/tests.webpack.js

Co-authored-by: Matteo V. <[email protected]>

* Update web/client/utils/__tests__/FilterUtils-test.js

---------

Co-authored-by: Matteo V. <[email protected]>

* removed temporarily failing tests for missing uitls functions

---------

Co-authored-by: Lorenzo Natali <[email protected]>
Co-authored-by: Matteo V. <[email protected]>
Co-authored-by: Alessandro Cristofori <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants