From eb8e6c6a9f306b4adf39aae5b6d9266eb174067d Mon Sep 17 00:00:00 2001 From: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:10:02 -0600 Subject: [PATCH] Query Library: Display query text even when datasource doesn't have getQueryDisplayText (#93668) Display query text even when datasource doesn't have getQueryDisplayText --- .../QueryLibrary/QueryTemplatesTable/QueryDescriptionCell.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app/features/explore/QueryLibrary/QueryTemplatesTable/QueryDescriptionCell.tsx b/public/app/features/explore/QueryLibrary/QueryTemplatesTable/QueryDescriptionCell.tsx index 7d44fe5a634..4dce16f9ced 100644 --- a/public/app/features/explore/QueryLibrary/QueryTemplatesTable/QueryDescriptionCell.tsx +++ b/public/app/features/explore/QueryLibrary/QueryTemplatesTable/QueryDescriptionCell.tsx @@ -2,6 +2,7 @@ import { cx } from '@emotion/css'; import { CellProps } from 'react-table'; import { Spinner, Tooltip } from '@grafana/ui'; +import { createQueryText } from 'app/core/utils/richHistory'; import { useDatasource } from '../utils/useDatasource'; @@ -20,7 +21,7 @@ export function QueryDescriptionCell(props: CellProps) { return
No queries
; } const query = props.row.original.query; - const queryDisplayText = datasourceApi?.getQueryDisplayText?.(query) || ''; + const queryDisplayText = createQueryText(query, datasourceApi); const description = props.row.original.description; const dsName = datasourceApi?.name || '';