gdpr audit implemented, email log, vollmachten, pdf delete cancel data privacy and vollmachten, removed message no id card in engergy car, and other contracts that are not telecom contracts, added insert counter for engery
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useAuth } from '../../context/AuthContext';
|
||||
import { gdprApi } from '../../services/api';
|
||||
import {
|
||||
LayoutDashboard,
|
||||
Users,
|
||||
@@ -11,17 +13,35 @@ import {
|
||||
ClipboardList,
|
||||
MessageSquare,
|
||||
AlertCircle,
|
||||
Shield,
|
||||
FileCheck,
|
||||
UserCircle,
|
||||
Gauge,
|
||||
} from 'lucide-react';
|
||||
|
||||
export default function Sidebar() {
|
||||
const { user, logout, hasPermission, isCustomer, developerMode } = useAuth();
|
||||
const { user, logout, hasPermission, isCustomer, isCustomerPortal, developerMode } = useAuth();
|
||||
|
||||
// Prüfe ob Vollmachten vorhanden sind (nur für Portal-Kunden)
|
||||
const { data: authData } = useQuery({
|
||||
queryKey: ['my-authorizations'],
|
||||
queryFn: () => gdprApi.getMyAuthorizations(),
|
||||
enabled: isCustomerPortal,
|
||||
staleTime: 60_000,
|
||||
});
|
||||
|
||||
const hasAuthorizations = (authData?.data?.length ?? 0) > 0;
|
||||
|
||||
const navItems = [
|
||||
{ to: '/', icon: LayoutDashboard, label: 'Dashboard', show: true, end: true },
|
||||
{ to: '/my-profile', icon: UserCircle, label: 'Meine Daten', show: isCustomerPortal },
|
||||
{ to: '/customers', icon: Users, label: 'Kunden', show: hasPermission('customers:read') && !isCustomer },
|
||||
{ to: '/contracts', icon: FileText, label: 'Verträge', show: hasPermission('contracts:read'), end: true },
|
||||
{ to: '/contracts/cockpit', icon: AlertCircle, label: 'Vertrags-Cockpit', show: hasPermission('contracts:read') && !isCustomer },
|
||||
{ to: '/tasks', icon: isCustomer ? MessageSquare : ClipboardList, label: isCustomer ? 'Support-Anfragen' : 'Aufgaben', show: hasPermission('contracts:read') },
|
||||
{ to: '/my-meters', icon: Gauge, label: 'Zählerstände', show: isCustomerPortal },
|
||||
{ to: '/privacy', icon: Shield, label: 'Datenschutz', show: isCustomerPortal },
|
||||
{ to: '/authorizations', icon: FileCheck, label: 'Vollmachten', show: isCustomerPortal && hasAuthorizations },
|
||||
];
|
||||
|
||||
const developerItems = [
|
||||
|
||||
Reference in New Issue
Block a user