mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 00:25:46 -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 {
|
return {
|
||||||
navId: 'connections-datasources',
|
navId: 'connections-datasources',
|
||||||
pageNav,
|
pageNav,
|
||||||
|
dataSourceHeader: nav.dataSourceHeader,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ export function EditDataSourcePage() {
|
|||||||
const { navId, pageNav } = useDataSourceSettingsNav();
|
const { navId, pageNav } = useDataSourceSettingsNav();
|
||||||
|
|
||||||
if (dataSourcePageHeader) {
|
if (dataSourcePageHeader) {
|
||||||
return <DataSourceTabPage uid={uid} pageId={pageId} navId="connections-datasources" />;
|
return <DataSourceTabPage uid={uid} pageId={pageId} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,32 +1,31 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { Page } from 'app/core/components/Page/Page';
|
import { Page } from 'app/core/components/Page/Page';
|
||||||
|
import { useDataSourceSettingsNav } from 'app/features/connections/hooks/useDataSourceSettingsNav';
|
||||||
|
|
||||||
import { EditDataSource } from '../components/EditDataSource';
|
import { EditDataSource } from '../components/EditDataSource';
|
||||||
import { EditDataSourceActions } from '../components/EditDataSourceActions';
|
import { EditDataSourceActions } from '../components/EditDataSourceActions';
|
||||||
import { useDataSourceInfo } from '../components/useDataSourceInfo';
|
import { useDataSourceInfo } from '../components/useDataSourceInfo';
|
||||||
import { useDataSourceSettingsNav } from '../state';
|
|
||||||
|
|
||||||
import { DataSourceTitle } from './DataSourceTitle';
|
import { DataSourceTitle } from './DataSourceTitle';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
uid: string;
|
uid: string;
|
||||||
pageId: string | null;
|
pageId: string | null;
|
||||||
navId: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function DataSourceTabPage({ uid, pageId, navId }: Props) {
|
export function DataSourceTabPage({ uid, pageId }: Props) {
|
||||||
const nav = useDataSourceSettingsNav(uid, pageId);
|
const { navId, pageNav, dataSourceHeader } = useDataSourceSettingsNav();
|
||||||
|
|
||||||
const info = useDataSourceInfo({
|
const info = useDataSourceInfo({
|
||||||
dataSourcePluginName: nav.main.dataSourcePluginName,
|
dataSourcePluginName: pageNav.dataSourcePluginName,
|
||||||
alertingSupported: nav.dataSourceHeader.alertingSupported,
|
alertingSupported: dataSourceHeader.alertingSupported,
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page
|
<Page
|
||||||
navId={navId}
|
navId={navId}
|
||||||
pageNav={nav.main}
|
pageNav={pageNav}
|
||||||
renderTitle={(title) => <DataSourceTitle title={title} />}
|
renderTitle={(title) => <DataSourceTitle title={title} />}
|
||||||
info={info}
|
info={info}
|
||||||
actions={<EditDataSourceActions uid={uid} />}
|
actions={<EditDataSourceActions uid={uid} />}
|
||||||
|
@ -19,7 +19,7 @@ export function EditDataSourcePage(props: Props) {
|
|||||||
const nav = useDataSourceSettingsNav(uid, pageId);
|
const nav = useDataSourceSettingsNav(uid, pageId);
|
||||||
|
|
||||||
if (dataSourcePageHeader) {
|
if (dataSourcePageHeader) {
|
||||||
return <DataSourceTabPage uid={uid} pageId={pageId} navId="datasources" />;
|
return <DataSourceTabPage uid={uid} pageId={pageId} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user