From ddcd7f47d88ae6cfa7c7e6ced140fa682dee34f9 Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Mon, 23 Oct 2023 12:11:11 +0300 Subject: [PATCH] chore: remove invite link flag (#5119) --- .../InviteLink/InviteLinkButton/InviteLinkButton.test.tsx | 6 +----- .../Header/InviteLink/InviteLinkButton/InviteLinkButton.tsx | 4 +--- frontend/src/interfaces/uiConfig.ts | 1 - src/lib/__snapshots__/create-config.test.ts.snap | 2 -- src/lib/types/experimental.ts | 5 ----- src/server-dev.ts | 1 - 6 files changed, 2 insertions(+), 17 deletions(-) diff --git a/frontend/src/component/menu/Header/InviteLink/InviteLinkButton/InviteLinkButton.test.tsx b/frontend/src/component/menu/Header/InviteLink/InviteLinkButton/InviteLinkButton.test.tsx index b00f78439f..a2fd08e2b2 100644 --- a/frontend/src/component/menu/Header/InviteLink/InviteLinkButton/InviteLinkButton.test.tsx +++ b/frontend/src/component/menu/Header/InviteLink/InviteLinkButton/InviteLinkButton.test.tsx @@ -9,11 +9,7 @@ import { testServerRoute, testServerSetup } from 'utils/testServer'; const server = testServerSetup(); const setupApi = () => { - testServerRoute(server, '/api/admin/ui-config', { - flags: { - newInviteLink: true, - }, - }); + testServerRoute(server, '/api/admin/ui-config', {}); }; test('Do not show button to non admins', async () => { setupApi(); diff --git a/frontend/src/component/menu/Header/InviteLink/InviteLinkButton/InviteLinkButton.tsx b/frontend/src/component/menu/Header/InviteLink/InviteLinkButton/InviteLinkButton.tsx index 734f9ff9f2..5b08943aa5 100644 --- a/frontend/src/component/menu/Header/InviteLink/InviteLinkButton/InviteLinkButton.tsx +++ b/frontend/src/component/menu/Header/InviteLink/InviteLinkButton/InviteLinkButton.tsx @@ -5,7 +5,6 @@ import { focusable } from 'themes/themeStyles'; import AccessContext from 'contexts/AccessContext'; import { PersonAdd } from '@mui/icons-material'; import { InviteLinkContent } from '../InviteLinkContent'; -import { useUiFlag } from 'hooks/useUiFlag'; const StyledContainer = styled('div')(() => ({ position: 'relative', @@ -24,12 +23,11 @@ const StyledIconButton = styled(IconButton)(({ theme }) => ({ const InviteLinkButton = () => { const [showInviteLinkContent, setShowInviteLinkContent] = useState(false); - const newInviteLink = useUiFlag('newInviteLink'); const modalId = useId(); const { isAdmin } = useContext(AccessContext); - if (!isAdmin || !newInviteLink) { + if (!isAdmin) { return null; } diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index c061d4d617..2b6087eb2f 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -66,7 +66,6 @@ export type UiFlags = { doraMetrics?: boolean; variantTypeNumber?: boolean; privateProjects?: boolean; - newInviteLink?: boolean; accessOverview?: boolean; datadogJsonTemplate?: boolean; dependentFeatures?: boolean; diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index b4e42e2ac7..487a3d6ec1 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -107,7 +107,6 @@ exports[`should create default config 1`] = ` }, "migrationLock": true, "multipleRoles": false, - "newInviteLink": false, "personalAccessTokensKillSwitch": false, "playgroundImprovements": false, "privateProjects": false, @@ -153,7 +152,6 @@ exports[`should create default config 1`] = ` }, "migrationLock": true, "multipleRoles": false, - "newInviteLink": false, "personalAccessTokensKillSwitch": false, "playgroundImprovements": false, "privateProjects": false, diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 05af0e8b58..5cd800932f 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -28,7 +28,6 @@ export type IFlagKey = | 'doraMetrics' | 'variantTypeNumber' | 'accessOverview' - | 'newInviteLink' | 'privateProjects' | 'dependentFeatures' | 'datadogJsonTemplate' @@ -142,10 +141,6 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_PRIVATE_PROJECTS, false, ), - newInviteLink: parseEnvVarBoolean( - process.env.UNLEASH_EXPERIMENTAL_NEW_INVITE_LINK, - false, - ), accessOverview: parseEnvVarBoolean( process.env.UNLEASH_EXPERIMENTAL_ACCESS_OVERVIEW, false, diff --git a/src/server-dev.ts b/src/server-dev.ts index fba0c67e7e..763e99ccc4 100644 --- a/src/server-dev.ts +++ b/src/server-dev.ts @@ -42,7 +42,6 @@ process.nextTick(async () => { doraMetrics: true, variantTypeNumber: true, privateProjects: true, - newInviteLink: true, accessOverview: true, datadogJsonTemplate: true, dependentFeatures: true,