From 662c7ab4dcb4d66b4f0023a1203fa834d1477518 Mon Sep 17 00:00:00 2001 From: "gitar-bot[bot]" <159877585+gitar-bot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:33:55 +0200 Subject: [PATCH] [Gitar] Cleaning up stale flag: changeRequestPlayground with value true (#7920) --- .../ChangeRequestOverview.test.tsx | 4 +-- .../ChangeRequestOverview.tsx | 28 ++----------------- .../PlaygroundConnectionFieldset.test.tsx | 4 +-- .../PlaygroundConnectionFieldset.tsx | 7 +---- frontend/src/interfaces/uiConfig.ts | 1 - .../__snapshots__/create-config.test.ts.snap | 1 - src/lib/types/experimental.ts | 5 ---- src/server-dev.ts | 1 - 8 files changed, 6 insertions(+), 45 deletions(-) diff --git a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.test.tsx b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.test.tsx index 21464fd35c2a..83c35e56aa4f 100644 --- a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.test.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.test.tsx @@ -145,9 +145,7 @@ const uiConfig = () => { versionInfo: { current: { oss: 'version', enterprise: 'version' }, }, - flags: { - changeRequestPlayground: true, - }, + flags: {}, }); }; diff --git a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.tsx b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.tsx index 1329c8054381..3dca721f8fc3 100644 --- a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.tsx @@ -33,7 +33,6 @@ import { import { ScheduleChangeRequestDialog } from './ChangeRequestScheduledDialogs/ScheduleChangeRequestDialog'; import type { PlausibleChangeRequestState } from '../changeRequest.types'; import { useNavigate } from 'react-router-dom'; -import { useUiFlag } from 'hooks/useUiFlag'; const StyledAsideBox = styled(Box)(({ theme }) => ({ width: '30%', @@ -104,7 +103,6 @@ export const ChangeRequestOverview: FC = () => { useChangeRequestsEnabled(projectId); const [disabled, setDisabled] = useState(false); const navigate = useNavigate(); - const changeRequestPlaygroundEnabled = useUiFlag('changeRequestPlayground'); if (!changeRequest) { return null; @@ -266,25 +264,6 @@ export const ChangeRequestOverview: FC = () => { const countOfChanges = changesCount(changeRequest); - const reason = (() => { - if (!('schedule' in changeRequest)) { - return undefined; - } - - switch (changeRequest.schedule.status) { - case 'failed': - return ( - (changeRequest.schedule.reason || - changeRequest.schedule.failureReason) ?? - undefined - ); - case 'suspended': - return changeRequest.schedule.reason; - default: - return undefined; - } - })(); - const scheduledAt = 'schedule' in changeRequest ? changeRequest.schedule.scheduledAt @@ -421,10 +400,9 @@ export const ChangeRequestOverview: FC = () => { { versionInfo: { current: { oss: 'version', enterprise: 'version' }, }, - flags: { - changeRequestPlayground: true, - }, + flags: {}, }); testServerRoute( server, diff --git a/frontend/src/component/playground/Playground/PlaygroundForm/PlaygroundConnectionFieldset/PlaygroundConnectionFieldset.tsx b/frontend/src/component/playground/Playground/PlaygroundForm/PlaygroundConnectionFieldset/PlaygroundConnectionFieldset.tsx index a62c66343e14..df71ef79528d 100644 --- a/frontend/src/component/playground/Playground/PlaygroundForm/PlaygroundConnectionFieldset/PlaygroundConnectionFieldset.tsx +++ b/frontend/src/component/playground/Playground/PlaygroundForm/PlaygroundConnectionFieldset/PlaygroundConnectionFieldset.tsx @@ -29,7 +29,6 @@ import { import Clear from '@mui/icons-material/Clear'; import { ProjectSelect } from '../../../../common/ProjectSelect/ProjectSelect'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { useUiFlag } from 'hooks/useUiFlag'; import { EnvironmentsField } from './EnvironmentsField/EnvironmentsField'; import { Link } from 'react-router-dom'; @@ -99,8 +98,6 @@ export const PlaygroundConnectionFieldset: FC< const { projects: availableProjects } = useProjects(); - const changeRequestPlaygroundEnabled = useUiFlag('changeRequestPlayground'); - const projectsOptions = [ allOption, ...availableProjects.map(({ name: label, id }) => ({ @@ -269,9 +266,7 @@ export const PlaygroundConnectionFieldset: FC< /> diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index 6e28946da04e..c00a70a7cab6 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -92,7 +92,6 @@ export type UiFlags = { insightsV2?: boolean; integrationEvents?: boolean; newEventSearch?: boolean; - changeRequestPlayground?: boolean; archiveProjects?: boolean; projectListImprovements?: boolean; }; diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index bb7233be4098..d5f1617b9b68 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -80,7 +80,6 @@ exports[`should create default config 1`] = ` "automatedActions": false, "caseInsensitiveInOperators": false, "celebrateUnleash": false, - "changeRequestPlayground": false, "collectTrafficDataUsage": false, "demo": false, "disableBulkToggle": false, diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 6404acd26950..e6df34fecd5a 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -63,7 +63,6 @@ export type IFlagKey = | 'integrationEvents' | 'originMiddleware' | 'newEventSearch' - | 'changeRequestPlayground' | 'archiveProjects' | 'projectListImprovements' | 'useProjectReadModel' @@ -309,10 +308,6 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_NEW_EVENT_SEARCH, false, ), - changeRequestPlayground: parseEnvVarBoolean( - process.env.UNLEASH_EXPERIMENTAL_CHANGE_REQUEST_PLAYGROUND, - false, - ), archiveProjects: parseEnvVarBoolean( process.env.UNLEASH_EXPERIMENTAL_ARCHIVE_PROJECTS, false, diff --git a/src/server-dev.ts b/src/server-dev.ts index 61b61088e27c..33037fd15747 100644 --- a/src/server-dev.ts +++ b/src/server-dev.ts @@ -56,7 +56,6 @@ process.nextTick(async () => { integrationEvents: true, originMiddleware: true, newEventSearch: true, - changeRequestPlayground: true, projectListImprovements: true, useProjectReadModel: true, webhookServiceNameLogging: true,