From bf3bf63db38e3ed710e1c94a2a9ee8c89ba7ab28 Mon Sep 17 00:00:00 2001 From: Gandalf the Greybeard Date: Mon, 16 Mar 2026 11:08:20 +0000 Subject: [PATCH] fix: match plugin settings name to deploy dir + fix badge nav URL The registerPluginSettings name 'headlamp-polaris' didn't match the deployed plugin directory name 'polaris', so the PolarisSettings component never rendered on the settings page (all 5 settings E2E tests failed). Router.createRouteURL('polaris', { cluster }) generated '/polaris' without the '/c/' prefix, causing the appbar badge click navigation test to fail with a URL pattern mismatch. - Change registerPluginSettings name from 'headlamp-polaris' to 'polaris' - Build badge navigation URL manually with cluster prefix 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 }) => {