grafana/public/app/core/utils/query.ts

13 lines
312 B
TypeScript
Raw Normal View History

2019-03-15 00:20:33 +08:00
import _ from 'lodash';
import { DataQuery } from '@grafana/ui/';
2019-03-18 18:17:58 +08:00
export const getNextRefIdChar = (queries: DataQuery[]): string => {
2019-03-15 00:20:33 +08:00
const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
return _.find(letters, refId => {
return _.every(queries, other => {
return other.refId !== refId;
});
});
};