1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

feat: warn about sdk update with feature dependencies (#5065)

This commit is contained in:
Mateusz Kwasniewski 2023-10-17 13:43:49 +02:00 committed by GitHub
parent db04a1eaa8
commit 163545de8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 4 deletions

View File

@ -114,6 +114,8 @@ test('Add dependency', async () => {
const addButton = await screen.findByText('Add'); const addButton = await screen.findByText('Add');
userEvent.click(addButton); userEvent.click(addButton);
await screen.findByText('Client SDK support for feature dependencies');
await waitFor(() => { await waitFor(() => {
expect(closed).toBe(true); expect(closed).toBe(true);
}); });

View File

@ -13,6 +13,7 @@ import { usePendingChangeRequests } from 'hooks/api/getters/usePendingChangeRequ
import useToast from 'hooks/useToast'; import useToast from 'hooks/useToast';
import { formatUnknownError } from 'utils/formatUnknownError'; import { formatUnknownError } from 'utils/formatUnknownError';
import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
import { DependenciesUpgradeAlert } from './DependenciesUpgradeAlert';
interface IAddDependencyDialogueProps { interface IAddDependencyDialogueProps {
project: string; project: string;
@ -189,10 +190,12 @@ export const AddDependencyDialogue = ({
secondaryButtonText='Cancel' secondaryButtonText='Cancel'
> >
<Box> <Box>
<DependenciesUpgradeAlert />
<Box sx={{ mt: 2, mb: 4 }}>
Your feature will be evaluated only when the selected parent Your feature will be evaluated only when the selected parent
feature is enabled in the same environment. feature is enabled in the same environment.
<br /> </Box>
<br />
<Typography>What feature do you want to depend on?</Typography> <Typography>What feature do you want to depend on?</Typography>
<ConditionallyRender <ConditionallyRender
condition={showDependencyDialogue} condition={showDependencyDialogue}

View File

@ -0,0 +1,22 @@
import { Alert } from '@mui/material';
export const DependenciesUpgradeAlert = () => {
return (
<Alert severity='warning'>
Remember to update your Unleash client! Feature dependencies require
new SDK versions. Read more about <DependenciesDocsLink />.
</Alert>
);
};
const DependenciesDocsLink = () => {
return (
<a
href='https://docs.getunleash.io/reference/dependent-features#client-sdk-support'
target='_blank'
rel='noreferrer'
>
Client SDK support for feature dependencies
</a>
);
};