Vertrag-UI: Kunde-Link + Externtab + Info-Modal überall einheitlich

ContractDetail (Vertragsansicht): neben dem Kunden-Link sitzt jetzt
zusätzlich ein ExternalLink-Icon, das die Kundenakte in einem neuen
Tab öffnet. Info-Icon (Schnellansicht-Modal) bleibt wie gehabt.

ContractForm (Neuer/Bearbeiten-Vertrag): bekommt unter dem Heading
dieselbe Kunden-Zeile wie ContractDetail – Customer-Name als Link,
ExternalLink-Icon für neuen Tab, Info-Icon für die
CustomerInfoModal-Schnellansicht. Nur sichtbar wenn schon ein
Kunde gewählt ist.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-24 21:03:20 +02:00
parent 818f801939
commit b23ebeefc3
2 changed files with 52 additions and 1 deletions
@@ -1838,6 +1838,16 @@ export default function ContractDetail() {
<Link to={`/customers/${c.customer.id}`} state={pushHistory(currentPath, location.state)} className="text-blue-600 hover:underline"> <Link to={`/customers/${c.customer.id}`} state={pushHistory(currentPath, location.state)} className="text-blue-600 hover:underline">
{c.customer.companyName || `${c.customer.firstName} ${c.customer.lastName}`} {c.customer.companyName || `${c.customer.firstName} ${c.customer.lastName}`}
</Link> </Link>
<a
href={`/customers/${c.customer.id}`}
target="_blank"
rel="noopener noreferrer"
title="Kundenakte in neuem Tab öffnen"
aria-label="Kundenakte in neuem Tab öffnen"
className="text-gray-400 hover:text-blue-600 p-1 rounded"
>
<ExternalLink className="w-4 h-4" />
</a>
<button <button
type="button" type="button"
onClick={() => setShowCustomerInfo(true)} onClick={() => setShowCustomerInfo(true)}
+42 -1
View File
@@ -10,6 +10,7 @@ import Button from '../../components/ui/Button';
import Input from '../../components/ui/Input'; import Input from '../../components/ui/Input';
import Select from '../../components/ui/Select'; import Select from '../../components/ui/Select';
import CopyButton from '../../components/ui/CopyButton'; import CopyButton from '../../components/ui/CopyButton';
import CustomerInfoModal from '../../components/contracts/CustomerInfoModal';
import type { ContractType } from '../../types'; import type { ContractType } from '../../types';
import { formatDate } from '../../utils/dateFormat'; import { formatDate } from '../../utils/dateFormat';
import { useProviderSettings } from '../../hooks/useProviderSettings'; import { useProviderSettings } from '../../hooks/useProviderSettings';
@@ -221,6 +222,7 @@ export default function ContractForm() {
// Passwort-Sichtbarkeit // Passwort-Sichtbarkeit
const [showPortalPassword, setShowPortalPassword] = useState(false); const [showPortalPassword, setShowPortalPassword] = useState(false);
const [showCustomerInfo, setShowCustomerInfo] = useState(false);
const [showInternetPassword, setShowInternetPassword] = useState(false); const [showInternetPassword, setShowInternetPassword] = useState(false);
const [showSipPasswords, setShowSipPasswords] = useState<Record<number, boolean>>({}); const [showSipPasswords, setShowSipPasswords] = useState<Record<number, boolean>>({});
const [showSimPins, setShowSimPins] = useState<Record<number, boolean>>({}); const [showSimPins, setShowSimPins] = useState<Record<number, boolean>>({});
@@ -775,7 +777,7 @@ export default function ContractForm() {
return ( return (
<div> <div>
<div className="flex items-center gap-4 mb-6"> <div className="flex items-center gap-4 mb-2">
<Button variant="ghost" size="sm" onClick={() => navigate(back.to, { state: back.state })}> <Button variant="ghost" size="sm" onClick={() => navigate(back.to, { state: back.state })}>
<ArrowLeft className="w-4 h-4" /> <ArrowLeft className="w-4 h-4" />
</Button> </Button>
@@ -783,6 +785,36 @@ export default function ContractForm() {
{isEdit ? 'Vertrag bearbeiten' : 'Neuer Vertrag'} {isEdit ? 'Vertrag bearbeiten' : 'Neuer Vertrag'}
</h1> </h1>
</div> </div>
{customer && (
<p className="text-gray-500 ml-12 mb-6 flex items-center gap-1">
Kunde:{' '}
<Link
to={`/customers/${customer.id}`}
className="text-blue-600 hover:underline"
>
{customer.companyName || `${customer.firstName} ${customer.lastName}`}
</Link>
<a
href={`/customers/${customer.id}`}
target="_blank"
rel="noopener noreferrer"
title="Kundenakte in neuem Tab öffnen"
aria-label="Kundenakte in neuem Tab öffnen"
className="text-gray-400 hover:text-blue-600 p-1 rounded"
>
<ExternalLink className="w-4 h-4" />
</a>
<button
type="button"
onClick={() => setShowCustomerInfo(true)}
title="Wichtige Kundendaten anzeigen (Schnellansicht mit Copy-Buttons)"
aria-label="Kundendaten anzeigen"
className="text-gray-400 hover:text-blue-600 p-1 rounded"
>
<Info className="w-4 h-4" />
</button>
</p>
)}
{error && ( {error && (
<div className="mb-4 p-4 bg-red-50 border border-red-200 text-red-700 rounded-lg"> <div className="mb-4 p-4 bg-red-50 border border-red-200 text-red-700 rounded-lg">
@@ -1764,6 +1796,15 @@ export default function ContractForm() {
{/* Status-Info Modal */} {/* Status-Info Modal */}
<StatusInfoModal isOpen={showStatusInfo} onClose={() => setShowStatusInfo(false)} /> <StatusInfoModal isOpen={showStatusInfo} onClose={() => setShowStatusInfo(false)} />
{/* Kunden-Schnellansicht */}
{customer && (
<CustomerInfoModal
customerId={customer.id}
open={showCustomerInfo}
onClose={() => setShowCustomerInfo(false)}
/>
)}
</div> </div>
); );
} }