1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-03-27 00:19:39 +01:00

fix: new strategy using default strategy (#7075)

This commit is contained in:
Mateusz Kwasniewski 2024-05-20 09:50:44 +02:00 committed by GitHub
parent dfc0c3c63f
commit 50ee7fa779
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -119,6 +119,7 @@ export const FeatureStrategyCreate = () => {
}, [
featureId,
JSON.stringify(strategyDefinition),
JSON.stringify(defaultStrategy),
shouldUseDefaultStrategy,
]);

View File

@ -21,7 +21,7 @@ const RenderFallbackStrategy = () => {
};
test('should render default strategy from project', async () => {
testServerRoute(server, '/api/admin/projects/default', {
testServerRoute(server, '/api/admin/projects/default/overview', {
environments: [
{
environment: 'development',
@ -35,7 +35,7 @@ test('should render default strategy from project', async () => {
});
test('should render fallback default strategy with project default stickiness', async () => {
testServerRoute(server, '/api/admin/projects/default', {
testServerRoute(server, '/api/admin/projects/default/overview', {
defaultStickiness: 'clientId',
environments: [],
});
@ -45,7 +45,7 @@ test('should render fallback default strategy with project default stickiness',
});
test('should render fallback default strategy with no project default stickiness', async () => {
testServerRoute(server, '/api/admin/projects/default', {
testServerRoute(server, '/api/admin/projects/default/overview', {
environments: [],
});
render(<RenderFallbackStrategy />);

View File

@ -18,14 +18,13 @@ import useProjectApi from 'hooks/api/actions/useProjectApi/useProjectApi';
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
import { ProjectDefaultStrategyForm } from './ProjectDefaultStrategyForm';
import type { CreateFeatureStrategySchema } from 'openapi';
import useProject from 'hooks/api/getters/useProject/useProject';
import useProjectOverview from 'hooks/api/getters/useProjectOverview/useProjectOverview';
export const useDefaultStrategy = (
projectId: string,
environmentId: string,
) => {
const { project, refetch } = useProject(projectId);
const { project, refetch } = useProjectOverview(projectId);
const defaultStrategyFallback = {
name: 'flexibleRollout',