Bug 2090895

Summary: Dynamic plugin nav extension "startsWith" property does not work
Product: OpenShift Container Platform Reporter: Jon Jackson <jonjacks>
Component: Management ConsoleAssignee: Andrew Ballantyne <aballant>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.11CC: yapei
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:14:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jon Jackson 2022-05-26 20:31:07 UTC
Description of problem:
Dynamic plugin nav extensions do not support `startsWith` property

Version-Release number of selected component (if applicable):
4.11

How reproducible:
Always

Steps to Reproduce:
1. Edit the console-app console-extensions.json and add a startsWith property to one of the nav items. (e.g. "startsWith": ["starts-with"])
2. In the console, navigate to a URL that should match (e.g. /k8s/cluster/starts-with)


Actual results:
The nav item will not be highlighted as active in the console

Expected results:
The nav item should be highlighted as active when the URL starts with any of the items in the startsWith property.

Additional info:

Comment 2 Yadan Pei 2022-06-21 06:51:15 UTC
$ git diff dynamic-demo-plugin/console-extensions.json
diff --git a/dynamic-demo-plugin/console-extensions.json b/dynamic-demo-plugin/console-extensions.json
index 57ce393b66..00ce7db27f 100644
--- a/dynamic-demo-plugin/console-extensions.json
+++ b/dynamic-demo-plugin/console-extensions.json
@@ -164,7 +164,8 @@
       "perspective": "admin",
       "section": "admin-demo-section",
       "name": "%plugin__console-demo-plugin~Test Consumer%",
-      "href": "/test-consumer"
+      "href": "/test-consumer",
+      "startsWith": ["consumer-starts", "consumer-prefix"]
     }
   },
   {
@@ -215,7 +216,8 @@
       "perspective": "admin",
       "section": "admin-demo-section",
       "name": "%plugin__console-demo-plugin~Test Utilities%",
-      "href": "/test-utility-consumer"
+      "href": "/test-utility-consumer",
+      "startsWith": ["utility-starts", "utility-prefix"]
     }
   },
   {


visit URL /utility-prefix or /consumer-starts, then 'Test Utilities' or 'Test Consumers' menu will be highlighted

verified on 4.11.0-0.nightly-2022-06-20-220209

Comment 4 errata-xmlrpc 2022-08-10 11:14:36 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 (Important: OpenShift Container Platform 4.11.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-2022:5069