diff --git a/packages/grafana-ui/src/themes/GlobalStyles/fonts.ts b/packages/grafana-ui/src/themes/GlobalStyles/fonts.ts index 5281d2ef6de..353baee7a90 100644 --- a/packages/grafana-ui/src/themes/GlobalStyles/fonts.ts +++ b/packages/grafana-ui/src/themes/GlobalStyles/fonts.ts @@ -75,5 +75,24 @@ export function getFontStyles(theme: GrafanaTheme2) { src: `url('${fontRoot}inter/Inter-MediumItalic.woff2') format('woff2')`, }, }, + { + /* CommitMono - monospace font for code */ + '@font-face': { + fontFamily: 'CommitMono', + fontStyle: 'normal', + fontWeight: 400, + fontDisplay: 'swap', + src: `url('${fontRoot}commitmono/CommitMono-Regular.woff2') format('woff2')`, + }, + }, + { + '@font-face': { + fontFamily: 'CommitMono', + fontStyle: 'italic', + fontWeight: 400, + fontDisplay: 'swap', + src: `url('${fontRoot}commitmono/CommitMono-Italic.woff2') format('woff2')`, + }, + }, ]); } diff --git a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/QueryTransformCard.tsx b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/QueryTransformCard.tsx index d9029e7de75..7c4297f9827 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/QueryTransformCard.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/QueryTransformCard.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/css'; -import { memo } from 'react'; +import { memo, useMemo } from 'react'; import { DataTransformerConfig, GrafanaTheme2 } from '@grafana/data'; import { t } from '@grafana/i18n'; @@ -31,26 +31,22 @@ export const QueryTransformCard = memo( return ''; }; - const getDatasourceName = (): string => { + const datasourceIcon = useMemo(() => { if (type === 'query' && 'datasource' in item && item.datasource) { try { const dsSettings = getDataSourceSrv().getInstanceSettings(item.datasource); - return dsSettings?.name || 'Unknown datasource'; + return dsSettings?.meta.info.logos.small; } catch { - return 'Unknown datasource'; + return undefined; } - } else if (type === 'expression' && 'type' in item && typeof item.type === 'string') { - // Show expression type (Math, Reduce, etc.) - return item.type.charAt(0).toUpperCase() + item.type.slice(1); } - return ''; - }; + return undefined; + }, [type, item]); const isHidden = (type === 'query' || type === 'expression') && 'hide' in item && item.hide; const icon = type === 'query' ? 'database' : type === 'expression' ? 'calculator-alt' : 'process'; const typeLabel = type === 'query' ? 'Query' : type === 'expression' ? 'Expression' : 'Transformation'; const name = getName(); - const datasourceName = getDatasourceName(); const handleAction = (e: React.MouseEvent, action: () => void) => { e.stopPropagation(); @@ -131,10 +127,14 @@ export const QueryTransformCard = memo( - {/* Content: Name and datasource */} + {/* Content: Name */}