Resolve "Ensure LocalBaserowTableService view filtering respects the view's filter type."
requested to merge 1971-ensure-localbaserowtableservice-view-filtering-respects-the-view-s-filter-type into develop
What is in this MR
This MR ensures that when we filter in a LocalBaserowTableService
dispatch containing a View
, we respect the view's filter_type
. Additionally, this MR introduces a filter_type
for the service filtering as well.
Previously, given:
-
ViewFilter(name=Peter)
ORViewFilter(name=Steve)
ServiceFilter(name=Clive)
I combined it into the following:
name=Peter
ANDname=Steve
ANDname=Clive
.
Now, with this MR, we will AND the two separate filter groups, and respect the filter_type
internally:
(
name=Peter
ORname=Steve
) ANDname=Clive
.
How to test this MR
There's no UI for ServiceFilter
yet (soon to follow!), the easiest way to test this is to:
- Create a
View
with some interestingViewFilter
(use perhaps both AND/OR in separate tests). - Create a
ServiceFilter
from shell, pointing at your service:
from baserow.contrib.integrations.local_baserow.models import LocalBaserowListRows
from baserow.contrib.integrations.local_baserow.models import LocalBaserowTableServiceFilter
service = LocalBaserowListRows.objects.get(id=YOUR_SERVICE_ID)
service_filter = LocalBaserowTableServiceFilter.objects.create(
type='equal',
value='YOUR_CELL_VALUE',
service=service,
field=service.table.field_set.get(name='YOUR_FIELD_NAME')
)
Merge Request Checklist
-
changelog.md has been updated if required. -
New/updated Premium/Enterprise features are separated correctly in the premium or enterprise folder -
The latest Chrome and Firefox have been used to test any new frontend features -
Documentation has been updated -
Quality Standards are met -
Performance: tables are still fast with 100k+ rows, 100+ field tables -
The redoc API pages have been updated for any REST API changes -
Our custom API docs are updated for changes to endpoints accessed via api tokens -
The UI/UX has been updated following UI Style Guide
Closes #1971 (closed)
Edited by Jérémie Pardou