From c76f122d7e584b2c6daaecf54e5f3b996203a40f Mon Sep 17 00:00:00 2001 From: Tom Forbes Date: Wed, 30 Oct 2024 15:25:34 +0000 Subject: [PATCH] only allow one method --- .../TestMethodologyEditor.tsx | 113 ++---------------- .../bannerTests/bannerTestEditor.tsx | 1 - .../epicTests/testEditor.tsx | 1 - 3 files changed, 10 insertions(+), 105 deletions(-) diff --git a/public/src/components/channelManagement/TestMethodologyEditor.tsx b/public/src/components/channelManagement/TestMethodologyEditor.tsx index fa3143a0..a741cfc1 100644 --- a/public/src/components/channelManagement/TestMethodologyEditor.tsx +++ b/public/src/components/channelManagement/TestMethodologyEditor.tsx @@ -1,17 +1,7 @@ import React from 'react'; import { Methodology } from './helpers/shared'; import { makeStyles } from '@mui/styles'; -import { - Button, - MenuItem, - Select, - SelectChangeEvent, - TextField, - Theme, - Tooltip, -} from '@mui/material'; -import CloseIcon from '@mui/icons-material/Close'; -import AddIcon from '@mui/icons-material/Add'; +import { MenuItem, Select, SelectChangeEvent, TextField, Theme } from '@mui/material'; const useStyles = makeStyles(({ spacing, palette }: Theme) => ({ container: { @@ -29,29 +19,6 @@ const useStyles = makeStyles(({ spacing, palette }: Theme) => ({ marginLeft: spacing(1), }, }, - audiencePercentage: { - display: 'flex', - alignItems: 'center', - margin: `0 ${spacing(1)}`, - fontWeight: 500, - }, - testNameAndDeleteButton: { - marginLeft: 'auto', - display: 'flex', - alignItems: 'center', - }, - deleteButton: { - '& > button': { - height: '100%', - }, - }, - testName: { - marginRight: spacing(2), - fontWeight: 500, - }, - error: { - color: 'red', - }, })); const defaultEpsilonGreedyBandit: Methodology = { @@ -59,30 +26,16 @@ const defaultEpsilonGreedyBandit: Methodology = { epsilon: 0.1, }; -const addMethodologyToTestName = (testName: string, methodology: Methodology): string => { - if (methodology.name === 'EpsilonGreedyBandit') { - return `${testName}_EpsilonGreedyBandit-${methodology.epsilon}`; - } else { - return `${testName}_ABTest`; - } -}; - interface TestMethodologyProps { methodology: Methodology; - audiencePercentage: number; - testName?: string; isDisabled: boolean; onChange: (methodology: Methodology) => void; - onDelete: () => void; } const TestMethodology: React.FC = ({ methodology, - audiencePercentage, - testName, isDisabled, onChange, - onDelete, }: TestMethodologyProps) => { const classes = useStyles(); @@ -96,9 +49,6 @@ const TestMethodology: React.FC = ({ }; return (
- -
{audiencePercentage}%
-