From dc8e25d34a107407ee0dab5df0301605a0c3a651 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 15 Mar 2023 19:18:28 +0800 Subject: [PATCH] fix(nc-gui): column filter type issues --- .../components/smartsheet/toolbar/ColumnFilter.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue b/packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue index eac17c2848..7495c534b0 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue @@ -109,7 +109,7 @@ const filterUpdateCondition = (filter: FilterType, i: number) => { } } saveOrUpdate(filter, i) - filterPrevComparisonOp.value[filter.id] = filter.comparison_op + filterPrevComparisonOp.value[filter.id!] = filter.comparison_op! $e('a:filter:update', { logical: filter.logical_op, comparison: filter.comparison_op, @@ -165,11 +165,10 @@ const selectFilterField = (filter: Filter, index: number) => { // since the existing one may not be supported for the new field // e.g. `eq` operator is not supported in checkbox field // hence, get the first option of the supported operators of the new field - filter.comparison_op = comparisonOpList(col.uidt as UITypes).filter((compOp) => - isComparisonOpAllowed(filter, compOp), - )?.[0].value + filter.comparison_op = comparisonOpList(col.uidt as UITypes).filter((compOp) => isComparisonOpAllowed(filter, compOp))?.[0] + .value as FilterType['comparison_op'] - if ([UITypes.Date, UITypes.DateTime].includes(col.uidt as UITypes) && !['blank', 'notblank'].includes(filter.comparison_op)) { + if ([UITypes.Date, UITypes.DateTime].includes(col.uidt as UITypes) && !['blank', 'notblank'].includes(filter.comparison_op!)) { if (filter.comparison_op === 'isWithin') { filter.comparison_sub_op = 'pastNumberOfDays' } else {