skip condition in query designer, when parsing failed

This commit is contained in:
Jan Prochazka 2022-01-01 10:48:18 +01:00
parent 020382a153
commit 579d72f03a

View File

@ -85,19 +85,24 @@ export class DesignerQueryDumper {
if (!table) continue;
if (!tables.find(x => x.designerId == table.designerId)) continue;
const condition = parseFilter(column.filter, findDesignerFilterType(column, this.designer));
if (condition) {
select.where = mergeConditions(
select.where,
_.cloneDeepWith(condition, expr => {
if (expr.exprType == 'placeholder')
return {
exprType: 'column',
columnName: column.columnName,
source: findQuerySource(this.designer, column.designerId),
};
})
);
try {
const condition = parseFilter(column.filter, findDesignerFilterType(column, this.designer));
if (condition) {
select.where = mergeConditions(
select.where,
_.cloneDeepWith(condition, expr => {
if (expr.exprType == 'placeholder')
return {
exprType: 'column',
columnName: column.columnName,
source: findQuerySource(this.designer, column.designerId),
};
})
);
}
} catch (err) {
// condition is skipped
continue;
}
}
}