mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: Fix issue when some query errors were not shown (#32212)
* Remove getFirstNonQueryRowSpecificError * Move some error handling to separate component * Update public/app/features/explore/ErrorContainer.tsx Co-authored-by: Giordano Ricci <gio.ricci@grafana.com> * Add comments * More explicit expects * Update tests with proper expects Co-authored-by: Giordano Ricci <gio.ricci@grafana.com>
This commit is contained in:
@@ -5,7 +5,6 @@ import { Unsubscribable } from 'rxjs';
|
||||
import {
|
||||
CoreApp,
|
||||
DataQuery,
|
||||
DataQueryError,
|
||||
DataQueryRequest,
|
||||
DataSourceApi,
|
||||
dateMath,
|
||||
@@ -422,14 +421,6 @@ export const getValueWithRefId = (value?: any): any => {
|
||||
return undefined;
|
||||
};
|
||||
|
||||
export const getFirstQueryErrorWithoutRefId = (errors?: DataQueryError[]): DataQueryError | undefined => {
|
||||
if (!errors) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return errors.filter((error) => (error && error.refId ? false : true))[0];
|
||||
};
|
||||
|
||||
export const getRefIds = (value: any): string[] => {
|
||||
if (!value) {
|
||||
return [];
|
||||
@@ -479,11 +470,6 @@ export function getIntervals(range: TimeRange, lowLimit?: string, resolution?: n
|
||||
return rangeUtil.calculateInterval(range, resolution, lowLimit);
|
||||
}
|
||||
|
||||
export const getFirstNonQueryRowSpecificError = (queryErrors?: DataQueryError[]): DataQueryError | undefined => {
|
||||
const refId = getValueWithRefId(queryErrors);
|
||||
return refId ? undefined : getFirstQueryErrorWithoutRefId(queryErrors);
|
||||
};
|
||||
|
||||
export const copyStringToClipboard = (string: string) => {
|
||||
const el = document.createElement('textarea');
|
||||
el.value = string;
|
||||
|
||||
Reference in New Issue
Block a user