Skip to content

Commit

Permalink
[Gitar] Cleaning up stale flag: changeRequestPlayground with value tr…
Browse files Browse the repository at this point in the history
…ue (#7920)
  • Loading branch information
gitar-bot[bot] authored Aug 19, 2024
1 parent 004038e commit 662c7ab
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ const uiConfig = () => {
versionInfo: {
current: { oss: 'version', enterprise: 'version' },
},
flags: {
changeRequestPlayground: true,
},
flags: {},
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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%',
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -421,10 +400,9 @@ export const ChangeRequestOverview: FC = () => {

<ConditionallyRender
condition={
changeRequestPlaygroundEnabled &&
(changeRequest.state === 'In review' ||
changeRequest.state === 'Approved' ||
changeRequest.state === 'Scheduled')
changeRequest.state === 'In review' ||
changeRequest.state === 'Approved' ||
changeRequest.state === 'Scheduled'
}
show={
<StyledButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ beforeEach(() => {
versionInfo: {
current: { oss: 'version', enterprise: 'version' },
},
flags: {
changeRequestPlayground: true,
},
flags: {},
});
testServerRoute(
server,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -99,8 +98,6 @@ export const PlaygroundConnectionFieldset: FC<

const { projects: availableProjects } = useProjects();

const changeRequestPlaygroundEnabled = useUiFlag('changeRequestPlayground');

const projectsOptions = [
allOption,
...availableProjects.map(({ name: label, id }) => ({
Expand Down Expand Up @@ -269,9 +266,7 @@ export const PlaygroundConnectionFieldset: FC<
/>
</Box>
<ConditionallyRender
condition={Boolean(
changeRequestPlaygroundEnabled && changeRequest,
)}
condition={Boolean(changeRequest)}
show={
<Box sx={{ display: 'flex', gap: 2 }}>
<Box sx={{ flex: 1 }}>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/interfaces/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export type UiFlags = {
insightsV2?: boolean;
integrationEvents?: boolean;
newEventSearch?: boolean;
changeRequestPlayground?: boolean;
archiveProjects?: boolean;
projectListImprovements?: boolean;
};
Expand Down
1 change: 0 additions & 1 deletion src/lib/__snapshots__/create-config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ exports[`should create default config 1`] = `
"automatedActions": false,
"caseInsensitiveInOperators": false,
"celebrateUnleash": false,
"changeRequestPlayground": false,
"collectTrafficDataUsage": false,
"demo": false,
"disableBulkToggle": false,
Expand Down
5 changes: 0 additions & 5 deletions src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export type IFlagKey =
| 'integrationEvents'
| 'originMiddleware'
| 'newEventSearch'
| 'changeRequestPlayground'
| 'archiveProjects'
| 'projectListImprovements'
| 'useProjectReadModel'
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/server-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ process.nextTick(async () => {
integrationEvents: true,
originMiddleware: true,
newEventSearch: true,
changeRequestPlayground: true,
projectListImprovements: true,
useProjectReadModel: true,
webhookServiceNameLogging: true,
Expand Down

0 comments on commit 662c7ab

Please sign in to comment.