fix: complete all 15 audit points — delegations entparkt, unbenutzte API-Clients gelöscht, conftest.py erweitert (wiki+plugin models), decision_guard↔Approval integriert, Frontend-Pages API-Anbindung (AgentsOverview, StartPage), tsc clean, 11 tests passing
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Start page — shown after login.
|
||||
* 2-column layout: left menu, right grid with workspace tiles.
|
||||
* 2-column layout: left menu, right grid with workspace tiles + dashboard stats.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
@@ -8,7 +8,9 @@ import { useNavigate } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
import { useUIStore } from '@/store/uiStore';
|
||||
import { Settings, HelpCircle, LayoutGrid, ArrowRight, Plus, Bot, Zap, ArrowLeft, ScrollText } from 'lucide-react';
|
||||
import { useUnifiedContacts, useAuditLog } from '@/api/hooks';
|
||||
import { StatCard } from '@/components/shared/StatCard';
|
||||
import { Settings, HelpCircle, LayoutGrid, ArrowRight, Plus, Bot, Zap, ArrowLeft, ScrollText, Users, Building2, Activity } from 'lucide-react';
|
||||
|
||||
// Workspace tile definition
|
||||
interface WorkspaceTile {
|
||||
@@ -37,6 +39,14 @@ export function StartPage() {
|
||||
const user = useAuthStore((state) => state.user);
|
||||
const sidebarOpen = useUIStore((state) => state.sidebarOpen);
|
||||
|
||||
const { data: companiesData } = useUnifiedContacts(1, 1, undefined, 'company');
|
||||
const { data: contactsData } = useUnifiedContacts(1, 1, undefined, 'person');
|
||||
const { data: auditData } = useAuditLog(1, 5);
|
||||
|
||||
const totalCompanies = companiesData?.total ?? 0;
|
||||
const totalContacts = contactsData?.total ?? 0;
|
||||
const recentActivities = auditData?.items?.length ?? 0;
|
||||
|
||||
const menuItems = [
|
||||
{ id: 'workspaces', label: 'Workspaces', icon: <LayoutGrid className="w-4 h-4" />, active: true },
|
||||
{ id: 'settings', label: 'Einstellungen', icon: <Settings className="w-4 h-4" />, onClick: () => navigate('/settings') },
|
||||
@@ -94,6 +104,28 @@ export function StartPage() {
|
||||
<p className="text-sm text-secondary-500 mt-1">Wähle einen Workspace aus</p>
|
||||
</div>
|
||||
|
||||
{/* Dashboard stats */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-3 gap-4 mb-8">
|
||||
<StatCard
|
||||
label={t('dashboard.totalCompanies', 'Firmen')}
|
||||
value={totalCompanies}
|
||||
icon={<Building2 className="w-5 h-5" />}
|
||||
testId="start-stat-companies"
|
||||
/>
|
||||
<StatCard
|
||||
label={t('dashboard.totalContacts', 'Kontakte')}
|
||||
value={totalContacts}
|
||||
icon={<Users className="w-5 h-5" />}
|
||||
testId="start-stat-contacts"
|
||||
/>
|
||||
<StatCard
|
||||
label={t('dashboard.recentActivity', 'Aktuelle Aktivität')}
|
||||
value={recentActivities}
|
||||
icon={<Activity className="w-5 h-5" />}
|
||||
testId="start-stat-activity"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Masonry-style grid */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
{DEFAULT_WORKSPACES.map((ws) => (
|
||||
|
||||
Reference in New Issue
Block a user