feat(generator): add determineArtifactStatus for complete status determination

Add a helper function to determine artifact status based on business
logic conditions:
- blocked: blockedReason exists (validation failed, wrong page context)
- error: fatalError exists (API call failed)
- partial: reasons array non-empty (some data issues)
- empty: no rows returned
- ok: rows exist with no issues

This is Task 3 of 8 in the progressive template enhancement.

🤖 Generated with [Qoder][https://qoder.com]
This commit is contained in:
木炎
2026-04-17 12:21:13 +08:00
parent d996b511f6
commit d26d96ef64

View File

@@ -325,6 +325,14 @@ function normalizeRows(rawData) {{
}});
}}
function determineArtifactStatus({{ blockedReason = '', fatalError = '', reasons = [], rows = [] }}) {{
if (blockedReason) return 'blocked';
if (fatalError) return 'error';
if (reasons.length > 0) return 'partial';
if (!rows.length) return 'empty';
return 'ok';
}}
function buildArtifact(args, rows) {{
return {{
type: 'report-artifact',