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:
@@ -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) {{
|
function buildArtifact(args, rows) {{
|
||||||
return {{
|
return {{
|
||||||
type: 'report-artifact',
|
type: 'report-artifact',
|
||||||
|
|||||||
Reference in New Issue
Block a user