query.ts 312 B

123456789101112
  1. import _ from 'lodash';
  2. import { DataQuery } from '@grafana/ui/';
  3. export const getNextRefIdChar = (queries: DataQuery[]): string => {
  4. const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  5. return _.find(letters, refId => {
  6. return _.every(queries, other => {
  7. return other.refId !== refId;
  8. });
  9. });
  10. };