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

Pass filter to minmax #1501

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Pass filter to minmax #1501

merged 2 commits into from
Sep 26, 2024

Conversation

simon-leech
Copy link
Contributor

@simon-leech simon-leech commented Sep 25, 2024

Pass Filter to minmax

Description

I noticed that the default field_minmax query contains WHERE TRUE ${filter}, however we never pass the filter as a parameter into the query.
So the layer filter is never being used in this query.
This is a bug as we need to ensure the filtering occurs only on the data used on the layer itself, not on all data on the table on the database.

I have resolved this by simply adding it to the list of parameters passed to the query.

Type of Change

Please delete options that are not relevant, and select all options that apply.

  • ✅ Bug fix (non-breaking change which fixes an issue)

Testing Checklist

Please delete options that are not relevant, and select all options that apply.

  • ✅ Existing Tests still pass
  • ✅ Ran locally on my machine

Code Quality Checklist

Please delete options that are not relevant, and select all options that apply.

  • ✅ My code follows the guidelines of XYZ
  • ✅ My code has been commented
  • ✅ Documentation has been updated
  • ✅ New and existing unit tests pass locally with my changes
  • ✅ Main has been merged into this PR

@simon-leech simon-leech added Bug A genuine bug. There must be some form of error exception to work with. v4.x.x labels Sep 25, 2024
@simon-leech simon-leech marked this pull request as ready for review September 25, 2024 17:18
Copy link

sonarcloud bot commented Sep 26, 2024

@@ -67,5 +67,22 @@ export async function filtersTest(mapview) {
codi.assertEqual(minInput.value, '100', 'The min should return 100.');
codi.assertEqual(maxInput.value, '1000', 'The max should return 1000');
});

await codi.it('Numeric Filter: layer.current specified as `lte: 200` and `gte: 800`', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice one! Thanks :)

Copy link
Contributor

@AlexanderGeere AlexanderGeere left a comment

Choose a reason for hiding this comment

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

I added a test for the change. Looks good to me!

Copy link
Member

@dbauszus-glx dbauszus-glx left a comment

Choose a reason for hiding this comment

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

Review in progress

Copy link
Member

@dbauszus-glx dbauszus-glx left a comment

Choose a reason for hiding this comment

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

lgtm

@dbauszus-glx dbauszus-glx merged commit d2141bb into GEOLYTIX:main Sep 26, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A genuine bug. There must be some form of error exception to work with. v4.x.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants