1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-19 17:52:45 +02:00

chore(AI): projectListViewToggle flag cleanup (#10527)

This PR cleans up the projectListViewToggle flag. These changes were
automatically generated by AI and should be reviewed carefully.

Fixes #10526

## 🧹 AI Flag Cleanup Summary
This change removes the `projectListViewToggle` feature flag and
hardcodes its
behavior. The feature, which allows toggling between card and list views
for
projects, is now permanently enabled.
### 🚮 Removed
- **Flag Definitions**
- Removed `projectListViewToggle` from `src/server-dev.ts`,
`src/lib/types/experimental.ts`, and
`frontend/src/interfaces/uiConfig.ts`.
- **Hooks & Conditionals**
- Removed `useUiFlag('projectListViewToggle')` calls from
`ProjectGroup.tsx`
and `ProjectList.tsx`.
- Removed conditional rendering logic based on the flag in
`ProjectGroup.tsx`
and `ProjectList.tsx`.
### 🛠 Kept
- **Project List View**
- The project list view functionality is now always available for
non-OSS
versions of Unleash.
- The `ProjectsListViewToggle` component is now always rendered when not
in an
OSS environment.
### 📝 Why
The `projectListViewToggle` feature flag was marked as completed and its
intended outcome was to be kept. The code has been updated to reflect
this by
removing the flag and making the feature a permanent part of the
application.
This simplifies the codebase by removing dead code paths and feature
flag
checks.

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
This commit is contained in:
unleash-bot[bot] 2025-08-25 09:01:59 +01:00 committed by GitHub
parent 51b8f969a5
commit 8ddeed09fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 21 deletions

View File

@ -8,7 +8,6 @@ import { UpgradeProjectCard } from '../ProjectCard/UpgradeProjectCard.tsx';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import type { ProjectsListView } from './hooks/useProjectsListState.ts';
import { ProjectsListTable } from './ProjectsListTable/ProjectsListTable.tsx';
import { useUiFlag } from 'hooks/useUiFlag.ts';
const StyledGridContainer = styled('div')(({ theme }) => ({
display: 'grid',
@ -47,11 +46,10 @@ export const ProjectGroup = ({
}: ProjectGroupProps) => {
const ProjectCard = ProjectCardComponent ?? DefaultProjectCard;
const { isOss } = useUiConfig();
const projectListViewToggleEnabled = useUiFlag('projectListViewToggle');
const projectsToRender = loading ? loadingData : projects;
if (!isOss() && projectListViewToggleEnabled && view === 'list') {
if (!isOss() && view === 'list') {
return <ProjectsListTable projects={projectsToRender} />;
}

View File

@ -19,7 +19,6 @@ import { ProjectArchiveLink } from './ProjectArchiveLink/ProjectArchiveLink.tsx'
import { ProjectsListHeader } from './ProjectsListHeader/ProjectsListHeader.tsx';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { TablePlaceholder } from 'component/common/Table/index.ts';
import { useUiFlag } from 'hooks/useUiFlag.ts';
import { ProjectsListViewToggle } from './ProjectsListViewToggle/ProjectsListViewToggle.tsx';
const StyledApiError = styled(ApiError)(({ theme }) => ({
@ -36,7 +35,6 @@ const StyledContainer = styled('div')(({ theme }) => ({
export const ProjectList = () => {
const { projects, loading, error, refetch } = useProjects();
const { isOss } = useUiConfig();
const projectListViewToggleEnabled = useUiFlag('projectListViewToggle');
const isSmallScreen = useMediaQuery(theme.breakpoints.down('md'));
@ -130,15 +128,14 @@ export const ProjectList = () => {
helpText='Favorite projects, projects you own, and projects you are a member of'
actions={
<>
{projectListViewToggleEnabled &&
!isOss() && (
<ProjectsListViewToggle
view={state.view}
setView={(view) =>
setState({ view })
}
/>
)}
{!isOss() && (
<ProjectsListViewToggle
view={state.view}
setView={(view) =>
setState({ view })
}
/>
)}
<ProjectsListSort
sortBy={state.sortBy}
setSortBy={(sortBy) =>

View File

@ -92,7 +92,6 @@ export type UiFlags = {
lifecycleGraphs?: boolean;
addConfiguration?: boolean;
filterFlagsToArchive?: boolean;
projectListViewToggle?: boolean;
};
export interface IVersionInfo {

View File

@ -60,7 +60,6 @@ export type IFlagKey =
| 'lifecycleGraphs'
| 'addConfiguration'
| 'filterFlagsToArchive'
| 'projectListViewToggle'
| 'fetchMode'
| 'etagByEnv';
@ -278,10 +277,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_FILTER_FLAGS_TO_ARCHIVE,
false,
),
projectListViewToggle: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_PROJECT_LIST_VIEW_TOGGLE,
false,
),
fetchMode: {
name: 'disabled',
feature_enabled: false,

View File

@ -56,7 +56,6 @@ process.nextTick(async () => {
impactMetrics: true,
lifecycleGraphs: true,
addConfiguration: true,
projectListViewToggle: true,
},
},
authentication: {