|
|
@ -120,8 +120,8 @@ const parseConditionV2 = async ( |
|
|
|
// aggregated value will be either json array or `___` separated string
|
|
|
|
// aggregated value will be either json array or `___` separated string
|
|
|
|
// `gb_null` is equivalent to `blank` but for lookup it compares on aggregated value is null
|
|
|
|
// `gb_null` is equivalent to `blank` but for lookup it compares on aggregated value is null
|
|
|
|
if ( |
|
|
|
if ( |
|
|
|
filter.comparison_op === 'gb_eq' || |
|
|
|
(filter.comparison_op as any) === 'gb_eq' || |
|
|
|
filter.comparison_op === 'gb_null' |
|
|
|
(filter.comparison_op as any) === 'gb_null' |
|
|
|
) { |
|
|
|
) { |
|
|
|
const column = await filter.getColumn(); |
|
|
|
const column = await filter.getColumn(); |
|
|
|
if ( |
|
|
|
if ( |
|
|
@ -137,13 +137,13 @@ const parseConditionV2 = async ( |
|
|
|
getAlias: getAliasGenerator('__gb_filter_lk'), |
|
|
|
getAlias: getAliasGenerator('__gb_filter_lk'), |
|
|
|
}); |
|
|
|
}); |
|
|
|
return (qb) => { |
|
|
|
return (qb) => { |
|
|
|
if (filter.comparison_op === 'gb_eq') |
|
|
|
if ((filter.comparison_op as any) === 'gb_eq') |
|
|
|
qb.where(knex.raw('?', [filter.value]), lkQb.builder); |
|
|
|
qb.where(knex.raw('?', [filter.value]), lkQb.builder); |
|
|
|
else qb.whereNull(knex.raw(lkQb.builder).wrap('(', ')')); |
|
|
|
else qb.whereNull(knex.raw(lkQb.builder).wrap('(', ')')); |
|
|
|
}; |
|
|
|
}; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
filter.comparison_op = |
|
|
|
filter.comparison_op = |
|
|
|
filter.comparison_op === 'gb_eq' ? 'eq' : 'blank'; |
|
|
|
(filter.comparison_op as any) === 'gb_eq' ? 'eq' : 'blank'; |
|
|
|
// if qrCode or Barcode replace it with value column
|
|
|
|
// if qrCode or Barcode replace it with value column
|
|
|
|
if ([UITypes.QrCode, UITypes.Barcode].includes(column.uidt)) |
|
|
|
if ([UITypes.QrCode, UITypes.Barcode].includes(column.uidt)) |
|
|
|
filter.fk_column_id = await column |
|
|
|
filter.fk_column_id = await column |
|
|
|