fix(order): add missing Collect step to environmental workflow (OGC-1050) - #4037
Open
mherman22 wants to merge 1 commit into
Open
fix(order): add missing Collect step to environmental workflow (OGC-1050)#4037mherman22 wants to merge 1 commit into
mherman22 wants to merge 1 commit into
Conversation
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.
Pull Requests Requirements
Issue number if applicable.
Styleguide and Design
documentation.
Guidelines of this
project.
Summary
Fixes the QA report that
/order/environmental/collectrenders a blank page(header + sidenav only, no empty state, no redirect).
Root cause: the route was never an orphan — the router was missing, not the
menu.
The nav menu has always been seeded for a 4-step environmental workflow.
Liquibase changeset
nav-015-create-environmental-collectin025-split-workflow-menus.xmlinserts a menu row withaction_url = /order/environmental/collectatpresentation_order = 2, sittingbetween enter (1) and label (3). But:
App.jsxregistered only ``,/enter, `/label` and `/qa` under`/order/environmental`. React Router's `Switch` renders nothing when no child
matches, so `Layout` painted the chrome and the content area stayed empty —
exactly the reported symptom.
ENVIRONMENTAL_ORDER_STEPShad 3 entries, so the wizard surfaced no Collectstep either.
So the menu, the stepper and the router all disagreed. This PR resolves the
disagreement in favour of the menu, which was right all along.
Changes
App.jsx— register/order/environmental/collect, rendering the existingOrderCollectstep underRoles.RECEPTIONlike its siblings.OrderCollectis already workflow-agnostic (it routes via
useWorkflowPrefix()with noclinical-specific branching), so no component changes were needed.
OrderStepper.jsx— add thecollectentry toENVIRONMENTAL_ORDER_STEPSbetween enter and label, so the wizard shows Enter → Collect → Label → QA.
EnvironmentalOrderEnter.jsx—handleSaveAndNextadvanced straight to/label. Without this the stepper would show 4 steps while the wizard's ownNext button jumped 1 → 3, leaving Collect reachable only via the stepper or
menu and never firing
markStepComplete("collect").Vector surveillance is untouched and still has no Collect step.
The resulting chain, with every step-complete marker firing on the happy path:
/order/environmental/collectenter${workflowPrefix}/labelcollect${workflowPrefix}/qalabelWhy the blank page is genuinely gone
The QA repro visits the URL with no order in context.
OrderCollecthas noearly
return null— it always rendersOrderWorkflowLayout, and with noordered tests it shows the
collect.noTestsWarningnotification pointing backto Step 1. Blank page becomes real content plus guidance.
Tests
Two new vitest suites, 8 tests, all passing. Both were verified by inversion —
reverting the source change makes them fail:
OrderStepper.test.jsx— environmental step set isenter → collect → label → qa; the stepper renders 4 steps; Collect is active
on its own URL; clicking it pushes the right route with
?order=. Also pinsthe workflow differences: clinical keeps its own Collect route, vector has
none.
EnvironmentalOrderEnter.test.jsx— Save & Next advances to/collectandnot to
/label, carrying the lab number so the Collect step rehydrates.Reverting the stepper entry fails 4 of the 6 stepper tests while leaving the
clinical and vector assertions green; reverting the
/collectpush fails bothnavigation tests.
Full
src/components/ordersuite: 66 passed.Not covered
The route registration in
App.jsxitself is not unit-tested — the environmentalroutes are defined inline in a component that needs the full session/auth
provider tree to render, so asserting on them in isolation isn't practical. That
specific regression (menu path with no matching route) is E2E territory; a
Playwright spec walking the environmental wizard would be the honest guard and is
worth adding separately.
Screenshots
Not included — I don't have a running instance of this branch to capture the
rendered Collect step. Worth a reviewer check against
indonesiadev.openelis-global.orgbefore merge, since that is where QA found it.Related Issue
https://uwdigi.atlassian.net/browse/OGC-1050