## Summary - collapse secondary and diagnostic operation-run sections by default to reduce page density - visually emphasize the primary next step while keeping counts readable but secondary - keep failures and other actionable detail available without dominating the default reading path ## Testing - vendor/bin/sail artisan test --compact tests/Feature/Filament/OperationRunBaselineTruthSurfaceTest.php tests/Feature/Filament/OperationRunEnterpriseDetailPageTest.php tests/Feature/Filament/EnterpriseDetailTemplateRegressionTest.php tests/Feature/Operations/TenantlessOperationRunViewerTest.php - vendor/bin/sail bin pint --dirty --format agent Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #194
79 lines
3.1 KiB
PHP
79 lines
3.1 KiB
PHP
@php
|
|
use App\Support\Ui\EnterpriseDetail\FactPresentation;
|
|
|
|
$header = $header ?? [];
|
|
$header = is_array($header) ? $header : [];
|
|
|
|
$statusBadges = array_values(array_filter($header['statusBadges'] ?? [], 'is_array'));
|
|
$keyFacts = array_values(array_filter($header['keyFacts'] ?? [], 'is_array'));
|
|
$primaryActions = array_values(array_filter($header['primaryActions'] ?? [], 'is_array'));
|
|
@endphp
|
|
|
|
<x-filament::section
|
|
:heading="$header['title'] ?? 'Detail'"
|
|
:description="$header['subtitle'] ?? null"
|
|
>
|
|
@if ($primaryActions !== [])
|
|
<x-slot name="afterHeader">
|
|
<div class="flex flex-wrap items-center gap-2">
|
|
@foreach ($primaryActions as $action)
|
|
@if (filled($action['url'] ?? null))
|
|
@if (($action['openInNewTab'] ?? false) === true)
|
|
<x-filament::button
|
|
tag="a"
|
|
size="sm"
|
|
:color="($action['destructive'] ?? false) === true ? 'danger' : 'gray'"
|
|
:href="$action['url']"
|
|
:icon="$action['icon'] ?? null"
|
|
target="_blank"
|
|
rel="noreferrer noopener"
|
|
>
|
|
{{ $action['label'] }}
|
|
</x-filament::button>
|
|
@else
|
|
<x-filament::button
|
|
tag="a"
|
|
size="sm"
|
|
:color="($action['destructive'] ?? false) === true ? 'danger' : 'gray'"
|
|
:href="$action['url']"
|
|
:icon="$action['icon'] ?? null"
|
|
>
|
|
{{ $action['label'] }}
|
|
</x-filament::button>
|
|
@endif
|
|
@endif
|
|
@endforeach
|
|
</div>
|
|
</x-slot>
|
|
@endif
|
|
|
|
<div class="space-y-4">
|
|
@if ($statusBadges !== [])
|
|
<div class="flex flex-wrap items-center gap-2">
|
|
@foreach ($statusBadges as $badge)
|
|
<x-filament::badge
|
|
:color="$badge['color'] ?? 'gray'"
|
|
:icon="$badge['icon'] ?? null"
|
|
:icon-color="$badge['iconColor'] ?? null"
|
|
>
|
|
{{ $badge['label'] ?? 'State' }}
|
|
</x-filament::badge>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
|
|
@if (filled($header['descriptionHint'] ?? null))
|
|
<div class="max-w-3xl text-sm text-gray-600 dark:text-gray-300">
|
|
{{ $header['descriptionHint'] }}
|
|
</div>
|
|
@endif
|
|
|
|
@if ($keyFacts !== [])
|
|
@include('filament.infolists.entries.enterprise-detail.section-items', [
|
|
'items' => $keyFacts,
|
|
'variant' => 'header',
|
|
])
|
|
@endif
|
|
</div>
|
|
</x-filament::section>
|