Chore: Use uuid v4 as an identifier instead of Date.now() (#27178)

This commit is contained in:
Simon Podlipsky
2020-08-26 11:38:39 +02:00
committed by GitHub
parent c5a7afce44
commit 7121d1e63f
13 changed files with 26 additions and 19 deletions

View File

@@ -25,6 +25,7 @@ import {
} from '@grafana/data';
import store from 'app/core/store';
import kbn from 'app/core/utils/kbn';
import { v4 as uuidv4 } from 'uuid';
import { getNextRefIdChar } from './query';
// Types
import { RefreshPicker } from '@grafana/ui';
@@ -265,7 +266,7 @@ export function parseUrlState(initial: string | undefined): ExploreUrlState {
}
export function generateKey(index = 0): string {
return `Q-${Date.now()}-${Math.random()}-${index}`;
return `Q-${uuidv4()}-${index}`;
}
export function generateEmptyQuery(queries: DataQuery[], index = 0): DataQuery {