mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-01 01:18:10 +02:00
fix: new strategy using default strategy (#7075)
This commit is contained in:
parent
dfc0c3c63f
commit
50ee7fa779
@ -119,6 +119,7 @@ export const FeatureStrategyCreate = () => {
|
|||||||
}, [
|
}, [
|
||||||
featureId,
|
featureId,
|
||||||
JSON.stringify(strategyDefinition),
|
JSON.stringify(strategyDefinition),
|
||||||
|
JSON.stringify(defaultStrategy),
|
||||||
shouldUseDefaultStrategy,
|
shouldUseDefaultStrategy,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ const RenderFallbackStrategy = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
test('should render default strategy from project', async () => {
|
test('should render default strategy from project', async () => {
|
||||||
testServerRoute(server, '/api/admin/projects/default', {
|
testServerRoute(server, '/api/admin/projects/default/overview', {
|
||||||
environments: [
|
environments: [
|
||||||
{
|
{
|
||||||
environment: 'development',
|
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 () => {
|
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',
|
defaultStickiness: 'clientId',
|
||||||
environments: [],
|
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 () => {
|
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: [],
|
environments: [],
|
||||||
});
|
});
|
||||||
render(<RenderFallbackStrategy />);
|
render(<RenderFallbackStrategy />);
|
||||||
|
@ -18,14 +18,13 @@ import useProjectApi from 'hooks/api/actions/useProjectApi/useProjectApi';
|
|||||||
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
||||||
import { ProjectDefaultStrategyForm } from './ProjectDefaultStrategyForm';
|
import { ProjectDefaultStrategyForm } from './ProjectDefaultStrategyForm';
|
||||||
import type { CreateFeatureStrategySchema } from 'openapi';
|
import type { CreateFeatureStrategySchema } from 'openapi';
|
||||||
import useProject from 'hooks/api/getters/useProject/useProject';
|
|
||||||
import useProjectOverview from 'hooks/api/getters/useProjectOverview/useProjectOverview';
|
import useProjectOverview from 'hooks/api/getters/useProjectOverview/useProjectOverview';
|
||||||
|
|
||||||
export const useDefaultStrategy = (
|
export const useDefaultStrategy = (
|
||||||
projectId: string,
|
projectId: string,
|
||||||
environmentId: string,
|
environmentId: string,
|
||||||
) => {
|
) => {
|
||||||
const { project, refetch } = useProject(projectId);
|
const { project, refetch } = useProjectOverview(projectId);
|
||||||
|
|
||||||
const defaultStrategyFallback = {
|
const defaultStrategyFallback = {
|
||||||
name: 'flexibleRollout',
|
name: 'flexibleRollout',
|
||||||
|
Loading…
Reference in New Issue
Block a user