ON-5981: Consolidate import flow into 3-step inventory mapping screen#2777
Merged
tatimoreira merged 6 commits intoJul 6, 2026
Merged
Conversation
…n mapping Single confirmation screen that replaces the separate validation-results and mapping-columns steps. Shows real-time validation banners (error when required GPC fields are unmapped, warning when optional columns lack mapping), red asterisks on mandatory fields, and inline "Needs remapping" indicators per row. Exposes onCanContinueChange so the parent can gate the Continue button.
Replaces the separate ValidationResultsStep (step 1) and MappingColumnsStep (step 2) with the new InventoryMappingStep. Updates step titles array, step rendering, and the bottom action bar so the Continue button on the mapping step is gated by canContinueMapping. The Import button now appears at step 2 (previously step 3).
New keys: inventory-mapping-step (step title), inventory-mapping-heading, inventory-mapping-description, required-fields-not-mapped (+ description), some-columns-need-mapping (+ description), needs-remapping, select-option-to-map. Non-English locales translated; legacy step-title keys kept for backward compatibility.
Lifted canContinue computation out of the child's useEffect into a useMemo in the parent, so it updates synchronously when mappingOverrides changes with no render-cycle delay. The gate logic was also corrected: instead of checking that auto-detected keys remain in mappedKeys (too strict), it now checks that every column marked as mandatory (by auto-detection or current override) has any non-empty effective key. This allows clearing and re-selecting to any value — including one that satisfies identity via the sector+subsector path — to correctly re-enable Continue.
Added cityName prop (sourced from inventory.city.name) to UploadFileStep, InventoryMappingStep, and ReviewConfirmStep so the city context is visible consistently across all three steps of the import flow.
tatimoreira
force-pushed
the
fix/ON-5981-Update-inventory-mapping-screen-design
branch
from
July 6, 2026 16:59
8174a0f to
86f140d
Compare
tatimoreira
deleted the
fix/ON-5981-Update-inventory-mapping-screen-design
branch
July 6, 2026 17:17
This was referenced Jul 6, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates the previous 4-step import flow (Upload → Validation Results → Mapping Columns → Review & Confirm) into a 3-step flow (Upload → Inventory Mapping → Review & Confirm). The new Inventory Mapping step combines validation feedback and column mapping into a single inline-editable table, gated by a Continue button that requires required fields to be mapped.
Changes
InventoryMappingStepcomponent: single table with FIELD NAME / VALUE / MAP TO columns, mandatory fields marked with red asterisks, inlineNativeSelectdropdowns for all columns, red error banner when required fields are unmapped, orange warning banner when optional fields are unmapped, "Needs remapping" indicators per row, mandatory columns sorted to the toppage.tsxfrom 4 steps to 3 steps; derivecanContinueviauseMemoin the parent (instead ofuseEffectin child) to ensure the Continue button updates synchronously when mappings changePreview
How to test
Ticket
ON-5981
Notes
The
canContinuecheck mirrors the backend validation rule: identity is satisfied bygpcRefNoalone or bothsector + subsectortogether;activityAmountis always required. The gate enforces that every auto-detected mandatory column has a non-empty value selected (not necessarily the originally detected key), which matches the backend's flexibility.