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