diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectDefaultStrategySettings.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectDefaultStrategySettings.tsx
index b22d4133dc..554f3bb4de 100644
--- a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectDefaultStrategySettings.tsx
+++ b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectDefaultStrategySettings.tsx
@@ -1,4 +1,4 @@
-import { useContext } from 'react';
+import React, { useContext } from 'react';
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
import useProject, {
useProjectNameOrId,
@@ -10,6 +10,9 @@ import { PageHeader } from 'component/common/PageHeader/PageHeader';
import { UPDATE_PROJECT } from 'component/providers/AccessProvider/permissions';
import { Alert, styled } from '@mui/material';
import ProjectEnvironment from './ProjectEnvironment/ProjectEnvironment';
+import { Route, Routes, useNavigate } from 'react-router-dom';
+import { SidebarModal } from '../../../../common/SidebarModal/SidebarModal';
+import EditDefaultStrategy from './ProjectEnvironment/ProjectEnvironmentDefaultStrategy/EditDefaultStrategy';
const StyledAlert = styled(Alert)(({ theme }) => ({
marginBottom: theme.spacing(4),
@@ -19,6 +22,7 @@ export const ProjectDefaultStrategySettings = () => {
const projectName = useProjectNameOrId(projectId);
const { hasAccess } = useContext(AccessContext);
const { project } = useProject(projectId);
+ const navigate = useNavigate();
usePageTitle(`Project default strategy configuration – ${projectName}`);
if (!hasAccess(UPDATE_PROJECT, projectId)) {
@@ -33,19 +37,38 @@ export const ProjectDefaultStrategySettings = () => {
);
}
+ const path = `/projects/${projectId}/settings/default-strategy`;
+ const onSidebarClose = () => navigate(path);
+
return (
- }>
-
- Here you can customize your default strategy for each specific
- environment. These will be used when you enable a toggle
- environment that has no strategies defined
-
- {project?.environments.map(environment => (
-
+ }>
+
+ Here you can customize your default strategy for each
+ specific environment. These will be used when you enable a
+ toggle environment that has no strategies defined
+
+ {project?.environments.map(environment => (
+
+ ))}
+
+
+
+
+
+ }
/>
- ))}
-
+
+ >
);
};
diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/ProjectDefaultStrategyForm.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/ProjectDefaultStrategyForm.tsx
index 3c06f35f8b..753d19bac0 100644
--- a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/ProjectDefaultStrategyForm.tsx
+++ b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/ProjectDefaultStrategyForm.tsx
@@ -20,7 +20,6 @@ import { useHasProjectEnvironmentAccess } from 'hooks/useHasAccess';
import { FeatureStrategyConstraints } from 'component/feature/FeatureStrategy/FeatureStrategyConstraints/FeatureStrategyConstraints';
import { FeatureStrategyType } from 'component/feature/FeatureStrategy/FeatureStrategyType/FeatureStrategyType';
import { FeatureStrategyTitle } from 'component/feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyTitle/FeatureStrategyTitle';
-import { CreateFeatureStrategySchema } from 'openapi';
interface IProjectDefaultStrategyFormProps {
projectId: string;
@@ -30,7 +29,7 @@ interface IProjectDefaultStrategyFormProps {
onCancel?: () => void;
loading: boolean;
isChangeRequest?: boolean;
- strategy: IFeatureStrategy | CreateFeatureStrategySchema;
+ strategy: Partial;
setStrategy: React.Dispatch<
React.SetStateAction>
>;
diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/ProjectEnvironmentDefaultStrategy.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/ProjectEnvironmentDefaultStrategy.tsx
index 8c1715440d..3ffecc26f5 100644
--- a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/ProjectEnvironmentDefaultStrategy.tsx
+++ b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/ProjectEnvironmentDefaultStrategy.tsx
@@ -2,13 +2,11 @@ import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
import { StrategyItemContainer } from 'component/common/StrategyItemContainer/StrategyItemContainer';
import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton';
import { UPDATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions';
-import { Link, Route, Routes, useNavigate } from 'react-router-dom';
+import { Link } from 'react-router-dom';
import { Edit } from '@mui/icons-material';
import { StrategyExecution } from 'component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/StrategyExecution';
import { ProjectEnvironmentType } from 'interfaces/environments';
import React, { useMemo } from 'react';
-import EditDefaultStrategy from './EditDefaultStrategy';
-import { SidebarModal } from 'component/common/SidebarModal/SidebarModal';
import { CreateFeatureStrategySchema } from 'openapi';
interface ProjectEnvironmentDefaultStrategyProps {
@@ -41,7 +39,6 @@ const ProjectEnvironmentDefaultStrategy = ({
environment,
description,
}: ProjectEnvironmentDefaultStrategyProps) => {
- const navigate = useNavigate();
const projectId = useRequiredPathParam('projectId');
const { environment: environmentId, defaultStrategy } = environment;
@@ -50,14 +47,10 @@ const ProjectEnvironmentDefaultStrategy = ({
environmentId
);
- const path = `/projects/${projectId}/settings/default-strategy`;
-
const strategy: CreateFeatureStrategySchema = useMemo(() => {
return defaultStrategy ? defaultStrategy : DEFAULT_STRATEGY;
}, [JSON.stringify(defaultStrategy)]);
- const onSidebarClose = () => navigate(path);
-
return (
<>
-
-
-
-
- }
- />
-
>
);
};