diff --git a/frontend/src/hooks/api/getters/useSegmentLimits/useSegmentLimits.ts b/frontend/src/hooks/api/getters/useSegmentLimits/useSegmentLimits.ts index 2ea8e589ee..728edca9c6 100644 --- a/frontend/src/hooks/api/getters/useSegmentLimits/useSegmentLimits.ts +++ b/frontend/src/hooks/api/getters/useSegmentLimits/useSegmentLimits.ts @@ -1,16 +1,13 @@ import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; -import type { IUiConfig } from 'interfaces/uiConfig'; -type IUseSegmentLimits = Pick< - IUiConfig, - 'segmentValuesLimit' | 'strategySegmentsLimit' ->; - -export const useSegmentLimits = (): IUseSegmentLimits => { +export const useSegmentLimits = (): { + segmentValuesLimit: number; + strategySegmentsLimit: number; +} => { const { uiConfig } = useUiConfig(); return { - segmentValuesLimit: uiConfig.segmentValuesLimit, - strategySegmentsLimit: uiConfig.strategySegmentsLimit, + segmentValuesLimit: uiConfig.resourceLimits.segmentValues, + strategySegmentsLimit: uiConfig.resourceLimits.strategySegments, }; }; diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index ec35cb68e1..f2042a28ec 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -29,8 +29,6 @@ export interface IUiConfig { prometheusAPIAvailable: boolean; maintenanceMode?: boolean; toast?: IProclamationToast; - segmentValuesLimit?: number; - strategySegmentsLimit?: number; frontendApiOrigins?: string[]; resourceLimits: ResourceLimitsSchema; oidcConfiguredThroughEnv?: boolean; diff --git a/src/lib/openapi/spec/ui-config-schema.test.ts b/src/lib/openapi/spec/ui-config-schema.test.ts index 656be7638c..4ccd6d7940 100644 --- a/src/lib/openapi/spec/ui-config-schema.test.ts +++ b/src/lib/openapi/spec/ui-config-schema.test.ts @@ -9,8 +9,24 @@ test('uiConfigSchema', () => { baseUriPath: 'a', environment: 'a', disablePasswordAuth: false, - segmentValuesLimit: 0, - strategySegmentsLimit: 0, + resourceLimits: { + segmentValues: 0, + strategySegments: 0, + actionSetActions: 0, + actionSetsPerProject: 0, + actionSetFilters: 0, + actionSetFilterValues: 0, + signalEndpoints: 0, + signalTokensPerEndpoint: 0, + featureEnvironmentStrategies: 0, + constraintValues: 0, + environments: 1, + projects: 1, + apiTokens: 0, + segments: 0, + featureFlags: 1, + constraints: 0, + }, versionInfo: { current: {}, latest: {}, diff --git a/src/lib/openapi/spec/ui-config-schema.ts b/src/lib/openapi/spec/ui-config-schema.ts index da0a60e5d8..d7c7e7e9bf 100644 --- a/src/lib/openapi/spec/ui-config-schema.ts +++ b/src/lib/openapi/spec/ui-config-schema.ts @@ -72,20 +72,6 @@ export const uiConfigSchema = { description: 'Whether maintenance mode is currently active or not.', example: false, }, - segmentValuesLimit: { - type: 'number', - description: - 'The maximum number of values that can be used in a single segment.', - example: 1000, - deprecated: true, - }, - strategySegmentsLimit: { - type: 'number', - description: - 'The maximum number of segments that can be applied to a single strategy.', - example: 5, - deprecated: true, - }, resourceLimits: { $ref: resourceLimitsSchema.$id, description: resourceLimitsSchema.description, diff --git a/src/lib/routes/admin-api/config.test.ts b/src/lib/routes/admin-api/config.test.ts index fea4ada769..eae2618b37 100644 --- a/src/lib/routes/admin-api/config.test.ts +++ b/src/lib/routes/admin-api/config.test.ts @@ -53,8 +53,12 @@ test('should get ui config', async () => { expect(body.slogan).toEqual('hello'); expect(body.headerBackground).toEqual('red'); - expect(body.segmentValuesLimit).toEqual(DEFAULT_SEGMENT_VALUES_LIMIT); - expect(body.strategySegmentsLimit).toEqual(DEFAULT_STRATEGY_SEGMENTS_LIMIT); + expect(body.resourceLimits!.segmentValues).toEqual( + DEFAULT_SEGMENT_VALUES_LIMIT, + ); + expect(body.resourceLimits!.strategySegments).toEqual( + DEFAULT_STRATEGY_SEGMENTS_LIMIT, + ); }); test('should update CORS settings', async () => { diff --git a/src/lib/routes/admin-api/config.ts b/src/lib/routes/admin-api/config.ts index c7e69afea7..47467480fe 100644 --- a/src/lib/routes/admin-api/config.ts +++ b/src/lib/routes/admin-api/config.ts @@ -191,8 +191,6 @@ class ConfigController extends Controller { unleashUrl: this.config.server.unleashUrl, baseUriPath: this.config.server.baseUriPath, authenticationType: this.config.authentication?.type, - segmentValuesLimit: this.config.resourceLimits.segmentValues, - strategySegmentsLimit: this.config.resourceLimits.strategySegments, frontendApiOrigins: frontendSettings.frontendApiOrigins, versionInfo: await this.versionService.getVersionInfo(), prometheusAPIAvailable: this.config.prometheusApi !== undefined,