Skip to content

fix(order): add missing Collect step to environmental workflow (OGC-1050) - #4037

Open
mherman22 wants to merge 1 commit into
DIGI-UW:demo-silnasfrom
mherman22:OGC-1050
Open

fix(order): add missing Collect step to environmental workflow (OGC-1050)#4037
mherman22 wants to merge 1 commit into
DIGI-UW:demo-silnasfrom
mherman22:OGC-1050

Conversation

@mherman22

@mherman22 mherman22 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Pull Requests Requirements

  • The PR title includes a brief description of the work done, including the
    Issue number if applicable.
  • The PR includes a video showing the changes for the work done.
  • The PR title follows conventional commit label standards.
  • The changes confirm to the OpenElis Global x3
    Styleguide and Design
    documentation.
  • The changes include tests or are validated by existing tests.
  • I have read and agree to the Contributing
    Guidelines of this
    project.

Summary

Fixes the QA report that /order/environmental/collect renders 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-collect in
025-split-workflow-menus.xml inserts a menu row with
action_url = /order/environmental/collect at presentation_order = 2, sitting
between enter (1) and label (3). But:

  • App.jsx registered 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_STEPS had 3 entries, so the wizard surfaced no Collect
    step 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 existing
    OrderCollect step under Roles.RECEPTION like its siblings. OrderCollect
    is already workflow-agnostic (it routes via useWorkflowPrefix() with no
    clinical-specific branching), so no component changes were needed.
  • OrderStepper.jsx — add the collect entry to ENVIRONMENTAL_ORDER_STEPS
    between enter and label, so the wizard shows Enter → Collect → Label → QA.
  • EnvironmentalOrderEnter.jsxhandleSaveAndNext advanced straight to
    /label. Without this the stepper would show 4 steps while the wizard's own
    Next 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:

Step Navigates to Marks complete
Enter /order/environmental/collect enter
Collect ${workflowPrefix}/label collect
Label ${workflowPrefix}/qa label

Why the blank page is genuinely gone

The QA repro visits the URL with no order in context. OrderCollect has no
early return null — it always renders OrderWorkflowLayout, and with no
ordered tests it shows the collect.noTestsWarning notification pointing back
to 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 is
    enter → collect → label → qa; the stepper renders 4 steps; Collect is active
    on its own URL; clicking it pushes the right route with ?order=. Also pins
    the workflow differences: clinical keeps its own Collect route, vector has
    none.
  • EnvironmentalOrderEnter.test.jsx — Save & Next advances to /collect and
    not 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 /collect push fails both
navigation tests.

Full src/components/order suite: 66 passed.

Not covered

The route registration in App.jsx itself is not unit-tested — the environmental
routes 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.org before merge, since that is where QA found it.

Related Issue

https://uwdigi.atlassian.net/browse/OGC-1050

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant