Implemented the consolidated operator guidance panel for the environment dashboard. Updated EnvironmentDashboardSummaryBuilder to prioritize and select guidance based on the operator guidance contract. Added comprehensive unit, feature, and browser tests to verify the guidance selection logic and UI rendering. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #423
83 lines
3.5 KiB
PHP
83 lines
3.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Support\EnvironmentDashboard;
|
|
|
|
final readonly class EnvironmentDashboardSummary
|
|
{
|
|
/**
|
|
* @param array{workspace:string,tenant:string,provider:?string,providerKey:?string,latestActivity:?string} $context
|
|
* @param array{status:string,tone:string,headline:string,summary:string} $posture
|
|
* @param array<string, mixed> $operatorGuidance
|
|
* @param array<string, mixed> $readinessDecision
|
|
* @param list<array<string, mixed>> $kpis
|
|
* @param list<array<string, mixed>> $recommendedActions
|
|
* @param list<array<string, mixed>> $governanceStatus
|
|
* @param list<array<string, mixed>> $readinessCards
|
|
* @param list<array<string, mixed>> $readinessDimensions
|
|
* @param list<array<string, mixed>> $readinessProofPanel
|
|
* @param list<array<string, mixed>> $supportingSignals
|
|
* @param array<string, mixed> $diagnosticsDisclosure
|
|
* @param array<string, mixed>|null $activeOperationSummary
|
|
* @param list<array<string, mixed>> $recentOperations
|
|
*/
|
|
public function __construct(
|
|
public array $context,
|
|
public array $posture,
|
|
public array $operatorGuidance,
|
|
public array $readinessDecision,
|
|
public array $kpis,
|
|
public array $recommendedActions,
|
|
public array $governanceStatus,
|
|
public array $readinessCards,
|
|
public array $readinessDimensions,
|
|
public array $readinessProofPanel,
|
|
public array $supportingSignals,
|
|
public array $diagnosticsDisclosure,
|
|
public ?array $activeOperationSummary,
|
|
public array $recentOperations,
|
|
public ?string $pollingInterval,
|
|
) {}
|
|
|
|
/**
|
|
* @return array{
|
|
* context: array{workspace:string,tenant:string,provider:?string,providerKey:?string,latestActivity:?string},
|
|
* posture: array{status:string,tone:string,headline:string,summary:string},
|
|
* operatorGuidance: array<string, mixed>,
|
|
* readinessDecision: array<string, mixed>,
|
|
* kpis: list<array<string, mixed>>,
|
|
* recommendedActions: list<array<string, mixed>>,
|
|
* governanceStatus: list<array<string, mixed>>,
|
|
* readinessCards: list<array<string, mixed>>,
|
|
* readinessDimensions: list<array<string, mixed>>,
|
|
* readinessProofPanel: list<array<string, mixed>>,
|
|
* supportingSignals: list<array<string, mixed>>,
|
|
* diagnosticsDisclosure: array<string, mixed>,
|
|
* activeOperationSummary: array<string, mixed>|null,
|
|
* recentOperations: list<array<string, mixed>>,
|
|
* pollingInterval: ?string,
|
|
* }
|
|
*/
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'context' => $this->context,
|
|
'posture' => $this->posture,
|
|
'operatorGuidance' => $this->operatorGuidance,
|
|
'readinessDecision' => $this->readinessDecision,
|
|
'kpis' => $this->kpis,
|
|
'recommendedActions' => $this->recommendedActions,
|
|
'governanceStatus' => $this->governanceStatus,
|
|
'readinessCards' => $this->readinessCards,
|
|
'readinessDimensions' => $this->readinessDimensions,
|
|
'readinessProofPanel' => $this->readinessProofPanel,
|
|
'supportingSignals' => $this->supportingSignals,
|
|
'diagnosticsDisclosure' => $this->diagnosticsDisclosure,
|
|
'activeOperationSummary' => $this->activeOperationSummary,
|
|
'recentOperations' => $this->recentOperations,
|
|
'pollingInterval' => $this->pollingInterval,
|
|
];
|
|
}
|
|
}
|