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

feat: strategy variants alert (#4371)

This commit is contained in:
Mateusz Kwasniewski 2023-07-31 12:26:12 +02:00 committed by GitHub
parent 3c8eecb413
commit b34f00c2cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 4 deletions

View File

@ -0,0 +1,22 @@
import { Alert } from '@mui/material';
export const StrategyVariantsUpgradeAlert = () => {
return (
<Alert severity="warning" sx={{ mb: 3 }}>
Remember to update your Unleash client! Strategy variants require
new SDK versions. <DocsLink />.
</Alert>
);
};
const DocsLink = () => {
return (
<a
href="https://docs.getunleash.io/reference/feature-strategy-variants#client-sdk-support"
target="_blank"
rel="noreferrer"
>
Read more
</a>
);
};

View File

@ -7,11 +7,12 @@ import { UPDATE_FEATURE_ENVIRONMENT_VARIANTS } from '../../providers/AccessProvi
import { v4 as uuidv4 } from 'uuid';
import { WeightType } from '../../../constants/variantTypes';
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
import { styled, Typography, useTheme, Link } from '@mui/material';
import { Link, styled, Typography, useTheme } from '@mui/material';
import { useRequiredQueryParam } from 'hooks/useRequiredQueryParam';
import { IFeatureStrategy } from 'interfaces/strategy';
import SplitPreviewSlider from './SplitPreviewSlider/SplitPreviewSlider';
import { HelpIcon } from '../../common/HelpIcon/HelpIcon';
import { StrategyVariantsUpgradeAlert } from '../../common/StrategyVariantsUpgradeAlert/StrategyVariantsUpgradeAlert';
const StyledVariantForms = styled('div')({
display: 'flex',
@ -100,9 +101,7 @@ export const StrategyVariants: FC<{
<span>
Variants allow to attach one or more values to
this strategy. Variants at the strategy level
override variants at the feature level. Make
sure to use recent SDK that supports strategy
variants.{' '}
override variants at the feature level.
</span>
<Link
target="_blank"
@ -115,6 +114,7 @@ export const StrategyVariants: FC<{
/>
</Typography>
<StyledVariantForms>
<StrategyVariantsUpgradeAlert />
{variantsEdit.map((variant, i) => (
<VariantForm
disableOverrides={true}