Skip to content

fix: improve inventory mapping screen display values#2772

Merged
tatimoreira merged 2 commits into
developfrom
fix/ON-5985-Update-inventory-mapping-screen-values
Jul 6, 2026
Merged

fix: improve inventory mapping screen display values#2772
tatimoreira merged 2 commits into
developfrom
fix/ON-5985-Update-inventory-mapping-screen-values

Conversation

@tatimoreira

@tatimoreira tatimoreira commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Improves the inventory mapping screen (upload flow) to display empty/undefined field values as "Not specified" in tertiary color instead of a bare dash, making it clear when a field is intentionally unspecified rather than an error. Also groups detected fields visually at the top of the mapping table, converts emission factor example values to metric tonnes (t CO₂e) for readability, and fixes an S3 PermanentRedirect error that prevented file uploads when the bucket's AWS region did not match the client's default.

Changes

  • Replace "-" placeholder with "Not specified" styled in content.tertiary color across the validation results, mapping columns, and review/confirm steps
  • Sort mapping columns so auto-detected fields (interpretedAs !== null) appear first, grouping required fields together visually
  • Convert emission factor example values (CO₂, CH₄, N₂O, Total CO₂e) from raw kg units to metric tonnes (t CO₂e) in both the validation results and mapping columns steps
  • Add followRegionRedirects: true to the S3 client in InventoryFileStorageService to handle buckets hosted in a region that differs from AWS_FILE_UPLOAD_REGION — previously the SDK threw a PermanentRedirect error instead of following the redirect automatically
  • Add "not-specified" i18n key across all 5 supported locales (en, es, fr, de, pt)

How to test

  1. Navigate to /{lng}/cities/{cityId}/GHGI/onboarding/import?inventory={inventoryId}
  2. Upload a CSV or Excel inventory file (e.g. a CRF-format file)
  3. Validation Results step: columns where no example value or interpretation was detected should show "Not specified" in light grey instead of "-"; emission factor columns (CO₂, CH₄, N₂O, Total CO₂e) should display values in t CO₂e (e.g. 63.1 gCO₂e/MJ → 0.0631 t CO₂e)
  4. Mapping Columns step: same "Not specified" and t CO₂e behaviour; detected fields should appear above undetected ones
  5. Review & Confirm step: if source file or format cannot be determined, those fields show "Not specified" in tertiary color rather than "-"
  6. If AWS_FILE_UPLOAD_S3_BUCKET_ID is set and the bucket lives in a different region than AWS_FILE_UPLOAD_REGION, uploads should succeed rather than failing with a PermanentRedirect error

Preview

Screenshot 2026-07-01 at 10 08 51 PM

Ticket

ON-5985

Notes

S3 redirect fix detail: the AWS SDK v3 S3 client by default treats a 301 PermanentRedirect response (returned when the bucket's region doesn't match the request endpoint) as a fatal error. Adding followRegionRedirects: true to the client config instructs the SDK to re-issue the request against the correct regional endpoint automatically. This means uploads work correctly even if AWS_FILE_UPLOAD_REGION is unset (defaults to us-east-1) or misconfigured — no change to environment variable setup is required for existing deployments.

@tatimoreira
tatimoreira requested a review from lemilonkh July 2, 2026 04:10

@lemilonkh lemilonkh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work, thanks 🙌 ✨

Comment thread app/src/components/steps/GHGI/import/validation-results-step.tsx
- Replace dash placeholder with "Not specified" in tertiary color for
  empty/undefined fields across validation, mapping, and review steps
- Sort mapping columns so auto-detected fields appear first, grouping
  required fields together visually
- Convert emission factor example values from raw units to metric tonnes
  (t CO2e) in both the validation results and mapping columns steps
- Add followRegionRedirects to S3 client to handle bucket region mismatches
- Add "not-specified" i18n key across all 5 supported locales (en, es, fr, de, pt)
@tatimoreira
tatimoreira force-pushed the fix/ON-5985-Update-inventory-mapping-screen-values branch from a639b63 to d2fc2a6 Compare July 6, 2026 16:34
@tatimoreira tatimoreira self-assigned this Jul 6, 2026
@tatimoreira
tatimoreira merged commit 6f6f67a into develop Jul 6, 2026
9 checks passed
@tatimoreira
tatimoreira deleted the fix/ON-5985-Update-inventory-mapping-screen-values branch July 6, 2026 16:51
lemilonkh pushed a commit that referenced this pull request Jul 8, 2026
…2804)

PR #2772 improved mapping-columns-step.tsx but that component was deleted
by PR #2777 when the import flow was consolidated into InventoryMappingStep.
Port the same fixes to the new component:

- Convert emission factor example values (CO2/CH4/N2O/TotalCO2e) from raw
  units to metric tonnes (t CO2e)
- Show "Not specified" in tertiary color instead of "-" for empty/undefined
  example values
- Sort: required fields first, then auto-detected fields, then undetected,
  so Activity data amount and other mandatory fields group at the top
lemilonkh pushed a commit that referenced this pull request Jul 8, 2026
…2804)

PR #2772 improved mapping-columns-step.tsx but that component was deleted
by PR #2777 when the import flow was consolidated into InventoryMappingStep.
Port the same fixes to the new component:

- Convert emission factor example values (CO2/CH4/N2O/TotalCO2e) from raw
  units to metric tonnes (t CO2e)
- Show "Not specified" in tertiary color instead of "-" for empty/undefined
  example values
- Sort: required fields first, then auto-detected fields, then undetected,
  so Activity data amount and other mandatory fields group at the top
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants