Skip to content

Commit a8a8e26

Browse files
authored
fix: save the fuzzy filter correctly (#790)
1 parent 0de842f commit a8a8e26

File tree

1 file changed

+8
-2
lines changed
  • packages/app-builder/src/components/AstBuilder/edition/EditModal/modals/Aggregation

1 file changed

+8
-2
lines changed

packages/app-builder/src/components/AstBuilder/edition/EditModal/modals/Aggregation/EditFilters.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
isBinaryAggregationFilter,
1212
isBinaryAggregationFilterOperator,
1313
isComplexAggregationFilter,
14+
isFuzzyMatchFilterOptionsAstNode,
1415
isUnaryAggregationFilterOperator,
1516
NewAggregatorFilterAstNode,
1617
NewFuzzyMatchFilterOptionsAstNode,
@@ -26,6 +27,7 @@ import { useFormatLanguage } from '@app-builder/utils/format';
2627
import clsx from 'clsx';
2728
import { Fragment, type ReactNode, useMemo, useState } from 'react';
2829
import { Trans, useTranslation } from 'react-i18next';
30+
import * as R from 'remeda';
2931
import { match } from 'ts-pattern';
3032
import { Button, MenuCommand } from 'ui-design-system';
3133
import { Icon } from 'ui-icons';
@@ -222,8 +224,12 @@ export function EditFilters({ aggregatedField, dataModel }: EditFiltersProps) {
222224
</Button>
223225
{filter.namedChildren.value && filterEditedIndex === filterIndex ? (
224226
<OperandEditModal
225-
node={filter.namedChildren.value}
226-
onSave={() => {
227+
node={R.clone(filter.namedChildren.value)}
228+
onSave={(astNode) => {
229+
if (isFuzzyMatchFilterOptionsAstNode(astNode)) {
230+
filter.namedChildren.value = astNode;
231+
nodeSharp.actions.validate();
232+
}
227233
setEditedFilterIndex(null);
228234
}}
229235
onCancel={() => {

0 commit comments

Comments
 (0)