- 83 Komponenten: Livewire\Volt\Component → Livewire\Component
- 73 Routen (admin, auth, customer): Volt::route() → Route::livewire()
- 88 Testdateien: Volt::test/actingAs → Livewire::test/actingAs
- VoltServiceProvider gelöscht; composer remove livewire/volt
- config/livewire.php auf v4-Schlüssel (component_layout, component_placeholder,
component_locations, make_command: SFC ohne ⚡). Der alte Schlüssel layout war
wirkungslos; alle gerouteten Komponenten setzen ihr Layout selbst.
- CLAUDE.md, AGENTS.md, boost.json, .cursorrules, Skill volt-development
- Roadmap: erledigt; Larastan erfasst SFCs weiterhin nicht (Blade-Dateien)
Suite 2.325 grün, einer übersprungen; Larastan und Pint ohne Meldung;
route:cache und view:cache laufen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
196 lines
9.3 KiB
PHP
196 lines
9.3 KiB
PHP
<?php
|
|
|
|
use App\Enums\ArchiveEvent;
|
|
use App\Models\ArchiveEntry;
|
|
use App\Services\Archive\EvidenceArchive;
|
|
use Flux\Flux;
|
|
use Livewire\Attributes\Layout;
|
|
use Livewire\Attributes\Title;
|
|
use Livewire\Attributes\Url;
|
|
use Livewire\Component;
|
|
use Livewire\WithPagination;
|
|
|
|
/**
|
|
* Admin ▸ Management ▸ Beweisarchiv (Bildkennzeichnung Block F.2).
|
|
*
|
|
* Liste der Einträge, Legal-Hold-Schalter mit Pflichtvermerk, Öffnen und
|
|
* Export nur mit Zweck (Zugriffsprotokoll). Inhalte werden hier nie
|
|
* angezeigt — nur Kennzahlen; der Payload kommt als Download.
|
|
*/
|
|
new #[Layout('components.layouts.app'), Title('Beweisarchiv')] class extends Component
|
|
{
|
|
use WithPagination;
|
|
|
|
#[Url]
|
|
public string $event = '';
|
|
|
|
#[Url]
|
|
public string $subject = '';
|
|
|
|
/** Vorgang im Meldeverfahren (legal_requests.id, 5.1 d). */
|
|
#[Url]
|
|
public string $legalRequest = '';
|
|
|
|
public ?int $holdEntryId = null;
|
|
|
|
public string $holdNote = '';
|
|
|
|
public function openHold(int $entryId): void
|
|
{
|
|
$this->holdEntryId = $entryId;
|
|
$this->holdNote = '';
|
|
$this->resetErrorBag();
|
|
}
|
|
|
|
public function toggleHold(EvidenceArchive $archive): void
|
|
{
|
|
$entry = ArchiveEntry::query()->findOrFail((int) $this->holdEntryId);
|
|
|
|
$this->validate(
|
|
['holdNote' => ['required', 'string', 'min:5', 'max:1000']],
|
|
['holdNote.required' => __('Bitte begründen Sie das Setzen bzw. Aufheben (Pflichtvermerk).')],
|
|
);
|
|
|
|
try {
|
|
$entry->legal_hold
|
|
? $archive->releaseLegalHold($entry, auth()->user(), $this->holdNote)
|
|
: $archive->setLegalHold($entry, auth()->user(), $this->holdNote);
|
|
} catch (\RuntimeException $exception) {
|
|
// Eintrag wurde zwischenzeitlich nach Fristablauf gelöscht (N02).
|
|
$this->holdEntryId = null;
|
|
Flux::toast(text: $exception->getMessage(), variant: 'danger');
|
|
|
|
return;
|
|
}
|
|
|
|
$this->holdEntryId = null;
|
|
$this->holdNote = '';
|
|
|
|
Flux::toast(text: $entry->legal_hold ? __('Legal Hold gesetzt.') : __('Legal Hold aufgehoben, Frist läuft neu.'), variant: 'success');
|
|
}
|
|
|
|
public function with(): array
|
|
{
|
|
$query = ArchiveEntry::query()->orderByDesc('id');
|
|
|
|
if ($this->event !== '' && ArchiveEvent::tryFrom($this->event) !== null) {
|
|
$query->where('event', $this->event);
|
|
}
|
|
|
|
if ($this->subject !== '') {
|
|
$query->where(function ($q): void {
|
|
$q->where('press_release_id', (int) $this->subject)->orWhere('subject_id', (int) $this->subject);
|
|
});
|
|
}
|
|
|
|
if ($this->legalRequest !== '') {
|
|
$query->where('legal_request_id', (int) $this->legalRequest);
|
|
}
|
|
|
|
return [
|
|
'entries' => $query->paginate(50),
|
|
'events' => ArchiveEvent::cases(),
|
|
'configured' => app(EvidenceArchive::class)->isConfigured(),
|
|
'holdEntry' => $this->holdEntryId ? ArchiveEntry::query()->find($this->holdEntryId) : null,
|
|
];
|
|
}
|
|
}; ?>
|
|
|
|
<div class="space-y-6">
|
|
<div class="flex flex-wrap items-end justify-between gap-4">
|
|
<div>
|
|
<flux:heading size="xl">{{ __('Beweisarchiv') }}</flux:heading>
|
|
<flux:subheading>{{ __('Verschlüsselte Datensätze zu entfernten Veröffentlichungen. Drei Jahre zum Jahresende, Legal Hold hat Vorrang. Jeder Zugriff wird mit Zweck protokolliert.') }}</flux:subheading>
|
|
</div>
|
|
<div class="flex gap-2">
|
|
<flux:select wire:model.live="event" size="sm">
|
|
<flux:select.option value="">{{ __('Alle Ereignisse') }}</flux:select.option>
|
|
@foreach ($events as $eventOption)
|
|
<flux:select.option :value="$eventOption->value">{{ $eventOption->label() }}</flux:select.option>
|
|
@endforeach
|
|
</flux:select>
|
|
<flux:input wire:model.live.debounce.400ms="subject" size="sm" :placeholder="__('PM- oder Bild-ID')" class="w-40" />
|
|
<flux:input wire:model.live.debounce.400ms="legalRequest" size="sm" :placeholder="__('Vorgang (Antrags-ID)')" class="w-44" />
|
|
</div>
|
|
</div>
|
|
|
|
@unless ($configured)
|
|
<flux:callout variant="danger" icon="exclamation-triangle">
|
|
{{ __('ARCHIVE_KEY ist nicht gesetzt: Es wird nichts archiviert und nichts kann geöffnet werden. Schlüssel mit „php artisan archive:key“ erzeugen, in der Umgebung setzen und getrennt sichern.') }}
|
|
</flux:callout>
|
|
@endunless
|
|
|
|
<flux:card>
|
|
<table class="w-full text-[13px]">
|
|
<thead>
|
|
<tr class="text-left text-zinc-500">
|
|
<th class="py-2 pr-3 font-medium">#</th>
|
|
<th class="py-2 pr-3 font-medium">{{ __('Ereignis') }}</th>
|
|
<th class="py-2 pr-3 font-medium">{{ __('Betrifft') }}</th>
|
|
<th class="py-2 pr-3 font-medium">{{ __('Grund') }}</th>
|
|
<th class="py-2 pr-3 font-medium">{{ __('Angelegt') }}</th>
|
|
<th class="py-2 pr-3 font-medium">{{ __('Frist bis') }}</th>
|
|
<th class="py-2 pr-3 font-medium">{{ __('Status') }}</th>
|
|
<th class="py-2 font-medium"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-zinc-200 dark:divide-zinc-700">
|
|
@forelse ($entries as $entry)
|
|
<tr wire:key="archive-{{ $entry->id }}">
|
|
<td class="py-2 pr-3 font-mono text-zinc-500">{{ $entry->id }}</td>
|
|
<td class="py-2 pr-3">{{ $entry->event->label() }}</td>
|
|
<td class="py-2 pr-3 text-zinc-600 dark:text-zinc-300">
|
|
{{ class_basename($entry->subject_type) }} #{{ $entry->subject_id }}
|
|
@if ($entry->press_release_id)
|
|
· <a class="underline underline-offset-2" href="{{ route('admin.press-releases.show', ['id' => $entry->press_release_id]) }}" wire:navigate>PM #{{ $entry->press_release_id }}</a>
|
|
@endif
|
|
@if ($entry->legal_request_id)
|
|
· <button type="button" class="underline underline-offset-2" wire:click="$set('legalRequest', '{{ $entry->legal_request_id }}')">{{ __('Vorgang') }} #{{ $entry->legal_request_id }}</button>
|
|
@endif
|
|
</td>
|
|
<td class="py-2 pr-3">{{ $entry->reason_category->label() }}</td>
|
|
<td class="py-2 pr-3 whitespace-nowrap">{{ $entry->created_at?->format('d.m.Y H:i') }}</td>
|
|
<td class="py-2 pr-3 whitespace-nowrap">{{ $entry->retain_until->format('d.m.Y') }}</td>
|
|
<td class="py-2 pr-3">
|
|
@if ($entry->isTombstoned())
|
|
<flux:badge size="sm" color="zinc">{{ __('gelöscht') }}</flux:badge>
|
|
@elseif ($entry->legal_hold)
|
|
<flux:badge size="sm" color="red">Legal Hold</flux:badge>
|
|
@else
|
|
<flux:badge size="sm" color="green">{{ __('aufbewahrt') }}</flux:badge>
|
|
@endif
|
|
</td>
|
|
<td class="py-2 text-right whitespace-nowrap">
|
|
@unless ($entry->isTombstoned())
|
|
<flux:button size="xs" variant="ghost" wire:click="openHold({{ $entry->id }})">
|
|
{{ $entry->legal_hold ? __('Hold aufheben') : __('Legal Hold') }}
|
|
</flux:button>
|
|
<flux:button size="xs" variant="ghost" href="{{ route('admin.archive.download', ['entry' => $entry->id]) }}">{{ __('Öffnen') }}</flux:button>
|
|
<flux:button size="xs" variant="ghost" href="{{ route('admin.archive.export', ['entry' => $entry->id]) }}">{{ __('Export') }}</flux:button>
|
|
@endunless
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="8" class="py-6 text-center text-zinc-500">{{ __('Noch keine Archiveinträge.') }}</td></tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
<div class="mt-4">{{ $entries->links() }}</div>
|
|
</flux:card>
|
|
|
|
@if ($holdEntry)
|
|
<flux:card data-hold-form>
|
|
<flux:heading size="md">{{ $holdEntry->legal_hold ? __('Legal Hold aufheben (Eintrag #:id)', ['id' => $holdEntry->id]) : __('Legal Hold setzen (Eintrag #:id)', ['id' => $holdEntry->id]) }}</flux:heading>
|
|
@if ($holdEntry->legal_hold_note)
|
|
<flux:text class="mt-1 text-sm text-zinc-500">{{ __('Letzter Vermerk: :note', ['note' => $holdEntry->legal_hold_note]) }}</flux:text>
|
|
@endif
|
|
<div class="mt-3 space-y-3">
|
|
<flux:textarea wire:model="holdNote" :label="__('Pflichtvermerk (Streit, Regress, Aktenzeichen)')" rows="2" />
|
|
<div class="flex gap-2">
|
|
<flux:button variant="primary" wire:click="toggleHold">{{ $holdEntry->legal_hold ? __('Aufheben') : __('Setzen') }}</flux:button>
|
|
<flux:button variant="filled" wire:click="$set('holdEntryId', null)">{{ __('Abbrechen') }}</flux:button>
|
|
</div>
|
|
</div>
|
|
</flux:card>
|
|
@endif
|
|
</div>
|