Skip to content

fix: hide abstract DCIM generics from auto-menu to drop duplicate entries#73

Open
iddocohen wants to merge 2 commits intomainfrom
ic-fix-display-menu
Open

fix: hide abstract DCIM generics from auto-menu to drop duplicate entries#73
iddocohen wants to merge 2 commits intomainfrom
ic-fix-display-menu

Conversation

@iddocohen
Copy link
Copy Markdown

Summary — include_in_menu cleanup on ic-fix-display-menu

What changed

Commit a2c51cdbase/dcim.yml
Added include_in_menu: false to the DcimGenericDevice generic.

Commit 0143c59experimental/optical_transport/optical_transport.yml
Flipped include_in_menu: truefalse on two generics:

  • DcimChannelMapping (line 26)
  • DcimOpticalDevice (line 69)

Why

All three are abstract generics whose concrete descendants already render their own top-level menu entries without nesting via menu_placement. That means the Infrahub UI was showing two top-level entries pointing at the same records:

Generic (was visible) Concrete descendants (also top-level)
DcimGenericDevice DcimDevice (rendered as "Network Device")
DcimChannelMapping DcimFiberMapping, DcimCableMapping, DcimWSSConnect
DcimOpticalDevice DcimOpticalNode

Functional duplicates — clicking either entry surfaced the same data. Hiding the generic eliminates the duplicate without losing anything, since the descendants are the only data carriers.

Consistency rationale

The base/dcim.yml file already opts every other abstract generic out of the menu (DcimPhysicalDevice, DcimEndpoint, DcimConnector, DcimInterface, InterfaceLayer2/3, etc.). DcimGenericDevice was the lone exception. The optical_transport generics followed the same anti-pattern. Both commits bring those generics in line with the established convention.

What was deliberately left alone

Generics whose descendants nest under them via menu_placement (e.g. ClusterGeneric, LocationGeneric, OrganizationGeneric, DcimGenericSFP, DcimGenericOadmInterface, DcimGenericPatchPanelInterface, NetworkManagementServer, TopologyNetworkStrategy) act as real menu parents and must stay visible.

One mixed case remains — DeviceGenericModule in extensions/modules/modules.yml — where some descendants nest correctly and others (DeviceRoutingEngine, DcimTransponderModule) don't. That's a design call rather than a one-line fix; not addressed here.

Direction this points toward

These changes are tactical fixes against the current include_in_menu-driven model. The stated goal is to have menus driven by menu.yml files instead, at which point include_in_menu: false would become the default for all abstract generics and explicit menu placement would live in the menu file. These two commits are a step in that direction without yet introducing the menu-file scaffolding.

Iddo and others added 2 commits May 8, 2026 08:42
Both abstract generics defaulted into the auto-menu while their concrete
descendants (DcimFiberMapping/DcimCableMapping/DcimWSSConnect, and
DcimOpticalNode) already render their own top-level entries with no
menu_placement nesting them. The generic listings duplicated the same
records, so this aligns them with DcimGenericDevice and the other hidden
DCIM generics.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@iddocohen iddocohen requested review from BaptisteGi and BeArchiTek May 8, 2026 08:12
@iddocohen iddocohen marked this pull request as ready for review May 8, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant