Skip to content

fix(procurement-dashboard): display readable status labels in overview card#5908

Merged
rajohnson90 merged 1 commit into
mainfrom
OPS-5902/proc-tracker-data-viz-fix
Jul 10, 2026
Merged

fix(procurement-dashboard): display readable status labels in overview card#5908
rajohnson90 merged 1 commit into
mainfrom
OPS-5902/proc-tracker-data-viz-fix

Conversation

@rajohnson90

@rajohnson90 rajohnson90 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What changed

Fixes the Procurement Dashboard summary page rendering raw enum strings (e.g. IN_EXECUTION) instead of human-readable labels (e.g. Executing) in the Procurement Overview card's stacked bar legend.

frontend/src/pages/procurementDashboard/summary/ProcurementOverviewCard.jsx

  • Added convertCodeForDisplay to the import from utils
  • In buildStatusData, replaced item.label (the raw enum value from the API) with convertCodeForDisplay("budgetLineStatus", item.status), which uses the existing frontend mapping to produce readable display names
  • Removed a vestigial item.label === "In Execution" ternary in the render that never fired (the label was "IN_EXECUTION", not "In Execution")

The backend's item.label field has always been set to status.value (the raw enum string) since the function was introduced in commit ab6573420 — it was never human-readable. The frontend mapping in convertCodeForDisplay already has the correct display names and is used consistently everywhere else statuses are shown.

Issue

#5902

How to test

  1. Start the app (docker compose up --build)
  2. Navigate to the Procurement Dashboard summary page
  3. Verify the stacked bar legend shows Planned, Executing, and Obligated instead of PLANNED, IN_EXECUTION, and OBLIGATED

To run the relevant unit tests:

cd frontend
bun run test --watch=false

A11y impact

  • No accessibility-impacting changes in this PR

Storybook

  • No UI component changes in this PR

Screenshots

Fixing the label fixed both problems
Screenshot 2026-07-08 at 10 29 43 AM

Definition of Done Checklist

  • OESA: Code refactored for clarity
  • OESA: Dependency rules followed
  • Automated unit tests updated and passed
  • Automated integration tests updated and passed
  • Automated quality tests updated and passed
  • Automated load tests updated and passed
  • Automated a11y tests updated and passed
  • Automated security tests updated and passed
  • 90%+ Code coverage achieved
  • Form validations updated

Links

N/A

@jonnalley jonnalley 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.

reusability! 🚀

@rajohnson90 rajohnson90 merged commit 239a0aa into main Jul 10, 2026
68 checks passed
@rajohnson90 rajohnson90 deleted the OPS-5902/proc-tracker-data-viz-fix branch July 10, 2026 14:56
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.426.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants