Skip to content

Commit

Permalink
Update Vega link and pass via DocLinksService
Browse files Browse the repository at this point in the history
  • Loading branch information
gtback committed Mar 22, 2021
1 parent 5c7edfe commit 6cbb0c7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class DocLinksService {
lens: `${ELASTIC_WEBSITE_URL}what-is/kibana-lens`,
lensPanels: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/dashboard.html#create-panels-with-lens`,
maps: `${ELASTIC_WEBSITE_URL}maps`,
vega: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/vega-graph.html`,
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`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -30,8 +32,7 @@ function VegaHelpMenu() {
const items = [
<EuiContextMenuItem
key="vegaHelp"
// TODO: Replace this to use the DocLinksService
href="https://www.elastic.co/guide/en/kibana/master/vega-graph.html"
href={getDocLinks().links.visualize.vega}
target="_blank"
onClick={closePopover}
>
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/vis_type_vega/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
setUISettings,
setInjectedMetadata,
setMapServiceSettings,
setDocLinks,
} from './services';

import { createVegaFn } from './vega_fn';
Expand Down Expand Up @@ -96,5 +97,6 @@ export class VegaPlugin implements Plugin<void, void> {
setNotifications(core.notifications);
setData(data);
setInjectedMetadata(core.injectedMetadata);
setDocLinks(core.docLinks);
}
}
4 changes: 3 additions & 1 deletion src/plugins/vis_type_vega/public/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -35,3 +35,5 @@ export const [getInjectedVars, setInjectedVars] = createGetterSetter<{
}>('InjectedVars');

export const getEnableExternalUrls = () => getInjectedVars().enableExternalUrls;

export const [getDocLinks, setDocLinks] = createGetterSetter<DocLinksStart>('docLinks');

0 comments on commit 6cbb0c7

Please sign in to comment.