mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
improvements
This commit is contained in:
parent
787c5f317c
commit
9da3448558
@ -29,6 +29,7 @@ export const useStyles = makeStyles()(theme => ({
|
||||
padding: '0.5rem',
|
||||
},
|
||||
width: '100%',
|
||||
flexShrink: 0,
|
||||
paddingBottom: '1rem',
|
||||
borderRadius: theme.shape.borderRadiusMedium,
|
||||
background: theme.palette.background.default,
|
||||
|
@ -26,7 +26,7 @@ const StyledItemWrapper = styled('div')(({ theme }) => ({
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
marginTop: '4px',
|
||||
gap: '4px',
|
||||
gap: '8px',
|
||||
}));
|
||||
|
||||
export const PlaygroundResultFeatureStrategyItem = ({
|
||||
@ -56,6 +56,7 @@ export const PlaygroundResultFeatureStrategyItem = ({
|
||||
width: '100%',
|
||||
position: 'relative',
|
||||
paddingRight: compact ? '12px' : 0,
|
||||
ml: '-12px'
|
||||
}}
|
||||
>
|
||||
<ConditionallyRender
|
||||
@ -63,7 +64,7 @@ export const PlaygroundResultFeatureStrategyItem = ({
|
||||
show={<StrategySeparator text="OR" />}
|
||||
/>
|
||||
<StyledItemWrapper>
|
||||
<Typography variant={'subtitle1'}>{index + 1}</Typography>
|
||||
<Typography variant={'subtitle1'} color={'text.secondary'}>{index + 1}</Typography>
|
||||
<Box className={styles.innerContainer} sx={{ border }}>
|
||||
<div className={styles.header}>
|
||||
<div className={styles.headerName}>
|
||||
|
@ -19,7 +19,6 @@ import PercentageCircle from '../../../../../../../../common/PercentageCircle/Pe
|
||||
import StringTruncator from '../../../../../../../../common/StringTruncator/StringTruncator';
|
||||
import { useStrategies } from '../../../../../../../../../hooks/api/getters/useStrategies/useStrategies';
|
||||
import { PlaygroundConstraintItem } from '../PlaygroundConstraintItem/PlaygroundConstraintItem';
|
||||
import { ConstraintItem } from '../../../../../../../../feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/ConstraintItem/ConstraintItem';
|
||||
|
||||
interface PlaygroundResultStrategyExecutionProps {
|
||||
strategyResult: PlaygroundStrategySchema;
|
||||
@ -31,6 +30,11 @@ const StyledStrategyExecutionWrapper = styled('div')(({ theme }) => ({
|
||||
padding: theme.spacing(1),
|
||||
}));
|
||||
|
||||
const StyledParamWrapper = styled('div')(({ theme }) => ({
|
||||
padding: theme.spacing(2,1),
|
||||
}));
|
||||
|
||||
|
||||
export const PlaygroundResultStrategyExecution = ({
|
||||
strategyResult,
|
||||
input,
|
||||
@ -155,7 +159,7 @@ export const PlaygroundResultStrategyExecution = ({
|
||||
});
|
||||
};
|
||||
|
||||
const renderCustomStrategy = () => {
|
||||
const renderCustomStrategyParameters = () => {
|
||||
if (!definition?.editable) return null;
|
||||
return definition?.parameters.map((param: any, index: number) => {
|
||||
const notLastItem = index !== definition?.parameters?.length - 1;
|
||||
@ -166,7 +170,7 @@ export const PlaygroundResultStrategyExecution = ({
|
||||
);
|
||||
return (
|
||||
<Fragment key={param?.name}>
|
||||
<ConstraintItem value={values} text={param.name} />
|
||||
<PlaygroundConstraintItem value={values} text={param.name} />
|
||||
<ConditionallyRender
|
||||
condition={notLastItem}
|
||||
show={<StrategySeparator text="AND" />}
|
||||
@ -352,8 +356,10 @@ export const PlaygroundResultStrategyExecution = ({
|
||||
</Box>
|
||||
}
|
||||
/>
|
||||
<StyledParamWrapper>
|
||||
{renderParameters()}
|
||||
{renderCustomStrategy()}
|
||||
{renderCustomStrategyParameters()}
|
||||
</StyledParamWrapper>
|
||||
</StyledStrategyExecutionWrapper>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user