## Summary - align the system-panel Operations, Failed operations, and Stuck operations pages to the read-only registry contract by removing inline row triage and keeping row-click inspection - keep retry, cancel, and mark-investigated behavior on the canonical system operation detail page while adding the explicit `Show all operations` return path and updated `Operations / Operation` copy - add and update focused Pest and Livewire coverage for list CTA behavior, detail-owned triage, and view-only versus manage-capable platform access - add Spec 170 implementation artifacts plus the follow-on Spec 171 and Spec 172 packages ## Testing - `vendor/bin/sail artisan test --compact tests/Feature/System/Spec114/OpsTriageActionsTest.php` - `vendor/bin/sail artisan test --compact tests/Feature/Guards/ActionSurfaceContractTest.php` - `vendor/bin/sail artisan test --compact tests/Feature/System/Spec114/OpsFailuresViewTest.php` - `vendor/bin/sail artisan test --compact tests/Feature/System/Spec114/OpsStuckViewTest.php` - integrated browser smoke on `/system/ops/runs`, `/system/ops/failures`, `/system/ops/stuck`, empty states via search filter, and detail-page retry confirmation visibility ## Notes - branch pushed from `170-system-operations-surface-alignment` - latest commit: `64b4d741 feat: align system operations surfaces` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #201
162 lines
6.7 KiB
PHP
162 lines
6.7 KiB
PHP
@php
|
|
/** @var \App\Models\OperationRun $run */
|
|
$run = $this->run;
|
|
|
|
$statusSpec = \App\Support\Badges\BadgeRenderer::spec(
|
|
\App\Support\Badges\BadgeDomain::OperationRunStatus,
|
|
(string) $run->status,
|
|
);
|
|
|
|
$outcomeSpec = (string) $run->status === 'completed'
|
|
? \App\Support\Badges\BadgeRenderer::spec(
|
|
\App\Support\Badges\BadgeDomain::OperationRunOutcome,
|
|
(string) $run->outcome,
|
|
)
|
|
: null;
|
|
|
|
$summaryCounts = is_array($run->summary_counts) ? $run->summary_counts : [];
|
|
$hasSummary = count($summaryCounts) > 0;
|
|
$integrityNote = \App\Support\RedactionIntegrity::noteForRun($run);
|
|
$guidance = \App\Support\OpsUx\OperationUxPresenter::surfaceGuidance($run);
|
|
@endphp
|
|
|
|
<x-filament-panels::page>
|
|
<div class="space-y-6">
|
|
<x-filament::section>
|
|
<x-slot name="heading">
|
|
Operation #{{ (int) $run->getKey() }}
|
|
</x-slot>
|
|
|
|
<x-slot name="description">
|
|
{{ \App\Support\OperationCatalog::label((string) $run->type) }}
|
|
</x-slot>
|
|
|
|
<x-slot name="afterHeader">
|
|
<div class="flex items-center gap-2">
|
|
<x-filament::badge
|
|
:color="$statusSpec->color"
|
|
:icon="$statusSpec->icon"
|
|
>
|
|
{{ $statusSpec->label }}
|
|
</x-filament::badge>
|
|
|
|
@if ($outcomeSpec)
|
|
<x-filament::badge
|
|
:color="$outcomeSpec->color"
|
|
:icon="$outcomeSpec->icon"
|
|
>
|
|
{{ $outcomeSpec->label }}
|
|
</x-filament::badge>
|
|
@endif
|
|
</div>
|
|
</x-slot>
|
|
|
|
<dl class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
|
<div>
|
|
<dt class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Workspace</dt>
|
|
<dd class="mt-1 text-sm font-medium text-gray-950 dark:text-white">
|
|
{{ $run->workspace?->name ?? 'Unknown workspace' }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Tenant</dt>
|
|
<dd class="mt-1 text-sm font-medium text-gray-950 dark:text-white">
|
|
{{ $run->tenant?->name ?? 'Tenantless' }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Started</dt>
|
|
<dd class="mt-1 text-sm font-medium text-gray-950 dark:text-white">
|
|
{{ $run->started_at?->toDayDateTimeString() ?? '—' }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Completed</dt>
|
|
<dd class="mt-1 text-sm font-medium text-gray-950 dark:text-white">
|
|
{{ $run->completed_at?->toDayDateTimeString() ?? '—' }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Initiator</dt>
|
|
<dd class="mt-1 text-sm font-medium text-gray-950 dark:text-white">
|
|
{{ (string) ($run->initiator_name ?? '—') }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Navigation</dt>
|
|
<dd class="mt-1 text-sm">
|
|
<div class="flex flex-col gap-2">
|
|
<x-filament::link href="{{ \App\Support\System\SystemOperationRunLinks::index() }}">
|
|
Show all operations
|
|
</x-filament::link>
|
|
|
|
<x-filament::link href="{{ \App\Filament\System\Pages\Ops\Runbooks::getUrl(panel: 'system') }}">
|
|
Go to runbooks
|
|
</x-filament::link>
|
|
</div>
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</x-filament::section>
|
|
|
|
@if ($integrityNote)
|
|
<x-filament::section>
|
|
<div class="rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-100">
|
|
{{ $integrityNote }}
|
|
</div>
|
|
</x-filament::section>
|
|
@endif
|
|
|
|
@if ($guidance)
|
|
<x-filament::section>
|
|
<x-slot name="heading">
|
|
Next step
|
|
</x-slot>
|
|
|
|
<div class="rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-800 dark:border-white/10 dark:bg-white/5 dark:text-gray-100">
|
|
{{ $guidance }}
|
|
</div>
|
|
</x-filament::section>
|
|
@endif
|
|
|
|
@if ($hasSummary)
|
|
<x-filament::section>
|
|
<x-slot name="heading">
|
|
Summary counts
|
|
</x-slot>
|
|
|
|
<div class="grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4">
|
|
@foreach ($summaryCounts as $key => $value)
|
|
<div class="rounded-lg bg-gray-50 px-4 py-3 dark:bg-white/5">
|
|
<p class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">
|
|
{{ \App\Support\OpsUx\SummaryCountsNormalizer::label((string) $key) }}
|
|
</p>
|
|
<p class="mt-1 text-xl font-bold text-gray-950 dark:text-white">
|
|
{{ is_numeric($value) ? number_format((int) $value) : $value }}
|
|
</p>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</x-filament::section>
|
|
@endif
|
|
|
|
@if (! empty($run->failure_summary))
|
|
<x-filament::section>
|
|
<x-slot name="heading">
|
|
<div class="flex items-center gap-2 text-danger-600 dark:text-danger-400">
|
|
<x-heroicon-m-exclamation-circle class="h-5 w-5" />
|
|
Failures
|
|
</div>
|
|
</x-slot>
|
|
|
|
@include('filament.partials.json-viewer', ['value' => $run->failure_summary])
|
|
</x-filament::section>
|
|
@endif
|
|
</div>
|
|
</x-filament-panels::page>
|