diff --git a/src/plugins/discover/public/application/components/top_nav/open_options_popover.tsx b/src/plugins/discover/public/application/components/top_nav/open_options_popover.tsx index 280144d400216..e32ffa4a05de3 100644 --- a/src/plugins/discover/public/application/components/top_nav/open_options_popover.tsx +++ b/src/plugins/discover/public/application/components/top_nav/open_options_popover.tsx @@ -11,11 +11,21 @@ import ReactDOM from 'react-dom'; import { I18nStart } from 'kibana/public'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiSpacer, EuiButton, EuiText, EuiWrappingPopover, EuiCode } from '@elastic/eui'; +import { + EuiSpacer, + EuiButton, + EuiText, + EuiWrappingPopover, + EuiCode, + EuiHorizontalRule, + EuiButtonEmpty, + EuiTextAlign, +} from '@elastic/eui'; import { getServices } from '../../../kibana_services'; import './open_options_popover.scss'; import { DOC_TABLE_LEGACY } from '../../../../common'; +const container = document.createElement('div'); let isOpen = false; interface OptionsPopoverProps { @@ -77,11 +87,29 @@ export function OptionsPopover(props: OptionsPopoverProps) { defaultMessage: 'Get started', })} + + + + {i18n.translate('discover.openOptionsPopover.gotToAllSettings', { + defaultMessage: 'All Discover options', + })} + + ); } +function onClose() { + ReactDOM.unmountComponentAtNode(container); + document.body.removeChild(container); + isOpen = false; +} + export function openOptionsPopover({ I18nContext, anchorElement, @@ -90,17 +118,11 @@ export function openOptionsPopover({ anchorElement: HTMLElement; }) { if (isOpen) { + onClose(); return; } isOpen = true; - const container = document.createElement('div'); - const onClose = () => { - ReactDOM.unmountComponentAtNode(container); - document.body.removeChild(container); - isOpen = false; - }; - document.body.appendChild(container); const element = (