diff --git a/public/app/features/dashboard/components/TransformationsEditor/TransformationEditorHelpDisplay.tsx b/public/app/features/dashboard/components/TransformationsEditor/TransformationEditorHelpDisplay.tsx index 3bca17be7c8..5cb6ba0e684 100644 --- a/public/app/features/dashboard/components/TransformationsEditor/TransformationEditorHelpDisplay.tsx +++ b/public/app/features/dashboard/components/TransformationsEditor/TransformationEditorHelpDisplay.tsx @@ -1,8 +1,7 @@ import { TransformerRegistryItem } from '@grafana/data'; import { Drawer } from '@grafana/ui'; import { OperationRowHelp } from 'app/core/components/QueryOperationRow/OperationRowHelp'; - -import { getLinkToDocs } from '../../../transformers/docs/content'; +import { FALLBACK_DOCS_LINK } from 'app/features/transformers/docs/constants'; interface TransformationEditorHelpDisplayProps { isOpen: boolean; @@ -20,7 +19,8 @@ export const TransformationEditorHelpDisplay = ({ help, } = transformer; - const helpContent = help ? help : getLinkToDocs(); + const helpContent = help ? help : FALLBACK_DOCS_LINK; + const helpElement = ( onCloseClick(false)}> diff --git a/public/app/features/transformers/docs/constants.ts b/public/app/features/transformers/docs/constants.ts new file mode 100644 index 00000000000..5ff9bdb4e58 --- /dev/null +++ b/public/app/features/transformers/docs/constants.ts @@ -0,0 +1 @@ +export const FALLBACK_DOCS_LINK = `Go to the transformation documentation for more general documentation.`; diff --git a/public/app/features/transformers/docs/content.ts b/public/app/features/transformers/docs/content.ts index 273cbe22c94..72726236b52 100644 --- a/public/app/features/transformers/docs/content.ts +++ b/public/app/features/transformers/docs/content.ts @@ -1610,14 +1610,6 @@ ${buildImageContent( }, }; -export function getLinkToDocs(): string { - return ` - Go to the - transformation documentation - for more general documentation. - `; -} - function buildImageContent(source: string, imageRenderType: ImageRenderType, imageAltText: string) { return imageRenderType === 'shortcodeFigure' ? // This will build a Hugo Shortcode "figure" image template, which shares the same default class and max-width. diff --git a/public/app/features/transformers/docs/getTransformationContent.ts b/public/app/features/transformers/docs/getTransformationContent.ts index 800c37af4d8..2989eb6389b 100644 --- a/public/app/features/transformers/docs/getTransformationContent.ts +++ b/public/app/features/transformers/docs/getTransformationContent.ts @@ -1,4 +1,5 @@ -import { transformationDocsContent, getLinkToDocs, ImageRenderType } from './content'; +import { FALLBACK_DOCS_LINK } from './constants'; +import { transformationDocsContent, ImageRenderType } from './content'; export function getTransformationContent(id: string): { name: string; helperDocs: string } { if (id in transformationDocsContent) { @@ -23,7 +24,7 @@ export function getTransformationContent(id: string): { name: string; helperDocs name, helperDocs: ` ${cleansedMarkdown} - ${getLinkToDocs()} + ${FALLBACK_DOCS_LINK} ${renderedLinks} `, }; @@ -34,7 +35,7 @@ export function getTransformationContent(id: string): { name: string; helperDocs name, helperDocs: ` ${cleansedMarkdown} - ${getLinkToDocs()} + ${FALLBACK_DOCS_LINK} `, }; } @@ -42,7 +43,7 @@ export function getTransformationContent(id: string): { name: string; helperDocs // If the transformation has no documentation, return an external link to the online documentation. return { name: 'No documentation found', - helperDocs: getLinkToDocs(), + helperDocs: FALLBACK_DOCS_LINK, }; }