@php $state = $getState() ?? []; $isFoundationEntry = function ($item) { return is_array($item) && array_key_exists('decision', $item) && array_key_exists('sourceId', $item); }; if (is_array($state) && array_key_exists('items', $state)) { $foundationItems = collect($state['foundations'] ?? [])->filter($isFoundationEntry); $policyItems = collect($state['items'] ?? [])->values(); $results = $state; } else { $results = $state; $foundationItems = collect($results)->filter($isFoundationEntry); $policyItems = collect($results)->reject($isFoundationEntry); } $tenant = rescue(fn () => \App\Models\Tenant::current(), null); $groupLabelResolver = $tenant ? app(\App\Services\Directory\EntraGroupLabelResolver::class) : null; $formatGroupId = function ($groupId, $fallbackName = null) use ($tenant, $groupLabelResolver) { if (! is_string($groupId) || $groupId === '') { return null; } $cachedName = null; if ($tenant && $groupLabelResolver) { $cached = $groupLabelResolver->lookupMany($tenant, [$groupId]); $cachedName = $cached[strtolower($groupId)] ?? null; } $name = is_string($fallbackName) && $fallbackName !== '' ? $fallbackName : null; return \App\Services\Directory\EntraGroupLabelResolver::formatLabel($cachedName ?? $name, $groupId); }; @endphp @if ($foundationItems->isEmpty() && $policyItems->isEmpty())
No results recorded.
@else @php $needsAttention = $policyItems->contains(function ($item) { $status = $item['status'] ?? null; return in_array($status, ['partial', 'manual_required'], true); }); @endphp