diff --git a/public/app/features/query/components/QueryEditorRow.test.tsx b/public/app/features/query/components/QueryEditorRow.test.tsx index b10e0617b8e..ae1bf9acc33 100644 --- a/public/app/features/query/components/QueryEditorRow.test.tsx +++ b/public/app/features/query/components/QueryEditorRow.test.tsx @@ -181,6 +181,7 @@ describe('frame results with warnings', () => { const metaInfo = { notices: [ { + severity: 'info', text: 'For your info, something is up.', }, ], @@ -192,6 +193,7 @@ describe('frame results with warnings', () => { text: 'Reduce operation is not needed. Input query or expression A is already reduced data.', }, { + severity: 'info', text: 'For your info, something is up.', }, ], diff --git a/public/app/features/query/components/QueryEditorRow.tsx b/public/app/features/query/components/QueryEditorRow.tsx index 143a5b8a384..7094901511f 100644 --- a/public/app/features/query/components/QueryEditorRow.tsx +++ b/public/app/features/query/components/QueryEditorRow.tsx @@ -398,17 +398,7 @@ export class QueryEditorRow extends PureComponent item.severity === 'warning'; - } else { - // The first condition is because sometimes info notices are not marked as info. - // We don't filter on severity not being equal to warnings because there's still - // the error severity, which does not seem to be used as errors are indicated - // separately, but we do this just to be safe. - criterion = (item: QueryResultMetaNotice) => !('severity' in item) || item.severity === 'info'; - } - const warnings = filter(serie.meta.notices, criterion) ?? []; + const warnings = filter(serie.meta.notices, (item: QueryResultMetaNotice) => item.severity === type) ?? []; return acc.concat(warnings); }, []);