-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Inline searching for grid and grid block #12049
Conversation
…arching operators where possible
…nto grid-inline-searching
packages/frontend-core/src/components/grid/cells/HeaderCell.svelte
Outdated
Show resolved
Hide resolved
packages/frontend-core/src/components/grid/cells/HeaderCell.svelte
Outdated
Show resolved
Hide resolved
…le for sort fields
…s, and optimise API usage across all datasources
…nto grid-inline-searching
… main grid keyboard manager
875c34d
to
74cab11
Compare
…nto grid-inline-searching
…nto grid-inline-searching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, small question though.
A row added while an inline search is in progress will be visible even if it doesn't match the search parameters, at least for string fields, just checking this is intentional, not sure if it being immediately hidden is preferable tbh
Yea I think that's the better alternative to creating a row just to have it immediately hidden. It's sort of a middle-ground though, because if you re-sort your data or do another search then the new row will be hidden. So it's basically just visible immediately after creation until the next filter/sort gets applied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Couple of questions:
- Search case sensitive for MultiSelect column but not Options?
- When searching for "fuel" in the expenses I get no results.
- For V1 Views with a
groupBy
defined, the grid loads but its blank - Similar issue to the schema issue outlined here.
- Parse view v1 schema to fix builder crash. #12135
As discussed, just leaving the comments here for visibility:
Technical restriction unfortunately due to how the fields are indexed.
I'll attempt to support these old views by updating the |
…datasource that has a custom means of determining a datasource schema
Description
This PR adds inline searching to the grid and grid block. Searching is only supported on a subset of column types, which right now is
string
,options
,longform
,array
,number
andformula
columns which are of the static type.The search field itself is always a text field at the moment, which is the main reason searching on dates is currently unsupported. This may be improved upon in future.
The search operator used is the most sensible of the available options for a given type. For most text based columns that is currently a
string
operator (which is a "starts with"). For numbers we use anequal
operator, and for multi-select columns we use acontains
operator.Filters can be cleared by either clearing the text field or pressing the dedicated clear icon.
Using search
Hover over a header cell, and if search is supported then the left icon will transform into a search icon:
Pressing the icon will transform the header into a text input and focus is, ready to type to search:
Typing a search value will automatically start filtering the rows in the grid. Searching is automatically performed on keystrokes (debounced by a short delay to avoid spam):
Blurring the field will keep the filter active and highlight the header cell with a unique background color, highlighting to the user that this column has a filter applied:
Multiple filters can be applied at the same time and results are those that match ALL the specified filters:
Addresses:
Documentation
Feature branch env
Feature Branch Link