From aa3f9b046572af8911fb0fb5485d4f85fcb67763 Mon Sep 17 00:00:00 2001 From: Ryland Herrick Date: Thu, 1 Oct 2020 12:37:23 -0500 Subject: [PATCH] Update EQL overview link to point to elasticsearch docs Adds an entry in our doclinks service, and uses that. --- .../public/doc_links/doc_links_service.ts | 2 ++ .../rules/eql_query_bar/eql_overview_link.tsx | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index 47f58a3a9fcb..629bf97c2488 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -119,6 +119,7 @@ export class DocLinksService { gettingStarted: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/index.html`, }, query: { + eql: `${ELASTICSEARCH_DOCS}eql.html`, luceneQuerySyntax: `${ELASTICSEARCH_DOCS}query-dsl-query-string-query.html#query-string-syntax`, queryDsl: `${ELASTICSEARCH_DOCS}query-dsl.html`, kueryQuerySyntax: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kuery-query.html`, @@ -227,6 +228,7 @@ export interface DocLinksStart { readonly gettingStarted: string; }; readonly query: { + readonly eql: string; readonly luceneQuerySyntax: string; readonly queryDsl: string; readonly kueryQuerySyntax: string; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/eql_query_bar/eql_overview_link.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/eql_query_bar/eql_overview_link.tsx index 22712b261b5a..e9891fc066ec 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/eql_query_bar/eql_overview_link.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/eql_query_bar/eql_overview_link.tsx @@ -6,18 +6,21 @@ import React from 'react'; import styled from 'styled-components'; - import { EuiLink, EuiText } from '@elastic/eui'; -import { EQL_OVERVIEW_LINK_TEXT } from './translations'; -const EQL_OVERVIEW_URL = 'https://eql.readthedocs.io/en/latest/query-guide/index.html'; +import { useKibana } from '../../../../common/lib/kibana'; +import { EQL_OVERVIEW_LINK_TEXT } from './translations'; const InlineText = styled(EuiText)` display: inline-block; `; -export const EqlOverviewLink = () => ( - - {EQL_OVERVIEW_LINK_TEXT} - -); +export const EqlOverviewLink = () => { + const overviewUrl = useKibana().services.docLinks.links.query.eql; + + return ( + + {EQL_OVERVIEW_LINK_TEXT} + + ); +};