Skip to content

Commit

Permalink
shell: Take docs from the correct manifest item
Browse files Browse the repository at this point in the history
  • Loading branch information
mvollmer committed Sep 25, 2024
1 parent d38e9df commit a865869
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions pkg/shell/topnav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
Expand Down

0 comments on commit a865869

Please sign in to comment.