|
|
@ -5,6 +5,7 @@ import { |
|
|
|
CoreApp, |
|
|
|
CoreApp, |
|
|
|
DataQuery, |
|
|
|
DataQuery, |
|
|
|
DataSourceInstanceSettings, |
|
|
|
DataSourceInstanceSettings, |
|
|
|
|
|
|
|
DataSourceRef, |
|
|
|
EventBusExtended, |
|
|
|
EventBusExtended, |
|
|
|
HistoryItem, |
|
|
|
HistoryItem, |
|
|
|
PanelData, |
|
|
|
PanelData, |
|
|
@ -60,13 +61,18 @@ export class QueryEditorRows extends PureComponent<Props> { |
|
|
|
return item; |
|
|
|
return item; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dataSourceRef: DataSourceRef = { |
|
|
|
|
|
|
|
type: dataSource.type, |
|
|
|
|
|
|
|
uid: dataSource.uid, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (item.datasource) { |
|
|
|
if (item.datasource) { |
|
|
|
const previous = getDataSourceSrv().getInstanceSettings(item.datasource); |
|
|
|
const previous = getDataSourceSrv().getInstanceSettings(item.datasource); |
|
|
|
|
|
|
|
|
|
|
|
if (previous?.type === dataSource.type) { |
|
|
|
if (previous?.type === dataSource.type) { |
|
|
|
return { |
|
|
|
return { |
|
|
|
...item, |
|
|
|
...item, |
|
|
|
datasource: { uid: dataSource.uid }, |
|
|
|
datasource: dataSourceRef, |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -74,7 +80,7 @@ export class QueryEditorRows extends PureComponent<Props> { |
|
|
|
return { |
|
|
|
return { |
|
|
|
refId: item.refId, |
|
|
|
refId: item.refId, |
|
|
|
hide: item.hide, |
|
|
|
hide: item.hide, |
|
|
|
datasource: { uid: dataSource.uid }, |
|
|
|
datasource: dataSourceRef, |
|
|
|
}; |
|
|
|
}; |
|
|
|
}) |
|
|
|
}) |
|
|
|
); |
|
|
|
); |
|
|
|