Skip to content

[Gitar] Cleaning up stale flag: projectListImprovements with value true #1699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import type React from 'react';
import type { FC } from 'react';
import { Box, styled } from '@mui/material';
import {
type IProjectOwnersProps,
ProjectOwners as LegacyProjectOwners,
} from '../LegacyProjectOwners/LegacyProjectOwners';
import type { IProjectOwnersProps } from '../LegacyProjectOwners/LegacyProjectOwners';
import { ProjectOwners } from './ProjectOwners/ProjectOwners';
import { useUiFlag } from 'hooks/useUiFlag';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';

interface IProjectCardFooterProps {
id?: string;
Expand All @@ -31,20 +26,13 @@ const StyledFooter = styled(Box)<{ disabled: boolean }>(
);

export const ProjectCardFooter: FC<IProjectCardFooterProps> = ({
id,
children,
owners,
disabled = false,
}) => {
const projectListImprovementsEnabled = useUiFlag('projectListImprovements');

return (
<StyledFooter disabled={disabled}>
<ConditionallyRender
condition={Boolean(projectListImprovementsEnabled)}
show={<ProjectOwners owners={owners} />}
elseShow={<LegacyProjectOwners owners={owners} />}
/>
<ProjectOwners owners={owners} />
{children}
</StyledFooter>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import type { FC } from 'react';
import LockIcon from '@mui/icons-material/Lock';
import ProtectedProjectIcon from '@mui/icons-material/LockOutlined';
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
import PrivateProjectIcon from '@mui/icons-material/VisibilityOffOutlined';
import { HtmlTooltip } from 'component/common/HtmlTooltip/HtmlTooltip';
import { Badge } from 'component/common/Badge/Badge';
import { useUiFlag } from 'hooks/useUiFlag';
import { styled } from '@mui/material';

interface IProjectModeBadgeProps {
Expand All @@ -19,50 +15,28 @@ const StyledIcon = styled('div')(({ theme }) => ({
}));

export const ProjectModeBadge: FC<IProjectModeBadgeProps> = ({ mode }) => {
const projectListImprovementsEnabled = useUiFlag('projectListImprovements');

if (mode === 'private') {
if (projectListImprovementsEnabled) {
return (
<HtmlTooltip
title="This project's collaboration mode is set to private. The project and associated feature flags can only be seen by members of the project."
arrow
>
<StyledIcon>
<PrivateProjectIcon fontSize='inherit' />
</StyledIcon>
</HtmlTooltip>
);
}
return (
<HtmlTooltip
title="This project's collaboration mode is set to private. The project and associated feature flags can only be seen by members of the project."
arrow
>
<Badge color='warning' icon={<VisibilityOffIcon />} />
<StyledIcon>
<PrivateProjectIcon fontSize='inherit' />
</StyledIcon>
</HtmlTooltip>
);
}

if (mode === 'protected') {
if (projectListImprovementsEnabled) {
return (
<HtmlTooltip
title="This project's collaboration mode is set to protected. Only admins and project members can submit change requests."
arrow
>
<StyledIcon>
<ProtectedProjectIcon fontSize='inherit' />
</StyledIcon>
</HtmlTooltip>
);
}
return (
<HtmlTooltip
title="This project's collaboration mode is set to protected. Only admins and project members can submit change requests."
arrow
>
<Badge color='warning' icon={<LockIcon />} />
<StyledIcon>
<ProtectedProjectIcon fontSize='inherit' />
</StyledIcon>
</HtmlTooltip>
);
}
Expand Down
12 changes: 2 additions & 10 deletions frontend/src/component/project/ProjectList/ProjectGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import type { ComponentType, ReactNode } from 'react';
import { Link } from 'react-router-dom';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { ProjectCard as LegacyProjectCard } from '../ProjectCard/LegacyProjectCard';
import { ProjectCard as NewProjectCard } from '../ProjectCard/ProjectCard';
import type { ProjectSchema } from 'openapi';
import loadingData from './loadingData';
import { TablePlaceholder } from 'component/common/Table';
import { styled, Typography } from '@mui/material';
import { useUiFlag } from 'hooks/useUiFlag';
import { useSearchHighlightContext } from 'component/common/Table/SearchHighlightContext/SearchHighlightContext';
import { flexColumn } from 'themes/themeStyles';

Expand Down Expand Up @@ -72,10 +70,7 @@ export const ProjectGroup = ({
ProjectCardComponent,
link = true,
}: ProjectGroupProps) => {
const projectListImprovementsEnabled = useUiFlag('projectListImprovements');
const ProjectCard =
ProjectCardComponent ??
(projectListImprovementsEnabled ? NewProjectCard : LegacyProjectCard);
const ProjectCard = ProjectCardComponent ?? NewProjectCard;
const { searchQuery } = useSearchHighlightContext();

return (
Expand All @@ -91,10 +86,7 @@ export const ProjectGroup = ({
}
/>
<ConditionallyRender
condition={
Boolean(sectionSubtitle) &&
projectListImprovementsEnabled
}
condition={Boolean(sectionSubtitle)}
show={
<Typography variant='body2' color='text.secondary'>
{sectionSubtitle}
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/component/project/ProjectList/ProjectList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { useUiFlag } from 'hooks/useUiFlag';
import { ProjectsListSort } from './ProjectsListSort/ProjectsListSort';
import { useProjectsListState } from './hooks/useProjectsListState';
import { SearchHighlightProvider } from 'component/common/Table/SearchHighlightContext/SearchHighlightContext';
import { ProjectList as LegacyProjectList } from './LegacyProjectList';
import { ProjectCreationButton } from './ProjectCreationButton/ProjectCreationButton';
import { useGroupedProjects } from './hooks/useGroupedProjects';
import { useProjectsSearchAndSort } from './hooks/useProjectsSearchAndSort';
Expand Down Expand Up @@ -146,11 +145,5 @@ const NewProjectList = () => {
};

export const ProjectList: FC = () => {
const projectListImprovementsEnabled = useUiFlag('projectListImprovements');

if (projectListImprovementsEnabled) {
return <NewProjectList />;
}

return <LegacyProjectList />;
return <NewProjectList />;
};
1 change: 0 additions & 1 deletion frontend/src/interfaces/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export type UiFlags = {
flagCreator?: boolean;
newEventSearch?: boolean;
archiveProjects?: boolean;
projectListImprovements?: boolean;
onboardingUI?: boolean;
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,4 @@
]
},
"packageManager": "[email protected]"
}
}
5 changes: 0 additions & 5 deletions src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export type IFlagKey =
| 'originMiddleware'
| 'newEventSearch'
| 'archiveProjects'
| 'projectListImprovements'
| 'useProjectReadModel'
| 'addonUsageMetrics'
| 'onboardingMetrics'
Expand Down Expand Up @@ -288,10 +287,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_ARCHIVE_PROJECTS,
false,
),
projectListImprovements: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_PROJECT_LIST_IMPROVEMENTS,
false,
),
useProjectReadModel: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_USE_PROJECT_READ_MODEL,
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 @@ -52,7 +52,6 @@ process.nextTick(async () => {
extendedMetrics: true,
originMiddleware: true,
newEventSearch: true,
projectListImprovements: true,
useProjectReadModel: true,
addonUsageMetrics: true,
onboardingMetrics: true,
Expand Down
Loading