Add "is none of" view filter for single select field type with simple frontend only
We want to introduce a new view filter type that allows users to filter a single select field to only match cells that have none of the comma separated list of a single select option ids. So, for example:
-
There is a Baserow table with a single field, with some single select options and some rows:
- The single select field is just like an enum. The options are the various "enum values" that the user can pick. A single select field cell can only ever contain one option or no option, and is stored in the underlying postgres database table holding this user's table of a data as a FK to the SelectOption table.
-
You then create a view filter on that single select field with your new filter type
is none of
with a value of"112,114,116"
.- The user should just enter this filter value using a text input box. There is no need for a fancier component letting the user pick the options using dropdowns in this issue.
-
Once the filter is created, only rows not containing the single select options with a PK of 112 or 114 or 116 should then be shown, and the rest should be filtered out.
Backend vs Frontend view filter logic
Note that every filter has two implementations, one in the backend and one in the web-frontend. The web-frontend checks in real time if the row still matches the filters. You can see how that works by for example by:
- Create a filter for a text field
- Change a cell of that text field so it no longer matches the filter
- It should indicate in real time if the row doesn't match the filters anymore.
- See the screenshot below for an example of what this looks like in our UI
Pointers
- The filter must be compatible with only the single select field type. Don't worry about the multi select field type.
- You don't need to make a nice component in the frontend that lets the user select which options they want "none of", instead just use a normal text input and expect the user to enter a comma separated string of single select option PKs.
- The real time check of if an edited row still matches the current filters should work for this new filter.
- The real time check should work if you follow these steps
- Create a filter of your new type
- Create a row which matches the filter
- Change the row so it no longer matches the filter and observe the orange warning pops up
- Clicking away from the changed row makes it disappear
- The API docs (https://api.baserow.io/api/redoc/) should show this new view filter type as an option with explanation.
- The automatically generated docs (https://baserow.io/api-docs) should show this new view filter type as an option with example.
- We value:
- Unit tests for the backend and for the web-frontend.
- High quality and clear documentation in our code.
Information
- More information about how the setup your development environment can be found here https://baserow.io/docs/development%2Fdevelopment-environment
- More information about how view filters work can be found here https://baserow.io/docs/plugins%2Fview-filter-type