diff --git a/x-pack/platform/plugins/shared/spaces/server/lib/utils/space_solution_disabled_features.test.ts b/x-pack/platform/plugins/shared/spaces/server/lib/utils/space_solution_disabled_features.test.ts index f19b4d585dc22..df54365d2c6e4 100644 --- a/x-pack/platform/plugins/shared/spaces/server/lib/utils/space_solution_disabled_features.test.ts +++ b/x-pack/platform/plugins/shared/spaces/server/lib/utils/space_solution_disabled_features.test.ts @@ -13,6 +13,7 @@ const features = [ { id: 'feature2', category: { id: 'enterpriseSearch' } }, { id: 'feature3', category: { id: 'securitySolution' } }, { id: 'feature4', category: { id: 'should_not_be_returned' } }, // not a solution, it should never appeared in the disabled features + { id: 'feature6', category: { id: 'observability' }, deprecated: true }, ] as KibanaFeature[]; describe('#withSpaceSolutionDisabledFeatures', () => { @@ -85,5 +86,18 @@ describe('#withSpaceSolutionDisabledFeatures', () => { expect(result).toEqual(['feature1', 'feature2']); // "baz" from the spaceDisabledFeatures should not be removed }); + + test('it does not include deprecated features in space disabled features', () => { + const spaceDisabledFeatures: string[] = []; + const spaceSolution = 'security'; + + const result = withSpaceSolutionDisabledFeatures( + features, + spaceDisabledFeatures, + spaceSolution + ); + + expect(result).not.toContain('feature6'); + }); }); }); diff --git a/x-pack/platform/plugins/shared/spaces/server/lib/utils/space_solution_disabled_features.ts b/x-pack/platform/plugins/shared/spaces/server/lib/utils/space_solution_disabled_features.ts index 2682daf3a1c54..acef92c1de4cc 100644 --- a/x-pack/platform/plugins/shared/spaces/server/lib/utils/space_solution_disabled_features.ts +++ b/x-pack/platform/plugins/shared/spaces/server/lib/utils/space_solution_disabled_features.ts @@ -15,7 +15,8 @@ const getFeatureIdsForCategories = ( ) => { return features .filter((feature) => - feature.category + // We need to make sure we only reference non-deprecated features + feature.category && !feature.deprecated ? categories.includes( feature.category.id as 'observability' | 'enterpriseSearch' | 'securitySolution' ) diff --git a/x-pack/test/spaces_api_integration/common/suites/create.ts b/x-pack/test/spaces_api_integration/common/suites/create.ts index f319eb50aa9ce..cb9fa66d56c1b 100644 --- a/x-pack/test/spaces_api_integration/common/suites/create.ts +++ b/x-pack/test/spaces_api_integration/common/suites/create.ts @@ -80,18 +80,13 @@ export function createTestSuiteFactory(esArchiver: any, supertest: SuperTest) 'infrastructure', 'inventory', 'logs', - 'observabilityCases', - 'observabilityCasesV2', 'observabilityCasesV3', 'securitySolutionAssistant', 'securitySolutionAttackDiscovery', - 'securitySolutionCases', - 'securitySolutionCasesV2', 'securitySolutionCasesV3', 'securitySolutionNotes', 'securitySolutionSiemMigrations', 'securitySolutionTimeline', - 'siem', 'siemV2', 'slo', 'uptime', diff --git a/x-pack/test/spaces_api_integration/common/suites/get_all.ts b/x-pack/test/spaces_api_integration/common/suites/get_all.ts index d2e9a2b6313e1..a5d03290d54b4 100644 --- a/x-pack/test/spaces_api_integration/common/suites/get_all.ts +++ b/x-pack/test/spaces_api_integration/common/suites/get_all.ts @@ -79,18 +79,13 @@ const ALL_SPACE_RESULTS: Space[] = [ 'infrastructure', 'inventory', 'logs', - 'observabilityCases', - 'observabilityCasesV2', 'observabilityCasesV3', 'securitySolutionAssistant', 'securitySolutionAttackDiscovery', - 'securitySolutionCases', - 'securitySolutionCasesV2', 'securitySolutionCasesV3', 'securitySolutionNotes', 'securitySolutionSiemMigrations', 'securitySolutionTimeline', - 'siem', 'siemV2', 'slo', 'uptime',