mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
* Show query errors under each query row * Testing a more plain error box * Font size * Make it green * Nit UI * Slight simplification of condition * New design * Update Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
21 lines
698 B
TypeScript
21 lines
698 B
TypeScript
import React from 'react';
|
|
import { useSelector } from 'react-redux';
|
|
import { ExploreId, StoreState } from '../../types';
|
|
import { LoadingState } from '@grafana/data';
|
|
import { ErrorContainer } from './ErrorContainer';
|
|
|
|
interface Props {
|
|
exploreId: ExploreId;
|
|
}
|
|
export function ResponseErrorContainer(props: Props) {
|
|
const queryResponse = useSelector((state: StoreState) => state.explore[props.exploreId]?.queryResponse);
|
|
const queryError = queryResponse?.state === LoadingState.Error ? queryResponse?.error : undefined;
|
|
|
|
// Errors with ref ids are shown below the corresponding query
|
|
if (queryError?.refId) {
|
|
return null;
|
|
}
|
|
|
|
return <ErrorContainer queryError={queryError} />;
|
|
}
|