diff --git a/src/generated_scene/generator.rs b/src/generated_scene/generator.rs index 3ddfe21..8eabb88 100644 --- a/src/generated_scene/generator.rs +++ b/src/generated_scene/generator.rs @@ -333,11 +333,11 @@ function determineArtifactStatus({{ blockedReason = '', fatalError = '', reasons return 'ok'; }} -function buildArtifact(args, rows) {{ +function buildArtifact({{ status, blockedReason = '', fatalError = '', reasons = [], rows = [], args }}) {{ return {{ type: 'report-artifact', - report_name: '{scene_id}', - status: rows.length > 0 ? 'ok' : 'empty', + report_name: REPORT_NAME, + status: status || determineArtifactStatus({{ blockedReason, fatalError, reasons, rows }}), period: {{ mode: args.period_mode, mode_code: args.period_mode_code, @@ -346,11 +346,11 @@ function buildArtifact(args, rows) {{ }}, org: {{ label: args.org_label, code: args.org_code }}, column_defs: COLUMN_DEFS, - columns: {columns_json}, + columns: COLUMNS, rows, counts: {{ detail_rows: rows.length }}, - partial_reasons: [], - reasons: [] + partial_reasons: reasons.filter(r => r && !r.startsWith('api_') && !r.startsWith('validation_')), + reasons: Array.from(new Set(reasons.filter(Boolean))) }}; }} @@ -423,7 +423,7 @@ async function buildBrowserEntrypointResult(args, deps = defaultDeps) {{ try {{ const rawData = await (deps.queryData ? deps.queryData(args) : Promise.resolve([])); const rows = normalizeRows(rawData); - return buildArtifact(args, rows); + return buildArtifact({{ args, rows }}); }} catch (error) {{ return {{ type: 'report-artifact',