revert change, and enforce table format when in explore (#50616)

This commit is contained in:
Stephanie Closson
2022-06-10 11:28:09 -03:00
committed by GitHub
parent b0ae4d460e
commit 913ac82108

View File

@@ -20,6 +20,7 @@ import {
DataQueryRequest, DataQueryRequest,
PreferredVisualisationType, PreferredVisualisationType,
DataFrameType, DataFrameType,
CoreApp,
} from '@grafana/data'; } from '@grafana/data';
import { FetchResponse, getDataSourceSrv, getTemplateSrv } from '@grafana/runtime'; import { FetchResponse, getDataSourceSrv, getTemplateSrv } from '@grafana/runtime';
@@ -47,7 +48,10 @@ interface TimeAndValue {
const isTableResult = (dataFrame: DataFrame, options: DataQueryRequest<PromQuery>): boolean => { const isTableResult = (dataFrame: DataFrame, options: DataQueryRequest<PromQuery>): boolean => {
// We want to process vector and scalar results in Explore as table // We want to process vector and scalar results in Explore as table
if (dataFrame.meta?.custom?.resultType === 'vector' || dataFrame.meta?.custom?.resultType === 'scalar') { if (
options.app === CoreApp.Explore &&
(dataFrame.meta?.custom?.resultType === 'vector' || dataFrame.meta?.custom?.resultType === 'scalar')
) {
return true; return true;
} }