Skip to content

fix(doctor-worklist): guard against undefined success message in care-context popup - #284

Open
snehar-nd wants to merge 18 commits into
vb/hwc-3.8.1from
sn/fix-doctor-worklist-undefined-popup
Open

fix(doctor-worklist): guard against undefined success message in care-context popup#284
snehar-nd wants to merge 18 commits into
vb/hwc-3.8.1from
sn/fix-doctor-worklist-undefined-popup

Conversation

@snehar-nd

@snehar-nd snehar-nd commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When a beneficiary returns from the lab and the doctor clicks Update on the doctor worklist, the success dialog literally showed the text "undefined" instead of a proper success message.
  • Root cause: getHealthIDDetails() in workarea.component.ts builds the popup text via successResponseFromAPI + '. ' + .... The Update flow passes res.data.response into this function with no fallback (unlike the initial Save flow, which always supplies a hardcoded fallback string). Whenever that API field was falsy, undefined + '. ' coerced to the literal string "undefined. " in the dialog.
  • Fix: guard the message with a nullish-coalescing fallback (reusing the same datafillSuccessfully translation key the Save flow already relies on), so the popup always shows a real success message regardless of the response shape.

Test plan

  • As a doctor, complete a General OPD consultation and prescribe a lab test so the beneficiary routes to the lab.
  • Complete the lab test as lab technician.
  • Reopen the beneficiary from the doctor worklist and click Update without prescribing further tests/scheduling.
  • Confirm the care-context popup shows a proper success message (not "undefined").
  • Repeat for at least one other visit category that shares this code path (e.g. ANC/PNC/NCD) to confirm no regression.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved care-context confirmation messaging when the health ID API returns no success message.
    • Displays the localized “Data saved successfully” message, with a default fallback if localization is unavailable.

dependabot Bot and others added 18 commits October 13, 2025 05:15
Bumps [jasmine-core](https://github.com/jasmine/jasmine) from 4.6.0 to 5.12.0.
- [Release notes](https://github.com/jasmine/jasmine/releases)
- [Changelog](https://github.com/jasmine/jasmine/blob/main/RELEASE.md)
- [Commits](jasmine/jasmine@v4.6.0...v5.12.0)

---
updated-dependencies:
- dependency-name: jasmine-core
  dependency-version: 5.12.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
fix: amm-2192 remove mandatory for prescription
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix incorrect !== operators to = in service-point.component.ts ngOnInit
- Remove debug console.log statements from service-point and service components
- Fix typo: locationGathetingIssues to locationGatheringIssues
- Fix typo: Seperated to Separated in registrar test files
…aphicsToStorage

- Add return statements after locationGatheringIssues() calls in both
  service-point.component.ts and service.component.ts
- Prevents runtime errors when data or data.stateMaster is null/undefined
- Addresses CodeRabbit review findings
- Remove unused subscription to currentLangugae$ that accumulated over time
- Remove unused HttpServiceService injection and imports
- Simplify AuthGuard to focus only on session validation
- Fixes memory leak on every route activation across 7 protected routes

Closes issue #138
Merge Relase 3.6.2 with Main
…re-5.12.0

build(deps-dev): bump jasmine-core from 4.6.0 to 5.12.0
fix: Remove unmanaged subscription memory leak in AuthGuard
…-and-typos

fix: correct assignment operators and fix typos in service components
docs: add CONTRIBUTING.md guide for HWC-UI contributors
…-context popup

After a beneficiary returns from the lab and the doctor clicks Update,
getHealthIDDetails() concatenated res.data.response directly into the
popup text. When that field was falsy, `undefined + '. '` rendered the
literal word "undefined" in the success dialog. Fall back to a proper
success string, matching the pattern already used by the initial Save flow.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The care-context confirmation prompt now uses the API success response when available. It falls back to the localized success message or a literal default when the response is nullish.

Changes

Care-context confirmation

Layer / File(s) Summary
Confirmation message fallback
src/app/app-modules/nurse-doctor/workarea/workarea.component.ts
The confirmation message now applies localized and literal success-message fallbacks before prompt construction.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the doctor worklist fix and the undefined success message in the care-context popup.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@snehar-nd
snehar-nd changed the base branch from main to release-3.8.1 August 13, 2026 06:34
@snehar-nd
snehar-nd changed the base branch from release-3.8.1 to vb/hwc-3.8.1 August 13, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants