@php // Nome e cor do selo de projeto, vindos de dev_projects (ver DevAdminService::projetos()). $devProjectsMap = collect($projetos ?? []) ->mapWithKeys(fn ($p) => [$p->slug => ['name' => $p->name, 'color' => $p->color]]) ->all(); $totalIdeias = $totalIdeias ?? 0; $contagemCategorias = $contagemCategorias ?? []; $totalTrabalho = $totalTrabalho ?? count($chamados); $categoriaAtiva = $categoriaAtiva ?? null; @endphp {{-- Chips de categoria. Renderizados aqui para os contadores acompanharem cada recarga da lista, e movidos pelo script abaixo para #dev-chips na toolbar. --}} @if (count($chamados) != 0) @foreach ($chamados as $chamado) @php $openerName = $chamado['opener_name'] ?? data_get($chamado['payload'], 'nome', ''); $openerInitials = collect(explode(' ', trim($openerName))) ->filter() ->take(2) ->map(fn($w) => strtoupper($w[0])) ->implode(''); $openerFoto = $chamado['opener_photo'] ?? null; $openerCargo = $chamado['opener_cargo'] ?? ''; $openerFilial = $chamado['opener_filial'] ?? ''; $tooltipText = \App\Helpers\TextHelper::resumo( data_get($chamado['payload'], 'msg', '') ?: ($chamado['content'] ?? '') ); $isPending = $chamado['actiontime'] === 'new'; // Dev-specific title parts $projeto = data_get($chamado['payload'], 'projeto', ''); $titulo = data_get($chamado['payload'], 'titulo', $chamado['name']); $projInfo = $devProjectsMap[$projeto] ?? null; $bugCount = (int) data_get($chamado['payload'], 'count', 1); $isBug = (int) ($chamado['category_id'] ?? 0) === \App\Services\BugReportService::CATEGORY_BUG; @endphp
@if ($isBug)
@endif {{-- ID --}}
#{{ $chamado['id'] }}
{{-- Opener --}}
@if ($openerName)
@if ($openerFoto) @else
{{ $openerInitials ?: '?' }}
@endif @if ($isPending) @endif
{{ Str::limit($openerName, 18) }} @if ($openerCargo || $openerFilial) {{ Str::limit(implode(' | ', array_filter([Str::limit($openerCargo, 15), $openerFilial])), 32) }} @endif
@else
?
Não informado
@endif
{{-- Title (Dev: título + badge projeto; a categoria fica nos chips) --}}
{{ $titulo }} @if ($isBug) @endif @if ($projInfo) {{ $projInfo['name'] }} @endif @if ($bugCount > 1) ×{{ $bugCount }} @endif
{{-- Status --}}
{{-- Agents (acompanhadores) --}} @php $followups = $followupsByTicket[$chamado['id']] ?? []; $currentUserId = auth()->id(); @endphp
@if ($followups) @else @endif
{{-- Dates --}}
Aberto {{ date('d/m/y', strtotime($chamado['date_creation'])) }}
Modif. {{ date('d/m/y', strtotime($chamado['date_mod'])) }}
{{-- Actions --}}
@endforeach @else @include('admin.view._empty') @endif