Uploaded image for project: 'FlightPath'
  1. FlightPath
  2. FLPATH-3178

dynamic-plugins.yaml menuItems children structure does not work in RHDH

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Summary

      The dynamic-plugins.yaml file in the redhat-resource-optimization plugin uses a children structure for hierarchical menu items that does not work with RHDH dynamic plugin loader.

      Problem

      The dynamic-plugins.yaml (added in commit 9e1f179b / PR #1719) defines the menu structure as:

      menuItems:   cost-management:     text: Cost management
          icon: costManagementIcon
          children:       openshift:         text: OpenShift
              route: /resource-optimization/openshift
            optimizations:         text: Optimizations
              route: /resource-optimization
      

      This children structure with nested route properties is not parsed by RHDH dynamic plugin loader. When applied, the menu items do not appear.

      Root Cause

      The Root.tsx in the static Backstage app uses a custom React component CollapsibleSubmenu to create the hierarchical menu. The dynamic-plugins.yaml was written to mirror this structure conceptually, but RHDH dynamic plugin system uses a different approach.

      Working Configuration

      RHDH dynamic plugin system requires:

      1. menuItem inside each dynamicRoute to define the menu text
      2. menuItems section using parent property to link children UP to parents
      3. Menu item IDs derived from route paths (e.g., redhat-resource-optimization.ocp for /redhat-resource-optimization/ocp)
      4. Parent menu items use title not text
      dynamicRoutes:   - path: /redhat-resource-optimization
          importName: ResourceOptimizationPage
          menuItem:       icon: costManagementIcon
            text: Optimizations
        - path: /redhat-resource-optimization/ocp
          importName: OpenShiftPage
          menuItem:       icon: costManagementIcon
            text: OpenShift
      menuItems:   redhat-resource-optimization:     parent: cost-management
          priority: 10
        redhat-resource-optimization.ocp:     parent: cost-management
          priority: 20
        cost-management:     icon: costManagementIcon
          title: Cost management
          priority: 100
      

      Impact

      Users following the plugin dynamic-plugins.yaml configuration will not see the Cost management menu or its children in RHDH.

      Suggested Fix

      Update dynamic-plugins.yaml to use the parent property approach that works with RHDH dynamic plugin loader.

              rh-ee-asmasarw Ashraf Masarwa
              gharden1 Gary Harden
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: