TenantAtlas/apps/platform/resources/views/filament/components/verification-report-viewer.blade.php
ahmido e02799b383 feat: implement spec 198 monitoring page state contract (#238)
## Summary
- implement Spec 198 monitoring page-state contracts across Operations, Audit Log, Finding Exceptions Queue, Evidence Overview, Baseline Compare Landing, and Baseline Compare Matrix
- align selected-record and draft/apply behavior with query/session restoration semantics, including canonical navigation and tenant-filter normalization helpers
- add Spec 198 feature and browser coverage, update closure/spec artifacts, and refresh affected regression tests that asserted pre-contract behavior

## Verification
- focused Spec 198 feature pack passed through Sail
- Spec 198 browser smoke passed through Sail
- existing Spec 190 and Spec 194 browser smokes passed through Sail
- targeted fallout tests were updated and rerun during full-suite triage

## Notes
- Livewire v4 / Filament v5 compliant only; no legacy API reintroduction
- no provider registration changes; Laravel 11+ provider registration remains in `bootstrap/providers.php`
- no global-search behavior changed for any resource
- destructive queue decision actions remain confirmation-gated and authorization-backed
- no new Filament assets were added; existing deploy step for `php artisan filament:assets` remains unchanged

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #238
2026-04-15 21:59:42 +00:00

98 lines
4.2 KiB
PHP

@php
$surface = is_array($surface ?? null) ? $surface : [];
$coreState = is_string($surface['coreState'] ?? null) ? (string) $surface['coreState'] : 'unavailable';
$hostVariation = is_array($surface['hostVariation'] ?? null) ? $surface['hostVariation'] : [];
$diagnostics = is_array($surface['diagnostics'] ?? null) ? $surface['diagnostics'] : [];
$showDiagnosticsZone = (bool) ($diagnostics['hasTechnicalZone'] ?? true)
&& ! (bool) ($hostVariation['supportsTechnicalDetailsTrigger'] ?? false);
$redactionNotes = is_array($redactionNotes ?? null)
? array_values(array_filter($redactionNotes, 'is_string'))
: [];
$canAcknowledge = (bool) ($canAcknowledge ?? false);
$ackAction = $ackAction ?? null;
$showAssist = (bool) ($showAssist ?? false);
$assistActionName = is_string($assistActionName ?? null) && trim((string) $assistActionName) !== ''
? trim((string) $assistActionName)
: 'wizardVerificationRequiredPermissionsAssist';
$linkBehavior = $linkBehavior ?? app(\App\Support\Verification\VerificationLinkBehavior::class);
$emptyState = is_array($surface['emptyState'] ?? null) ? $surface['emptyState'] : null;
@endphp
<div
data-shared-detail-family="verification-report"
data-host-kind="{{ (string) ($surface['hostKind'] ?? 'operation_run_detail') }}"
class="space-y-4"
>
@if ($coreState === 'unavailable')
<div
data-shared-zone="unavailable"
class="rounded-lg border border-gray-200 bg-white p-4 text-sm text-gray-600 shadow-sm dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300"
>
<div class="font-medium text-gray-900 dark:text-white">
{{ $emptyState['title'] ?? 'Verification report unavailable' }}
</div>
<div class="mt-1">
{{ $emptyState['message'] ?? 'This operation does not have a report yet.' }}
</div>
<div class="mt-2 text-xs text-gray-600 dark:text-gray-300">
<span class="font-semibold">Read-only:</span> this view uses stored data and makes no external calls.
</div>
@if ($redactionNotes !== [])
<div class="mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-100">
@foreach ($redactionNotes as $note)
<div>{{ $note }}</div>
@endforeach
</div>
@endif
</div>
@else
@include('filament.components.verification-report.summary', [
'surface' => $surface,
'redactionNotes' => $redactionNotes,
])
<div x-data="{ tab: 'issues' }" class="space-y-4">
<x-filament::tabs label="Verification report tabs">
<x-filament::tabs.item
:active="true"
alpine-active="tab === 'issues'"
x-on:click="tab = 'issues'"
>
Issues
</x-filament::tabs.item>
<x-filament::tabs.item
:active="false"
alpine-active="tab === 'passed'"
x-on:click="tab = 'passed'"
>
Passed
</x-filament::tabs.item>
</x-filament::tabs>
<div x-show="tab === 'issues'">
@include('filament.components.verification-report.issues', [
'surface' => $surface,
'canAcknowledge' => $canAcknowledge,
'ackAction' => $ackAction,
'showAssist' => $showAssist,
'assistActionName' => $assistActionName,
'linkBehavior' => $linkBehavior,
])
</div>
<div x-show="tab === 'passed'" style="display: none;">
@include('filament.components.verification-report.passed', [
'surface' => $surface,
])
</div>
</div>
@if ($showDiagnosticsZone)
@include('filament.components.verification-report.diagnostics', [
'surface' => $surface,
])
@endif
@endif
</div>