diff --git a/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionEdit/ConstraintAccordionEditHeader/ConstraintAccordionEditHeader.tsx b/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionEdit/ConstraintAccordionEditHeader/ConstraintAccordionEditHeader.tsx index 76d6b37519..b4688363ef 100644 --- a/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionEdit/ConstraintAccordionEditHeader/ConstraintAccordionEditHeader.tsx +++ b/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionEdit/ConstraintAccordionEditHeader/ConstraintAccordionEditHeader.tsx @@ -9,6 +9,7 @@ import { DATE_AFTER, IN, stringOperators, + inOperators, } from 'constants/operators'; import { resolveText } from './helpers'; import { oneOf } from 'utils/oneOf'; @@ -123,7 +124,7 @@ export const ConstraintAccordionEditHeader = ({ setOperator(IN); } - if (oneOf(stringOperators, operator)) { + if (oneOf([...stringOperators, ...inOperators], operator)) { setShowCaseSensitiveButton(true); } else { setShowCaseSensitiveButton(false); diff --git a/src/lib/util/feature-evaluator/constraint.ts b/src/lib/util/feature-evaluator/constraint.ts index 72c7c3976b..c39cf17fe5 100644 --- a/src/lib/util/feature-evaluator/constraint.ts +++ b/src/lib/util/feature-evaluator/constraint.ts @@ -39,10 +39,15 @@ const cleanValues = (values: string[]) => const InOperator = (constraint: Constraint, context: Context) => { const field = constraint.contextName; + const caseInsensitive = Boolean(constraint.caseInsensitive); const values = cleanValues(constraint.values); const contextValue = resolveContextValue(context, field); - const isIn = values.some((val) => val === contextValue); + const isIn = values.some((val) => + caseInsensitive + ? val.toLowerCase() === contextValue?.toLowerCase() + : val === contextValue, + ); return constraint.operator === Operator.IN ? isIn : !isIn; };