PluginPages: Support plugin pages that don't belong to a section (#55904)

* Fixing pages that don't exist in navtree

* Fix test

* fix lint warning

* Fixes
This commit is contained in:
Torkel Ödegaard
2022-09-29 13:27:51 +02:00
committed by GitHub
parent 34f18aacd6
commit b4f73c9f09
7 changed files with 44 additions and 45 deletions

View File

@@ -50,7 +50,7 @@ export const Page: PageType = ({
<div className={cx(styles.wrapper, className)} {...otherProps}>
{layout === PageLayoutType.Standard && (
<div className={styles.panes}>
{navModel && navModel.main.children && <SectionNav model={navModel} />}
{navModel && <SectionNav model={navModel} />}
<div className={styles.pageContent}>
<CustomScrollbar autoHeightMin={'100%'} scrollTop={scrollTop} scrollRefCallback={scrollRef}>
<div className={styles.pageInner}>

View File

@@ -13,6 +13,10 @@ export interface Props {
export function SectionNav({ model }: Props) {
const styles = useStyles2(getStyles);
if (!Boolean(model.main?.children?.length)) {
return null;
}
return (
<nav className={styles.nav}>
<CustomScrollbar showScrollIndicators>