diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/PlaygroundStrategyExecution/LegacyStrategyExecution.tsx b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/PlaygroundStrategyExecution/LegacyStrategyExecution.tsx deleted file mode 100644 index d304fcf39e..0000000000 --- a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/PlaygroundStrategyExecution/LegacyStrategyExecution.tsx +++ /dev/null @@ -1,87 +0,0 @@ -import { Fragment, type VFC } from 'react'; -import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { StrategySeparator } from 'component/common/StrategySeparator/LegacyStrategySeparator'; -import { styled } from '@mui/material'; -import type { - PlaygroundRequestSchema, - PlaygroundStrategySchema, -} from 'openapi'; -import { ConstraintExecution } from './ConstraintExecution/LegacyConstraintExecution'; -import { SegmentExecution } from './SegmentExecution/LegacySegmentExecution'; -import { PlaygroundResultStrategyExecutionParameters } from './StrategyExecutionParameters/StrategyExecutionParameters'; -import { CustomStrategyParams } from './CustomStrategyParams/CustomStrategyParams'; -import { formattedStrategyNames } from 'utils/strategyNames'; -import { StyledBoxSummary } from './StrategyExecution.styles'; -import { Badge } from 'component/common/Badge/Badge'; - -interface IStrategyExecutionProps { - strategyResult: PlaygroundStrategySchema; - percentageFill?: string; - input?: PlaygroundRequestSchema; -} - -const StyledStrategyExecutionWrapper = styled('div')(({ theme }) => ({ - padding: theme.spacing(0), -})); - -export const StrategyExecution: VFC = ({ - strategyResult, - input, -}) => { - const { name, constraints, segments, parameters } = strategyResult; - - const hasSegments = Boolean(segments && segments.length > 0); - const hasConstraints = Boolean(constraints && constraints?.length > 0); - const hasExecutionParameters = - name !== 'default' && - Object.keys(formattedStrategyNames).includes(name); - const hasCustomStrategyParameters = - Object.keys(parameters).length > 0 && - strategyResult.result.evaluationStatus === 'incomplete'; // Use of custom strategy can be more explicit from the API - - if (!parameters) { - return null; - } - - const items = [ - hasSegments && , - hasConstraints && ( - - ), - hasExecutionParameters && ( - - ), - hasCustomStrategyParameters && ( - - ), - name === 'default' && ( - - The standard strategy is ON for - all users. - - ), - ].filter(Boolean); - - return ( - - {items.map((item, index) => ( - - 0 && - (strategyResult.name === 'flexibleRollout' - ? index < items.length - : index < items.length - 1) - } - show={} - /> - {item} - - ))} - - ); -}; diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/PlaygroundStrategyExecution/SegmentExecution/LegacySegmentExecution.tsx b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/PlaygroundStrategyExecution/SegmentExecution/LegacySegmentExecution.tsx deleted file mode 100644 index 8a8563bdea..0000000000 --- a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/PlaygroundStrategyExecution/SegmentExecution/LegacySegmentExecution.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import { Fragment, type VFC } from 'react'; -import type { PlaygroundSegmentSchema, PlaygroundRequestSchema } from 'openapi'; -import { ConstraintExecution } from '../ConstraintExecution/LegacyConstraintExecution'; -import CancelOutlined from '@mui/icons-material/CancelOutlined'; -import { StrategySeparator } from 'component/common/StrategySeparator/LegacyStrategySeparator'; -import { styled, Typography } from '@mui/material'; -import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { SegmentItem } from 'component/common/SegmentItem/LegacySegmentItem'; - -interface ISegmentExecutionProps { - segments?: PlaygroundSegmentSchema[]; - input?: PlaygroundRequestSchema; -} - -const SegmentResultTextWrapper = styled('div')(({ theme }) => ({ - color: theme.palette.error.main, - display: 'inline-flex', - justifyContent: 'center', - marginLeft: 'auto', - gap: theme.spacing(1), -})); - -export const SegmentExecution: VFC = ({ - segments, - input, -}) => { - if (!segments) return null; - - return ( - <> - {segments.map((segment, index) => ( - - - } - headerContent={ - - - segment is false - - - - - - } - elseShow={undefined} - /> - } - isExpanded - /> - = 0 && - segments.length > 1 && - // Don't add if it's the last segment item - index !== segments.length - 1 - } - show={} - /> - - ))} - - ); -};