Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1996158 - Dynamic Plugins: Unable to add nav sections to admin perspective
Summary: Dynamic Plugins: Unable to add nav sections to admin perspective
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.9
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.9.0
Assignee: Samuel Padgett
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-20 17:37 UTC by Samuel Padgett
Modified: 2021-10-18 17:48 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:47:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 9885 0 None None None 2021-08-25 17:35:41 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:48:03 UTC

Description Samuel Padgett 2021-08-20 17:37:08 UTC
I'm able to add a nav section to the dev perspective, but not to the admin perspective. To reproduce, add the following to the dynamic demo plugin console-extensions.json then run the demo plugin following the README here: https://github.com/openshift/console/tree/master/frontend/dynamic-demo-plugin

  {
    "type": "console.navigation/section",
    "properties": {
      "id": "admin-demo-section",
      "perspective": "admin",
      "name": "Demo Plugin"
    }
  },
  {
    "type": "console.navigation/href",
    "properties": {
      "id": "test-consumer",
      "perspective": "admin",
      "section": "admin-demo-section",
      "name": "Test Consumer",
      "href": "/test-consumer"
    },
    "flags": {
      "required": ["OPENSHIFT"]
    }
  },

The nav section does not appear. If I change `admin` to `dev` in the above example, the nav section appears in the dev perspective.

Comment 2 Samuel Padgett 2021-08-25 16:50:14 UTC
Looks like this is happening because `AdminNav` uses different logic:

https://github.com/spadgett/console/blob/c317d0619b360b973d9747dbf6348137fbeeeb77/frontend/public/components/nav/perspective-nav.tsx#L48-L51

This should be covered by https://issues.redhat.com/browse/CONSOLE-2943 and is not expected to work yet.

Comment 3 Samuel Padgett 2021-08-25 17:03:11 UTC
Reopening, I have a smaller fix until we can move the admin perspective to a plugin.

Comment 6 Yadan Pei 2021-08-31 08:44:40 UTC
1. build dynamic plugin image following https://github.com/openshift/console/tree/master/frontend/dynamic-demo-plugin#docker-image based on latest console code in which console-extension.json has added both navigation menu in Admin and Developer perspective

  {
    "type": "console.navigation/section",
    "properties": {
      "id": "admin-demo-section",
      "perspective": "admin",
      "name": "Demo Plugin"
    }
  },
  {
    "type": "console.navigation/href",
    "properties": {
      "id": "test-consumer",
      "perspective": "admin",
      "section": "admin-demo-section",
      "name": "Test Consumer",
      "href": "/test-consumer"
    },
    "flags": {
      "required": ["OPENSHIFT"]
    }
  },
  {
    "type": "console.navigation/section",
    "properties": {
      "id": "dev-demo-section",
      "perspective": "dev",
      "name": "Demo Plugin"
    }
  },
  {
    "type": "console.navigation/href",
    "properties": {
      "id": "test-consumer",
      "perspective": "dev",
      "section": "dev-demo-section",
      "name": "Test Consumer",
      "href": "/test-consumer"
    },
    "flags": {
      "required": ["OPENSHIFT"]
    }
  },
https://github.com/openshift/console/blob/master/frontend/dynamic-demo-plugin/console-extensions.json#L35~L76

2. Deploy dynamic plugin to the cluster and enable it

3. `Demo Plugin` primary navigation menu appears and `Test Consumer` secondary menu exists too

4. `Demo Plugin` primary navigation menu and `Test Consumer` secondary menu also shown in Developer perspective

Verified on 4.9.0-0.nightly-2021-08-30-192239

Comment 9 errata-xmlrpc 2021-10-18 17:47:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:3759


Note You need to log in before you can comment on or make changes to this bug.