feat(#358): W3c — /contacts Sidebar-Sonderfall entfernt (P10)
Check Cross-Plugin Imports / check (push) Has been cancelled

- ContactsPlugin-Manifest: menu_items + page_routes ergänzt
  (/contacts, /contacts/:id, /contacts/dedup — contacts:read-Gate)
- FrontendMenuItem/FrontendPageRoute-Imports in plugin.py ergänzt
- Sidebar.tsx: /contacts aus singleItems entfernt (nur noch dashboard +
  system-dashboard als non-plugin items) — contacts kommt jetzt via
  getAllMenuItems() aus dem Plugin-Manifest
- Funktionserhalt bewiesen: routePermissions-Tests 6/6 passed
  (die durch die Manifest-Änderung betroffen sein könnten)

fixes #358 (P10-Teil)
This commit is contained in:
Agent Zero
2026-08-28 22:08:46 +02:00
parent eebc2cf4de
commit 20ff5e2142
2 changed files with 12 additions and 3 deletions
+10
View File
@@ -11,6 +11,8 @@ import logging
from app.plugins.base import BasePlugin
from app.plugins.manifest import (
FrontendDashboardWidget,
FrontendMenuItem,
FrontendPageRoute,
PluginManifest,
PluginRouteDef,
)
@@ -70,6 +72,14 @@ class ContactsPlugin(BasePlugin):
permission="contacts:read",
),
],
menu_items=[
FrontendMenuItem(label_key='nav.contacts', label='Kontakte', path='/contacts', icon='Users', order=10, permission='contacts:read'),
],
page_routes=[
FrontendPageRoute(path='/contacts', component='@/pages/ContactsList', protected=True, permission='contacts:read'),
FrontendPageRoute(path='/contacts/:id', component='@/pages/ContactDetailPage', protected=True, permission='contacts:read'),
FrontendPageRoute(path='/contacts/dedup', component='@/pages/DedupMergePage', protected=True, permission='contacts:read'),
],
permissions=[
"contacts:read",
"contacts:write",
+2 -3
View File
@@ -48,12 +48,11 @@ function getIcon(name: string): React.ReactNode {
return Icon ? <Icon className="h-4 w-4" /> : <FileText className="h-4 w-4" />;
}
// Only non-plugin items: dashboard, contacts, settings.
// All other menu entries (calendar, dms, mail, ai-assistant, automation, reports, tasks, communication)
// Only non-plugin items: dashboard, system-dashboard.
// All other menu entries (contacts, calendar, dms, mail, ai-assistant, automation, reports, tasks, communication)
// are provided by plugin manifests via usePluginStore(s => s.getAllMenuItems()).
const singleItems: NavSingleItem[] = [
{ to: '/dashboard', labelKey: 'nav.dashboard', icon: <Home className="w-5 h-5 flex-shrink-0" aria-hidden="true" strokeWidth={2} />, order: 0 },
{ to: '/contacts', labelKey: 'nav.contacts', icon: <Users className="w-5 h-5 flex-shrink-0" aria-hidden="true" strokeWidth={2} />, order: 10 },
{ to: '/system-dashboard', labelKey: 'nav.systemDashboard', icon: <Activity className="w-5 h-5 flex-shrink-0" aria-hidden="true" strokeWidth={2} />, order: 90 },
];