mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: Change datasourceName usage to datasourceUID or datasourceRef where appropriate (#52479)
* First pass at using datasource UID when appropriate * Fix tests * be more lenient with lookup to accomodate different URLs * Make test setup get mock work like real datasource get * Fix the typing issue and remaining tests * Fix PR feedback
This commit is contained in:
@@ -2,7 +2,7 @@ import { createAction } from '@reduxjs/toolkit';
|
||||
import { AnyAction } from 'redux';
|
||||
|
||||
import { ExploreUrlState, serializeStateToUrlParam, SplitOpen, UrlQueryMap } from '@grafana/data';
|
||||
import { DataSourceSrv, getDataSourceSrv, locationService } from '@grafana/runtime';
|
||||
import { DataSourceSrv, locationService } from '@grafana/runtime';
|
||||
import { GetExploreUrlArguments, stopQueryState } from 'app/core/utils/explore';
|
||||
import { PanelModel } from 'app/features/dashboard/state';
|
||||
import { ExploreId, ExploreItemState, ExploreState } from 'app/types/explore';
|
||||
@@ -108,9 +108,8 @@ export const splitOpen: SplitOpen = (options): ThunkResult<void> => {
|
||||
let rightUrlState: ExploreUrlState = leftUrlState;
|
||||
|
||||
if (options) {
|
||||
const datasourceName = getDataSourceSrv().getInstanceSettings(options.datasourceUid)?.name || '';
|
||||
rightUrlState = {
|
||||
datasource: datasourceName,
|
||||
datasource: options.datasourceUid,
|
||||
queries: [options.query],
|
||||
range: options.range || leftState.range,
|
||||
panelsState: options.panelsState,
|
||||
|
Reference in New Issue
Block a user