1
0
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:
Mateusz Kwasniewski 2023-08-08 11:44:43 +02:00 committed by GitHub
parent f3b11b89bb
commit 19119bd1f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -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,
});

View File

@ -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