diff --git a/packages/grafana-ui/src/components/Tabs/Tab.tsx b/packages/grafana-ui/src/components/Tabs/Tab.tsx index e5aa26a2149..cb27db0006f 100644 --- a/packages/grafana-ui/src/components/Tabs/Tab.tsx +++ b/packages/grafana-ui/src/components/Tabs/Tab.tsx @@ -14,7 +14,7 @@ export interface TabProps extends HTMLProps { /** When provided, it is possible to use the tab as a hyperlink. Use in cases where the tabs update location. */ href?: string; icon?: IconName; - onChangeTab: (event?: React.MouseEvent) => void; + onChangeTab?: (event?: React.MouseEvent) => void; /** A number rendered next to the text. Usually used to display the number of items in a tab's view. */ counter?: number | null; } diff --git a/public/app/app.ts b/public/app/app.ts index 0acb94941f2..27d338def7a 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -106,7 +106,6 @@ export class GrafanaApp { app.config( ( - $locationProvider: angular.ILocationProvider, $controllerProvider: angular.IControllerProvider, $compileProvider: angular.ICompileProvider, $filterProvider: angular.IFilterProvider, diff --git a/public/app/core/components/PageHeader/PageHeader.tsx b/public/app/core/components/PageHeader/PageHeader.tsx index 7739fb5c6cc..c16019a46ab 100644 --- a/public/app/core/components/PageHeader/PageHeader.tsx +++ b/public/app/core/components/PageHeader/PageHeader.tsx @@ -1,9 +1,8 @@ -import React, { FormEvent } from 'react'; +import React from 'react'; import { css } from 'emotion'; import { Tab, TabsBar, Icon, IconName } from '@grafana/ui'; -import appEvents from 'app/core/app_events'; import { NavModel, NavModelItem, NavModelBreadcrumb } from '@grafana/data'; -import { CoreEvents } from 'app/types'; +import { PanelHeaderMenuItem } from 'app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuItem'; export interface Props { model: NavModel; @@ -18,37 +17,29 @@ const SelectNav = ({ children, customCss }: { children: NavModelItem[]; customCs return navItem.active === true; }); - const gotoUrl = (evt: FormEvent) => { - const element = evt.target as HTMLSelectElement; - const url = element.options[element.selectedIndex].value; - appEvents.emit(CoreEvents.locationChange, { href: url }); - }; - return (
-
); }; @@ -58,14 +49,6 @@ const Navigation = ({ children }: { children: NavModelItem[] }) => { return null; } - const goToUrl = (index: number) => { - children.forEach((child, i) => { - if (i === index) { - appEvents.emit(CoreEvents.locationChange, { href: child.url }); - } - }); - }; - return (