Skip to content

fix(filter.numeric_filter): Prefer filter.type in the spread operation#2900

Merged
simon-leech merged 4 commits into
GEOLYTIX:patchfrom
AlexanderGeere:fix-filter-type
Jul 17, 2026
Merged

fix(filter.numeric_filter): Prefer filter.type in the spread operation#2900
simon-leech merged 4 commits into
GEOLYTIX:patchfrom
AlexanderGeere:fix-filter-type

Conversation

@AlexanderGeere

@AlexanderGeere AlexanderGeere commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

Filter types were being overwritten by the type of the entry due to this line:

screenshot-2026-07-16_16-02-11

in lib/ui/layers/filters.mjs. This meant that setting the filter type to numeric or integer would always use numeric steps e.g. 0.01
as the type of the filter would the same as the entry, text for example, and steps would default:
screenshot-2026-07-16_16-03-52

This PR uses a spread operation filter to entry to maintain the filters' type.

GitHub Issue

#2895

Type of Change

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

How have you tested this?

Tested locally

Important

bugs_testing/filter/all_filters.json
The numeric filter should use decimal steps and the integer filter should use integer steps

Testing Checklist

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

Code Quality Checklist

  • ✅ 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

@AlexanderGeere AlexanderGeere self-assigned this Jul 16, 2026
@AlexanderGeere AlexanderGeere added the Bug A genuine bug. There must be some form of error exception to work with. label Jul 16, 2026
@AlexanderGeere AlexanderGeere linked an issue Jul 16, 2026 that may be closed by this pull request
@AlexanderGeere
AlexanderGeere marked this pull request as ready for review July 16, 2026 14:09
@AlexanderGeere AlexanderGeere changed the title fix(filter): Prefer filter.type in the object assign fix(filter.numeric_filter): Prefer filter.type in the object assign Jul 16, 2026
@AlexanderGeere AlexanderGeere changed the title fix(filter.numeric_filter): Prefer filter.type in the object assign fix(filter.numeric_filter): Prefer filter.type in the spread operation Jul 16, 2026

@simon-leech simon-leech left a comment

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.

Working for me - tested overwriting the title and type of filter and all good! 👍

    {
      "title": "UK Rank",
      "field": "rp_rank",
      "fieldfx": "select case when rp_rank is not null then to_char(rp_rank, 'FM999,999,999') || ' of ' ||  1000 else null end",
      "inline": true,
      "skipNullValue": true,
      "filter": {
        "title": "HELLO",
        "type": "integer"
      }
    },

@dbauszus-glx dbauszus-glx linked an issue Jul 17, 2026 that may be closed by this pull request

@dbauszus-glx dbauszus-glx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I quickly revised the documentation. I highly recommend using inline copilot for this kind of things to make sure that missing properties are documented.

Image

@simon-leech
simon-leech merged commit ec809ce into GEOLYTIX:patch Jul 17, 2026
4 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filter Properties Not Overwriting Entry Types

3 participants