mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
fix(frontend): leave MCP server integrations out of provider settings
This commit is contained in:
1 parent
99713e15b4
commit
8cebb9449e
2 files changed
+16
No files matched your search
@@ -489,6 +489,17 @@ describe('ProviderSettings', () => {
|
||||
expect(within(connectedCard).queryByRole('button', { name: 'Edit API key for Connected Command Only' })).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('leaves MCP server integrations out of the provider lists', async () => {
|
||||
vi.mocked(oauthApi.getIntegrations).mockResolvedValue([
|
||||
integrationFixture('anthropic', 'Anthropic', [oauthMethod], true),
|
||||
{ ...integrationFixture('mcp_figma', 'figma', [oauthMethod]), metadata: { source: 'mcp' } },
|
||||
])
|
||||
renderSettings()
|
||||
|
||||
await screen.findByText('Anthropic')
|
||||
expect(screen.queryByText('figma')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('shows an integration-list error instead of guessing connection status', async () => {
|
||||
vi.mocked(oauthApi.getIntegrations).mockRejectedValue(new Error('Server unavailable'))
|
||||
renderSettings()
|
||||
|
||||
@@ -35,6 +35,10 @@ function hasKeyConnection(integration: IntegrationInfo): boolean {
|
||||
)
|
||||
}
|
||||
|
||||
function isMcpIntegration(integration: IntegrationInfo): boolean {
|
||||
return integration.metadata?.source === 'mcp'
|
||||
}
|
||||
|
||||
function supportsOAuthMethods(methods: IntegrationMethod[]): boolean {
|
||||
return methods.some((method) => method.type === 'oauth')
|
||||
}
|
||||
@@ -79,6 +83,7 @@ function buildProviderEntries(
|
||||
.filter(
|
||||
(integration) =>
|
||||
!seen.has(integration.id) &&
|
||||
!isMcpIntegration(integration) &&
|
||||
(supportsSettingsAuthentication(integration.methods) || hasCredentialConnection(integration)),
|
||||
)
|
||||
.map((integration): ProviderEntry => ({
|
||||
|
||||
Reference in new issue
Block a user