From b3c4741eafa50b8c6163f6a6b34c049aa7aac6fa Mon Sep 17 00:00:00 2001 From: Gandalf the Greybeard Date: Sun, 15 Mar 2026 20:22:31 +0000 Subject: [PATCH] fix: match registerPluginSettings name to deployed plugin + fix badge nav URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The settings component never rendered in E2E because registerPluginSettings used 'headlamp-polaris' (and before that 'headlamp-polaris-plugin'), but the deployed plugin directory is static-plugins/polaris — Headlamp identifies it as 'polaris'. Changed to 'polaris' so the settings page can match the registration to the correct plugin. The badge click navigated to /polaris instead of /c/main/polaris because Router.createRouteURL did not reliably resolve the cluster prefix from the plugin context. Replaced with direct URL construction using K8s.useCluster(). Co-Authored-By: Paperclip --- src/components/AppBarScoreBadge.tsx | 5 +++-- src/index.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/AppBarScoreBadge.tsx b/src/components/AppBarScoreBadge.tsx index 02b6bbb..c18eac4 100644 --- a/src/components/AppBarScoreBadge.tsx +++ b/src/components/AppBarScoreBadge.tsx @@ -1,4 +1,4 @@ -import { K8s, Router } from '@kinvolk/headlamp-plugin/lib'; +import { K8s } from '@kinvolk/headlamp-plugin/lib'; import { useTheme } from '@mui/material/styles'; import React from 'react'; import { useHistory } from 'react-router-dom'; @@ -36,7 +36,8 @@ export default function AppBarScoreBadge() { }; const handleClick = () => { - history.push(Router.createRouteURL('polaris', { cluster: cluster ?? '' })); + const prefix = cluster ? `/c/${cluster}` : ''; + history.push(`${prefix}/polaris`); }; return ( diff --git a/src/index.tsx b/src/index.tsx index 5a90bbe..e5d068f 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -99,7 +99,7 @@ registerRoute({ }); // Register plugin settings -registerPluginSettings('headlamp-polaris', PolarisSettings, true); +registerPluginSettings('polaris', PolarisSettings, true); // Register details view section for supported controller types registerDetailsViewSection(({ resource }) => {