mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
EditDatasource: Fix navtree when dataSourcePageHeader
is on (#72827)
use useDataSourceSettingsNav from connections in DataSourceTabPage
This commit is contained in:
parent
54f0de313f
commit
1646b901af
@ -29,5 +29,6 @@ export function useDataSourceSettingsNav(pageId?: string) {
|
||||
return {
|
||||
navId: 'connections-datasources',
|
||||
pageNav,
|
||||
dataSourceHeader: nav.dataSourceHeader,
|
||||
};
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ export function EditDataSourcePage() {
|
||||
const { navId, pageNav } = useDataSourceSettingsNav();
|
||||
|
||||
if (dataSourcePageHeader) {
|
||||
return <DataSourceTabPage uid={uid} pageId={pageId} navId="connections-datasources" />;
|
||||
return <DataSourceTabPage uid={uid} pageId={pageId} />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -1,32 +1,31 @@
|
||||
import React from 'react';
|
||||
|
||||
import { Page } from 'app/core/components/Page/Page';
|
||||
import { useDataSourceSettingsNav } from 'app/features/connections/hooks/useDataSourceSettingsNav';
|
||||
|
||||
import { EditDataSource } from '../components/EditDataSource';
|
||||
import { EditDataSourceActions } from '../components/EditDataSourceActions';
|
||||
import { useDataSourceInfo } from '../components/useDataSourceInfo';
|
||||
import { useDataSourceSettingsNav } from '../state';
|
||||
|
||||
import { DataSourceTitle } from './DataSourceTitle';
|
||||
|
||||
export interface Props {
|
||||
uid: string;
|
||||
pageId: string | null;
|
||||
navId: string;
|
||||
}
|
||||
|
||||
export function DataSourceTabPage({ uid, pageId, navId }: Props) {
|
||||
const nav = useDataSourceSettingsNav(uid, pageId);
|
||||
export function DataSourceTabPage({ uid, pageId }: Props) {
|
||||
const { navId, pageNav, dataSourceHeader } = useDataSourceSettingsNav();
|
||||
|
||||
const info = useDataSourceInfo({
|
||||
dataSourcePluginName: nav.main.dataSourcePluginName,
|
||||
alertingSupported: nav.dataSourceHeader.alertingSupported,
|
||||
dataSourcePluginName: pageNav.dataSourcePluginName,
|
||||
alertingSupported: dataSourceHeader.alertingSupported,
|
||||
});
|
||||
|
||||
return (
|
||||
<Page
|
||||
navId={navId}
|
||||
pageNav={nav.main}
|
||||
pageNav={pageNav}
|
||||
renderTitle={(title) => <DataSourceTitle title={title} />}
|
||||
info={info}
|
||||
actions={<EditDataSourceActions uid={uid} />}
|
||||
|
@ -19,7 +19,7 @@ export function EditDataSourcePage(props: Props) {
|
||||
const nav = useDataSourceSettingsNav(uid, pageId);
|
||||
|
||||
if (dataSourcePageHeader) {
|
||||
return <DataSourceTabPage uid={uid} pageId={pageId} navId="datasources" />;
|
||||
return <DataSourceTabPage uid={uid} pageId={pageId} />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user