diff --git a/x-pack/plugins/security_solution/public/common/components/autocomplete/field.tsx b/x-pack/plugins/security_solution/public/common/components/autocomplete/field.tsx index f87bf3137765f..2aa71f0d9b5ad 100644 --- a/x-pack/plugins/security_solution/public/common/components/autocomplete/field.tsx +++ b/x-pack/plugins/security_solution/public/common/components/autocomplete/field.tsx @@ -122,16 +122,16 @@ const getAvailableFields = ( selectedFields: IFieldType[], fieldTypeFilter: string[] ): IFieldType[] => { - const map = new Map(); + const fieldsByName = new Map(); - existingFields.forEach((f) => map.set(f.name, f)); - selectedFields.forEach((f) => map.set(f.name, f)); + existingFields.forEach((f) => fieldsByName.set(f.name, f)); + selectedFields.forEach((f) => fieldsByName.set(f.name, f)); - const array = Array.from(map.values()); + const uniqueFields = Array.from(fieldsByName.values()); if (fieldTypeFilter.length > 0) { - return array.filter(({ type }) => fieldTypeFilter.includes(type)); + return uniqueFields.filter(({ type }) => fieldTypeFilter.includes(type)); } - return array; + return uniqueFields; }; diff --git a/x-pack/plugins/security_solution/public/common/components/links_to_docs/doc_link.tsx b/x-pack/plugins/security_solution/public/common/components/links_to_docs/doc_link.tsx index f02e4390db02f..6bd180c6fd510 100644 --- a/x-pack/plugins/security_solution/public/common/components/links_to_docs/doc_link.tsx +++ b/x-pack/plugins/security_solution/public/common/components/links_to_docs/doc_link.tsx @@ -22,7 +22,11 @@ const DocLink: FC = ({ guidePath = 'security', docPath, linkText } const url = `${ELASTIC_WEBSITE_URL}guide/en/${guidePath}/${DOC_LINK_VERSION}/${docPath}`; const ariaLabel = `${linkText} - ${COMMON_ARIA_LABEL_ENDING}`; - return ; + return ( + + {linkText} + + ); }; /** diff --git a/x-pack/plugins/security_solution/public/common/components/links_to_docs/external_link.tsx b/x-pack/plugins/security_solution/public/common/components/links_to_docs/external_link.tsx index f83c6f8fe31e4..d953ed2d706e5 100644 --- a/x-pack/plugins/security_solution/public/common/components/links_to_docs/external_link.tsx +++ b/x-pack/plugins/security_solution/public/common/components/links_to_docs/external_link.tsx @@ -5,21 +5,34 @@ */ import React, { FC } from 'react'; -import { EuiLink } from '@elastic/eui'; +import { EuiLink, EuiToolTip } from '@elastic/eui'; interface ExternalLinkProps { url: string; - text: string; + children?: React.ReactNode; ariaLabel?: string; } /** - * A simplistic text link for opening external urls in a new browser tab. + * A link for opening external urls in a new browser tab. */ -export const ExternalLink: FC = ({ url, text, ariaLabel }) => { +export const ExternalLink: FC = ({ url, children, ariaLabel }) => { + if (!children) { + return null; + } + return ( - - {text} - + + + {children} + + ); };