mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-11 00:08:30 +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,
|
title: strategy.title,
|
||||||
constraints: strategy.constraints ?? [],
|
constraints: strategy.constraints ?? [],
|
||||||
parameters: strategy.parameters ?? {},
|
parameters: strategy.parameters ?? {},
|
||||||
|
variants: strategy.variants ?? [],
|
||||||
segments: segments.map(segment => segment.id),
|
segments: segments.map(segment => segment.id),
|
||||||
disabled: strategy.disabled ?? false,
|
disabled: strategy.disabled ?? false,
|
||||||
});
|
});
|
||||||
|
@ -20,6 +20,7 @@ import { useHasProjectEnvironmentAccess } from 'hooks/useHasAccess';
|
|||||||
import { FeatureStrategyConstraints } from 'component/feature/FeatureStrategy/FeatureStrategyConstraints/FeatureStrategyConstraints';
|
import { FeatureStrategyConstraints } from 'component/feature/FeatureStrategy/FeatureStrategyConstraints/FeatureStrategyConstraints';
|
||||||
import { FeatureStrategyType } from 'component/feature/FeatureStrategy/FeatureStrategyType/FeatureStrategyType';
|
import { FeatureStrategyType } from 'component/feature/FeatureStrategy/FeatureStrategyType/FeatureStrategyType';
|
||||||
import { FeatureStrategyTitle } from 'component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyTitle/FeatureStrategyTitle';
|
import { FeatureStrategyTitle } from 'component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyTitle/FeatureStrategyTitle';
|
||||||
|
import { StrategyVariants } from 'component/feature/StrategyTypes/StrategyVariants';
|
||||||
|
|
||||||
interface IProjectDefaultStrategyFormProps {
|
interface IProjectDefaultStrategyFormProps {
|
||||||
projectId: string;
|
projectId: string;
|
||||||
@ -179,6 +180,21 @@ export const ProjectDefaultStrategyForm = ({
|
|||||||
errors={errors}
|
errors={errors}
|
||||||
hasAccess={access}
|
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 />
|
<StyledHr />
|
||||||
<StyledButtons>
|
<StyledButtons>
|
||||||
<PermissionButton
|
<PermissionButton
|
||||||
|
Loading…
Reference in New Issue
Block a user