mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-31 13:47:02 +02:00
cleanup dead code
This commit is contained in:
parent
f396e714a1
commit
f0201dac55
@ -18,7 +18,7 @@ export const ConstraintListItem = styled('div')(({ theme }) => ({
|
||||
padding: theme.spacing(1.5, 3),
|
||||
display: 'flex',
|
||||
flexFlow: 'column',
|
||||
gap: theme.spacing(2),
|
||||
gap: theme.spacing(1),
|
||||
}));
|
||||
|
||||
const StyledListItem = styled('li')({
|
||||
|
@ -1,7 +1,6 @@
|
||||
import type React from 'react';
|
||||
import { forwardRef, Fragment, useImperativeHandle } from 'react';
|
||||
import { styled, Tooltip } from '@mui/material';
|
||||
import HelpOutline from '@mui/icons-material/HelpOutline';
|
||||
import { styled } from '@mui/material';
|
||||
import type { IConstraint } from 'interfaces/strategy';
|
||||
import produce from 'immer';
|
||||
import useUnleashContext from 'hooks/api/getters/useUnleashContext/useUnleashContext';
|
||||
@ -43,30 +42,6 @@ const StyledContainer = styled('div')({
|
||||
flexDirection: 'column',
|
||||
});
|
||||
|
||||
const StyledHelpWrapper = styled(Tooltip)(({ theme }) => ({
|
||||
marginLeft: theme.spacing(0.75),
|
||||
height: theme.spacing(1.5),
|
||||
}));
|
||||
|
||||
const StyledHelp = styled(HelpOutline)(({ theme }) => ({
|
||||
fill: theme.palette.action.active,
|
||||
[theme.breakpoints.down(860)]: {
|
||||
display: 'none',
|
||||
},
|
||||
}));
|
||||
|
||||
const StyledConstraintLabel = styled('p')(({ theme }) => ({
|
||||
marginBottom: theme.spacing(1),
|
||||
color: theme.palette.text.secondary,
|
||||
}));
|
||||
|
||||
const StyledAddCustomLabel = styled('div')(({ theme }) => ({
|
||||
marginTop: theme.spacing(1),
|
||||
marginBottom: theme.spacing(1),
|
||||
color: theme.palette.text.primary,
|
||||
display: 'flex',
|
||||
}));
|
||||
|
||||
export const useConstraintAccordionList = (
|
||||
setConstraints:
|
||||
| React.Dispatch<React.SetStateAction<IConstraint[]>>
|
||||
|
@ -7,6 +7,7 @@ import { ConstraintItemHeader } from 'component/common/ConstraintsList/Constrain
|
||||
import CheckCircle from '@mui/icons-material/CheckCircle';
|
||||
import { styled } from '@mui/material';
|
||||
import Cancel from '@mui/icons-material/Cancel';
|
||||
import { ConstraintListItem } from 'component/common/ConstraintsList/ConstraintsList';
|
||||
|
||||
interface IConstraintExecutionProps {
|
||||
constraint?: PlaygroundConstraintSchema;
|
||||
@ -20,7 +21,7 @@ const StyledContainer = styled('div', {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: theme.spacing(1),
|
||||
paddingInline: theme.spacing(0.25),
|
||||
padding: theme.spacing(0.5, 0.25),
|
||||
color:
|
||||
variant === 'ok'
|
||||
? theme.palette.success.dark
|
||||
@ -67,13 +68,15 @@ export const ConstraintExecution: FC<IConstraintExecutionProps> = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<ConstraintItemHeader {...constraint} />
|
||||
{constraint.result ? (
|
||||
<ConstraintOk />
|
||||
) : (
|
||||
<ConstraintError text={errorText()} />
|
||||
)}
|
||||
</>
|
||||
<ConstraintListItem>
|
||||
<div>
|
||||
<ConstraintItemHeader {...constraint} />
|
||||
{constraint.result ? (
|
||||
<ConstraintOk />
|
||||
) : (
|
||||
<ConstraintError text={errorText()} />
|
||||
)}
|
||||
</div>
|
||||
</ConstraintListItem>
|
||||
);
|
||||
};
|
||||
|
@ -6,7 +6,10 @@ import { ConstraintExecution } from './ConstraintExecution/ConstraintExecution';
|
||||
import { formattedStrategyNames } from 'utils/strategyNames';
|
||||
import { StyledBoxSummary } from './StrategyExecution.styles';
|
||||
import { Badge } from 'component/common/Badge/Badge';
|
||||
import { ConstraintsList } from 'component/common/ConstraintsList/ConstraintsList';
|
||||
import {
|
||||
ConstraintListItem,
|
||||
ConstraintsList,
|
||||
} from 'component/common/ConstraintsList/ConstraintsList';
|
||||
import { objectId } from 'utils/objectId';
|
||||
import type { FC } from 'react';
|
||||
import { SegmentExecution } from './SegmentExecution/SegmentExecution';
|
||||
@ -60,8 +63,14 @@ export const StrategyExecution: FC<StrategyExecutionProps> = ({
|
||||
/>
|
||||
))
|
||||
: []),
|
||||
hasExecutionParameters && params,
|
||||
isCustomStrategy && customStrategyItems,
|
||||
hasExecutionParameters &&
|
||||
params.map((param, index) => (
|
||||
<ConstraintListItem key={index}>{param}</ConstraintListItem>
|
||||
)),
|
||||
isCustomStrategy &&
|
||||
customStrategyItems.map((param, index) => (
|
||||
<ConstraintListItem key={index}>{param}</ConstraintListItem>
|
||||
)),
|
||||
name === 'default' && (
|
||||
<StyledBoxSummary sx={{ width: '100%' }}>
|
||||
The standard strategy is <Badge color='success'>ON</Badge> for
|
||||
|
Loading…
Reference in New Issue
Block a user