From bf7c5aaf29e475979023a607a4f318b5f005d0d8 Mon Sep 17 00:00:00 2001 From: Philippe Oberti Date: Fri, 18 Oct 2024 13:09:02 -0500 Subject: [PATCH] [Security Solution][Notes] - fix an issue that breaks the notes management page, an enum value was missing from the api (#196912) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary _**Notes: please ignore the spaces introduced in the first commit, Webstorm is trying to be smart... CI should take care of fixing that in a second commit shortly**_ This PR fixes a small issue that prevents the notes management page to load. The issue comes from the fact that one of the enum values passed to filter notes was missing from the open api spec. This issue was introduced in this recent [PR](https://github.com/elastic/kibana/pull/195501). Current notes management borken page ![Screenshot 2024-10-18 at 10 30 13 AM](https://github.com/user-attachments/assets/4926a62f-1ebf-4698-8a13-bf761d77f4ba) This is the error in the network tab ![Screenshot 2024-10-18 at 10 30 29 AM](https://github.com/user-attachments/assets/90b56246-c116-4050-bcfa-2c6668274e74) This PR fixes the issue ![Screenshot 2024-10-18 at 10 27 01 AM](https://github.com/user-attachments/assets/7d3338ce-ad73-4be5-b94c-15bcf0234680) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- oas_docs/output/kibana.serverless.staging.yaml | 1 + oas_docs/output/kibana.serverless.yaml | 1 + oas_docs/output/kibana.staging.yaml | 1 + oas_docs/output/kibana.yaml | 1 + .../common/api/timeline/get_notes/get_notes_route.gen.ts | 1 + .../api/timeline/get_notes/get_notes_route.schema.yaml | 9 +++++---- ..._solution_timeline_api_2023_10_31.bundled.schema.yaml | 1 + ..._solution_timeline_api_2023_10_31.bundled.schema.yaml | 1 + 8 files changed, 12 insertions(+), 4 deletions(-) diff --git a/oas_docs/output/kibana.serverless.staging.yaml b/oas_docs/output/kibana.serverless.staging.yaml index 1ee5e2e149a1f..16781e74b0c9b 100644 --- a/oas_docs/output/kibana.serverless.staging.yaml +++ b/oas_docs/output/kibana.serverless.staging.yaml @@ -49426,6 +49426,7 @@ components: Security_Timeline_API_AssociatedFilterType: description: Filter notes based on their association with a document or saved object. enum: + - all - document_only - saved_object_only - document_and_saved_object diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 1ee5e2e149a1f..16781e74b0c9b 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -49426,6 +49426,7 @@ components: Security_Timeline_API_AssociatedFilterType: description: Filter notes based on their association with a document or saved object. enum: + - all - document_only - saved_object_only - document_and_saved_object diff --git a/oas_docs/output/kibana.staging.yaml b/oas_docs/output/kibana.staging.yaml index 7326d9c10436d..8dc1e3614b18f 100644 --- a/oas_docs/output/kibana.staging.yaml +++ b/oas_docs/output/kibana.staging.yaml @@ -58192,6 +58192,7 @@ components: Security_Timeline_API_AssociatedFilterType: description: Filter notes based on their association with a document or saved object. enum: + - all - document_only - saved_object_only - document_and_saved_object diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 7326d9c10436d..8dc1e3614b18f 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -58192,6 +58192,7 @@ components: Security_Timeline_API_AssociatedFilterType: description: Filter notes based on their association with a document or saved object. enum: + - all - document_only - saved_object_only - document_and_saved_object diff --git a/x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.gen.ts b/x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.gen.ts index 41615f24d011c..151fb05f41856 100644 --- a/x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.gen.ts +++ b/x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.gen.ts @@ -23,6 +23,7 @@ import { Note } from '../model/components.gen'; */ export type AssociatedFilterType = z.infer; export const AssociatedFilterType = z.enum([ + 'all', 'document_only', 'saved_object_only', 'document_and_saved_object', diff --git a/x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.schema.yaml b/x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.schema.yaml index 734a9580dcd23..019c11baa7386 100644 --- a/x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.schema.yaml +++ b/x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.schema.yaml @@ -75,10 +75,11 @@ components: AssociatedFilterType: type: string enum: - - document_only - - saved_object_only - - document_and_saved_object - - orphan + - all + - document_only + - saved_object_only + - document_and_saved_object + - orphan description: Filter notes based on their association with a document or saved object. DocumentIds: oneOf: diff --git a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_timeline_api_2023_10_31.bundled.schema.yaml b/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_timeline_api_2023_10_31.bundled.schema.yaml index e48dafbdc0e05..7a928b357603b 100644 --- a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_timeline_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_timeline_api_2023_10_31.bundled.schema.yaml @@ -928,6 +928,7 @@ components: AssociatedFilterType: description: Filter notes based on their association with a document or saved object. enum: + - all - document_only - saved_object_only - document_and_saved_object diff --git a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_timeline_api_2023_10_31.bundled.schema.yaml b/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_timeline_api_2023_10_31.bundled.schema.yaml index fab5e022c6b06..6ffcd585d8160 100644 --- a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_timeline_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_timeline_api_2023_10_31.bundled.schema.yaml @@ -928,6 +928,7 @@ components: AssociatedFilterType: description: Filter notes based on their association with a document or saved object. enum: + - all - document_only - saved_object_only - document_and_saved_object