diff --git a/frontend/src/component/feature/CreateFeature/CreateFeature.tsx b/frontend/src/component/feature/CreateFeature/CreateFeature.tsx index 41bcb25af5..99ead7164d 100644 --- a/frontend/src/component/feature/CreateFeature/CreateFeature.tsx +++ b/frontend/src/component/feature/CreateFeature/CreateFeature.tsx @@ -94,11 +94,10 @@ const CreateFeature = () => { navigate(GO_BACK); }; - const featureLimitReached = - isFeatureLimitReached( - projectInfo.featureLimit, - projectInfo.features.length - ) && Boolean(uiConfig.flags.newProjectLayout); + const featureLimitReached = isFeatureLimitReached( + projectInfo.featureLimit, + projectInfo.features.length + ); return ( { } /> - - navigate( - `/projects/${projectId}/edit` - ) - } - tooltipProps={{ title: 'Edit project' }} - data-loading - data-testid={NAVIGATE_TO_EDIT_PROJECT} - > - - - } - /> - { - setShowDelDialog(true); - }} - tooltipProps={{ - title: 'Delete project', - }} - data-loading - > - - - } - /> diff --git a/frontend/src/component/project/Project/ProjectForm/ProjectForm.tsx b/frontend/src/component/project/Project/ProjectForm/ProjectForm.tsx index 22304af86f..bb8a7ccd63 100644 --- a/frontend/src/component/project/Project/ProjectForm/ProjectForm.tsx +++ b/frontend/src/component/project/Project/ProjectForm/ProjectForm.tsx @@ -8,7 +8,6 @@ import { Box, styled, TextField } from '@mui/material'; import { CollaborationModeTooltip } from './CollaborationModeTooltip'; import Input from 'component/common/Input/Input'; import { FeatureTogglesLimitTooltip } from './FeatureTogglesLimitTooltip'; -import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; interface IProjectForm { projectId: string; @@ -107,7 +106,6 @@ const ProjectForm: React.FC = ({ validateProjectId, clearErrors, }) => { - const { uiConfig } = useUiConfig(); return ( @@ -199,50 +197,42 @@ const ProjectForm: React.FC = ({ ]} > - - -

Feature toggles limit?

- -
- - Leave it empty if you don’t want to add a limit - - - - setFeatureLimit(e.target.value) - } - /> - - ({featureCount} of {featureLimit}{' '} - used) - - } - /> - - - } - /> + <> + +

Feature toggles limit?

