TenantAtlas/apps/platform/app/Filament/Widgets/Dashboard/EnvironmentDashboardOverview.php
Ahmed Darrazi 6ed29d5756
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 6m32s
feat(platform): implement environment dashboard baseline compare productization
2026-05-20 22:31:13 +02:00

82 lines
3.4 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Filament\Widgets\Dashboard;
use App\Models\ManagedEnvironment;
use App\Support\EnvironmentDashboard\EnvironmentDashboardSummaryBuilder;
use Filament\Facades\Filament;
use Filament\Widgets\Widget;
class EnvironmentDashboardOverview extends Widget
{
protected static bool $isLazy = false;
protected int|string|array $columnSpan = 'full';
protected string $view = 'filament.widgets.dashboard.environment-dashboard-overview';
/**
* @return array<string, mixed>
*/
protected function getViewData(): array
{
$tenant = Filament::getTenant();
if (! $tenant instanceof ManagedEnvironment) {
return [
'context' => [
'workspace' => __('localization.dashboard.overview.context_workspace'),
'tenant' => __('localization.dashboard.overview.context_no_tenant'),
'provider' => null,
'providerKey' => null,
'latestActivity' => null,
],
'posture' => [
'status' => __('localization.dashboard.overview.status_unavailable'),
'tone' => 'gray',
'headline' => __('localization.dashboard.overview.tenant_context_unavailable_headline'),
'summary' => __('localization.dashboard.overview.tenant_context_unavailable_summary'),
],
'readinessDecision' => [
'question' => 'Is this environment ready, blocked, stale, or requiring review?',
'statusLabel' => 'Status',
'status' => __('localization.dashboard.overview.status_unavailable'),
'tone' => 'gray',
'reasonLabel' => 'Reason',
'reason' => __('localization.dashboard.overview.tenant_context_unavailable_headline'),
'impactLabel' => 'Impact',
'impact' => __('localization.dashboard.overview.tenant_context_unavailable_summary'),
'proofLabel' => 'Readiness proof',
'proof' => 'Evidence, operation, review, provider, backup, and baseline signals are summarized before diagnostics.',
'nextActionLabel' => 'Next action',
'actionLabel' => 'Review readiness proof',
'actionUrl' => null,
'actionDisabled' => true,
'helperText' => 'No single repo-real follow-up is currently available.',
],
'kpis' => [],
'recommendedActions' => [],
'governanceStatus' => [],
'readinessCards' => [],
'readinessDimensions' => [],
'readinessProofPanel' => [],
'supportingSignals' => [],
'diagnosticsDisclosure' => [
'label' => 'Diagnostics - Collapsed',
'summary' => 'Support diagnostics stay closed by default and require the existing diagnostics capability.',
'tone' => 'gray',
],
'activeOperationSummary' => null,
'recentOperations' => [],
'pollingInterval' => null,
];
}
return app(EnvironmentDashboardSummaryBuilder::class)
->build($tenant)
->toArray();
}
}