While working on frontend improvements in OpenELIS Global, I investigated the issue where Sample Items filtered by “Disposed” still displayed an “Active” badge in the UI.
Root Cause
After tracing both the frontend and backend flow, I found that:
The backend returns the status field as a status ID (or "active" when no status ID exists).
The frontend logic in StorageDashboard.jsx expected literal values like "active" or "disposed".
Because of this mismatch, the UI always fell back to displaying the Active badge even when disposed records were correctly returned by the backend filter.
Solution
I updated the frontend formatting logic in formatSamplesData to interpret the backend status value correctly and render the appropriate badge.
Result
Disposed records now show the red “Disposed” badge.
Active records show the green “Active” badge.
Filtering behavior now matches the actual record state returned by the backend.
Additional Improvement
While reviewing the location search flow, I also added a small robustness improvement by trimming the search input before sending the query to /rest/storage/locations/search.
Takeaway
This fix highlights how frontend assumptions about backend data structures can lead to subtle UI inconsistencies. Ensuring alignment between backend responses and frontend display logic improves reliability and user trust in dashboard state.
Happy to continue contributing improvements around frontend stability, UI correctness, and performance in the Storage module.