Transformations: Match only the field spelled time when Time is configured

When the configured name is Time and the frame has a field named time
(or the other way round), the fallback still matched every time field.
Now it only matches the field with the other spelling, and keeps
matching any time field when no field goes by either name.
This commit is contained in:
dualfroz committed 2026-10-18 07:17:46 +02:00
1 parent 47a8d79948
commit c09f0db570
2 files changed
+21 -9

No files matched your search

@@ -484,6 +484,14 @@ it('Should only match the field named time when the frame has more time fields',
expect(namesMatcher(frame.fields[0], frame, [frame])).toBeTruthy();
expect(namesMatcher(frame.fields[1], frame, [frame])).toBeFalsy();
expect(namesMatcher(frame.fields[2], frame, [frame])).toBeTruthy();
const aliasMatcher = getFieldMatcher({
id: FieldMatcherID.byName,
options: 'Time',
});
expect(aliasMatcher(frame.fields[0], frame, [frame])).toBeTruthy();
expect(aliasMatcher(frame.fields[1], frame, [frame])).toBeFalsy();
expect(aliasMatcher(frame.fields[2], frame, [frame])).toBeFalsy();
});
describe('Fields returned by query with refId', () => {