Skip to content

19805-missing-validation-when-saving-without-adding-plan#19845

Open
denuwanhendalage wants to merge 2 commits intodevelopmentfrom
19805-missing-validation-when-saving-without-adding-plan
Open

19805-missing-validation-when-saving-without-adding-plan#19845
denuwanhendalage wants to merge 2 commits intodevelopmentfrom
19805-missing-validation-when-saving-without-adding-plan

Conversation

@denuwanhendalage
Copy link
Copy Markdown
Collaborator

@denuwanhendalage denuwanhendalage commented Apr 8, 2026

changes

  1. plans.xhtml -> added Id and life to <p:growl> , update attribute in save button added growlMsg
  2. planController.java -> created field-specific validation messages, swapped the save message and update message to give correct responce

Summary by CodeRabbit

  • Bug Fixes

    • Prevented saving when required Name or Code are blank; users now receive inline error messages and the operation is halted.
    • Clarified success messages so creating vs. updating records are reported distinctly.
  • UI Improvements

    • Improved notification display timing and ensured messages reliably appear after save actions.

Signed-off-by: denuwanhendalage <shashankadenuwanb@gmail.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 170170c0-edd7-488d-9981-b38e133959de

📥 Commits

Reviewing files that changed from the base of the PR and between 02ff531 and b071510.

📒 Files selected for processing (1)
  • src/main/webapp/emr/admin/plans.xhtml
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/webapp/emr/admin/plans.xhtml

Walkthrough

Added server-side validation in plan save to block empty/null name or code with JSF error messages; adjusted save/create success messages. Updated the plans view: stable growl ID with 4s lifespan, reformatted input markup, and expanded AJAX update targets to refresh growl and detail panel.

Changes

Cohort / File(s) Summary
Plan Save Validation
src/main/java/com/divudi/bean/clinical/PlanController.java
Added null/empty (trimmed) checks for getCurrent().getName() and getCurrent().getCode() in saveSelected() that add JSF error messages and return early; adjusted success messages to "Saved Successfully." for create and "Updated Successfully." for update.
Plan View UI Refinement
src/main/webapp/emr/admin/plans.xhtml
Replaced anonymous <p:growl/> with <p:growl id="growlMsg" life="4000"/>; reformatted p:inputText attributes for readability; updated btnSave AJAX update targets to include growlMsg and gpDetail alongside existing targets.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references issue 19805 and describes validation being added when saving without adding a plan, which aligns with the main changes in the pull request (field validation and corrected feedback messages).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 19805-missing-validation-when-saving-without-adding-plan

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 and usage tips.

Signed-off-by: denuwanhendalage <shashankadenuwanb@gmail.com>
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.

1 participant