Bug: Raw submissions table only shows columns from first submission (missing fields)
File: src/pages/TemplateDetailAnalytics.jsx:125-127
Problem
The raw submissions table builds its column headers from only the first submission's data:
const allSubmissionKeys = submissions.length > 0
? Object.keys(submissions[0].submittedData || {})
: [];
If later submissions have additional fields (e.g., optional fields that only some users fill), those columns won't appear. Conversely, if the first submission is missing a field that later submissions have, that data is invisible.
Impact
- Incomplete data display in the submissions table
- Paginated data changes columns on each page (page 1 might have different keys than page 2)
Fix
Collect all unique keys across all submissions on the current page:
const allSubmissionKeys = submissions.length > 0
? [...new Set(submissions.flatMap(s => Object.keys(s.submittedData || {})))]
: [];
Or better: use the template's enabledFields from detail.enabledFields since that defines the complete schema:
const allSubmissionKeys = detail.enabledFields;
Severity
Medium — Data display issue, not a crash. But users may miss seeing fields that don't appear in the first row.
Phase
Introduced in Phase 2 (PR #27, merged).
Bug: Raw submissions table only shows columns from first submission (missing fields)
File:
src/pages/TemplateDetailAnalytics.jsx:125-127Problem
The raw submissions table builds its column headers from only the first submission's data:
If later submissions have additional fields (e.g., optional fields that only some users fill), those columns won't appear. Conversely, if the first submission is missing a field that later submissions have, that data is invisible.
Impact
Fix
Collect all unique keys across all submissions on the current page:
Or better: use the template's
enabledFieldsfromdetail.enabledFieldssince that defines the complete schema:Severity
Medium — Data display issue, not a crash. But users may miss seeing fields that don't appear in the first row.
Phase
Introduced in Phase 2 (PR #27, merged).