Explore: Generate log row uid (#18994)

This commit is contained in:
Andrej Ocenas
2019-09-30 14:44:15 +02:00
committed by GitHub
parent ccba986bc2
commit 0490dbb88d
14 changed files with 129 additions and 58 deletions

View File

@@ -1,6 +1,6 @@
import { Field, DataFrame, FieldType, guessFieldTypeForField } from '../index';
interface FieldWithIndex extends Field {
export interface FieldWithIndex extends Field {
index: number;
}

View File

@@ -48,6 +48,7 @@ export interface LogRowModel {
timeEpochMs: number;
timeLocal: string;
timeUtc: string;
uid: string;
uniqueLabels?: Labels;
}

View File

@@ -33,6 +33,7 @@ describe('getRowContexts', () => {
timeLocal: '',
timeUtc: '',
timestamp: '4',
uid: '1',
};
let called = false;
@@ -65,6 +66,7 @@ describe('getRowContexts', () => {
timeLocal: '',
timeUtc: '',
timestamp: '4',
uid: '1',
};
let called = false;

View File

@@ -105,7 +105,7 @@ class UnThemedLogRows extends PureComponent<Props, State> {
!deferLogs && // Only inject highlighterExpression in the first set for performance reasons
firstRows.map((row, index) => (
<LogRow
key={index}
key={row.uid}
getRows={getRows}
getRowContext={getRowContext}
highlighterExpressions={highlighterExpressions}
@@ -122,7 +122,7 @@ class UnThemedLogRows extends PureComponent<Props, State> {
renderAll &&
lastRows.map((row, index) => (
<LogRow
key={PREVIEW_LIMIT + index}
key={row.uid}
getRows={getRows}
getRowContext={getRowContext}
row={row}