|
|
@ -7,6 +7,18 @@ export function customTableFilterFunction(data: any, filter: any) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (const filterElementName of Object.keys(filter.columnFilters)) {
|
|
|
|
for (const filterElementName of Object.keys(filter.columnFilters)) {
|
|
|
|
const filterElement = filter.columnFilters[filterElementName];
|
|
|
|
const filterElement = filter.columnFilters[filterElementName];
|
|
|
|
|
|
|
|
// List Filter - ignore types if column is list
|
|
|
|
|
|
|
|
if (filterElement.list && filterElement.values.length > 0) {
|
|
|
|
|
|
|
|
let dataElement: Array<any> = data[filterElementName];
|
|
|
|
|
|
|
|
if (dataElement.length !== filterElement.values.length) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (const element of filterElement.values) {
|
|
|
|
|
|
|
|
if (!dataElement.includes(element)) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
// String Filter
|
|
|
|
// String Filter
|
|
|
|
if (filterElement.value) {
|
|
|
|
if (filterElement.value) {
|
|
|
|
if (filterElement.type === 'String' || filterElement.type === 'Id') {
|
|
|
|
if (filterElement.type === 'String' || filterElement.type === 'Id') {
|
|
|
@ -148,14 +160,23 @@ export function customTableFilterFunction(data: any, filter: any) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Enum Filter
|
|
|
|
// Enum Filter
|
|
|
|
if (filterElement.type.startsWith('Enum') && filterElement.value != null && filterElement.value !== data[filterElementName]) {
|
|
|
|
if (
|
|
|
|
|
|
|
|
filterElement.type.startsWith('Enum') &&
|
|
|
|
|
|
|
|
filterElement.value != null &&
|
|
|
|
|
|
|
|
filterElement.value !== data[filterElementName]
|
|
|
|
|
|
|
|
) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Boolean Filter
|
|
|
|
// Boolean Filter
|
|
|
|
if (filterElement.type === "Boolean" && ((filterElement.value === "Ja" && !data[filterElementName])||(filterElement.value === "Nein" && data[filterElementName]))) {
|
|
|
|
if (
|
|
|
|
|
|
|
|
filterElement.type === 'Boolean' &&
|
|
|
|
|
|
|
|
((filterElement.value === 'Ja' && !data[filterElementName]) ||
|
|
|
|
|
|
|
|
(filterElement.value === 'Nein' && data[filterElementName]))
|
|
|
|
|
|
|
|
) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
/*const b =
|
|
|
|
/*const b =
|
|
|
|
!filter.includesString ||
|
|
|
|
!filter.includesString ||
|
|
|
|
Object.keys(data).some(
|
|
|
|
Object.keys(data).some(
|
|
|
|