Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: warn about sdk update with feature dependencies #5065

Merged
merged 3 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
);
};