+ +
+ + Leave it empty if you don’t want to add a limit + + + setFeatureLimit(e.target.value)} + /> + + ({featureCount} of {featureLimit} used) + + } + /> + +
{children}
diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectSettings.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectSettings.tsx index f30ba76097..28742f1db7 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ProjectSettings.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ProjectSettings.tsx @@ -25,14 +25,10 @@ export const ProjectSettings = () => { const updatedNavigation = uiConfig.flags?.frontendNavigationUpdate; const tabs: ITab[] = [ - ...(uiConfig.flags.newProjectLayout - ? [ - { - id: '', - label: 'Settings', - }, - ] - : []), + { + id: '', + label: 'Settings', + }, { id: 'environments', label: 'Environments', @@ -84,9 +80,7 @@ export const ProjectSettings = () => { onChange={onChange} > - {uiConfig.flags.newProjectLayout ? ( - } /> - ) : null} + } /> } diff --git a/frontend/src/component/project/ProjectCard/ProjectCard.tsx b/frontend/src/component/project/ProjectCard/ProjectCard.tsx index 2304b9d248..501cbfbbf5 100644 --- a/frontend/src/component/project/ProjectCard/ProjectCard.tsx +++ b/frontend/src/component/project/ProjectCard/ProjectCard.tsx @@ -22,7 +22,6 @@ import { StyledBox, StyledH2Title, StyledEditIcon, - StyledDeleteIcon, StyledProjectIcon, StyledDivInfo, StyledDivInfoContainer, @@ -49,7 +48,7 @@ export const ProjectCard = ({ isFavorite = false, }: IProjectCardProps) => { const { hasAccess } = useContext(AccessContext); - const { isOss, uiConfig } = useUiConfig(); + const { isOss } = useUiConfig(); const [anchorEl, setAnchorEl] = useState(null); const [showDelDialog, setShowDelDialog] = useState(false); const navigate = useNavigate(); @@ -61,9 +60,6 @@ export const ProjectCard = ({ setAnchorEl(event.currentTarget); }; - const canDeleteProject = - hasAccess(DELETE_PROJECT, id) && id !== DEFAULT_PROJECT_ID; - const onFavorite = async (e: React.SyntheticEvent) => { e.preventDefault(); if (isFavorite) { @@ -117,34 +113,12 @@ export const ProjectCard = ({ { e.preventDefault(); - navigate( - getProjectEditPath( - id, - Boolean(uiConfig.flags.newProjectLayout) - ) - ); + navigate(getProjectEditPath(id)); }} > Edit project - { - e.preventDefault(); - setShowDelDialog(true); - }} - disabled={!canDeleteProject} - > - - {id === DEFAULT_PROJECT_ID && !canDeleteProject - ? "You can't delete the default project" - : 'Delete project'} - - } - />
diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index 64421cc4e3..80590ebde9 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -52,7 +52,6 @@ export interface IFlags { advancedPlayground?: boolean; customRootRolesKillSwitch?: boolean; strategyVariant?: boolean; - newProjectLayout?: boolean; configurableFeatureTypeLifetimes?: boolean; frontendNavigationUpdate?: boolean; segmentChangeRequests?: boolean; diff --git a/frontend/src/utils/routePathHelpers.ts b/frontend/src/utils/routePathHelpers.ts index 24e1b856fd..35788c69d2 100644 --- a/frontend/src/utils/routePathHelpers.ts +++ b/frontend/src/utils/routePathHelpers.ts @@ -23,11 +23,6 @@ export const getCreateTogglePath = ( return path; }; -export const getProjectEditPath = ( - projectId: string, - newProjectPath: boolean -) => { - return newProjectPath - ? `/projects/${projectId}/settings` - : `/projects/${projectId}/edit`; +export const getProjectEditPath = (projectId: string) => { + return `/projects/${projectId}/settings`; }; diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index 5674c6cef5..c734a1569b 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -94,7 +94,6 @@ exports[`should create default config 1`] = ` }, }, "migrationLock": true, - "newProjectLayout": false, "personalAccessTokensKillSwitch": false, "proPlanAutoCharge": false, "responseTimeWithAppNameKillSwitch": false, @@ -132,7 +131,6 @@ exports[`should create default config 1`] = ` }, }, "migrationLock": true, - "newProjectLayout": false, "personalAccessTokensKillSwitch": false, "proPlanAutoCharge": false, "responseTimeWithAppNameKillSwitch": false, diff --git a/src/lib/services/feature-toggle-service.ts b/src/lib/services/feature-toggle-service.ts index 14658512b1..dbaa79d165 100644 --- a/src/lib/services/feature-toggle-service.ts +++ b/src/lib/services/feature-toggle-service.ts @@ -1018,10 +1018,7 @@ class FeatureToggleService { await this.validateName(value.name); const exists = await this.projectStore.hasProject(projectId); - if ( - this.flagResolver.isEnabled('newProjectLayout') && - (await this.projectStore.isFeatureLimitReached(projectId)) - ) { + if (await this.projectStore.isFeatureLimitReached(projectId)) { throw new InvalidOperationError( 'You have reached the maximum number of feature toggles for this project.', ); diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 4fb67a01e9..5f087186f1 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -21,7 +21,6 @@ export type IFlagKey = | 'disableNotifications' | 'advancedPlayground' | 'strategyVariant' - | 'newProjectLayout' | 'slackAppAddon' | 'emitPotentiallyStaleEvents' | 'configurableFeatureTypeLifetimes' @@ -99,10 +98,6 @@ const flags: IFlags = { process.env.DISABLE_NOTIFICATIONS, false, ), - newProjectLayout: parseEnvVarBoolean( - process.env.UNLEASH_EXPERIMENTAL_NEW_PROJECT_LAYOUT, - false, - ), strategyVariant: parseEnvVarBoolean( process.env.UNLEASH_STRATEGY_VARIANT, false, diff --git a/src/server-dev.ts b/src/server-dev.ts index 769c110eb8..df995522a1 100644 --- a/src/server-dev.ts +++ b/src/server-dev.ts @@ -38,7 +38,6 @@ process.nextTick(async () => { anonymiseEventLog: false, responseTimeWithAppNameKillSwitch: false, strategyVariant: true, - newProjectLayout: true, emitPotentiallyStaleEvents: true, slackAppAddon: true, configurableFeatureTypeLifetimes: true,