[APM] Uses doc link service instead of ElasticDocsLink for linking custom links (#111149) (#111334)

This commit is contained in:
István Zoltán Szabó 2021-09-07 13:28:42 +02:00 committed by GitHub
parent cd622af391
commit e7aef42036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 10 deletions

View file

@ -12,6 +12,7 @@ readonly links: {
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly customLinks: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;

File diff suppressed because one or more lines are too long

View file

@ -34,6 +34,7 @@ export class DocLinksService {
apm: {
kibanaSettings: `${KIBANA_DOCS}apm-settings-in-kibana.html`,
supportedServiceMaps: `${KIBANA_DOCS}service-maps.html#service-maps-supported`,
customLinks: `${KIBANA_DOCS}custom-links.html`,
droppedTransactionSpans: `${APM_DOCS}get-started/${DOC_LINK_VERSION}/transaction-spans.html#dropped-spans`,
upgrading: `${APM_DOCS}server/${DOC_LINK_VERSION}/upgrading.html`,
metaData: `${APM_DOCS}get-started/${DOC_LINK_VERSION}/metadata.html`,
@ -464,6 +465,7 @@ export interface DocLinksStart {
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly customLinks: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;

View file

@ -477,6 +477,7 @@ export interface DocLinksStart {
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly customLinks: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;

View file

@ -6,19 +6,14 @@
*/
import React from 'react';
import { ElasticDocsLink } from '../../../../../shared/Links/ElasticDocsLink';
import { EuiLink } from '@elastic/eui';
import { useApmPluginContext } from '../../../../../../context/apm_plugin/use_apm_plugin_context';
interface Props {
label: string;
}
export function Documentation({ label }: Props) {
return (
<ElasticDocsLink
section="/kibana"
path="/custom-links.html"
target="_blank"
>
{label}
</ElasticDocsLink>
);
const { docLinks } = useApmPluginContext().core;
return <EuiLink href={docLinks.links.apm.customLinks}>{label}</EuiLink>;
}