OBPIH-7570 Fix styling for 'no quantity counted' disappearing after saving progress#5618
OBPIH-7570 Fix styling for 'no quantity counted' disappearing after saving progress#5618alannadolny merged 1 commit intorelease/0.9.6from
Conversation
| {quantityCounted === null | ||
| ? <ValueIndicator variant={valueIndicatorVariant.EMPTY} /> | ||
| : quantityCounted} | ||
| {quantityCounted ?? <ValueIndicator variant={valueIndicatorVariant.EMPTY} />} |
There was a problem hiding this comment.
In the case described in the ticket our backend returns quantityCounted as undefined, so the previous solution didn’t work. I think the best solution is to use nullish coalescing operator
There was a problem hiding this comment.
It's rather impossible for Grails' backend to return undefined in the response. The only way this could be undefined is when the property would not be sent at all from backend.
I'm fine with the solution but are we sure this can't be e.g. empty string where the nullish coalescing operator would also not work?
There was a problem hiding this comment.
Yes, you are right the backend doesn’t return undefined in the response. I was mistaken because when I did console.log, I saw quantityCounted as undefined 🙈 There shouldn't be any possiblity that quantityCounted could be empty string so I think this solution is fine
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/0.9.6 #5618 +/- ##
===============================================
Coverage ? 8.71%
Complexity ? 1187
===============================================
Files ? 712
Lines ? 45618
Branches ? 10914
===============================================
Hits ? 3975
Misses ? 41061
Partials ? 582 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
316ecd7 to
305dd6e
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the quantity counted cell rendering logic in the cycle count resolve step table to use the nullish coalescing operator, which fixes an issue where the "no quantity counted" indicator was disappearing after saving progress.
Key Changes:
- Replaced verbose ternary operator with nullish coalescing operator (
??) for cleaner, more robust null/undefined handling
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
✨ Description of Change
Link to GitHub issue or Jira ticket:
https://pihemr.atlassian.net/browse/OBPIH-7568
Description:
📷 Screenshots & Recordings (optional)