From 1ffeb7c365a06292b4b878ddc06efc8065efc23d Mon Sep 17 00:00:00 2001 From: Leon Sorokin Date: Wed, 27 Mar 2024 13:19:13 -0500 Subject: [PATCH] StateTimeline: Fix data links causing unrendering of string fields (#85260) --- public/app/core/components/GraphNG/GraphNG.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/core/components/GraphNG/GraphNG.tsx b/public/app/core/components/GraphNG/GraphNG.tsx index 9dd45cc312a..193c29705b3 100644 --- a/public/app/core/components/GraphNG/GraphNG.tsx +++ b/public/app/core/components/GraphNG/GraphNG.tsx @@ -106,14 +106,14 @@ export class GraphNG extends Component { const preparePlotFrameFn = preparePlotFrame ?? defaultPreparePlotFrame; - const matchY = fieldMatchers.get(FieldMatcherID.byTypes).get(new Set([FieldType.number, FieldType.enum])); + const matchYDefault = fieldMatchers.get(FieldMatcherID.byTypes).get(new Set([FieldType.number, FieldType.enum])); // if there are data links, we have to keep all fields so they're index-matched, then filter out dimFields.y const withLinks = frames.some((frame) => frame.fields.some((field) => (field.config.links?.length ?? 0) > 0)); const dimFields = fields ?? { x: fieldMatchers.get(FieldMatcherID.firstTimeField).get({}), - y: withLinks ? () => true : matchY, + y: withLinks ? () => true : matchYDefault, }; const alignedFrame = preparePlotFrameFn(frames, dimFields, props.timeRange); @@ -150,7 +150,7 @@ export class GraphNG extends Component { // filter join field and dimFields.y alignedFrameFinal = { ...alignedFrame, - fields: alignedFrame.fields.filter((field, i) => i === 0 || matchY(field, alignedFrame, [alignedFrame])), + fields: alignedFrame.fields.filter((field, i) => i === 0 || dimFields.y(field, alignedFrame, [alignedFrame])), }; }