fix: restore badge emoji, fix aria-label, and correct service proxy URL #19

Merged
ghost merged 2 commits from fix/e2e-badge-and-proxy-url into main 2026-03-08 03:13:29 +00:00
5 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Project
Headlamp plugin surfacing Fairwinds Polaris audit results. Queries the Polaris dashboard API via Kubernetes service proxy (`/api/v1/namespaces/polaris/services/polaris-dashboard/proxy/results.json`). Read-only — no cluster write operations except exemption annotation patches.
Headlamp plugin surfacing Fairwinds Polaris audit results. Queries the Polaris dashboard API via Kubernetes service proxy (`/api/v1/namespaces/polaris/services/http:polaris-dashboard:80/proxy/results.json`). Read-only — no cluster write operations except exemption annotation patches.
- **Plugin name**: `polaris`
- **Target**: Headlamp >= v0.26
+2 -1
View File
@@ -218,7 +218,8 @@ const REFRESH_STORAGE_KEY = 'polaris-plugin-refresh-interval';
const DEFAULT_INTERVAL_SECONDS = 300; // 5 minutes
const URL_STORAGE_KEY = 'polaris-plugin-dashboard-url';
const DEFAULT_DASHBOARD_URL = '/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/';
const DEFAULT_DASHBOARD_URL =
'/api/v1/namespaces/polaris/services/http:polaris-dashboard:80/proxy/';
/**
* Retrieves the configured refresh interval from localStorage.
+1 -1
View File
@@ -131,6 +131,6 @@ describe('AppBarScoreBadge', () => {
mockUsePolarisDataContext.mockReturnValue({ data, loading: false });
render(<AppBarScoreBadge />);
expect(screen.getByLabelText('Polaris cluster score: 100%')).toBeInTheDocument();
expect(screen.getByLabelText('Polaris: 100%')).toBeInTheDocument();
});
});
+2 -1
View File
@@ -54,8 +54,9 @@ export default function AppBarScoreBadge() {
alignItems: 'center',
gap: '4px',
}}
aria-label={`Polaris cluster score: ${score}%`}
aria-label={`Polaris: ${score}%`}
>
<span>{'\u{1F6E1}\uFE0F'}</span>
<span>Polaris: {score}%</span>
</button>
);
+2 -2
View File
@@ -105,7 +105,7 @@ export default function PolarisSettings(props: PluginSettingsProps) {
type="text"
value={currentUrl}
onChange={handleUrlChange}
placeholder="/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/"
placeholder="/api/v1/namespaces/polaris/services/http:polaris-dashboard:80/proxy/"
style={{
width: '100%',
padding: '4px 8px',
@@ -125,7 +125,7 @@ export default function PolarisSettings(props: PluginSettingsProps) {
>
Examples:
<br /> K8s proxy:{' '}
<code>/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/</code>
<code>/api/v1/namespaces/polaris/services/http:polaris-dashboard:80/proxy/</code>
<br /> Full URL: <code>https://my-polaris.example.com</code>
</div>
</div>