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:
parent
51b8f969a5
commit
8ddeed09fb
@ -8,7 +8,6 @@ import { UpgradeProjectCard } from '../ProjectCard/UpgradeProjectCard.tsx';
|
|||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
import type { ProjectsListView } from './hooks/useProjectsListState.ts';
|
import type { ProjectsListView } from './hooks/useProjectsListState.ts';
|
||||||
import { ProjectsListTable } from './ProjectsListTable/ProjectsListTable.tsx';
|
import { ProjectsListTable } from './ProjectsListTable/ProjectsListTable.tsx';
|
||||||
import { useUiFlag } from 'hooks/useUiFlag.ts';
|
|
||||||
|
|
||||||
const StyledGridContainer = styled('div')(({ theme }) => ({
|
const StyledGridContainer = styled('div')(({ theme }) => ({
|
||||||
display: 'grid',
|
display: 'grid',
|
||||||
@ -47,11 +46,10 @@ export const ProjectGroup = ({
|
|||||||
}: ProjectGroupProps) => {
|
}: ProjectGroupProps) => {
|
||||||
const ProjectCard = ProjectCardComponent ?? DefaultProjectCard;
|
const ProjectCard = ProjectCardComponent ?? DefaultProjectCard;
|
||||||
const { isOss } = useUiConfig();
|
const { isOss } = useUiConfig();
|
||||||
const projectListViewToggleEnabled = useUiFlag('projectListViewToggle');
|
|
||||||
|
|
||||||
const projectsToRender = loading ? loadingData : projects;
|
const projectsToRender = loading ? loadingData : projects;
|
||||||
|
|
||||||
if (!isOss() && projectListViewToggleEnabled && view === 'list') {
|
if (!isOss() && view === 'list') {
|
||||||
return <ProjectsListTable projects={projectsToRender} />;
|
return <ProjectsListTable projects={projectsToRender} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ import { ProjectArchiveLink } from './ProjectArchiveLink/ProjectArchiveLink.tsx'
|
|||||||
import { ProjectsListHeader } from './ProjectsListHeader/ProjectsListHeader.tsx';
|
import { ProjectsListHeader } from './ProjectsListHeader/ProjectsListHeader.tsx';
|
||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
import { TablePlaceholder } from 'component/common/Table/index.ts';
|
import { TablePlaceholder } from 'component/common/Table/index.ts';
|
||||||
import { useUiFlag } from 'hooks/useUiFlag.ts';
|
|
||||||
import { ProjectsListViewToggle } from './ProjectsListViewToggle/ProjectsListViewToggle.tsx';
|
import { ProjectsListViewToggle } from './ProjectsListViewToggle/ProjectsListViewToggle.tsx';
|
||||||
|
|
||||||
const StyledApiError = styled(ApiError)(({ theme }) => ({
|
const StyledApiError = styled(ApiError)(({ theme }) => ({
|
||||||
@ -36,7 +35,6 @@ const StyledContainer = styled('div')(({ theme }) => ({
|
|||||||
export const ProjectList = () => {
|
export const ProjectList = () => {
|
||||||
const { projects, loading, error, refetch } = useProjects();
|
const { projects, loading, error, refetch } = useProjects();
|
||||||
const { isOss } = useUiConfig();
|
const { isOss } = useUiConfig();
|
||||||
const projectListViewToggleEnabled = useUiFlag('projectListViewToggle');
|
|
||||||
|
|
||||||
const isSmallScreen = useMediaQuery(theme.breakpoints.down('md'));
|
const isSmallScreen = useMediaQuery(theme.breakpoints.down('md'));
|
||||||
|
|
||||||
@ -130,8 +128,7 @@ export const ProjectList = () => {
|
|||||||
helpText='Favorite projects, projects you own, and projects you are a member of'
|
helpText='Favorite projects, projects you own, and projects you are a member of'
|
||||||
actions={
|
actions={
|
||||||
<>
|
<>
|
||||||
{projectListViewToggleEnabled &&
|
{!isOss() && (
|
||||||
!isOss() && (
|
|
||||||
<ProjectsListViewToggle
|
<ProjectsListViewToggle
|
||||||
view={state.view}
|
view={state.view}
|
||||||
setView={(view) =>
|
setView={(view) =>
|
||||||
|
@ -92,7 +92,6 @@ export type UiFlags = {
|
|||||||
lifecycleGraphs?: boolean;
|
lifecycleGraphs?: boolean;
|
||||||
addConfiguration?: boolean;
|
addConfiguration?: boolean;
|
||||||
filterFlagsToArchive?: boolean;
|
filterFlagsToArchive?: boolean;
|
||||||
projectListViewToggle?: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IVersionInfo {
|
export interface IVersionInfo {
|
||||||
|
@ -60,7 +60,6 @@ export type IFlagKey =
|
|||||||
| 'lifecycleGraphs'
|
| 'lifecycleGraphs'
|
||||||
| 'addConfiguration'
|
| 'addConfiguration'
|
||||||
| 'filterFlagsToArchive'
|
| 'filterFlagsToArchive'
|
||||||
| 'projectListViewToggle'
|
|
||||||
| 'fetchMode'
|
| 'fetchMode'
|
||||||
| 'etagByEnv';
|
| 'etagByEnv';
|
||||||
|
|
||||||
@ -278,10 +277,6 @@ const flags: IFlags = {
|
|||||||
process.env.UNLEASH_EXPERIMENTAL_FILTER_FLAGS_TO_ARCHIVE,
|
process.env.UNLEASH_EXPERIMENTAL_FILTER_FLAGS_TO_ARCHIVE,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
projectListViewToggle: parseEnvVarBoolean(
|
|
||||||
process.env.UNLEASH_EXPERIMENTAL_PROJECT_LIST_VIEW_TOGGLE,
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
fetchMode: {
|
fetchMode: {
|
||||||
name: 'disabled',
|
name: 'disabled',
|
||||||
feature_enabled: false,
|
feature_enabled: false,
|
||||||
|
@ -56,7 +56,6 @@ process.nextTick(async () => {
|
|||||||
impactMetrics: true,
|
impactMetrics: true,
|
||||||
lifecycleGraphs: true,
|
lifecycleGraphs: true,
|
||||||
addConfiguration: true,
|
addConfiguration: true,
|
||||||
projectListViewToggle: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
authentication: {
|
authentication: {
|
||||||
|
Loading…
Reference in New Issue
Block a user