mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Navigation: Add descriptions to NavModelItems (#55669)
* add some descriptions! * Update some descriptions * Tweak playlist description * fix unit tests + betterer
This commit is contained in:
@@ -27,7 +27,7 @@ describe('NavLandingPage', () => {
|
||||
const mockChild3 = {
|
||||
text: 'Child 3',
|
||||
id: 'child3',
|
||||
subTitle: 'Child 3 subtitle',
|
||||
description: 'Child 3 subtitle',
|
||||
url: 'mock-section-url/child3',
|
||||
hideFromTabs: true,
|
||||
children: [
|
||||
@@ -86,9 +86,9 @@ describe('NavLandingPage', () => {
|
||||
expect(screen.getByRole('heading', { name: mockChild3.text })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders the subTitle for a nested section', () => {
|
||||
it('renders the description for a nested section', () => {
|
||||
setup();
|
||||
expect(screen.getByText(mockChild3.subTitle)).toBeInTheDocument();
|
||||
expect(screen.getByText(mockChild3.description)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders a link for a nested child', () => {
|
||||
|
@@ -40,7 +40,7 @@ export function NavLandingPage({ navId }: Props) {
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<h2 className={styles.nestedTitle}>{child.text}</h2>
|
||||
</div>
|
||||
<div className={styles.nestedDescription}>{child.subTitle}</div>
|
||||
<div className={styles.nestedDescription}>{child.description}</div>
|
||||
<div className={styles.grid}>
|
||||
{child.children?.map((child) => (
|
||||
<NavLandingPageCard
|
||||
|
@@ -11,7 +11,7 @@ export interface Props {
|
||||
|
||||
export function PageHeader({ navItem, subTitle }: Props) {
|
||||
const styles = useStyles2(getStyles);
|
||||
const sub = subTitle ?? navItem.subTitle;
|
||||
const sub = subTitle ?? navItem.description;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
Reference in New Issue
Block a user