diff --git a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx index d38c50db68e..f4816ce8ac2 100644 --- a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx +++ b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx @@ -2,7 +2,7 @@ import React, { useCallback } from 'react'; import { DataSourcePluginMeta } from '@grafana/data'; import { Button } from '@grafana/ui'; -import { addDataSource } from 'app/features/datasources/state/actions'; +import { useDataSourcesRoutes, addDataSource } from 'app/features/datasources/state'; import { useDispatch } from 'app/types'; import { isDataSourceEditor } from '../../permissions'; @@ -14,14 +14,15 @@ type Props = { export function GetStartedWithDataSource({ plugin }: Props): React.ReactElement | null { const dispatch = useDispatch(); + const dataSourcesRoutes = useDataSourcesRoutes(); const onAddDataSource = useCallback(() => { const meta = { name: plugin.name, id: plugin.id, } as DataSourcePluginMeta; - dispatch(addDataSource(meta)); - }, [dispatch, plugin]); + dispatch(addDataSource(meta, dataSourcesRoutes.Edit)); + }, [dispatch, plugin, dataSourcesRoutes]); if (!isDataSourceEditor()) { return null;