1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: Also display strategy variant information on default strategies (#8115)

This change copies (and then simplifies) the strategy variant display
logic from

`frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx`
and inserts it into the `ProjectEnvironmentDefaultStrategy` component.

Before:

![image](https://github.com/user-attachments/assets/c00098c3-3161-4a89-a6cf-8db711b4fb3e)


After:

![image](https://github.com/user-attachments/assets/4fdd46f1-97a4-4344-98e1-16c842947a1c)
This commit is contained in:
Thomas Heartman 2024-09-06 11:47:59 +02:00 committed by GitHub
parent ae719325cc
commit 7e52da11bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,7 @@ import { StrategyExecution } from 'component/feature/FeatureView/FeatureOverview
import type { ProjectEnvironmentType } from 'interfaces/environments';
import { useMemo } from 'react';
import type { CreateFeatureStrategySchema } from 'openapi';
import SplitPreviewSlider from 'component/feature/StrategyTypes/SplitPreviewSlider/SplitPreviewSlider';
interface ProjectEnvironmentDefaultStrategyProps {
environment: ProjectEnvironmentType;
@ -75,6 +76,10 @@ const ProjectEnvironmentDefaultStrategy = ({
}
>
<StrategyExecution strategy={strategy} />
{strategy.variants && strategy.variants.length > 0 ? (
<SplitPreviewSlider variants={strategy.variants} />
) : null}
</StrategyItemContainer>
</>
);