feat: Betrieb-Module auf 100% — Buttons verdrahtet, Delete-Flows, tote Links gefixt
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 36s
CI / test-python-backend-compliance (push) Successful in 32s
CI / test-python-document-crawler (push) Successful in 22s
CI / test-python-dsms-gateway (push) Successful in 17s
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 36s
CI / test-python-backend-compliance (push) Successful in 32s
CI / test-python-document-crawler (push) Successful in 22s
CI / test-python-dsms-gateway (push) Successful in 17s
- consent-management: ConsentTemplateCreateModal + useRouter für DSR-Navigation - vendor-compliance: QuickActionCard unterstützt onClick; /vendors/new → Modal, /processing-activities/new → Liste - incidents: handleDeleteIncident + Löschen-Button im IncidentDetailDrawer - whistleblower: handleDeleteReport + Löschen-Button im CaseDetailPanel - escalations: handleDeleteEscalation + Löschen-Button im EscalationDetailDrawer - notfallplan: ExerciseCreateModal (API-backed) + handleDeleteExercise + Neue-Übung-Button Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -604,13 +604,31 @@ const STATUS_TRANSITIONS: Record<string, { label: string; nextStatus: string } |
|
||||
function IncidentDetailDrawer({
|
||||
incident,
|
||||
onClose,
|
||||
onStatusChange
|
||||
onStatusChange,
|
||||
onDeleted,
|
||||
}: {
|
||||
incident: Incident
|
||||
onClose: () => void
|
||||
onStatusChange: () => void
|
||||
onDeleted?: () => void
|
||||
}) {
|
||||
const [isChangingStatus, setIsChangingStatus] = useState(false)
|
||||
const [isDeleting, setIsDeleting] = useState(false)
|
||||
|
||||
const handleDeleteIncident = async () => {
|
||||
if (!window.confirm(`Incident "${incident.title}" wirklich löschen?`)) return
|
||||
setIsDeleting(true)
|
||||
try {
|
||||
const res = await fetch(`/api/sdk/v1/incidents/${incident.id}`, { method: 'DELETE' })
|
||||
if (!res.ok) throw new Error(`Fehler: ${res.status}`)
|
||||
onDeleted ? onDeleted() : onClose()
|
||||
} catch (err) {
|
||||
console.error('Löschen fehlgeschlagen:', err)
|
||||
alert('Löschen fehlgeschlagen.')
|
||||
} finally {
|
||||
setIsDeleting(false)
|
||||
}
|
||||
}
|
||||
const severityInfo = INCIDENT_SEVERITY_INFO[incident.severity]
|
||||
const statusInfo = INCIDENT_STATUS_INFO[incident.status]
|
||||
const categoryInfo = INCIDENT_CATEGORY_INFO[incident.category]
|
||||
@@ -762,6 +780,17 @@ function IncidentDetailDrawer({
|
||||
<p className="text-xs text-gray-500 mb-2">72h-Meldefrist</p>
|
||||
<CountdownTimer incident={incident} />
|
||||
</div>
|
||||
|
||||
{/* Delete */}
|
||||
<div className="pt-2 border-t border-gray-100">
|
||||
<button
|
||||
onClick={handleDeleteIncident}
|
||||
disabled={isDeleting}
|
||||
className="px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 text-sm transition-colors disabled:opacity-50"
|
||||
>
|
||||
{isDeleting ? 'Löschen...' : 'Löschen'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1113,6 +1142,7 @@ export default function IncidentsPage() {
|
||||
incident={selectedIncident}
|
||||
onClose={() => setSelectedIncident(null)}
|
||||
onStatusChange={() => { setSelectedIncident(null); loadData() }}
|
||||
onDeleted={() => { setSelectedIncident(null); loadData() }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user