Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(control-ui): r1-m1 omit empty connector authentication field

Josuébb6eae3d7bf6
diff --git a/control-ui/components/ConnectorDetailPage/index.tsx b/control-ui/components/ConnectorDetailPage/index.tsx
index 7ebc93ffd..16a168a9a 100644
--- a/control-ui/components/ConnectorDetailPage/index.tsx
+++ b/control-ui/components/ConnectorDetailPage/index.tsx
@@ -110,6 +110,7 @@ export function ConnectorDetailPage() {
const spec = server?.spec ?? {}
const auth =
spec.auth && typeof spec.auth === 'object' ? (spec.auth as Record<string, unknown>) : {}
+ const authentication = connectorAuthenticationLabel(auth.type)
const conditions = server?.status?.conditions ?? []
const transport =
spec.transport && typeof spec.transport === 'object'
@@ -276,10 +277,9 @@ export function ConnectorDetailPage() {
value={spec.enabled === false ? 'No' : 'Yes'}
/>
<ConnectorReadOnlyField label="Transport" value={text(transport.type)} />
- <ConnectorReadOnlyField
- label="Authentication"
- value={connectorAuthenticationLabel(auth.type)}
- />
+ {authentication ? (
+ <ConnectorReadOnlyField label="Authentication" value={authentication} />
+ ) : null}
<ConnectorReadOnlyField code label="Endpoint" value={text(transport.url)} wide />
</div>
</FormSection>
diff --git a/control-ui/components/__tests__/ConnectorDetailAccessPage.test.tsx b/control-ui/components/__tests__/ConnectorDetailAccessPage.test.tsx
index 191f8e074..5d05c8a79 100644
--- a/control-ui/components/__tests__/ConnectorDetailAccessPage.test.tsx
+++ b/control-ui/components/__tests__/ConnectorDetailAccessPage.test.tsx
@@ -266,3 +266,34 @@ describe('connector detail access tabs', () => {
).not.toBeInTheDocument()
})
})
+
+describe('connector detail authentication field', () => {
+ it.each([
+ { name: 'absent', authType: undefined, expectedLabel: undefined },
+ { name: 'none', authType: 'none', expectedLabel: undefined },
+ { name: 'OAuth', authType: 'oauth', expectedLabel: 'OAuth' },
+ { name: 'bearer', authType: 'bearer', expectedLabel: 'Static credentials' },
+ ])(
+ 'shows the field only when authentication is configured ($name)',
+ async ({ authType, expectedLabel }) => {
+ const auth = authType === undefined ? {} : { auth: { type: authType } }
+ vi.mocked(api.getMcpServer).mockResolvedValue({
+ metadata: { name: 'search', namespace: 'mcp-server' },
+ spec: { description: 'Search the public web', ...auth },
+ status: { conditions: [] },
+ })
+ navigation.params = { name: 'search', tab: 'configuration' }
+ navigation.segment = 'configuration'
+
+ renderDetail()
+
+ expect(await screen.findByText('Search the public web')).toBeVisible()
+ if (expectedLabel) {
+ expect(screen.getByText('Authentication')).toBeVisible()
+ expect(screen.getByText(expectedLabel)).toBeVisible()
+ } else {
+ expect(screen.queryByText('Authentication')).not.toBeInTheDocument()
+ }
+ }
+ )
+})
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 3dee10cc4..b91d7ddbb 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.731",
+ "version": "0.1.732",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.731",
+ "version": "0.1.732",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/control-ui/package.json b/control-ui/package.json
index c20794cdc..b587ca335 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.731",
+ "version": "0.1.732",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",