1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-04 13:48:56 +02:00

chore: adapt configuration modal to standard and advanced strategies (#10434)

https://linear.app/unleash/issue/2-3730/adapt-modal-to-new-standard-and-advanced-strategies-split

Adapts our "add configuration" modal to the new concept of standard and
advanced strategies.

Follow-up to: https://github.com/Unleash/unleash/pull/10433

<img width="984" height="482" alt="image"
src="https://github.com/user-attachments/assets/5af7a087-0bb6-46c3-93d0-f9968ea1928f"
/>
This commit is contained in:
Nuno Góis 2025-07-30 10:17:03 +01:00 committed by GitHub
parent 3bfed7fb0c
commit 32996460df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -130,12 +130,16 @@ export const FeatureStrategyMenuCards = ({
const { templates } = useReleasePlanTemplates();
const navigate = useNavigate();
const preDefinedStrategies = strategies.filter(
(strategy) => !strategy.deprecated && !strategy.editable,
const activeStrategies = strategies.filter(
(strategy) => !strategy.deprecated,
);
const customStrategies = strategies.filter(
(strategy) => !strategy.deprecated && strategy.editable,
const standardStrategies = activeStrategies.filter(
(strategy) => !strategy.advanced && !strategy.editable,
);
const advancedAndCustomStrategies = activeStrategies.filter(
(strategy) => strategy.editable || strategy.advanced,
);
const defaultStrategy = {
@ -225,7 +229,7 @@ export const FeatureStrategyMenuCards = ({
Standard strategies
</Typography>
<HelpIcon
tooltip='Select a starting setup, then customize your strategy with targeting and variants'
tooltip='Standard strategies let you enable a feature only for a specified audience. Select a starting setup, then customize your strategy with targeting and variants.'
size='16px'
/>
</SectionTitle>
@ -240,7 +244,7 @@ export const FeatureStrategyMenuCards = ({
onClose={onClose}
/>
</CardWrapper>
{preDefinedStrategies.map((strategy) => (
{standardStrategies.map((strategy) => (
<CardWrapper key={strategy.name}>
<FeatureStrategyMenuCard
projectId={projectId}
@ -254,29 +258,33 @@ export const FeatureStrategyMenuCards = ({
</GridSection>
</Box>
{renderReleasePlanTemplates()}
{customStrategies.length > 0 && (
{advancedAndCustomStrategies.length > 0 && (
<Box>
<SectionTitle>
<Typography color='inherit' variant='body2'>
Custom strategies
Custom and advanced strategies
</Typography>
<HelpIcon
tooltip='Custom strategies you have defined in Unleash'
tooltip='Advanced strategies let you target based on specific properties. Custom activation strategies let you define your own activation strategies to use with Unleash.'
size='16px'
/>
</SectionTitle>
<GridSection>
{customStrategies.map((strategy) => (
<CardWrapper key={strategy.name}>
<FeatureStrategyMenuCard
projectId={projectId}
featureId={featureId}
environmentId={environmentId}
strategy={strategy}
onClose={onClose}
/>
</CardWrapper>
))}
{advancedAndCustomStrategies.map(
(strategy) => (
<CardWrapper key={strategy.name}>
<FeatureStrategyMenuCard
projectId={projectId}
featureId={featureId}
environmentId={
environmentId
}
strategy={strategy}
onClose={onClose}
/>
</CardWrapper>
),
)}
</GridSection>
</Box>
)}