Add Vega help link to DocLinksService (#87721)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Greg Back 2021-03-25 17:57:25 -04:00 committed by GitHub
parent bd3f5d4863
commit e01f317d9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 2 deletions

View file

@ -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`,

View file

@ -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}
>

View file

@ -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);
}
}

View file

@ -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');