refactor(admin): split loeschfristen and vvt pages

Reduce both page.tsx files below the 500-LOC hard cap by extracting
all inline tab components and API helpers into colocated _components/.
- loeschfristen/page.tsx: 2720 → 467 LOC
- vvt/page.tsx: 2297 → 256 LOC
New files: LoeschkonzeptTab, loeschfristen/api, TabDokument, TabProcessor
Updated: TabVerzeichnis (template picker + badge), vvt/api (template helpers)
Fixed: VVTLinkSection wrong field name (linkedVVTActivityIds), VendorLinkSection added

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-04-16 17:11:45 +02:00
parent 2ade65431a
commit e0c1d21879
10 changed files with 1279 additions and 4424 deletions

View File

@@ -7,7 +7,7 @@ import {
import { renderStatusBadge } from './UebersichtTab'
import {
DataObjectSection, DeletionLogicSection, StorageSection,
ResponsibilitySection, VVTLinkSection, ReviewSection,
ResponsibilitySection, VVTLinkSection, VendorLinkSection, ReviewSection,
} from './EditorSections'
// ---------------------------------------------------------------------------
@@ -19,6 +19,7 @@ interface EditorTabProps {
editingId: string | null
editingPolicy: LoeschfristPolicy | null
vvtActivities: any[]
vendorList: Array<{id: string; name: string}>
saving: boolean
setEditingId: (id: string | null) => void
setTab: (tab: 'uebersicht' | 'editor' | 'generator' | 'export') => void
@@ -79,7 +80,7 @@ function EditorNoSelection({
// ---------------------------------------------------------------------------
function EditorForm({
policy, vvtActivities, saving, setEditingId, setTab,
policy, vvtActivities, vendorList, saving, setEditingId, setTab,
updatePolicy, deletePolicy, addLegalHold, removeLegalHold,
addStorageLocation, removeStorageLocation, handleSaveAndClose,
}: Omit<EditorTabProps, 'policies' | 'editingId' | 'editingPolicy' | 'createNewPolicy'> & {
@@ -127,6 +128,7 @@ function EditorForm({
addStorageLocation={addStorageLocation} removeStorageLocation={removeStorageLocation} />
<ResponsibilitySection policy={policy} set={set} />
<VVTLinkSection policy={policy} pid={pid} vvtActivities={vvtActivities} updatePolicy={updatePolicy} />
<VendorLinkSection policy={policy} pid={pid} vendorList={vendorList} updatePolicy={updatePolicy} />
<ReviewSection policy={policy} set={set} />
{/* Action buttons */}