mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
feat: default strategy variant (#4443)
This commit is contained in:
parent
f3b11b89bb
commit
19119bd1f0
@ -170,6 +170,7 @@ export const createStrategyPayload = (
|
||||
title: strategy.title,
|
||||
constraints: strategy.constraints ?? [],
|
||||
parameters: strategy.parameters ?? {},
|
||||
variants: strategy.variants ?? [],
|
||||
segments: segments.map(segment => segment.id),
|
||||
disabled: strategy.disabled ?? false,
|
||||
});
|
||||
|
@ -20,6 +20,7 @@ import { useHasProjectEnvironmentAccess } from 'hooks/useHasAccess';
|
||||
import { FeatureStrategyConstraints } from 'component/feature/FeatureStrategy/FeatureStrategyConstraints/FeatureStrategyConstraints';
|
||||
import { FeatureStrategyType } from 'component/feature/FeatureStrategy/FeatureStrategyType/FeatureStrategyType';
|
||||
import { FeatureStrategyTitle } from 'component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyTitle/FeatureStrategyTitle';
|
||||
import { StrategyVariants } from 'component/feature/StrategyTypes/StrategyVariants';
|
||||
|
||||
interface IProjectDefaultStrategyFormProps {
|
||||
projectId: string;
|
||||
@ -179,6 +180,21 @@ export const ProjectDefaultStrategyForm = ({
|
||||
errors={errors}
|
||||
hasAccess={access}
|
||||
/>
|
||||
<ConditionallyRender
|
||||
condition={
|
||||
Boolean(uiConfig?.flags?.strategyVariant) &&
|
||||
strategy.parameters != null &&
|
||||
'stickiness' in strategy.parameters
|
||||
}
|
||||
show={
|
||||
<StrategyVariants
|
||||
strategy={strategy}
|
||||
setStrategy={setStrategy}
|
||||
environment={environmentId}
|
||||
projectId={projectId}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<StyledHr />
|
||||
<StyledButtons>
|
||||
<PermissionButton
|
||||
|
Loading…
Reference in New Issue
Block a user