Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More route nav id fixe #2

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 53 additions & 48 deletions .betterer.results
Original file line number Diff line number Diff line change
Expand Up @@ -3105,7 +3105,7 @@ exports[`better eslint`] = {
[35, 46, 3, "Unexpected any. Specify a different type.", "193409811"],
[37, 26, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/angular/services/nav_model_srv.ts:1949768361": [
"public/app/angular/services/nav_model_srv.ts:356083867": [
[57, 39, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/angular/services/ng_react.ts:1219930949": [
Expand Down Expand Up @@ -3331,15 +3331,21 @@ exports[`better eslint`] = {
"public/app/core/components/OptionsUI/strings.tsx:1826340875": [
[24, 16, 42, "Do not use any type assertions.", "3301854123"]
],
"public/app/core/components/PageHeader/PageHeader.test.tsx:3755271251": [
[19, 32, 10, "Do not use any type assertions.", "883420344"],
[19, 39, 3, "Unexpected any. Specify a different type.", "193409811"],
[39, 32, 10, "Do not use any type assertions.", "883420344"],
[39, 39, 3, "Unexpected any. Specify a different type.", "193409811"]
"public/app/core/components/PageHeader/PageHeader.test.tsx:4036541205": [
[16, 34, 10, "Do not use any type assertions.", "883420344"],
[16, 41, 3, "Unexpected any. Specify a different type.", "193409811"],
[33, 34, 10, "Do not use any type assertions.", "883420344"],
[33, 41, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/core/components/PageHeader/PageHeader.tsx:952684291": [
"public/app/core/components/PageHeader/PageHeader.tsx:503869166": [
[65, 22, 22, "Do not use any type assertions.", "4054086100"],
[104, 34, 21, "Do not use any type assertions.", "2401004021"]
[102, 34, 21, "Do not use any type assertions.", "2401004021"]
],
"public/app/core/components/PageNew/PageTabs.tsx:3261576880": [
[23, 22, 22, "Do not use any type assertions.", "4054086100"]
],
"public/app/core/components/PageNew/SectionNav.tsx:3562461661": [
[20, 34, 21, "Do not use any type assertions.", "2401004021"]
],
"public/app/core/components/PanelTypeFilter/PanelTypeFilter.tsx:1614517181": [
[41, 24, 3, "Unexpected any. Specify a different type.", "193409811"],
Expand Down Expand Up @@ -3549,7 +3555,7 @@ exports[`better eslint`] = {
"public/app/core/reducers/appNotification.ts:735507530": [
[77, 35, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/core/reducers/navModel.ts:2486277874": [
"public/app/core/reducers/navModel.ts:3755863968": [
[7, 20, 41, "Do not use any type assertions.", "680953089"]
],
"public/app/core/reducers/processsAclItems.ts:2776156466": [
Expand Down Expand Up @@ -3959,23 +3965,23 @@ exports[`better eslint`] = {
[26, 5, 29, "Do not use any type assertions.", "2635161824"],
[67, 9, 60, "Do not use any type assertions.", "738572730"]
],
"public/app/features/admin/AdminListOrgsPage.tsx:1232501301": [
"public/app/features/admin/AdminListOrgsPage.tsx:851621779": [
[22, 32, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/admin/AdminSettings.tsx:876474391": [
"public/app/features/admin/AdminSettings.tsx:3612709745": [
[18, 10, 63, "Do not use any type assertions.", "1950730127"]
],
"public/app/features/admin/OrgRolePicker.tsx:2826049686": [
[23, 34, 20, "Do not use any type assertions.", "3568020359"]
],
"public/app/features/admin/UserListAdminPage.tsx:3454473979": [
"public/app/features/admin/UserListAdminPage.tsx:1874540957": [
[27, 21, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/admin/UserProfile.tsx:2121737967": [
[205, 24, 3, "Unexpected any. Specify a different type.", "193409811"],
[302, 10, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/admin/ldap/LdapPage.tsx:1724804732": [
"public/app/features/admin/ldap/LdapPage.tsx:2036572570": [
[73, 19, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/admin/state/reducers.test.ts:3463255684": [
Expand All @@ -3994,7 +4000,7 @@ exports[`better eslint`] = {
[57, 34, 39, "Do not use any type assertions.", "935682756"],
[57, 70, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/alerting/AlertRuleList.tsx:474918126": [
"public/app/features/alerting/AlertRuleList.tsx:3637063496": [
[134, 24, 17, "Do not use any type assertions.", "2518695225"],
[137, 58, 17, "Do not use any type assertions.", "2518695225"]
],
Expand Down Expand Up @@ -4044,7 +4050,7 @@ exports[`better eslint`] = {
[402, 51, 3, "Unexpected any. Specify a different type.", "193409811"],
[468, 34, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/alerting/EditNotificationChannelPage.tsx:3397946803": [
"public/app/features/alerting/EditNotificationChannelPage.tsx:3335986965": [
[21, 23, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/alerting/StateHistory.tsx:3418297987": [
Expand Down Expand Up @@ -4578,7 +4584,7 @@ exports[`better eslint`] = {
"public/app/features/canvas/runtime/root.tsx:2845174121": [
[24, 19, 36, "Do not use any type assertions.", "1413431594"]
],
"public/app/features/canvas/runtime/scene.tsx:4285479205": [
"public/app/features/canvas/runtime/scene.tsx:4221384430": [
[155, 61, 25, "Do not use any type assertions.", "588553285"],
[160, 42, 25, "Do not use any type assertions.", "588553285"]
],
Expand Down Expand Up @@ -4645,7 +4651,7 @@ exports[`better eslint`] = {
[198, 29, 13, "Do not use any type assertions.", "2146830713"],
[217, 32, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/dashboard/components/DashNav/DashNav.tsx:1533394562": [
"public/app/features/dashboard/components/DashNav/DashNav.tsx:2724792053": [
[67, 87, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/dashboard/components/DashNav/DashNavTimeControls.test.tsx:3825334541": [
Expand Down Expand Up @@ -5014,7 +5020,7 @@ exports[`better eslint`] = {
[264, 15, 56, "Do not use any type assertions.", "2674630592"],
[266, 13, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/dashboard/containers/DashboardPage.tsx:3173260528": [
"public/app/features/dashboard/containers/DashboardPage.tsx:3836168909": [
[108, 36, 40, "Do not use any type assertions.", "2547843745"],
[108, 73, 3, "Unexpected any. Specify a different type.", "193409811"],
[144, 32, 40, "Do not use any type assertions.", "2547843745"],
Expand Down Expand Up @@ -5438,14 +5444,14 @@ exports[`better eslint`] = {
[15, 16, 24, "Do not use any type assertions.", "3405802617"],
[21, 11, 21, "Do not use any type assertions.", "3218407483"]
],
"public/app/features/datasources/DataSourceDashboards.tsx:3932611556": [
"public/app/features/datasources/DataSourceDashboards.tsx:2085374850": [
[49, 16, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/datasources/DataSourcesListPage.test.tsx:368182366": [
[19, 17, 26, "Do not use any type assertions.", "3994646623"],
[22, 14, 126, "Do not use any type assertions.", "1409469672"]
],
"public/app/features/datasources/DataSourcesListPage.tsx:247845505": [
"public/app/features/datasources/DataSourcesListPage.tsx:2606271463": [
[44, 14, 22, "Do not use any type assertions.", "2167463294"]
],
"public/app/features/datasources/__mocks__/dataSourcesMocks.ts:1217473343": [
Expand Down Expand Up @@ -6154,7 +6160,7 @@ exports[`better eslint`] = {
"public/app/features/live/pages/AddNewRule.tsx:2593231672": [
[59, 16, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/live/pages/PipelineAdminPage.tsx:952820098": [
"public/app/features/live/pages/PipelineAdminPage.tsx:87558436": [
[13, 51, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/live/pages/PipelineTable.tsx:894975337": [
Expand All @@ -6181,7 +6187,7 @@ exports[`better eslint`] = {
"public/app/features/live/pages/utils.ts:270086979": [
[19, 37, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/manage-dashboards/DashboardImportPage.tsx:1780804260": [
"public/app/features/manage-dashboards/DashboardImportPage.tsx:1590008002": [
[81, 19, 3, "Unexpected any. Specify a different type.", "193409811"],
[82, 25, 3, "Unexpected any. Specify a different type.", "193409811"]
],
Expand Down Expand Up @@ -6482,7 +6488,7 @@ exports[`better eslint`] = {
[68, 90, 12, "Do not use any type assertions.", "3603862904"],
[68, 99, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/plugins/components/AppRootPage.tsx:1453161637": [
"public/app/features/plugins/components/AppRootPage.tsx:3831200387": [
[109, 21, 34, "Do not use any type assertions.", "462520373"]
],
"public/app/features/plugins/datasource_srv.ts:3002426838": [
Expand Down Expand Up @@ -6763,7 +6769,7 @@ exports[`better eslint`] = {
[12, 13, 3, "Unexpected any. Specify a different type.", "193409811"],
[41, 9, 43, "Do not use any type assertions.", "4109129169"]
],
"public/app/features/sandbox/TestStuffPage.tsx:3698683147": [
"public/app/features/sandbox/TestStuffPage.tsx:1454935587": [
[134, 30, 29, "Do not use any type assertions.", "3195381622"]
],
"public/app/features/search/components/DashboardSearch.test.tsx:3245889886": [
Expand Down Expand Up @@ -6921,22 +6927,24 @@ exports[`better eslint`] = {
[246, 28, 17, "Do not use any type assertions.", "1811834489"],
[251, 5, 29, "Do not use any type assertions.", "4135357902"]
],
"public/app/features/serviceaccounts/ServiceAccountPage.test.tsx:3979425477": [
[33, 20, 23, "Do not use any type assertions.", "499357842"],
[44, 13, 9, "Do not use any type assertions.", "3692209159"],
[44, 19, 3, "Unexpected any. Specify a different type.", "193409811"],
[45, 14, 9, "Do not use any type assertions.", "3692209159"],
[45, 20, 3, "Unexpected any. Specify a different type.", "193409811"],
[47, 11, 9, "Do not use any type assertions.", "3692209159"],
[47, 17, 3, "Unexpected any. Specify a different type.", "193409811"]
"public/app/features/serviceaccounts/ServiceAccountPage.test.tsx:3401231959": [
[25, 20, 23, "Do not use any type assertions.", "499357842"],
[36, 13, 9, "Do not use any type assertions.", "3692209159"],
[36, 19, 3, "Unexpected any. Specify a different type.", "193409811"],
[37, 14, 9, "Do not use any type assertions.", "3692209159"],
[37, 20, 3, "Unexpected any. Specify a different type.", "193409811"],
[39, 11, 9, "Do not use any type assertions.", "3692209159"],
[39, 17, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/serviceaccounts/state/reducers.ts:816482675": [
[13, 18, 23, "Do not use any type assertions.", "499357842"],
[15, 10, 14, "Do not use any type assertions.", "2767045528"],
[43, 19, 25, "Do not use any type assertions.", "1122467828"]
],
"public/app/features/teams/CreateTeam.test.tsx:136903941": [
[30, 14, 34, "Do not use any type assertions.", "463003776"]
"public/app/features/teams/CreateTeam.test.tsx:933968426": [
[16, 14, 42, "Do not use any type assertions.", "2370189818"],
[16, 14, 28, "Do not use any type assertions.", "3912429083"],
[18, 5, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/teams/TeamGroupSync.test.tsx:2647720693": [
[12, 12, 17, "Do not use any type assertions.", "2242876437"]
Expand All @@ -6945,12 +6953,11 @@ exports[`better eslint`] = {
[59, 32, 3, "Unexpected any. Specify a different type.", "193409811"],
[63, 23, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/teams/TeamList.test.tsx:2054736348": [
[22, 14, 123, "Do not use any type assertions.", "695951401"],
[30, 11, 12, "Do not use any type assertions.", "1079483306"],
[40, 18, 59, "Do not use any type assertions.", "25768610"],
[67, 24, 77, "Do not use any type assertions.", "361803129"],
[84, 24, 77, "Do not use any type assertions.", "1295202722"]
"public/app/features/teams/TeamList.test.tsx:3686781523": [
[21, 11, 12, "Do not use any type assertions.", "1079483306"],
[31, 18, 59, "Do not use any type assertions.", "25768610"],
[58, 24, 77, "Do not use any type assertions.", "361803129"],
[75, 24, 77, "Do not use any type assertions.", "1295202722"]
],
"public/app/features/teams/TeamMemberRow.tsx:607934811": [
[41, 18, 20, "Do not use any type assertions.", "3089389535"]
Expand All @@ -6962,16 +6969,15 @@ exports[`better eslint`] = {
"public/app/features/teams/TeamMembers.tsx:4139991775": [
[19, 32, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/teams/TeamPages.test.tsx:1955453068": [
"public/app/features/teams/TeamPages.test.tsx:648699836": [
[63, 13, 86, "Do not use any type assertions.", "2945747797"],
[68, 11, 3, "Unexpected any. Specify a different type.", "193409811"],
[70, 14, 34, "Do not use any type assertions.", "463003776"],
[75, 10, 10, "Do not use any type assertions.", "1584692172"],
[76, 13, 18, "Do not use any type assertions.", "2776323642"],
[79, 18, 88, "Do not use any type assertions.", "2247670218"],
[138, 20, 95, "Do not use any type assertions.", "4068964415"]
],
"public/app/features/teams/TeamPages.tsx:3881385980": [
"public/app/features/teams/TeamPages.tsx:342488801": [
[52, 43, 18, "Do not use any type assertions.", "373851894"]
],
"public/app/features/teams/state/reducers.ts:1856799550": [
Expand Down Expand Up @@ -7177,10 +7183,9 @@ exports[`better eslint`] = {
"public/app/features/users/UsersActionBar.tsx:1795710611": [
[66, 32, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/features/users/UsersListPage.test.tsx:4284943401": [
[27, 14, 119, "Do not use any type assertions.", "1781051572"],
[35, 11, 15, "Do not use any type assertions.", "2789568508"],
[36, 14, 15, "Do not use any type assertions.", "3505843099"]
"public/app/features/users/UsersListPage.test.tsx:761605339": [
[26, 11, 15, "Do not use any type assertions.", "2789568508"],
[27, 14, 15, "Do not use any type assertions.", "3505843099"]
],
"public/app/features/users/UsersTable.test.tsx:2179189208": [
[19, 11, 15, "Do not use any type assertions.", "2789568508"]
Expand Down Expand Up @@ -10977,7 +10982,7 @@ exports[`better eslint`] = {
[41, 64, 3, "Unexpected any. Specify a different type.", "193409811"],
[41, 69, 3, "Unexpected any. Specify a different type.", "193409811"]
],
"public/app/plugins/panel/canvas/editor/LayerElementListEditor.tsx:374041207": [
"public/app/plugins/panel/canvas/editor/LayerElementListEditor.tsx:2123096129": [
[21, 33, 3, "Unexpected any. Specify a different type.", "193409811"],
[40, 30, 44, "Do not use any type assertions.", "712744497"]
],
Expand Down
4 changes: 0 additions & 4 deletions packages/grafana-data/src/types/navModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ export interface NavModel {
* This is the current active tab/navigation.
*/
node: NavModelItem;
/**
* Describes breadcrumbs that are used in places such as data source settings., folder page and plugins page.
*/
breadcrumbs?: NavModelItem[];
}

export interface NavModelBreadcrumb {
Expand Down
96 changes: 96 additions & 0 deletions packages/grafana-ui/src/components/Tabs/VerticalTab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import { css, cx } from '@emotion/css';
import React from 'react';

import { GrafanaTheme2 } from '@grafana/data';
import { selectors } from '@grafana/e2e-selectors';

import { useStyles2 } from '../../themes/ThemeContext';
import { Icon } from '../Icon/Icon';

import { Counter } from './Counter';
import { TabProps } from './Tab';

export const VerticalTab = React.forwardRef<HTMLAnchorElement, TabProps>(
({ label, active, icon, counter, className, suffix: Suffix, onChangeTab, href, ...otherProps }, ref) => {
const tabsStyles = useStyles2(getTabStyles);
const content = () => (
<>
{icon && <Icon name={icon} />}
{label}
{typeof counter === 'number' && <Counter value={counter} />}
{Suffix && <Suffix className={tabsStyles.suffix} />}
</>
);

const linkClass = cx(tabsStyles.link, active && tabsStyles.activeStyle);

return (
<li className={tabsStyles.item}>
<a
href={href}
className={linkClass}
{...otherProps}
onClick={onChangeTab}
aria-label={otherProps['aria-label'] || selectors.components.Tab.title(label)}
role="tab"
aria-selected={active}
ref={ref}
>
{content()}
</a>
</li>
);
}
);

VerticalTab.displayName = 'Tab';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: displayName 'Tab' may be confusing since this is VerticalTab component


const getTabStyles = (theme: GrafanaTheme2) => {
return {
item: css`
list-style: none;
margin-right: ${theme.spacing(2)};
position: relative;
display: block;
margin-bottom: 4px;
`,
link: css`
padding: 6px 12px;
display: block;
height: 100%;
cursor: pointer;

color: ${theme.colors.text.primary};

svg {
margin-right: ${theme.spacing(1)};
}

&:hover,
&:focus {
text-decoration: underline;
}
`,
activeStyle: css`
label: activeTabStyle;
color: ${theme.colors.text.maxContrast};
font-weight: 500;
overflow: hidden;

&::before {
display: block;
content: ' ';
position: absolute;
left: 0;
width: 4px;
bottom: 0;
top: 0;
border-radius: 2px;
background-image: linear-gradient(0deg, #f05a28 30%, #fbca0a 99%);
}
`,
suffix: css`
margin-left: ${theme.spacing(1)};
`,
};
};
1 change: 1 addition & 0 deletions packages/grafana-ui/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export { TableCellDisplayMode, TableSortByFieldState } from './Table/types';
export { TableInputCSV } from './TableInputCSV/TableInputCSV';
export { TabsBar } from './Tabs/TabsBar';
export { Tab } from './Tabs/Tab';
export { VerticalTab } from './Tabs/VerticalTab';
export { TabContent } from './Tabs/TabContent';
export { Counter } from './Tabs/Counter';

Expand Down
2 changes: 1 addition & 1 deletion public/app/angular/angular_wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { QueryEditor as CloudMonitoringQueryEditor } from 'app/plugins/datasourc

import EmptyListCTA from '../core/components/EmptyListCTA/EmptyListCTA';
import { Footer } from '../core/components/Footer/Footer';
import PageHeader from '../core/components/PageHeader/PageHeader';
import { PageHeader } from '../core/components/PageHeader/PageHeader';
import { MetricSelect } from '../core/components/Select/MetricSelect';
import { TagFilter } from '../core/components/TagFilter/TagFilter';
import { HelpModal } from '../core/components/help/HelpModal';
Expand Down
Loading