mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
SharedQuery: Error when switching to -- Dashboard -- data source caused "no data" no matter what source panel was selected (#27627)
* SharedQuery: Error when switching to -- Dashboard -- data source made observable subscription error and subsequent data results not update visualization * added null check just in case
This commit is contained in:
parent
c450ffd711
commit
31e2b7e7c8
@ -93,11 +93,13 @@ export class PanelQueryRunner {
|
|||||||
if (withFieldConfig) {
|
if (withFieldConfig) {
|
||||||
// Apply field defaults & overrides
|
// Apply field defaults & overrides
|
||||||
const fieldConfig = this.dataConfigSource.getFieldOverrideOptions();
|
const fieldConfig = this.dataConfigSource.getFieldOverrideOptions();
|
||||||
|
const timeZone = data.request?.timezone ?? 'browser';
|
||||||
|
|
||||||
if (fieldConfig) {
|
if (fieldConfig) {
|
||||||
processedData = {
|
processedData = {
|
||||||
...processedData,
|
...processedData,
|
||||||
series: applyFieldOverrides({
|
series: applyFieldOverrides({
|
||||||
timeZone: data.request!.timezone,
|
timeZone: timeZone,
|
||||||
autoMinMax: true,
|
autoMinMax: true,
|
||||||
data: processedData.series,
|
data: processedData.series,
|
||||||
...fieldConfig,
|
...fieldConfig,
|
||||||
|
@ -2,7 +2,7 @@ import { Observable } from 'rxjs';
|
|||||||
import { QueryRunnerOptions } from 'app/features/dashboard/state/PanelQueryRunner';
|
import { QueryRunnerOptions } from 'app/features/dashboard/state/PanelQueryRunner';
|
||||||
import { DashboardQuery, SHARED_DASHBODARD_QUERY } from './types';
|
import { DashboardQuery, SHARED_DASHBODARD_QUERY } from './types';
|
||||||
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
|
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
|
||||||
import { LoadingState, DefaultTimeRange, DataQuery, PanelData, DataSourceApi } from '@grafana/data';
|
import { LoadingState, DefaultTimeRange, DataQuery, PanelData, DataSourceApi, DataQueryRequest } from '@grafana/data';
|
||||||
|
|
||||||
export function isSharedDashboardQuery(datasource: string | DataSourceApi | null) {
|
export function isSharedDashboardQuery(datasource: string | DataSourceApi | null) {
|
||||||
if (!datasource) {
|
if (!datasource) {
|
||||||
@ -70,6 +70,7 @@ function getQueryError(msg: string): PanelData {
|
|||||||
return {
|
return {
|
||||||
state: LoadingState.Error,
|
state: LoadingState.Error,
|
||||||
series: [],
|
series: [],
|
||||||
|
request: {} as DataQueryRequest,
|
||||||
error: { message: msg },
|
error: { message: msg },
|
||||||
timeRange: DefaultTimeRange,
|
timeRange: DefaultTimeRange,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user