@php $results = $getState() ?? []; $foundationItems = collect($results)->filter(function ($item) { return is_array($item) && array_key_exists('decision', $item) && array_key_exists('sourceId', $item); }); $policyItems = collect($results)->reject(function ($item) { return is_array($item) && array_key_exists('decision', $item) && array_key_exists('sourceId', $item); }); @endphp @if (empty($results))

No results recorded.

@else @php $needsAttention = $policyItems->contains(function ($item) { $status = $item['status'] ?? null; return in_array($status, ['partial', 'manual_required'], true); }); @endphp
@if ($foundationItems->isNotEmpty())
Foundations
@foreach ($foundationItems as $item) @php $decision = $item['decision'] ?? 'mapped_existing'; $decisionColor = match ($decision) { 'created' => 'text-green-700 bg-green-100 border-green-200', 'created_copy' => 'text-amber-900 bg-amber-100 border-amber-200', 'mapped_existing' => 'text-blue-700 bg-blue-100 border-blue-200', 'failed' => 'text-red-700 bg-red-100 border-red-200', 'skipped' => 'text-amber-900 bg-amber-50 border-amber-200', default => 'text-gray-700 bg-gray-100 border-gray-200', }; @endphp
{{ $item['sourceName'] ?? $item['sourceId'] ?? 'Foundation' }} {{ $decision }}
{{ $item['type'] ?? 'foundation' }}
@if (! empty($item['targetName']))
Target: {{ $item['targetName'] }}
@endif @if (! empty($item['reason']))
{{ $item['reason'] }}
@endif
@endforeach
@endif @if ($needsAttention)
Some settings could not be applied automatically. Review the per-setting details below.
@endif @if ($policyItems->isNotEmpty())
Policies
@foreach ($policyItems as $item)
{{ $item['policy_identifier'] ?? $item['policy_id'] ?? 'Policy' }} {{ $item['policy_type'] ?? '' }}
@php $status = $item['status'] ?? 'unknown'; $restoreMode = $item['restore_mode'] ?? null; $statusColor = match ($status) { 'applied' => 'text-green-700 bg-green-100 border-green-200', 'dry_run' => 'text-blue-700 bg-blue-100 border-blue-200', 'skipped' => 'text-amber-900 bg-amber-50 border-amber-200', 'partial' => 'text-amber-900 bg-amber-50 border-amber-200', 'manual_required' => 'text-amber-900 bg-amber-100 border-amber-200', 'failed' => 'text-red-700 bg-red-100 border-red-200', default => 'text-gray-700 bg-gray-100 border-gray-200', }; @endphp
@if ($restoreMode === 'preview-only') preview-only @endif {{ $status }}
@php $itemReason = $item['reason'] ?? null; $itemGraphMessage = $item['graph_error_message'] ?? null; if ($itemReason === 'preview_only') { $itemReason = 'Preview-only policy type; execution skipped.'; } @endphp @if (! empty($itemReason) && ($itemGraphMessage === null || $itemGraphMessage !== $itemReason))
{{ $itemReason }}
@endif @if (! empty($item['assignment_summary']) && is_array($item['assignment_summary'])) @php $summary = $item['assignment_summary']; $assignmentOutcomes = $item['assignment_outcomes'] ?? []; $assignmentIssues = collect($assignmentOutcomes) ->filter(fn ($outcome) => in_array($outcome['status'] ?? null, ['failed', 'skipped'], true)) ->values(); @endphp
Assignments: {{ (int) ($summary['success'] ?? 0) }} success • {{ (int) ($summary['failed'] ?? 0) }} failed • {{ (int) ($summary['skipped'] ?? 0) }} skipped
@if ($assignmentIssues->isNotEmpty())
Assignment details
@foreach ($assignmentIssues as $outcome) @php $outcomeStatus = $outcome['status'] ?? 'unknown'; $outcomeColor = match ($outcomeStatus) { 'failed' => 'text-red-700 bg-red-100 border-red-200', 'skipped' => 'text-amber-900 bg-amber-100 border-amber-200', default => 'text-gray-700 bg-gray-100 border-gray-200', }; $assignmentGroupId = $outcome['group_id'] ?? ($outcome['assignment']['target']['groupId'] ?? null); @endphp
Assignment {{ $assignmentGroupId ?? 'unknown group' }}
{{ $outcomeStatus }}
@if (! empty($outcome['mapped_group_id']))
Mapped to: {{ $outcome['mapped_group_id'] }}
@endif @php $outcomeReason = $outcome['reason'] ?? null; $outcomeGraphMessage = $outcome['graph_error_message'] ?? null; @endphp @if (! empty($outcomeReason) && ($outcomeGraphMessage === null || $outcomeGraphMessage !== $outcomeReason))
{{ $outcomeReason }}
@endif @if (! empty($outcome['graph_error_message']) || ! empty($outcome['graph_error_code']))
{{ $outcome['graph_error_message'] ?? 'Unknown error' }}
@if (! empty($outcome['graph_error_code']))
Code: {{ $outcome['graph_error_code'] }}
@endif
@endif
@endforeach
@endif @endif @if (! empty($item['compliance_action_summary']) && is_array($item['compliance_action_summary'])) @php $summary = $item['compliance_action_summary']; $complianceOutcomes = is_array($item['compliance_action_outcomes'] ?? null) ? $item['compliance_action_outcomes'] : []; $complianceEntries = collect($complianceOutcomes)->values(); @endphp
Compliance notifications: {{ (int) ($summary['mapped'] ?? 0) }} mapped • {{ (int) ($summary['skipped'] ?? 0) }} skipped
@if ($complianceEntries->isNotEmpty())
Compliance notification details
@foreach ($complianceEntries as $outcome) @php $outcomeStatus = $outcome['status'] ?? 'unknown'; $outcomeColor = match ($outcomeStatus) { 'mapped' => 'text-green-700 bg-green-100 border-green-200', 'skipped' => 'text-amber-900 bg-amber-100 border-amber-200', default => 'text-gray-700 bg-gray-100 border-gray-200', }; @endphp
Template {{ $outcome['template_id'] ?? 'unknown' }}
{{ $outcomeStatus }}
@if (! empty($outcome['rule_name']))
Rule: {{ $outcome['rule_name'] }}
@endif @if (! empty($outcome['mapped_template_id']))
Mapped to: {{ $outcome['mapped_template_id'] }}
@endif @if (! empty($outcome['reason']))
{{ $outcome['reason'] }}
@endif
@endforeach
@endif @endif @if (! empty($item['created_policy_id'])) @php $createdMode = $item['created_policy_mode'] ?? null; $createdMessage = match ($createdMode) { 'metadata_only' => 'New policy created (metadata only). Apply settings manually.', 'created' => 'New policy created.', default => 'New policy created (manual cleanup required).', }; @endphp
{{ $createdMessage }} ID: {{ $item['created_policy_id'] }}
@endif @if (! empty($item['graph_error_message']) || ! empty($item['graph_error_code']))
Graph error
{{ $item['graph_error_message'] ?? 'Unknown error' }}
@if (! empty($item['graph_error_code']))
Code: {{ $item['graph_error_code'] }}
@endif @if (! empty($item['graph_request_id']) || ! empty($item['graph_client_request_id']))
Details
@if (! empty($item['graph_request_id']))
request-id: {{ $item['graph_request_id'] }}
@endif @if (! empty($item['graph_client_request_id']))
client-request-id: {{ $item['graph_client_request_id'] }}
@endif
@endif
@endif @if (! empty($item['settings_apply']) && is_array($item['settings_apply'])) @php $apply = $item['settings_apply']; $total = (int) ($apply['total'] ?? 0); $applied = (int) ($apply['applied'] ?? 0); $failed = (int) ($apply['failed'] ?? 0); $manual = (int) ($apply['manual_required'] ?? 0); $issues = $apply['issues'] ?? []; @endphp
Settings applied: {{ $applied }}/{{ $total }} @if ($failed > 0 || $manual > 0) • {{ $failed }} failed • {{ $manual }} manual @endif
@if (! empty($issues))
Settings requiring attention
@foreach ($issues as $issue) @php $issueStatus = $issue['status'] ?? 'unknown'; $issueColor = match ($issueStatus) { 'failed' => 'text-red-700 bg-red-100 border-red-200', 'manual_required' => 'text-amber-900 bg-amber-100 border-amber-200', default => 'text-gray-700 bg-gray-100 border-gray-200', }; @endphp
Setting {{ $issue['setting_id'] ?? 'unknown' }}
{{ $issueStatus }}
@if (! empty($issue['reason']))
{{ $issue['reason'] }}
@endif @if (! empty($issue['graph_error_message']) || ! empty($issue['graph_error_code']))
{{ $issue['graph_error_message'] ?? 'Unknown error' }}
@if (! empty($issue['graph_error_code']))
Code: {{ $issue['graph_error_code'] }}
@endif @if (! empty($issue['graph_request_id']) || ! empty($issue['graph_client_request_id']))
@if (! empty($issue['graph_request_id']))
request-id: {{ $issue['graph_request_id'] }}
@endif @if (! empty($issue['graph_client_request_id']))
client-request-id: {{ $issue['graph_client_request_id'] }}
@endif
@endif
@endif
@endforeach
@endif @endif @if (! empty($item['platform']))
Platform: {{ $item['platform'] }}
@endif
@endforeach
@endif
@endif