Skip to content

Commit

Permalink
chore: remove project overview refactor flag (#6897)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew authored May 7, 2024
1 parent d1803b2 commit 8ae7823
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { ILastSeenEnvironments } from 'interfaces/featureToggle';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { useLastSeenColors } from 'component/feature/FeatureView/FeatureEnvironmentSeen/useLastSeenColors';
import { LastSeenProgress } from './LastSeenProgress/LastSeenProgress';
import { useUiFlag } from 'hooks/useUiFlag';

const StyledDescription = styled(
'div',
Expand Down Expand Up @@ -75,7 +74,6 @@ export const LastSeenTooltip = ({
...rest
}: ILastSeenTooltipProps) => {
const getColor = useLastSeenColors();
const projectOverviewRefactor = useUiFlag('projectOverviewRefactor');
const [, defaultTextColor] = getColor();
const environmentsHaveLastSeen = environments?.some((environment) =>
Boolean(environment.lastSeenAt),
Expand Down Expand Up @@ -134,12 +132,7 @@ export const LastSeenTooltip = ({
}
/>
</StyledValueContainer>
<ConditionallyRender
condition={Boolean(projectOverviewRefactor)}
show={
<LastSeenProgress yes={yes} no={no} />
}
/>
<LastSeenProgress yes={yes} no={no} />
</StyledDescriptionBlock>
))}
</StyledListContainer>
Expand Down
37 changes: 7 additions & 30 deletions frontend/src/component/project/Project/Project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ import { ImportModal } from './Import/ImportModal';
import { IMPORT_BUTTON } from 'utils/testIds';
import { EnterpriseBadge } from 'component/common/EnterpriseBadge/EnterpriseBadge';
import { Badge } from 'component/common/Badge/Badge';
import { ProjectDoraMetrics } from './ProjectDoraMetrics/ProjectDoraMetrics';
import type { UiFlags } from 'interfaces/uiConfig';
import { HiddenProjectIconWithTooltip } from './HiddenProjectIconWithTooltip/HiddenProjectIconWithTooltip';
import { ChangeRequestPlausibleProvider } from 'component/changeRequest/ChangeRequestContext';
import { ProjectApplications } from '../ProjectApplications/ProjectApplications';
import { useUiFlag } from 'hooks/useUiFlag';
import { ProjectInsights } from './ProjectInsights/ProjectInsights';

const StyledBadge = styled(Badge)(({ theme }) => ({
Expand Down Expand Up @@ -78,8 +76,6 @@ export const Project = () => {
const projectName = project?.name || projectId;
const { favorite, unfavorite } = useFavoriteProjectsApi();

const projectOverviewRefactor = useUiFlag('projectOverviewRefactor');

const [showDelDialog, setShowDelDialog] = useState(false);

const [
Expand All @@ -93,16 +89,12 @@ export const Project = () => {
path: basePath,
name: 'overview',
},
...(projectOverviewRefactor
? [
{
title: 'Insights',
path: `${basePath}/insights`,
name: 'insights',
new: true,
},
]
: []),
{
title: 'Insights',
path: `${basePath}/insights`,
name: 'insights',
new: true,
},
{
title: 'Health',
path: `${basePath}/health`,
Expand All @@ -119,16 +111,6 @@ export const Project = () => {
name: 'change-request',
isEnterprise: true,
},
...(!projectOverviewRefactor
? [
{
title: 'Metrics',
path: `${basePath}/metrics`,
name: 'dora',
isEnterprise: true,
},
]
: []),
{
title: 'Applications',
path: `${basePath}/applications`,
Expand Down Expand Up @@ -319,9 +301,7 @@ export const Project = () => {
/>
<Route path='environments' element={<ProjectEnvironment />} />
<Route path='archive' element={<ProjectFeaturesArchive />} />
{Boolean(projectOverviewRefactor) && (
<Route path='insights' element={<ProjectInsights />} />
)}
<Route path='insights' element={<ProjectInsights />} />
<Route path='logs' element={<ProjectLog />} />
<Route
path='change-requests'
Expand All @@ -343,9 +323,6 @@ export const Project = () => {
}
/>
<Route path='settings/*' element={<ProjectSettings />} />
{Boolean(!projectOverviewRefactor) && (
<Route path='metrics' element={<ProjectDoraMetrics />} />
)}
<Route path='applications' element={<ProjectApplications />} />
<Route path='*' element={<ProjectOverview />} />
</Routes>
Expand Down
67 changes: 0 additions & 67 deletions frontend/src/component/project/Project/ProjectOverview.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { type FC, useEffect } from 'react';
import { Box, styled } from '@mui/material';
import ProjectInfo from './ProjectInfo/ProjectInfo';
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
import { ProjectStats } from './ProjectStats/ProjectStats';
import { ProjectFeatureToggles } from './PaginatedProjectFeatureToggles/ProjectFeatureToggles';
import useProjectOverview, {
useProjectOverviewNameOrId,
} from 'hooks/api/getters/useProjectOverview/useProjectOverview';
import { usePageTitle } from 'hooks/usePageTitle';
import { useLastViewedProject } from 'hooks/useLastViewedProject';
import { useUiFlag } from 'hooks/useUiFlag';
import { ProjectOverviewChangeRequests } from './ProjectOverviewChangeRequests';
import { OldProjectFeatureToggles } from './PaginatedProjectFeatureToggles/OldProjectFeatureToggles';

const refreshInterval = 15 * 1000;

Expand All @@ -38,69 +34,6 @@ const StyledContentContainer = styled(Box)(({ theme }) => ({

const ProjectOverview: FC<{
storageKey?: string;
}> = ({ storageKey = 'project-overview-v2' }) => {
const projectOverviewRefactor = useUiFlag('projectOverviewRefactor');

if (projectOverviewRefactor) {
return <NewProjectOverview storageKey={storageKey} />;
} else {
return <OldProjectOverview storageKey={storageKey} />;
}
};

const OldProjectOverview: FC<{
storageKey?: string;
}> = ({ storageKey = 'project-overview-v2' }) => {
const projectId = useRequiredPathParam('projectId');
const projectName = useProjectOverviewNameOrId(projectId);
const { project } = useProjectOverview(projectId, {
refreshInterval,
});
usePageTitle(`Project overview – ${projectName}`);
const { setLastViewed } = useLastViewedProject();
useEffect(() => {
setLastViewed(projectId);
}, [projectId, setLastViewed]);

const {
members,
featureTypeCounts,
health,
description,
environments,
stats,
} = project;

return (
<StyledContainer key={projectId}>
<ProjectInfo
id={projectId}
description={description}
memberCount={members}
health={health}
featureTypeCounts={featureTypeCounts}
stats={stats}
/>

<StyledContentContainer>
<ProjectStats stats={project.stats} />

<StyledProjectToggles>
<OldProjectFeatureToggles
environments={project.environments.map(
(environment) => environment.environment,
)}
refreshInterval={refreshInterval}
storageKey={storageKey}
/>
</StyledProjectToggles>
</StyledContentContainer>
</StyledContainer>
);
};

const NewProjectOverview: FC<{
storageKey?: string;
}> = ({ storageKey = 'project-overview-v2' }) => {
const projectId = useRequiredPathParam('projectId');
const projectName = useProjectOverviewNameOrId(projectId);
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 @@ -75,7 +75,6 @@ export type UiFlags = {
featureSearchFeedbackPosting?: boolean;
userAccessUIEnabled?: boolean;
outdatedSdksBanner?: boolean;
projectOverviewRefactor?: string;
displayTrafficDataUsage?: boolean;
disableShowContextFieldSelectionValues?: boolean;
projectOverviewRefactorFeedback?: 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 @@ -136,7 +136,6 @@ exports[`should create default config 1`] = `
"parseProjectFromSession": false,
"personalAccessTokensKillSwitch": false,
"projectListFilterMyProjects": false,
"projectOverviewRefactor": false,
"projectOverviewRefactorFeedback": false,
"projectsListNewCards": false,
"queryMissingTokens": 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 @@ -51,7 +51,6 @@ export type IFlagKey =
| 'responseTimeMetricsFix'
| 'scimApi'
| 'displayEdgeBanner'
| 'projectOverviewRefactor'
| 'disableShowContextFieldSelectionValues'
| 'projectOverviewRefactorFeedback'
| 'featureLifecycle'
Expand Down Expand Up @@ -251,10 +250,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_RESPONSE_TIME_METRICS_FIX,
false,
),
projectOverviewRefactor: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_PROJECT_OVERVIEW_REFACTOR,
false,
),
disableShowContextFieldSelectionValues: parseEnvVarBoolean(
process.env
.UNLEASH_EXPERIMENTAL_DISABLE_SHOW_CONTEXT_FIELD_SELECTION_VALUES,
Expand Down
1 change: 0 additions & 1 deletion src/server-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ process.nextTick(async () => {
executiveDashboardUI: true,
userAccessUIEnabled: true,
outdatedSdksBanner: true,
projectOverviewRefactor: true,
disableShowContextFieldSelectionValues: false,
projectOverviewRefactorFeedback: true,
featureLifecycle: true,
Expand Down

0 comments on commit 8ae7823

Please sign in to comment.