TenantAtlas/resources/views/filament/infolists/entries/related-context.blade.php
ahmido b15d1950b4 feat: add cross-resource navigation cohesion (#160)
## Summary
- add a shared cross-resource navigation layer with canonical navigation context and related-context rendering
- wire findings, policy versions, baseline snapshots, backup sets, and canonical operations surfaces into consistent drill-down flows
- extend focused Pest coverage for canonical operations links, related navigation, and tenant-context preservation

## Testing
- focused Pest coverage for spec 131 was added and the task list marks the implementation verification and Pint steps as completed

## Follow-up
- manual QA checklist item `T036` in `specs/131-cross-resource-navigation/tasks.md` is still open and should be completed during review

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #160
2026-03-10 16:08:14 +00:00

73 lines
3.3 KiB
PHP

@php
$entries = $getState() ?? [];
@endphp
<div class="space-y-3">
@if ($entries === [])
<div class="rounded-lg border border-dashed border-gray-300 px-4 py-6 text-sm text-gray-600 dark:border-gray-700 dark:text-gray-300">
No related context is available for this record.
</div>
@else
@foreach ($entries as $entry)
@php
$isAvailable = ($entry['availability'] ?? null) === 'available' && filled($entry['targetUrl'] ?? null);
@endphp
<div class="rounded-xl border border-gray-200 bg-white/80 px-4 py-3 shadow-sm dark:border-gray-800 dark:bg-gray-900/60">
<div class="flex items-start justify-between gap-4">
<div class="min-w-0 space-y-1">
<div class="text-xs font-medium uppercase tracking-[0.18em] text-gray-500 dark:text-gray-400">
{{ $entry['label'] ?? 'Related record' }}
</div>
@if ($isAvailable)
<a href="{{ $entry['targetUrl'] }}" class="text-sm font-semibold text-primary-600 hover:text-primary-500 hover:underline dark:text-primary-400">
{{ $entry['value'] ?? 'Open related record' }}
</a>
@else
<div class="text-sm font-semibold text-gray-900 dark:text-white">
{{ $entry['value'] ?? 'Unavailable' }}
</div>
@endif
@if (filled($entry['secondaryValue'] ?? null))
<div class="text-xs text-gray-500 dark:text-gray-400">
{{ $entry['secondaryValue'] }}
</div>
@endif
@if (filled($entry['unavailableReason'] ?? null))
<div class="text-xs text-gray-600 dark:text-gray-300">
{{ $entry['unavailableReason'] }}
</div>
@endif
</div>
<div class="flex shrink-0 items-center gap-2">
@if ($isAvailable && filled($entry['actionLabel'] ?? null))
<a
href="{{ $entry['targetUrl'] }}"
class="text-xs font-medium text-primary-600 hover:text-primary-500 hover:underline dark:text-primary-400"
>
{{ $entry['actionLabel'] }}
</a>
@endif
@if (filled($entry['contextBadge'] ?? null))
<x-filament::badge color="gray" size="sm">
{{ $entry['contextBadge'] }}
</x-filament::badge>
@endif
@unless ($isAvailable)
<x-filament::badge color="gray" size="sm">
Unavailable
</x-filament::badge>
@endunless
</div>
</div>
</div>
@endforeach
@endif
</div>