## Summary - introduce a shared enterprise-detail composition layer for Filament detail pages - migrate BackupSet, BaselineSnapshot, EntraGroup, and OperationRun detail screens to the shared summary-first layout - add regression and unit coverage for section hierarchy, related context, degraded states, and duplicate fact/badge presentation ## Scope - adds shared support classes under `app/Support/Ui/EnterpriseDetail` - adds shared enterprise detail Blade partials under `resources/views/filament/infolists/entries/enterprise-detail` - updates touched Filament resources/pages to use the shared detail shell - includes Spec 133 artifacts under `specs/133-detail-page-template` ## Notes - branch: `133-detail-page-template` - base: `dev` - commit: `fd294c7` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #162
70 lines
3.2 KiB
PHP
70 lines
3.2 KiB
PHP
@php
|
|
$detail = isset($getState) ? $getState() : ($detail ?? null);
|
|
$detail = is_array($detail) ? $detail : [];
|
|
|
|
$mainSections = array_values(array_filter($detail['mainSections'] ?? [], 'is_array'));
|
|
$supportingCards = array_values(array_filter($detail['supportingCards'] ?? [], 'is_array'));
|
|
$technicalSections = array_values(array_filter($detail['technicalSections'] ?? [], 'is_array'));
|
|
$emptyStateNotes = array_values(array_filter($detail['emptyStateNotes'] ?? [], 'is_array'));
|
|
@endphp
|
|
|
|
<div class="space-y-6">
|
|
@include('filament.infolists.entries.enterprise-detail.header', [
|
|
'header' => is_array($detail['header'] ?? null) ? $detail['header'] : [],
|
|
])
|
|
|
|
@if ($emptyStateNotes !== [])
|
|
<div class="space-y-3">
|
|
@foreach ($emptyStateNotes as $state)
|
|
@include('filament.infolists.entries.enterprise-detail.empty-state', ['state' => $state])
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
|
|
<div class="grid gap-6 xl:grid-cols-3">
|
|
<div class="{{ $supportingCards === [] ? 'xl:col-span-3' : 'xl:col-span-2' }} space-y-6">
|
|
@foreach ($mainSections as $section)
|
|
@php
|
|
$view = is_string($section['view'] ?? null) && trim($section['view']) !== '' ? trim($section['view']) : null;
|
|
$items = is_array($section['items'] ?? null) ? $section['items'] : [];
|
|
$emptyState = is_array($section['emptyState'] ?? null) ? $section['emptyState'] : null;
|
|
@endphp
|
|
|
|
<x-filament::section
|
|
:heading="$section['title'] ?? 'Details'"
|
|
:description="$section['description'] ?? null"
|
|
:collapsible="(bool) ($section['collapsible'] ?? false)"
|
|
:collapsed="(bool) ($section['collapsed'] ?? false)"
|
|
>
|
|
@if ($view !== null)
|
|
@include($view, is_array($section['viewData'] ?? null) ? $section['viewData'] : [])
|
|
@elseif ($items !== [])
|
|
@include('filament.infolists.entries.enterprise-detail.section-items', [
|
|
'items' => $items,
|
|
'action' => is_array($section['action'] ?? null) ? $section['action'] : null,
|
|
])
|
|
@elseif ($emptyState !== null)
|
|
@include('filament.infolists.entries.enterprise-detail.empty-state', ['state' => $emptyState])
|
|
@endif
|
|
</x-filament::section>
|
|
@endforeach
|
|
</div>
|
|
|
|
@if ($supportingCards !== [])
|
|
<aside class="space-y-4">
|
|
@foreach ($supportingCards as $card)
|
|
@include('filament.infolists.entries.enterprise-detail.supporting-card', ['card' => $card])
|
|
@endforeach
|
|
</aside>
|
|
@endif
|
|
</div>
|
|
|
|
@if ($technicalSections !== [])
|
|
<div class="space-y-4">
|
|
@foreach ($technicalSections as $section)
|
|
@include('filament.infolists.entries.enterprise-detail.technical-detail', ['section' => $section])
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|