Skip to content

Commit

Permalink
feat: warn about sdk update with feature dependencies (#5065)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew authored Oct 17, 2023
1 parent db04a1e commit 163545d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ test('Add dependency', async () => {
const addButton = await screen.findByText('Add');
userEvent.click(addButton);

await screen.findByText('Client SDK support for feature dependencies');

await waitFor(() => {
expect(closed).toBe(true);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { usePendingChangeRequests } from 'hooks/api/getters/usePendingChangeRequ
import useToast from 'hooks/useToast';
import { formatUnknownError } from 'utils/formatUnknownError';
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
import { DependenciesUpgradeAlert } from './DependenciesUpgradeAlert';

interface IAddDependencyDialogueProps {
project: string;
Expand Down Expand Up @@ -189,10 +190,12 @@ export const AddDependencyDialogue = ({
secondaryButtonText='Cancel'
>
<Box>
Your feature will be evaluated only when the selected parent
feature is enabled in the same environment.
<br />
<br />
<DependenciesUpgradeAlert />
<Box sx={{ mt: 2, mb: 4 }}>
Your feature will be evaluated only when the selected parent
feature is enabled in the same environment.
</Box>

<Typography>What feature do you want to depend on?</Typography>
<ConditionallyRender
condition={showDependencyDialogue}
Expand Down
Original file line number Diff line number Diff line change
@@ -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>
);
};

0 comments on commit 163545d

Please sign in to comment.