diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilter.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilter.vue index ffc4dfc2dc..6756ba6aac 100644 --- a/packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilter.vue +++ b/packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilter.vue @@ -1,6 +1,7 @@ @@ -77,7 +90,7 @@ watch( - + - - - + /> - - - {{ $t('activity.addFilter') }} - - + + + + + + + {{ $t('activity.addFilter') }} + + + + + + + Add Filter Group + + + + diff --git a/packages/nc-gui-v2/composables/useViewFilters.ts b/packages/nc-gui-v2/composables/useViewFilters.ts index 64a82d24bc..daf0a1d161 100644 --- a/packages/nc-gui-v2/composables/useViewFilters.ts +++ b/packages/nc-gui-v2/composables/useViewFilters.ts @@ -7,7 +7,8 @@ export function useViewFilters( parentId?: string, reloadData?: () => void, ) { - const filters = ref<(FilterType & { status?: 'update' | 'delete' })[]>([]) + // todo: update swagger + const filters = ref<(FilterType & { status?: 'update' | 'delete'; parentId?: string })[]>([]) const { $api } = useNuxtApp() @@ -100,5 +101,16 @@ export function useViewFilters( }) } - return { filters, loadFilters, sync, deleteFilter, saveOrUpdate, addFilter } + const addFilterGroup = async (parentId?: string) => { + filters.value.push({ + parentId, + is_group: true, + status: 'update', + logical_op: 'and', + }) + const index = filters.value.length - 1 + await saveOrUpdate(filters.value[index], index) + } + + return { filters, loadFilters, sync, deleteFilter, saveOrUpdate, addFilter, addFilterGroup } }