Skip to content

Commit

Permalink
Add observability-search link rendering for integrations (#1642)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
Swiddis authored Apr 16, 2024
1 parent bccdc31 commit e1e6da7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
8 changes: 7 additions & 1 deletion common/constants/integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -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",
}
Expand Down
12 changes: 12 additions & 0 deletions public/components/integrations/components/added_integration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,18 @@ export function AddedIntegration(props: AddedIntegrationProps) {
{_.truncate(record.description, { length: 100 })}
</EuiLink>
);
case 'observability-search':
return (
<EuiLink
data-test-subj={`SavedQueryLink`}
data-click-metric-element="integrations.saved_query_link"
onClick={() =>
window.location.assign(`observability-logs#/explorer/${record.assetId}`)
}
>
{_.truncate(record.description, { length: 100 })}
</EuiLink>
);
default:
return (
<EuiText data-test-subj={`IntegrationAssetText`}>
Expand Down

0 comments on commit e1e6da7

Please sign in to comment.