Skip to content

Commit

Permalink
Fix isFieldVisible check for undefined as allowed field condition "in…
Browse files Browse the repository at this point in the history
…" value
  • Loading branch information
chrismaltby committed Mar 25, 2024
1 parent f1d184c commit 2ad34d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/shared/lib/scripts/scriptDefHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export const isFieldVisible = (
(!condition.gte || Number(keyValue) >= Number(condition.gte)) &&
(!condition.lt || Number(keyValue) > Number(condition.lt)) &&
(!condition.lte || Number(keyValue) >= Number(condition.lte)) &&
(!condition.in || condition.in.indexOf(keyValue) >= 0) &&
(!condition.in ||
condition.in.indexOf(keyValue) >= 0 ||
(keyValue === undefined && condition.in.indexOf(null) >= 0)) &&
(condition.set === undefined ||
(condition.set && keyValue !== undefined) ||
(!condition.set && keyValue === undefined))
Expand Down

0 comments on commit 2ad34d6

Please sign in to comment.