[v10.3.x] Logs: Fix toggleable filters to be applied for specified query (#81376)

Logs: Fix toggleable filters to be applied for specified query (#81368)

(cherry picked from commit 8c212a1952)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-01-26 16:11:13 +01:00
committed by GitHub
co-authored by Ivana Huckova
parent 537d7b46cf
commit e6d2e4d8fe
2 changed files with 7 additions and 0 deletions
@@ -1549,6 +1549,7 @@ const mockLogRow = {
},
{ name: 'labels', type: FieldType.other, values: [{ app: 'app01' }, { app: 'app02' }] },
],
refId: 'Z',
}),
rowIndex: 0,
} as unknown as LogRowModel;
@@ -1587,4 +1588,9 @@ describe('logRowToDataFrame', () => {
expect(result).toBe(null);
});
it('should use refId from original DataFrame', () => {
const result = logRowToSingleRowDataFrame(mockLogRow);
expect(result?.refId).toBe(mockLogRow.dataFrame.refId);
});
});
+1
View File
@@ -809,6 +809,7 @@ export function logRowToSingleRowDataFrame(logRow: LogRowModel): DataFrame | nul
// create a new data frame containing only the single row from `logRow`
const frame = createDataFrame({
fields: originFrame.fields.map((field) => ({ ...field, values: [field.values[logRow.rowIndex]] })),
refId: originFrame.refId,
});
return frame;