diff --git a/frontend/src/component/common/NewConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ConstraintViewHeaderOperator.tsx b/frontend/src/component/common/NewConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ConstraintViewHeaderOperator.tsx deleted file mode 100644 index 8fcd0db8ae..0000000000 --- a/frontend/src/component/common/NewConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ConstraintViewHeaderOperator.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import type { IConstraint } from 'interfaces/strategy'; -import { ConditionallyRender } from '../../../ConditionallyRender/ConditionallyRender.tsx'; -import { Tooltip, Box, styled } from '@mui/material'; -import { stringOperators } from 'constants/operators'; -import { ReactComponent as NegatedOnIcon } from 'assets/icons/not_operator_selected.svg'; -import { ConstraintOperator } from '../../ConstraintOperator/ConstraintOperator.tsx'; -import { StyledIconWrapper } from './StyledIconWrapper.tsx'; -import { ReactComponent as CaseSensitive } from 'assets/icons/24_Text format.svg'; -import { oneOf } from 'utils/oneOf'; -import { useTheme } from '@mui/material'; - -interface ConstraintViewHeaderOperatorProps { - constraint: IConstraint; - disabled?: boolean; -} - -const StyledHeaderValuesContainerWrapper = styled('div')(({ theme }) => ({ - display: 'flex', - alignItems: 'stretch', - margin: 'auto 0', -})); - -const StyledHeaderConstraintContainer = styled('div')(({ theme }) => ({ - minWidth: '152px', - position: 'relative', - [theme.breakpoints.down('sm')]: { - paddingRight: 0, - }, -})); - -export const ConstraintViewHeaderOperator = ({ - constraint, - disabled = false, -}: ConstraintViewHeaderOperatorProps) => { - const theme = useTheme(); - return ( - - - - - - - - - } - /> - - - - - - - - - } - /> - - ); -}; diff --git a/frontend/src/component/common/NewConstraintAccordion/ConstraintOperator/ConstraintOperator.tsx b/frontend/src/component/common/NewConstraintAccordion/ConstraintOperator/ConstraintOperator.tsx deleted file mode 100644 index eb95363bf6..0000000000 --- a/frontend/src/component/common/NewConstraintAccordion/ConstraintOperator/ConstraintOperator.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import type { IConstraint } from 'interfaces/strategy'; -import { formatOperatorDescription } from 'component/common/LegacyConstraintAccordion/ConstraintOperator/formatOperatorDescription'; -import { styled } from '@mui/material'; - -interface IConstraintOperatorProps { - constraint: IConstraint; - hasPrefix?: boolean; - disabled?: boolean; -} - -const StyledContainer = styled('div')(({ theme }) => ({ - padding: theme.spacing(0.5, 1.5), - borderRadius: theme.shape.borderRadius, - backgroundColor: theme.palette.background.elevation2, - lineHeight: 1.25, -})); - -const StyledName = styled('p', { - shouldForwardProp: (prop) => prop !== 'disabled', -})<{ disabled: boolean }>(({ theme, disabled }) => ({ - fontSize: theme.fontSizes.smallBody, - lineHeight: 17 / 14, - color: disabled ? theme.palette.text.secondary : theme.palette.text.primary, -})); - -const StyledText = styled('p', { - shouldForwardProp: (prop) => prop !== 'disabled', -})<{ disabled: boolean }>(({ theme, disabled }) => ({ - fontSize: theme.fontSizes.smallerBody, - color: disabled ? theme.palette.text.secondary : theme.palette.neutral.main, -})); - -export const ConstraintOperator = ({ - constraint, - hasPrefix, - disabled = false, -}: IConstraintOperatorProps) => { - const operatorName = constraint.operator; - const operatorText = formatOperatorDescription(constraint.operator); - - return ( - - {operatorName} - {operatorText} - - ); -}; diff --git a/frontend/src/component/common/NewConstraintAccordion/ConstraintOperator/formatOperatorDescription.ts b/frontend/src/component/common/NewConstraintAccordion/ConstraintOperator/formatOperatorDescription.ts deleted file mode 100644 index 845d2d14bb..0000000000 --- a/frontend/src/component/common/NewConstraintAccordion/ConstraintOperator/formatOperatorDescription.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Operator } from 'constants/operators'; - -export const formatOperatorDescription = (operator: Operator): string => { - return constraintOperatorDescriptions[operator]; -}; - -const constraintOperatorDescriptions = { - IN: 'is one of', - NOT_IN: 'is not one of', - STR_CONTAINS: 'is a string that contains', - STR_STARTS_WITH: 'is a string that starts with', - STR_ENDS_WITH: 'is a string that ends with', - NUM_EQ: 'is a number equal to', - NUM_GT: 'is a number greater than', - NUM_GTE: 'is a number greater than or equal to', - NUM_LT: 'is a number less than', - NUM_LTE: 'is a number less than or equal to', - DATE_BEFORE: 'is a date before', - DATE_AFTER: 'is a date after', - SEMVER_EQ: 'is a SemVer equal to', - SEMVER_GT: 'is a SemVer greater than', - SEMVER_LT: 'is a SemVer less than', -};