@extends('layouts.demo10.base') @php $approvalCount = count($data ?? []); $approvalChangeDetails = collect($data ?? [])->mapWithKeys(function ($item) { $change = $item['changes'] ?? []; $instanceId = $item['step']->workflow_instance_id ?? ''; $rowUuid = $change['row_uuid'] ?? ''; $detailKey = $instanceId . '_' . $rowUuid; return [ $detailKey => [ 'workflow_instance_id' => $instanceId, 'row_uuid' => $rowUuid, 'table_name' => $change['table_name'] ?? 'submissions', 'row_key' => $change['row_key'] ?? '__id', 'column_labels' => $change['column_labels'] ?? [], 'old_data' => $change['old_data'] ?? [], 'new_data' => $change['new_data'] ?? [], ], ]; }); @endphp @section('content')

Pending Approvals

Project/Workflow/Approvals
@if(!empty($data))

Approval Queue

{{ $approvalCount }} Pending
{{-- @if(count($data) > 0) @foreach(array_keys((array) $data[0]['submission']) as $col) @endforeach @endif --}} @foreach($data as $item) @php $submission = (array) $item['submission']; $changeItem = $item['changes'] ?? []; $changes = $changeItem['new_data'] ?? []; $rowUuid = $changeItem['row_uuid'] ?? ''; $instanceId = $item['step']->workflow_instance_id; $detailKey = $instanceId . '_' . $rowUuid; @endphp {{-- @foreach($submission as $col => $value) @php $updatedValue = $changes[$col] ?? $value; $highlight = array_key_exists($col, $changes) ? 'approval-cell-updated' : ''; $displayValue = filled((string) $updatedValue) ? $updatedValue : '-'; @endphp @endforeach --}} @endforeach
UUID{{ $col }}Actions
{{ $rowUuid }}{{ $displayValue }}
@csrf @if($workflowDetails->is_approved) @endif @if($workflowDetails->is_rejected) @endif
@else
There are no pending approvals for this instance.
@endif
@endsection @section('scripts') @endsection