deerflow2/frontend/src/components
Huixin615 a17d2ff8f8
fix(mcp): surface admin-required state on settings tools page (#3527) (#3533)
GET /api/mcp/config returns 403 for non-admin users, but the previous
client returned the error body as MCPConfig, causing MCPServerList to
crash with 'Cannot convert undefined or null to object' on
Object.entries(config.mcp_servers).

- api.ts: introduce MCPConfigRequestError; loadMCPConfig and
  updateMCPConfig now throw it (carrying status + isAdminRequired)
  instead of letting non-2xx bodies leak through as parsed config
- tool-settings-page.tsx: render a friendly 'admin privileges required'
  empty state when the React Query error is an admin-required
  MCPConfigRequestError; keep MCPServerList resilient with
  Object.entries(servers ?? {}) and an empty-state for no servers
- i18n: add settings.tools.adminRequired and settings.tools.empty in
  en-US, zh-CN and the Translations type
- tests: cover 403 / 5xx / instanceof / detail-fallback for both
  loadMCPConfig and updateMCPConfig in tests/unit/core/mcp/api.test.ts

Refs: #3527
2026-06-13 07:36:57 +08:00
..
ai-elements fix(frontend): render user messages as plain text and cap blockquote nesting (#3502) 2026-06-12 16:15:40 +08:00
landing feat: Add metadata and descriptions to various documentation pages in Chinese 2026-04-26 11:09:55 +08:00
ui fix(frontend): resolve login page flickering and resize observer loop. (#2954) 2026-05-17 09:01:42 +08:00
workspace fix(mcp): surface admin-required state on settings tools page (#3527) (#3533) 2026-06-13 07:36:57 +08:00
query-client-provider.tsx fix(frontend): unify local settings runtime state and remove sidebar layout from LocalSettings (#1879) 2026-04-07 17:41:34 +08:00
theme-provider.tsx feat: implement the first section of landing page 2026-01-23 00:15:21 +08:00