Skip to content

Commit

Permalink
[frontend] fix nil/not_nil operator in WidgetConfig (#3165)
Browse files Browse the repository at this point in the history
  • Loading branch information
Archidoit authored and jpkha committed Dec 1, 2023
1 parent baa0283 commit 53ba98b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,9 @@ const WidgetConfig = ({ workspace, widget, onComplete, closeMenu }) => {
const dataFilters = data[filterName];
const filter = findFilterFromKey(dataFilters?.filters ?? [], key, op);
if (filter) {
if (op === 'nil' || op === 'not_nil') {
return { ...data };
}
const newValues = isUniqFilter(key)
? [id]
: R.uniq([...(filter?.values ?? []), id]);
Expand All @@ -570,7 +573,7 @@ const WidgetConfig = ({ workspace, widget, onComplete, closeMenu }) => {
}
const newFilterElement = {
key,
values: [id],
values: (op === 'nil' || op === 'not_nil') ? [] : [id],
operator: op,
mode: 'or',
};
Expand Down

0 comments on commit 53ba98b

Please sign in to comment.