From acfedaf03ef1175446371a5d4e3c00678f84385e Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Tue, 14 Feb 2023 17:30:39 +0800 Subject: [PATCH] fix(nc-gui): incorrect order for isComparisonOpAllowed --- packages/nc-gui/composables/useViewFilters.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui/composables/useViewFilters.ts b/packages/nc-gui/composables/useViewFilters.ts index 72cfd4c9ba..d8aedceb02 100644 --- a/packages/nc-gui/composables/useViewFilters.ts +++ b/packages/nc-gui/composables/useViewFilters.ts @@ -116,15 +116,15 @@ export function useViewFilters( excludedTypes?: UITypes[] }, ) => { - if (['empty', 'notempty', 'null', 'notnull'].includes(compOp.value)) { - // for these 4 comparisonOp, show them based on `showNullAndEmptyInFilter` in Project Settings - return projectMeta.value.showNullAndEmptyInFilter - } else if (compOp.includedTypes) { + if (compOp.includedTypes) { // include allowed values only if selected column type matches return filter.fk_column_id && compOp.includedTypes.includes(types.value[filter.fk_column_id]) } else if (compOp.excludedTypes) { // include not allowed values only if selected column type not matches return filter.fk_column_id && !compOp.excludedTypes.includes(types.value[filter.fk_column_id]) + } else if (['empty', 'notempty', 'null', 'notnull'].includes(compOp.value)) { + // for these 4 comparisonOp, show them based on `showNullAndEmptyInFilter` in Project Settings + return projectMeta.value.showNullAndEmptyInFilter } return true }