|
|
@ -22,7 +22,7 @@ import { ROUTES as CONNECTIONS_ROUTES } from 'app/features/connections/constants |
|
|
|
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; |
|
|
|
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; |
|
|
|
import { getPluginSettings } from 'app/features/plugins/pluginSettings'; |
|
|
|
import { getPluginSettings } from 'app/features/plugins/pluginSettings'; |
|
|
|
import { importDataSourcePlugin } from 'app/features/plugins/plugin_loader'; |
|
|
|
import { importDataSourcePlugin } from 'app/features/plugins/plugin_loader'; |
|
|
|
import { DataSourcePluginCategory, ThunkDispatch, ThunkResult } from 'app/types'; |
|
|
|
import { AccessControlAction, DataSourcePluginCategory, ThunkDispatch, ThunkResult } from 'app/types'; |
|
|
|
|
|
|
|
|
|
|
|
import * as api from '../api'; |
|
|
|
import * as api from '../api'; |
|
|
|
import { DATASOURCES_ROUTES } from '../constants'; |
|
|
|
import { DATASOURCES_ROUTES } from '../constants'; |
|
|
@ -177,6 +177,9 @@ export const testDataSource = ( |
|
|
|
|
|
|
|
|
|
|
|
export function loadDataSources(): ThunkResult<Promise<void>> { |
|
|
|
export function loadDataSources(): ThunkResult<Promise<void>> { |
|
|
|
return async (dispatch) => { |
|
|
|
return async (dispatch) => { |
|
|
|
|
|
|
|
if (!contextSrv.hasPermission(AccessControlAction.DataSourcesRead)) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
dispatch(dataSourcesLoad()); |
|
|
|
dispatch(dataSourcesLoad()); |
|
|
|
const response = await api.getDataSources(); |
|
|
|
const response = await api.getDataSources(); |
|
|
|
dispatch(dataSourcesLoaded(response)); |
|
|
|
dispatch(dataSourcesLoaded(response)); |
|
|
|