2019-10-15 22:37:31 +02:00
|
|
|
/*
|
|
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { EuiHorizontalRule, EuiSpacer, EuiLink, EuiText, EuiIcon, EuiButton } from '@elastic/eui';
|
|
|
|
import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links';
|
|
|
|
import { i18n } from '@kbn/i18n';
|
|
|
|
import { FormattedMessage } from '@kbn/i18n/react';
|
|
|
|
import { render, unmountComponentAtNode } from 'react-dom';
|
2019-11-20 12:06:53 +01:00
|
|
|
import { ChromeStart } from 'kibana/public';
|
2019-10-15 22:37:31 +02:00
|
|
|
|
2019-10-29 22:43:39 +01:00
|
|
|
const docsPage = 'lens';
|
2019-10-15 22:37:31 +02:00
|
|
|
|
2019-11-20 12:06:53 +01:00
|
|
|
export function addHelpMenuToAppChrome(chrome: ChromeStart) {
|
|
|
|
chrome.setHelpExtension(domElement => {
|
2019-10-15 22:37:31 +02:00
|
|
|
render(<HelpMenu />, domElement);
|
|
|
|
return () => {
|
|
|
|
unmountComponentAtNode(domElement);
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function HelpMenu() {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<EuiHorizontalRule margin="none" />
|
|
|
|
{docsPage && (
|
|
|
|
<>
|
|
|
|
<EuiSpacer />
|
|
|
|
<EuiButton
|
|
|
|
fill
|
|
|
|
iconType="popout"
|
|
|
|
href={`${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/${docsPage}.html`}
|
|
|
|
target="_blank"
|
|
|
|
>
|
|
|
|
<FormattedMessage
|
|
|
|
id="xpack.lens.helpMenu.docLabel"
|
|
|
|
defaultMessage="Lens documentation"
|
|
|
|
/>
|
|
|
|
</EuiButton>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
|
|
|
|
<EuiSpacer />
|
|
|
|
<EuiText size="s">
|
|
|
|
<EuiIcon type="logoGithub" color="primary" />
|
2019-10-29 15:54:27 +01:00
|
|
|
<EuiLink href="https://github.com/elastic/kibana/issues/new/choose" target="_blank">
|
2019-10-15 22:37:31 +02:00
|
|
|
{i18n.translate('xpack.lens.helpMenu.feedbackLinkText', {
|
|
|
|
defaultMessage: 'Provide feedback for the Lens application',
|
|
|
|
})}
|
|
|
|
</EuiLink>
|
|
|
|
</EuiText>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|