Skip to content

FilteredTable - Make Search and Fixed Search results groups configurable (union, intersection) #1578

Description

@joshiraezcode

Small improvement to the component in case someone wants to pick it up to understand this part of the code. Low priority as it's not needed currently for any feature.

Right now, any search in a given key always acts as an intersection. That is: all search inputs for a given key must be a hit for every input of that given key.

Example:

Hi how are you
Hi I'm good
That's good

If we search for "Hi" we would get: "Hi how are you" and "Hi I'm good"
If we search for "good": "Hi I'm good" and "That's good"
If we search for "Hi" and "good" we would only get "Hi, I'm good" as it's currently acting as an intersection (every search input must be in the result).

If we could configure it to allow unions, in the previous example we would get all 3 sentences as any of those sentences have some of the search inputs we wrote.

With search texts is an ok behaviour, but with fixed search we currently use checkboxes to select search terms. Which we decided on after seeing how this is handled in OpenShift but it's bad UX I think

Image

Anytime we use a fixed search with 2 or more inputs, we wont get results. With checkboxes, you usually expect to be a union type of result, meaning that you are looking for any results that have some of the fixed searches we selected with checkboxes, but that's not the case.

So for example in the above example I would expect to get all Loggers of type Warn and Info, but Filtered Table is trying to find one that is at the same time Warn and Info which is impossible.

I think it would be nice that we could configure it and also change the design accordingly.

  • Search input or text search - I think is fine currently but it never hurts to allow it to be configurable in a per key basis for the developer.
  • Fixed search - Allow to be configurable as a union or intersection kind of search. Also, for intersection, allow the rare case where we might work with multiple values of the fixed set. That would mean

So that would mean adding:

  • SingleSearch prop (only for fixed search, although it can be discussed the same for text search):
    • If it's activated for a given key
      • Remove checkboxes
      • On click, change the dropdown label to the selected search input
      • Leave the current logic to see the different inputs as is.
    • If it's not activated
      • Leave behaviour as is.
  • IsUnion prop (mainly for fixed search, but can also be discussed to be added to text search):
    • If activated for a given key
      • Add every result that has any of the search inputs for that key
    • If not activated:
      • Current behaviour - Every search input for a key must be in the result

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions