Support numeric between operator

Created on 21 November 2024, 4 days ago

Problem/Motivation

When using an exposed numeric filter with 'between' operator, the filter is not shown in the filter summary.

Steps to reproduce

Add an exposed filter for a numeric field. Select 'between' as the operator. Go to the frontend and filter on these values. The filter summary does not include the numeric field.

Proposed resolution

Add support for the numeric field 'between' operator. Add a single filter item in the summary with the 2 values seperated by a dash (-).
For example;
Filter between 1 and 10, filter shows: 1-10

Remaining tasks

Support for all operators? We might need to think about how this should work for every operator (altough, most operators are easy, for example add '<' or '>' before the value in the filter summary).

User interface changes

Filter between 1 and 10, filter shows: 1-10

API changes

-

Data model changes

-

Feature request
Status

Active

Version

3.0

Component

Code

Created by

🇧🇪Belgium pietermouton

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @pietermouton
  • Pipeline finished with Canceled
    4 days ago
    Total: 140s
    #346105
  • Pipeline finished with Success
    4 days ago
    Total: 138s
    #346109
  • First commit to issue fork.
  • 🇫🇷France mably

    Hi @pietermouton, I have trie to implement a more generic solution in MR 30.

    Could you give it a try and tell me how it goes? Thanks.

  • 🇧🇪Belgium pietermouton

    Hi @mably, I've checked the MR. Looks goods code-wise, but there's one issue (at least for me).

    I have a range filter with 'within' (range contains) operator and a 'word' (contains any word) operator, but now it is added before the value as a prefix. It doesn't feel right to add the machine name of the operator over there.

    For example for the 'contains any word'-operator, it seems ok to just show the value provided without a prefix. I think that's the case for most operators. There are only a few operators that might add value for the end-user.

    I think only some of the numeric operators have added value to be used as a prefix: <, <=, >, >=, !=
    We should add a mapper to check which operators need to be visualized.

  • Pipeline finished with Canceled
    3 days ago
    Total: 76s
    #346724
  • Pipeline finished with Success
    3 days ago
    Total: 173s
    #346725
  • 🇫🇷France mably

    @pietermouton do you think I can merge MR 30 or do you have other improvements in sight?

Production build 0.71.5 2024