Skip to content

[Customer Portal MicroApp] Remove the comment bar entirely on closed cases - #1189

Merged
cloby99 merged 1 commit into
wso2-open-operations:mainfrom
Hesara2003:fix/customer-portal-microapp-comment-on-closed-case
Jul 21, 2026
Merged

[Customer Portal MicroApp] Remove the comment bar entirely on closed cases#1189
cloby99 merged 1 commit into
wso2-open-operations:mainfrom
Hesara2003:fix/customer-portal-microapp-comment-on-closed-case

Conversation

@Hesara2003

@Hesara2003 Hesara2003 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Purpose

A closed case could still take new comments through the UI in the Customer Portal microapp — the comment bar had no closed-case gating at all.

Goals

  • Match the read-only expectation a closed case already has everywhere else in this page (case actions, feedback prompt): no new comments once closed.

Approach

  • isClosed was already computed in CaseDetailPage.tsx (used for the feedback prompt and the case-actions menu) but never applied to the comment composer — StickyCommentBar was rendered unconditionally, with no disabled prop passed even though the component already supports one.
  • Went with removing the bar outright for a closed case rather than just disabling its inputs, and dropped the reserved bottom margin (mb) to match — same treatment ChatDetailPage already gives its own read-only state (isReadOnly).
  • Added a defensive guard in handleSend itself too, so nothing can post while closed even if some other path reaches it.

User stories

As a customer, once my case is closed, I no longer see a way to add a comment on it.

Release note

Closed cases no longer show a comment box in the Customer Portal mobile app.

Documentation

N/A — internal customer portal UI change, no external doc surface affected.

Automation tests

  • No automated test runner is wired up for this app yet.
  • Verified locally: tsc -b, eslint, and vite build all clean.

Security checks

Test environment

  • Local dev server (Vite), manual browser testing.

Summary by CodeRabbit

  • Bug Fixes
    • Prevented users from submitting new comments on closed cases.
    • Hid the comment entry bar when a case is closed.
    • Improved spacing around the Activity Timeline for closed cases.

…cases

isClosed was already computed in this component (used for the
feedback prompt and case actions) but never applied to the comment
composer — StickyCommentBar was rendered unconditionally, so a closed
case could still take new comments through the UI. Hides it outright
rather than just disabling it, and drops the reserved bottom margin to
match, same treatment ChatDetailPage already gives its read-only state.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

CaseDetailPage now treats closed cases as read-only by blocking comment sends, hiding StickyCommentBar, and reducing spacing above the activity timeline.

Changes

Closed case comment behavior

Layer / File(s) Summary
Closed-case read-only presentation
apps/customer-portal/microapp/src/pages/CaseDetailPage.tsx
Comment submission and the sticky comment bar are disabled for closed cases, with reduced bottom spacing around the activity timeline.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: Area/Frontend

Suggested reviewers: lithika-damnod, suwagath, shayanmalinda

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: hiding the comment bar on closed cases.
Description check ✅ Passed It covers the required template sections with clear purpose, goals, approach, testing, security, and release note details.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@cloby99
cloby99 merged commit 7d156f4 into wso2-open-operations:main Jul 21, 2026
1 of 2 checks passed

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/customer-portal/microapp/src/pages/CaseDetailPage.tsx`:
- Around line 74-75: Add a !data guard to handleSend alongside the existing
comment and isClosed checks, and pass disabled={!data} to StickyCommentBar so
submissions and input remain unavailable until case data loads. Apply both
changes in apps/customer-portal/microapp/src/pages/CaseDetailPage.tsx at lines
74-75 and 342-350.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4ce76355-68f9-4b98-a790-9a5dcc9fbc46

📥 Commits

Reviewing files that changed from the base of the PR and between 235ee06 and ac66fe2.

📒 Files selected for processing (1)
  • apps/customer-portal/microapp/src/pages/CaseDetailPage.tsx

Comment thread apps/customer-portal/microapp/src/pages/CaseDetailPage.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants