Fix Pack creation: correct API path, signal-based reactivity, null-safe sort
Three root causes for "create does nothing": 1. Wrong API base path: PolicyApiService used /api/policy (routed to platform service via /api/ catch-all) instead of /policy/api (routed to policy-gateway via nginx regex). Fixed API_BASE. 2. OnPush + plain fields: loading/packs/refreshing were plain booleans and arrays. OnPush change detection ignored their mutations. Converted all three to signals so template reactivity works automatically. 3. sortPacks crash: API returns packs with undefined modifiedAt/id fields. localeCompare on undefined threw TypeError, preventing the empty state from rendering. Added nullish coalescing fallbacks. Also removed hardcoded fallback "Core Policy Pack" from the store — it masked API failures and prevented the create form from appearing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -217,7 +217,7 @@ public sealed class TopologyLayoutService
|
||||
var deployingCount = envPaths.Count(p => p.Status is "running" or "deploying");
|
||||
var pendingCount = envPaths.Count(p => p.Status is "pending" or "awaiting_approval" or "gates_running");
|
||||
var failedCount = envPaths.Count(p => p.Status is "failed");
|
||||
var totalDeployments = envPaths.Count;
|
||||
var totalDeployments = env?.TargetCount ?? 0;
|
||||
|
||||
var agentStatus = ResolveAgentStatus(envId, targetsByEnv);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user