Ordering + limit-only Test für created_at DESC in DependencyExtractionFeatureTest.php UI Test für masked Identifier (ID: 123456…) + Guest-Access blocked in InventoryItemDependenciesTest.php Quickstart ergänzt um manuellen <2s Check in quickstart.md pr-gate Checkbox-Format normalisiert (kein leading space) in pr-gate.md Co-authored-by: Ahmed Darrazi <ahmeddarrazi@adsmac.local> Reviewed-on: #49
67 lines
3.5 KiB
PHP
67 lines
3.5 KiB
PHP
@php /** @var callable $getState */ @endphp
|
|
|
|
<div class="space-y-4">
|
|
<form method="GET" class="flex items-center gap-2">
|
|
<label for="direction" class="text-sm text-gray-600">Direction</label>
|
|
<select id="direction" name="direction" class="fi-input fi-select">
|
|
<option value="all" {{ request('direction', 'all') === 'all' ? 'selected' : '' }}>All</option>
|
|
<option value="inbound" {{ request('direction') === 'inbound' ? 'selected' : '' }}>Inbound</option>
|
|
<option value="outbound" {{ request('direction') === 'outbound' ? 'selected' : '' }}>Outbound</option>
|
|
</select>
|
|
|
|
<label for="relationship_type" class="text-sm text-gray-600">Relationship</label>
|
|
<select id="relationship_type" name="relationship_type" class="fi-input fi-select">
|
|
<option value="all" {{ request('relationship_type', 'all') === 'all' ? 'selected' : '' }}>All</option>
|
|
@foreach (\App\Support\Enums\RelationshipType::options() as $value => $label)
|
|
<option value="{{ $value }}" {{ request('relationship_type') === $value ? 'selected' : '' }}>{{ $label }}</option>
|
|
@endforeach
|
|
</select>
|
|
<button type="submit" class="fi-btn">Apply</button>
|
|
</form>
|
|
|
|
@php
|
|
$raw = $getState();
|
|
$edges = $raw instanceof \Illuminate\Support\Collection ? $raw : collect($raw);
|
|
@endphp
|
|
|
|
@if ($edges->isEmpty())
|
|
<div class="text-sm text-gray-500">No dependencies found</div>
|
|
@else
|
|
<div class="divide-y">
|
|
@foreach ($edges->groupBy('relationship_type') as $type => $group)
|
|
<div class="py-2">
|
|
<div class="text-xs uppercase tracking-wide text-gray-600 mb-2">{{ str_replace('_', ' ', $type) }}</div>
|
|
<ul class="space-y-1">
|
|
@foreach ($group as $edge)
|
|
@php
|
|
$isMissing = ($edge['target_type'] ?? null) === 'missing';
|
|
$name = $edge['metadata']['last_known_name'] ?? null;
|
|
$targetId = $edge['target_id'] ?? null;
|
|
$display = $name ?: ($targetId ? ("ID: ".substr($targetId,0,6)."…") : 'Unknown');
|
|
|
|
$missingTitle = 'Missing target';
|
|
if (is_string($name) && $name !== '') {
|
|
$missingTitle .= ". Last known: {$name}";
|
|
}
|
|
$rawRef = $edge['metadata']['raw_ref'] ?? null;
|
|
if ($rawRef !== null) {
|
|
$encodedRef = json_encode($rawRef);
|
|
if (is_string($encodedRef) && $encodedRef !== '') {
|
|
$missingTitle .= '. Ref: '.\Illuminate\Support\Str::limit($encodedRef, 200);
|
|
}
|
|
}
|
|
@endphp
|
|
<li class="flex items-center gap-2 text-sm">
|
|
<span class="fi-badge" title="{{ is_string($targetId) ? $targetId : '' }}">{{ $display }}</span>
|
|
@if ($isMissing)
|
|
<span class="fi-badge fi-badge-danger" title="{{ $missingTitle }}">Missing</span>
|
|
@endif
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|