## Summary - add the shared resolved-reference foundation with registry, resolvers, presenters, and badge semantics - refactor related context, assignment evidence, and policy-version assignment rendering toward label-first reference presentation - add Spec 132 artifacts and focused Pest coverage for reference resolution, degraded states, canonical linking, and tenant-context carryover ## Verification - `vendor/bin/sail bin pint --dirty --format agent` - focused Pest verification was marked complete in the task artifact ## Notes - this PR is opened from the current session branch - `specs/132-guid-context-resolver/tasks.md` reflects in-progress completion state for the implemented tasks Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #161
80 lines
4.0 KiB
PHP
80 lines
4.0 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);
|
|
$reference = is_array($entry['reference'] ?? null) ? $entry['reference'] : 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="space-y-2">
|
|
<div class="text-xs font-medium uppercase tracking-[0.18em] text-gray-500 dark:text-gray-400">
|
|
{{ $entry['label'] ?? 'Related record' }}
|
|
</div>
|
|
|
|
@if ($reference !== null)
|
|
@include('filament.infolists.entries.resolved-reference-detail', ['reference' => $reference])
|
|
@else
|
|
<div class="flex items-start justify-between gap-4">
|
|
<div class="min-w-0 space-y-1">
|
|
@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>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
@endif
|
|
</div>
|