|
|
@ -192,6 +192,16 @@ export function useViewFilters( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const placeholderGroupFilter = (): Filter => { |
|
|
|
|
|
|
|
const logicalOps = new Set(filters.value.slice(1).map((filter) => filter.logical_op)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
is_group: true, |
|
|
|
|
|
|
|
status: 'create', |
|
|
|
|
|
|
|
logical_op: logicalOps.size === 1 ? logicalOps.values().next().value : 'and', |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const loadAllChildFilters = async (filters: Filter[]) => { |
|
|
|
const loadAllChildFilters = async (filters: Filter[]) => { |
|
|
|
// Array to store promises of child filter loading
|
|
|
|
// Array to store promises of child filter loading
|
|
|
|
const promises = [] |
|
|
|
const promises = [] |
|
|
@ -464,11 +474,7 @@ export function useViewFilters( |
|
|
|
const addFilterGroup = async () => { |
|
|
|
const addFilterGroup = async () => { |
|
|
|
const child = placeholderFilter() |
|
|
|
const child = placeholderFilter() |
|
|
|
|
|
|
|
|
|
|
|
const placeHolderGroupFilter: Filter = { |
|
|
|
const placeHolderGroupFilter: Filter = placeholderGroupFilter() |
|
|
|
is_group: true, |
|
|
|
|
|
|
|
status: 'create', |
|
|
|
|
|
|
|
logical_op: 'and', |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nestedMode.value) placeHolderGroupFilter.children = [child] |
|
|
|
if (nestedMode.value) placeHolderGroupFilter.children = [child] |
|
|
|
|
|
|
|
|
|
|
|