diff --git a/src/component/common/ConstraintAccordion/ConstraintOperatorSelect/ConstraintOperatorSelect.tsx b/src/component/common/ConstraintAccordion/ConstraintOperatorSelect/ConstraintOperatorSelect.tsx index d922148cdf..9c38f2d8f5 100644 --- a/src/component/common/ConstraintAccordion/ConstraintOperatorSelect/ConstraintOperatorSelect.tsx +++ b/src/component/common/ConstraintAccordion/ConstraintOperatorSelect/ConstraintOperatorSelect.tsx @@ -5,6 +5,7 @@ import { semVerOperators, dateOperators, numOperators, + inOperators, } from 'constants/operators'; import React, { useState, ChangeEvent } from 'react'; import { formatOperatorDescription } from 'component/common/ConstraintAccordion/ConstraintOperator/formatOperatorDescription'; @@ -61,7 +62,8 @@ export const ConstraintOperatorSelect = ({ key={operator} value={operator} className={classNames( - needSeparatorAbove(operator) && styles.separator + needSeparatorAbove(options, operator) && + styles.separator )} >
@@ -77,15 +79,20 @@ export const ConstraintOperatorSelect = ({ ); }; -const needSeparatorAbove = (operator: Operator): boolean => { - const groups = [ - stringOperators, - numOperators, - dateOperators, - semVerOperators, - ]; +const needSeparatorAbove = (options: Operator[], option: Operator): boolean => { + if (option === options[0]) { + return false; + } - return groups.some(group => { - return group[0] === operator; + return operatorGroups.some(group => { + return group[0] === option; }); }; + +const operatorGroups = [ + inOperators, + stringOperators, + numOperators, + dateOperators, + semVerOperators, +];