@php $diffs = $getState() ?? []; $diffs = is_array($diffs) ? $diffs : []; $summary = $summary ?? []; $summary = is_array($summary) ? $summary : []; $ranAt = $ranAt ?? null; $ranAtLabel = null; if (is_string($ranAt) && $ranAt !== '') { try { $ranAtLabel = \Carbon\CarbonImmutable::parse($ranAt)->format('Y-m-d H:i'); } catch (\Throwable) { $ranAtLabel = $ranAt; } } $policiesTotal = (int) ($summary['policies_total'] ?? 0); $policiesChanged = (int) ($summary['policies_changed'] ?? 0); $assignmentsChanged = (int) ($summary['assignments_changed'] ?? 0); $scopeTagsChanged = (int) ($summary['scope_tags_changed'] ?? 0); $diffsOmitted = (int) ($summary['diffs_omitted'] ?? 0); $limitedKeys = static function (array $items, int $limit = 8): array { $keys = array_keys($items); if (count($keys) <= $limit) { return $keys; } return array_slice($keys, 0, $limit); }; @endphp
{{ $policiesChanged }}/{{ $policiesTotal }} policies changed {{ $assignmentsChanged }} assignments changed {{ $scopeTagsChanged }} scope tags changed @if ($diffsOmitted > 0) {{ $diffsOmitted }} diffs omitted (limit) @endif
@if ($diffs === [])
No preview generated yet.
@else
@foreach ($diffs as $entry) @php $entry = is_array($entry) ? $entry : []; $name = $entry['display_name'] ?? $entry['policy_identifier'] ?? 'Item'; $type = $entry['policy_type'] ?? 'type'; $platform = $entry['platform'] ?? 'platform'; $action = $entry['action'] ?? 'update'; $diff = is_array($entry['diff'] ?? null) ? $entry['diff'] : []; $diffSummary = is_array($diff['summary'] ?? null) ? $diff['summary'] : []; $added = (int) ($diffSummary['added'] ?? 0); $removed = (int) ($diffSummary['removed'] ?? 0); $changed = (int) ($diffSummary['changed'] ?? 0); $assignmentsDelta = (bool) ($entry['assignments_changed'] ?? false); $scopeTagsDelta = (bool) ($entry['scope_tags_changed'] ?? false); $diffOmitted = (bool) ($entry['diff_omitted'] ?? false); $diffTruncated = (bool) ($entry['diff_truncated'] ?? false); $changedKeys = $limitedKeys(is_array($diff['changed'] ?? null) ? $diff['changed'] : []); $addedKeys = $limitedKeys(is_array($diff['added'] ?? null) ? $diff['added'] : []); $removedKeys = $limitedKeys(is_array($diff['removed'] ?? null) ? $diff['removed'] : []); @endphp
{{ $action }} {{ $added }} added {{ $removed }} removed {{ $changed }} changed @if ($assignmentsDelta) assignments @endif @if ($scopeTagsDelta) scope tags @endif @if ($diffTruncated) truncated @endif
@if ($diffOmitted)
Diff details omitted due to preview limits. Narrow scope to see more items in detail.
@elseif ($changedKeys !== [] || $addedKeys !== [] || $removedKeys !== [])
@if ($changedKeys !== [])
Changed keys (sample)
    @foreach ($changedKeys as $key)
  • {{ $key }}
  • @endforeach
@endif @if ($addedKeys !== [])
Added keys (sample)
    @foreach ($addedKeys as $key)
  • {{ $key }}
  • @endforeach
@endif @if ($removedKeys !== [])
Removed keys (sample)
    @foreach ($removedKeys as $key)
  • {{ $key }}
  • @endforeach
@endif
@endif
@endforeach
@endif