mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TopNav: Make it possible to to have sections without children (#57815)
This commit is contained in:
parent
656f159ae9
commit
19b961465c
@ -19,6 +19,10 @@ export interface NavLinkDTO {
|
||||
hideFromTabs?: boolean;
|
||||
showIconInNavbar?: boolean;
|
||||
roundIcon?: boolean;
|
||||
/**
|
||||
* This is true for some sections that have no children (but is still a section)
|
||||
**/
|
||||
isSection?: boolean;
|
||||
children?: NavLinkDTO[];
|
||||
highlightText?: string;
|
||||
emptyMessageId?: string;
|
||||
|
@ -62,6 +62,7 @@ type NavLink struct {
|
||||
HideFromTabs bool `json:"hideFromTabs,omitempty"`
|
||||
ShowIconInNavbar bool `json:"showIconInNavbar,omitempty"`
|
||||
RoundIcon bool `json:"roundIcon,omitempty"`
|
||||
IsSection bool `json:"isSection,omitempty"`
|
||||
Children []*NavLink `json:"children,omitempty"`
|
||||
HighlightText string `json:"highlightText,omitempty"`
|
||||
HighlightID string `json:"highlightId,omitempty"`
|
||||
|
@ -71,6 +71,7 @@ func (s *ServiceImpl) processAppPlugin(plugin plugins.PluginDTO, c *models.ReqCo
|
||||
Img: plugin.Info.Logos.Small,
|
||||
Section: navtree.NavSectionPlugin,
|
||||
SortWeight: navtree.WeightPlugin,
|
||||
IsSection: true,
|
||||
}
|
||||
|
||||
if topNavEnabled {
|
||||
|
@ -24,7 +24,7 @@ export function SectionNavItem({ item, isSectionRoot = false }: Props) {
|
||||
const linkClass = cx({
|
||||
[styles.link]: true,
|
||||
[styles.activeStyle]: item.active,
|
||||
[styles.isSection]: Boolean(children?.length),
|
||||
[styles.isSection]: Boolean(children?.length) || item.isSection,
|
||||
[styles.hasActiveChild]: hasActiveChild,
|
||||
[styles.isSectionRoot]: isSectionRoot,
|
||||
[styles.noRootMargin]: noRootMargin,
|
||||
|
Loading…
Reference in New Issue
Block a user