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) {
|
||||
// Apply field defaults & overrides
|
||||
const fieldConfig = this.dataConfigSource.getFieldOverrideOptions();
|
||||
const timeZone = data.request?.timezone ?? 'browser';
|
||||
|
||||
if (fieldConfig) {
|
||||
processedData = {
|
||||
...processedData,
|
||||
series: applyFieldOverrides({
|
||||
timeZone: data.request!.timezone,
|
||||
timeZone: timeZone,
|
||||
autoMinMax: true,
|
||||
data: processedData.series,
|
||||
...fieldConfig,
|
||||
|
@ -2,7 +2,7 @@ import { Observable } from 'rxjs';
|
||||
import { QueryRunnerOptions } from 'app/features/dashboard/state/PanelQueryRunner';
|
||||
import { DashboardQuery, SHARED_DASHBODARD_QUERY } from './types';
|
||||
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) {
|
||||
if (!datasource) {
|
||||
@ -70,6 +70,7 @@ function getQueryError(msg: string): PanelData {
|
||||
return {
|
||||
state: LoadingState.Error,
|
||||
series: [],
|
||||
request: {} as DataQueryRequest,
|
||||
error: { message: msg },
|
||||
timeRange: DefaultTimeRange,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user