Add Vega help link to DocLinksService (#87721)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
bd3f5d4863
commit
e01f317d9c
|
@ -191,6 +191,7 @@ export class DocLinksService {
|
|||
lens: `${ELASTIC_WEBSITE_URL}what-is/kibana-lens`,
|
||||
lensPanels: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/lens.html`,
|
||||
maps: `${ELASTIC_WEBSITE_URL}maps`,
|
||||
vega: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/vega.html`,
|
||||
},
|
||||
observability: {
|
||||
guide: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/index.html`,
|
||||
|
|
|
@ -11,6 +11,8 @@ import { EuiButtonIcon, EuiContextMenuPanel, EuiContextMenuItem, EuiPopover } fr
|
|||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { getDocLinks } from '../services';
|
||||
|
||||
function VegaHelpMenu() {
|
||||
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
||||
const onButtonClick = useCallback(() => setIsPopoverOpen(!isPopoverOpen), [isPopoverOpen]);
|
||||
|
@ -30,7 +32,7 @@ function VegaHelpMenu() {
|
|||
const items = [
|
||||
<EuiContextMenuItem
|
||||
key="vegaHelp"
|
||||
href="https://www.elastic.co/guide/en/kibana/master/vega-graph.html"
|
||||
href={getDocLinks().links.visualize.vega}
|
||||
target="_blank"
|
||||
onClick={closePopover}
|
||||
>
|
||||
|
|
|
@ -19,6 +19,7 @@ import {
|
|||
setUISettings,
|
||||
setInjectedMetadata,
|
||||
setMapServiceSettings,
|
||||
setDocLinks,
|
||||
} from './services';
|
||||
|
||||
import { createVegaFn } from './vega_fn';
|
||||
|
@ -96,5 +97,6 @@ export class VegaPlugin implements Plugin<void, void> {
|
|||
setNotifications(core.notifications);
|
||||
setData(data);
|
||||
setInjectedMetadata(core.injectedMetadata);
|
||||
setDocLinks(core.docLinks);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { CoreStart, NotificationsStart, IUiSettingsClient } from 'src/core/public';
|
||||
import { CoreStart, NotificationsStart, IUiSettingsClient, DocLinksStart } from 'src/core/public';
|
||||
|
||||
import { DataPublicPluginStart } from '../../data/public';
|
||||
import { createGetterSetter } from '../../kibana_utils/public';
|
||||
|
@ -35,3 +35,5 @@ export const [getInjectedVars, setInjectedVars] = createGetterSetter<{
|
|||
}>('InjectedVars');
|
||||
|
||||
export const getEnableExternalUrls = () => getInjectedVars().enableExternalUrls;
|
||||
|
||||
export const [getDocLinks, setDocLinks] = createGetterSetter<DocLinksStart>('docLinks');
|
||||
|
|
Loading…
Reference in a new issue