From e1e6da7e88e7eef2f8c6b59472f822ccd9fad071 Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Tue, 16 Apr 2024 14:47:28 -0700 Subject: [PATCH] Add observability-search link rendering for integrations (#1642) * Add observability-search link rendering for integrations Signed-off-by: Simeon Widdis * Update snapshots Signed-off-by: Simeon Widdis --------- Signed-off-by: Simeon Widdis --- common/constants/integrations.ts | 8 +++++++- .../added_integration.test.tsx.snap | 20 +++++++++++++++++++ .../components/added_integration.tsx | 12 +++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/common/constants/integrations.ts b/common/constants/integrations.ts index 2d31c3c0f5..327d3b5b7b 100644 --- a/common/constants/integrations.ts +++ b/common/constants/integrations.ts @@ -4,7 +4,13 @@ */ export const OPENSEARCH_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest/integrations/index'; -export const ASSET_FILTER_OPTIONS = ['index-pattern', 'search', 'visualization', 'dashboard']; +export const ASSET_FILTER_OPTIONS = [ + 'index-pattern', + 'search', + 'visualization', + 'dashboard', + 'observability-search', +]; export const VALID_INDEX_NAME = /^[a-z\d\.][a-z\d\._\-\*]*$/; // Upstream doesn't export this, so we need to redeclare it for our use. diff --git a/public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap b/public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap index 648c682511..0c52dc1e85 100644 --- a/public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap +++ b/public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap @@ -453,6 +453,11 @@ exports[`Added Integration View Test Renders added integration view using dummy "value": "dashboard", "view": "dashboard", }, + Object { + "name": "observability-search", + "value": "observability-search", + "view": "observability-search", + }, ], "type": "field_value_selection", }, @@ -495,6 +500,11 @@ exports[`Added Integration View Test Renders added integration view using dummy "value": "dashboard", "view": "dashboard", }, + Object { + "name": "observability-search", + "value": "observability-search", + "view": "observability-search", + }, ], "type": "field_value_selection", }, @@ -652,6 +662,11 @@ exports[`Added Integration View Test Renders added integration view using dummy "value": "dashboard", "view": "dashboard", }, + Object { + "name": "observability-search", + "value": "observability-search", + "view": "observability-search", + }, ], "type": "field_value_selection", }, @@ -709,6 +724,11 @@ exports[`Added Integration View Test Renders added integration view using dummy "value": "dashboard", "view": "dashboard", }, + Object { + "name": "observability-search", + "value": "observability-search", + "view": "observability-search", + }, ], "type": "field_value_selection", } diff --git a/public/components/integrations/components/added_integration.tsx b/public/components/integrations/components/added_integration.tsx index 7378426d51..3031b2d7ba 100644 --- a/public/components/integrations/components/added_integration.tsx +++ b/public/components/integrations/components/added_integration.tsx @@ -220,6 +220,18 @@ export function AddedIntegration(props: AddedIntegrationProps) { {_.truncate(record.description, { length: 100 })} ); + case 'observability-search': + return ( + + window.location.assign(`observability-logs#/explorer/${record.assetId}`) + } + > + {_.truncate(record.description, { length: 100 })} + + ); default: return (