Skip to content

Commit e1e6da7

Browse files
authored
Add observability-search link rendering for integrations (opensearch-project#1642)
* Add observability-search link rendering for integrations Signed-off-by: Simeon Widdis <[email protected]> * Update snapshots Signed-off-by: Simeon Widdis <[email protected]> --------- Signed-off-by: Simeon Widdis <[email protected]>
1 parent bccdc31 commit e1e6da7

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

common/constants/integrations.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
*/
55

66
export const OPENSEARCH_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest/integrations/index';
7-
export const ASSET_FILTER_OPTIONS = ['index-pattern', 'search', 'visualization', 'dashboard'];
7+
export const ASSET_FILTER_OPTIONS = [
8+
'index-pattern',
9+
'search',
10+
'visualization',
11+
'dashboard',
12+
'observability-search',
13+
];
814
export const VALID_INDEX_NAME = /^[a-z\d\.][a-z\d\._\-\*]*$/;
915

1016
// Upstream doesn't export this, so we need to redeclare it for our use.

public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap

+20
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,11 @@ exports[`Added Integration View Test Renders added integration view using dummy
453453
"value": "dashboard",
454454
"view": "dashboard",
455455
},
456+
Object {
457+
"name": "observability-search",
458+
"value": "observability-search",
459+
"view": "observability-search",
460+
},
456461
],
457462
"type": "field_value_selection",
458463
},
@@ -495,6 +500,11 @@ exports[`Added Integration View Test Renders added integration view using dummy
495500
"value": "dashboard",
496501
"view": "dashboard",
497502
},
503+
Object {
504+
"name": "observability-search",
505+
"value": "observability-search",
506+
"view": "observability-search",
507+
},
498508
],
499509
"type": "field_value_selection",
500510
},
@@ -652,6 +662,11 @@ exports[`Added Integration View Test Renders added integration view using dummy
652662
"value": "dashboard",
653663
"view": "dashboard",
654664
},
665+
Object {
666+
"name": "observability-search",
667+
"value": "observability-search",
668+
"view": "observability-search",
669+
},
655670
],
656671
"type": "field_value_selection",
657672
},
@@ -709,6 +724,11 @@ exports[`Added Integration View Test Renders added integration view using dummy
709724
"value": "dashboard",
710725
"view": "dashboard",
711726
},
727+
Object {
728+
"name": "observability-search",
729+
"value": "observability-search",
730+
"view": "observability-search",
731+
},
712732
],
713733
"type": "field_value_selection",
714734
}

public/components/integrations/components/added_integration.tsx

+12
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,18 @@ export function AddedIntegration(props: AddedIntegrationProps) {
220220
{_.truncate(record.description, { length: 100 })}
221221
</EuiLink>
222222
);
223+
case 'observability-search':
224+
return (
225+
<EuiLink
226+
data-test-subj={`SavedQueryLink`}
227+
data-click-metric-element="integrations.saved_query_link"
228+
onClick={() =>
229+
window.location.assign(`observability-logs#/explorer/${record.assetId}`)
230+
}
231+
>
232+
{_.truncate(record.description, { length: 100 })}
233+
</EuiLink>
234+
);
223235
default:
224236
return (
225237
<EuiText data-test-subj={`IntegrationAssetText`}>

0 commit comments

Comments
 (0)