From a86586935a4c19991df868169796f9fda4f2b726 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Wed, 25 Sep 2024 14:34:28 +0300 Subject: [PATCH] shell: Take docs from the correct manifest item Fixes #21040 --- pkg/shell/topnav.jsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pkg/shell/topnav.jsx b/pkg/shell/topnav.jsx index 9da6a0df938..d11f00ac4e5 100644 --- a/pkg/shell/topnav.jsx +++ b/pkg/shell/topnav.jsx @@ -92,7 +92,7 @@ export class TopNav extends React.Component { const { current_location, current_machine, - current_machine_manifest_items, + current_manifest_item, current_frame, } = this.props.state; @@ -113,16 +113,14 @@ export class TopNav extends React.Component { } } - const item = current_machine_manifest_items.items[current_location.path]; - if (item && item.docs) - docs = item.docs; + // Check first whether we have docs in the "parent" section of + // the manifest. + const comp = cockpit.manifests[current_location.path]; + if (comp && comp.parent && comp.parent.docs) + docs = comp.parent.docs; + else if (current_manifest_item.docs) + docs = current_manifest_item.docs; - // Check for parent as well - if (docs.length === 0) { - const comp = cockpit.manifests[current_location.path]; - if (comp && comp.parent && comp.parent.docs) - docs = comp.parent.docs; - } const docItems = []; if (this.state.osRelease.DOCUMENTATION_URL)