mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-24 01:18:01 +02:00
chore: remove project overview refactor flag (#6897)
This commit is contained in:
parent
d1803b2e62
commit
8ae78236d2
@ -4,7 +4,6 @@ import type { ILastSeenEnvironments } from 'interfaces/featureToggle';
|
|||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import { useLastSeenColors } from 'component/feature/FeatureView/FeatureEnvironmentSeen/useLastSeenColors';
|
import { useLastSeenColors } from 'component/feature/FeatureView/FeatureEnvironmentSeen/useLastSeenColors';
|
||||||
import { LastSeenProgress } from './LastSeenProgress/LastSeenProgress';
|
import { LastSeenProgress } from './LastSeenProgress/LastSeenProgress';
|
||||||
import { useUiFlag } from 'hooks/useUiFlag';
|
|
||||||
|
|
||||||
const StyledDescription = styled(
|
const StyledDescription = styled(
|
||||||
'div',
|
'div',
|
||||||
@ -75,7 +74,6 @@ export const LastSeenTooltip = ({
|
|||||||
...rest
|
...rest
|
||||||
}: ILastSeenTooltipProps) => {
|
}: ILastSeenTooltipProps) => {
|
||||||
const getColor = useLastSeenColors();
|
const getColor = useLastSeenColors();
|
||||||
const projectOverviewRefactor = useUiFlag('projectOverviewRefactor');
|
|
||||||
const [, defaultTextColor] = getColor();
|
const [, defaultTextColor] = getColor();
|
||||||
const environmentsHaveLastSeen = environments?.some((environment) =>
|
const environmentsHaveLastSeen = environments?.some((environment) =>
|
||||||
Boolean(environment.lastSeenAt),
|
Boolean(environment.lastSeenAt),
|
||||||
@ -134,12 +132,7 @@ export const LastSeenTooltip = ({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</StyledValueContainer>
|
</StyledValueContainer>
|
||||||
<ConditionallyRender
|
|
||||||
condition={Boolean(projectOverviewRefactor)}
|
|
||||||
show={
|
|
||||||
<LastSeenProgress yes={yes} no={no} />
|
<LastSeenProgress yes={yes} no={no} />
|
||||||
}
|
|
||||||
/>
|
|
||||||
</StyledDescriptionBlock>
|
</StyledDescriptionBlock>
|
||||||
))}
|
))}
|
||||||
</StyledListContainer>
|
</StyledListContainer>
|
||||||
|
@ -38,12 +38,10 @@ import { ImportModal } from './Import/ImportModal';
|
|||||||
import { IMPORT_BUTTON } from 'utils/testIds';
|
import { IMPORT_BUTTON } from 'utils/testIds';
|
||||||
import { EnterpriseBadge } from 'component/common/EnterpriseBadge/EnterpriseBadge';
|
import { EnterpriseBadge } from 'component/common/EnterpriseBadge/EnterpriseBadge';
|
||||||
import { Badge } from 'component/common/Badge/Badge';
|
import { Badge } from 'component/common/Badge/Badge';
|
||||||
import { ProjectDoraMetrics } from './ProjectDoraMetrics/ProjectDoraMetrics';
|
|
||||||
import type { UiFlags } from 'interfaces/uiConfig';
|
import type { UiFlags } from 'interfaces/uiConfig';
|
||||||
import { HiddenProjectIconWithTooltip } from './HiddenProjectIconWithTooltip/HiddenProjectIconWithTooltip';
|
import { HiddenProjectIconWithTooltip } from './HiddenProjectIconWithTooltip/HiddenProjectIconWithTooltip';
|
||||||
import { ChangeRequestPlausibleProvider } from 'component/changeRequest/ChangeRequestContext';
|
import { ChangeRequestPlausibleProvider } from 'component/changeRequest/ChangeRequestContext';
|
||||||
import { ProjectApplications } from '../ProjectApplications/ProjectApplications';
|
import { ProjectApplications } from '../ProjectApplications/ProjectApplications';
|
||||||
import { useUiFlag } from 'hooks/useUiFlag';
|
|
||||||
import { ProjectInsights } from './ProjectInsights/ProjectInsights';
|
import { ProjectInsights } from './ProjectInsights/ProjectInsights';
|
||||||
|
|
||||||
const StyledBadge = styled(Badge)(({ theme }) => ({
|
const StyledBadge = styled(Badge)(({ theme }) => ({
|
||||||
@ -78,8 +76,6 @@ export const Project = () => {
|
|||||||
const projectName = project?.name || projectId;
|
const projectName = project?.name || projectId;
|
||||||
const { favorite, unfavorite } = useFavoriteProjectsApi();
|
const { favorite, unfavorite } = useFavoriteProjectsApi();
|
||||||
|
|
||||||
const projectOverviewRefactor = useUiFlag('projectOverviewRefactor');
|
|
||||||
|
|
||||||
const [showDelDialog, setShowDelDialog] = useState(false);
|
const [showDelDialog, setShowDelDialog] = useState(false);
|
||||||
|
|
||||||
const [
|
const [
|
||||||
@ -93,16 +89,12 @@ export const Project = () => {
|
|||||||
path: basePath,
|
path: basePath,
|
||||||
name: 'overview',
|
name: 'overview',
|
||||||
},
|
},
|
||||||
...(projectOverviewRefactor
|
|
||||||
? [
|
|
||||||
{
|
{
|
||||||
title: 'Insights',
|
title: 'Insights',
|
||||||
path: `${basePath}/insights`,
|
path: `${basePath}/insights`,
|
||||||
name: 'insights',
|
name: 'insights',
|
||||||
new: true,
|
new: true,
|
||||||
},
|
},
|
||||||
]
|
|
||||||
: []),
|
|
||||||
{
|
{
|
||||||
title: 'Health',
|
title: 'Health',
|
||||||
path: `${basePath}/health`,
|
path: `${basePath}/health`,
|
||||||
@ -119,16 +111,6 @@ export const Project = () => {
|
|||||||
name: 'change-request',
|
name: 'change-request',
|
||||||
isEnterprise: true,
|
isEnterprise: true,
|
||||||
},
|
},
|
||||||
...(!projectOverviewRefactor
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
title: 'Metrics',
|
|
||||||
path: `${basePath}/metrics`,
|
|
||||||
name: 'dora',
|
|
||||||
isEnterprise: true,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
{
|
{
|
||||||
title: 'Applications',
|
title: 'Applications',
|
||||||
path: `${basePath}/applications`,
|
path: `${basePath}/applications`,
|
||||||
@ -319,9 +301,7 @@ export const Project = () => {
|
|||||||
/>
|
/>
|
||||||
<Route path='environments' element={<ProjectEnvironment />} />
|
<Route path='environments' element={<ProjectEnvironment />} />
|
||||||
<Route path='archive' element={<ProjectFeaturesArchive />} />
|
<Route path='archive' element={<ProjectFeaturesArchive />} />
|
||||||
{Boolean(projectOverviewRefactor) && (
|
|
||||||
<Route path='insights' element={<ProjectInsights />} />
|
<Route path='insights' element={<ProjectInsights />} />
|
||||||
)}
|
|
||||||
<Route path='logs' element={<ProjectLog />} />
|
<Route path='logs' element={<ProjectLog />} />
|
||||||
<Route
|
<Route
|
||||||
path='change-requests'
|
path='change-requests'
|
||||||
@ -343,9 +323,6 @@ export const Project = () => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Route path='settings/*' element={<ProjectSettings />} />
|
<Route path='settings/*' element={<ProjectSettings />} />
|
||||||
{Boolean(!projectOverviewRefactor) && (
|
|
||||||
<Route path='metrics' element={<ProjectDoraMetrics />} />
|
|
||||||
)}
|
|
||||||
<Route path='applications' element={<ProjectApplications />} />
|
<Route path='applications' element={<ProjectApplications />} />
|
||||||
<Route path='*' element={<ProjectOverview />} />
|
<Route path='*' element={<ProjectOverview />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
import { type FC, useEffect } from 'react';
|
import { type FC, useEffect } from 'react';
|
||||||
import { Box, styled } from '@mui/material';
|
import { Box, styled } from '@mui/material';
|
||||||
import ProjectInfo from './ProjectInfo/ProjectInfo';
|
|
||||||
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
|
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
|
||||||
import { ProjectStats } from './ProjectStats/ProjectStats';
|
|
||||||
import { ProjectFeatureToggles } from './PaginatedProjectFeatureToggles/ProjectFeatureToggles';
|
import { ProjectFeatureToggles } from './PaginatedProjectFeatureToggles/ProjectFeatureToggles';
|
||||||
import useProjectOverview, {
|
import useProjectOverview, {
|
||||||
useProjectOverviewNameOrId,
|
useProjectOverviewNameOrId,
|
||||||
} from 'hooks/api/getters/useProjectOverview/useProjectOverview';
|
} from 'hooks/api/getters/useProjectOverview/useProjectOverview';
|
||||||
import { usePageTitle } from 'hooks/usePageTitle';
|
import { usePageTitle } from 'hooks/usePageTitle';
|
||||||
import { useLastViewedProject } from 'hooks/useLastViewedProject';
|
import { useLastViewedProject } from 'hooks/useLastViewedProject';
|
||||||
import { useUiFlag } from 'hooks/useUiFlag';
|
|
||||||
import { ProjectOverviewChangeRequests } from './ProjectOverviewChangeRequests';
|
import { ProjectOverviewChangeRequests } from './ProjectOverviewChangeRequests';
|
||||||
import { OldProjectFeatureToggles } from './PaginatedProjectFeatureToggles/OldProjectFeatureToggles';
|
|
||||||
|
|
||||||
const refreshInterval = 15 * 1000;
|
const refreshInterval = 15 * 1000;
|
||||||
|
|
||||||
@ -38,69 +34,6 @@ const StyledContentContainer = styled(Box)(({ theme }) => ({
|
|||||||
|
|
||||||
const ProjectOverview: FC<{
|
const ProjectOverview: FC<{
|
||||||
storageKey?: string;
|
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' }) => {
|
}> = ({ storageKey = 'project-overview-v2' }) => {
|
||||||
const projectId = useRequiredPathParam('projectId');
|
const projectId = useRequiredPathParam('projectId');
|
||||||
const projectName = useProjectOverviewNameOrId(projectId);
|
const projectName = useProjectOverviewNameOrId(projectId);
|
||||||
|
@ -75,7 +75,6 @@ export type UiFlags = {
|
|||||||
featureSearchFeedbackPosting?: boolean;
|
featureSearchFeedbackPosting?: boolean;
|
||||||
userAccessUIEnabled?: boolean;
|
userAccessUIEnabled?: boolean;
|
||||||
outdatedSdksBanner?: boolean;
|
outdatedSdksBanner?: boolean;
|
||||||
projectOverviewRefactor?: string;
|
|
||||||
displayTrafficDataUsage?: boolean;
|
displayTrafficDataUsage?: boolean;
|
||||||
disableShowContextFieldSelectionValues?: boolean;
|
disableShowContextFieldSelectionValues?: boolean;
|
||||||
projectOverviewRefactorFeedback?: boolean;
|
projectOverviewRefactorFeedback?: boolean;
|
||||||
|
@ -136,7 +136,6 @@ exports[`should create default config 1`] = `
|
|||||||
"parseProjectFromSession": false,
|
"parseProjectFromSession": false,
|
||||||
"personalAccessTokensKillSwitch": false,
|
"personalAccessTokensKillSwitch": false,
|
||||||
"projectListFilterMyProjects": false,
|
"projectListFilterMyProjects": false,
|
||||||
"projectOverviewRefactor": false,
|
|
||||||
"projectOverviewRefactorFeedback": false,
|
"projectOverviewRefactorFeedback": false,
|
||||||
"projectsListNewCards": false,
|
"projectsListNewCards": false,
|
||||||
"queryMissingTokens": false,
|
"queryMissingTokens": false,
|
||||||
|
@ -51,7 +51,6 @@ export type IFlagKey =
|
|||||||
| 'responseTimeMetricsFix'
|
| 'responseTimeMetricsFix'
|
||||||
| 'scimApi'
|
| 'scimApi'
|
||||||
| 'displayEdgeBanner'
|
| 'displayEdgeBanner'
|
||||||
| 'projectOverviewRefactor'
|
|
||||||
| 'disableShowContextFieldSelectionValues'
|
| 'disableShowContextFieldSelectionValues'
|
||||||
| 'projectOverviewRefactorFeedback'
|
| 'projectOverviewRefactorFeedback'
|
||||||
| 'featureLifecycle'
|
| 'featureLifecycle'
|
||||||
@ -251,10 +250,6 @@ const flags: IFlags = {
|
|||||||
process.env.UNLEASH_EXPERIMENTAL_RESPONSE_TIME_METRICS_FIX,
|
process.env.UNLEASH_EXPERIMENTAL_RESPONSE_TIME_METRICS_FIX,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
projectOverviewRefactor: parseEnvVarBoolean(
|
|
||||||
process.env.UNLEASH_EXPERIMENTAL_PROJECT_OVERVIEW_REFACTOR,
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
disableShowContextFieldSelectionValues: parseEnvVarBoolean(
|
disableShowContextFieldSelectionValues: parseEnvVarBoolean(
|
||||||
process.env
|
process.env
|
||||||
.UNLEASH_EXPERIMENTAL_DISABLE_SHOW_CONTEXT_FIELD_SELECTION_VALUES,
|
.UNLEASH_EXPERIMENTAL_DISABLE_SHOW_CONTEXT_FIELD_SELECTION_VALUES,
|
||||||
|
@ -47,7 +47,6 @@ process.nextTick(async () => {
|
|||||||
executiveDashboardUI: true,
|
executiveDashboardUI: true,
|
||||||
userAccessUIEnabled: true,
|
userAccessUIEnabled: true,
|
||||||
outdatedSdksBanner: true,
|
outdatedSdksBanner: true,
|
||||||
projectOverviewRefactor: true,
|
|
||||||
disableShowContextFieldSelectionValues: false,
|
disableShowContextFieldSelectionValues: false,
|
||||||
projectOverviewRefactorFeedback: true,
|
projectOverviewRefactorFeedback: true,
|
||||||
featureLifecycle: true,
|
featureLifecycle: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user