diff --git a/public/app/features/panel/components/PanelDataErrorView.tsx b/public/app/features/panel/components/PanelDataErrorView.tsx index 4520cc1ea09..35baee77e1c 100644 --- a/public/app/features/panel/components/PanelDataErrorView.tsx +++ b/public/app/features/panel/components/PanelDataErrorView.tsx @@ -64,7 +64,8 @@ function getMessageFor( return message; } - if (!data.series || data.series.length === 0) { + // In some cases there is a data frame but with no fields + if (!data.series || data.series.length === 0 || (data.series.length === 1 && data.series[0].fields.length === 0)) { return 'No data'; } diff --git a/public/app/plugins/panel/logs/LogsPanel.tsx b/public/app/plugins/panel/logs/LogsPanel.tsx index 7df81c7b65f..d5cc9973979 100644 --- a/public/app/plugins/panel/logs/LogsPanel.tsx +++ b/public/app/plugins/panel/logs/LogsPanel.tsx @@ -15,6 +15,7 @@ import { Options } from './types'; import { dataFrameToLogsModel, dedupLogRows } from 'app/core/logs_model'; import { getFieldLinksForExplore } from 'app/features/explore/utils/links'; import { COMMON_LABELS } from '../../../core/logs_model'; +import { PanelDataErrorView } from 'app/features/panel/components/PanelDataErrorView'; interface LogsPanelProps extends PanelProps {} @@ -32,6 +33,7 @@ export const LogsPanel: React.FunctionComponent = ({ enableLogDetails, }, title, + id, }) => { const isAscending = sortOrder === LogsSortOrder.Ascending; const style = useStyles2(getStyles(title, isAscending)); @@ -80,12 +82,8 @@ export const LogsPanel: React.FunctionComponent = ({ [data] ); - if (!data) { - return ( -
-

No data found in response

-
- ); + if (!data || logRows.length === 0) { + return ; } const renderCommonLabels = () => (