Skip to content

[Customer Portal] Populate updatedOn for cases and stop falling back to createdOn - #1206

Merged
Rashmika998 merged 8 commits into
wso2-open-operations:mainfrom
cloby99:feat/enhancements
Jul 22, 2026
Merged

Rashmika998 merged 8 commits into
wso2-open-operations:mainfrom
cloby99:feat/enhancements

Conversation

@cloby99

@cloby99 cloby99 commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

  • The /cases/search response never populated updatedOn — the entity and portal Case types only declared createdOn, so the Dashboard and Support case lists showed the created date labeled as "Updated."
  • Added updatedOn to the entity (entity/types.bal) and portal (types/types.bal) Case records, mapped it in searchCases (utils.bal), and updated openapi.yaml to mark it as a required field on the Case schema.
  • With updatedOn now guaranteed by the backend, removed the ?? createdOn fallbacks in the frontend (cases, announcements, change requests, service requests, outstanding cases lists) that were masking the missing field, so "Updated" labels now reflect the real update time and fall back to a placeholder only when genuinely absent.

Changes

Backend

  • modules/entity/types.bal — add updatedOn to Case
  • modules/types/types.bal — add updatedOn to Case
  • utils.bal — map updatedOn in searchCases
  • openapi.yaml — add updatedOn to Case schema, mark required

Frontend

  • components/list-view/ListCard.tsx
  • features/announcements/components/AnnouncementDetailsPanel.tsx
  • features/announcements/components/AnnouncementList.tsx
  • features/dashboard/components/cases-table/CasesList.tsx
  • features/operations/components/change-requests/ChangeRequestsList.tsx
  • features/operations/components/service-requests/ServiceRequestsList.tsx
  • features/support/components/support-overview-cards/OutstandingCasesList.tsx

Each drops the updatedOn ?? createdOn fallback now that the backend always returns updatedOn.

Test plan

  • bal build compiles cleanly with the type/mapper changes
  • Verify Dashboard "Updated" column shows the correct last-updated timestamp (not created date) for cases
  • Verify Support case list "Updated" label matches case-details "Last Updated"
  • Verify announcements, change requests, service requests, and outstanding cases lists still render correctly when updatedOn is present/absent

Summary by CodeRabbit

  • New Features
    • Added updated date and time information to case records and API responses.
    • Case and announcement views now display the latest update timestamp consistently.
  • Bug Fixes
    • Removed fallback to creation dates when updated timestamps are unavailable.
    • Added clear placeholders where update information is missing.
    • Standardized “Updated” labels across lists, cards, tables, and detail views.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Case contracts now include required updatedOn data, backend search results propagate it, and customer portal timestamp displays no longer fall back to createdOn.

Changes

Case updated timestamp propagation

Layer / File(s) Summary
Case timestamp contract
apps/customer-portal/backend/modules/entity/types.bal, apps/customer-portal/backend/modules/types/types.bal, apps/customer-portal/backend/openapi.yaml
Case records and the OpenAPI Case schema now define updatedOn as a required string field.
Search result propagation
apps/customer-portal/backend/utils.bal
searchCases includes case.updatedOn in mapped case metadata.
Portal timestamp displays
apps/customer-portal/webapp/src/components/list-view/ListCard.tsx, apps/customer-portal/webapp/src/features/announcements/*, apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesList.tsx, apps/customer-portal/webapp/src/features/operations/components/{change-requests,service-requests}/*, apps/customer-portal/webapp/src/features/support/components/support-overview-cards/OutstandingCasesList.tsx
Updated and last-updated displays use updatedOn directly and render placeholders or omit the section when it is unavailable.

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

Possibly related PRs

Suggested labels: Type/Bug

Suggested reviewers: dileepapeiris, shayanmalinda

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete versus the template; it only includes Summary, Changes, and a partial test plan, with most required sections missing. Add the missing template sections, especially Purpose, Goals, Approach, User stories, Release note, Documentation, Certification, Security checks, Test environment, and related links.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: populating updatedOn and removing the createdOn fallback.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
apps/customer-portal/backend/openapi.yaml

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


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.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/customer-portal/webapp/src/features/operations/components/change-requests/ChangeRequestsList.tsx (1)

322-338: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Render the Updated field when updatedOn is unavailable.

The {item.updatedOn && (...)} guard removes the entire field, so records without updatedOn show neither an Updated value nor the required -- placeholder. Render the block unconditionally and apply the fallback after formatting; only gate the separator on the neighboring schedule dates.

Proposed fix
-                {item.updatedOn && (
+                <Box
+                  sx={{
+                    display: "flex",
+                    alignItems: "center",
+                    gap: 0.5,
+                  }}
+                >
+                  <Typography variant="body2" color="text.secondary">
+                    {CHANGE_REQUESTS_LIST_UPDATED_PREFIX}
+                  </Typography>
+                  <Typography variant="body2" color="text.secondary">
+                    {formatDateTime(item.updatedOn) || CHANGE_REQUESTS_LIST_PLACEHOLDER}
+                  </Typography>
+                </Box>
-                )}
-                {item.updatedOn && (item.startDate || item.endDate) && (
+                {(item.startDate || item.endDate) && (
🤖 Prompt for 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.

In
`@apps/customer-portal/webapp/src/features/operations/components/change-requests/ChangeRequestsList.tsx`
around lines 322 - 338, The Updated field in ChangeRequestsList must render
unconditionally, using `--` when `item.updatedOn` is unavailable and
`formatDateTime(item.updatedOn)` otherwise. Remove the `item.updatedOn` guard
from the Updated display block while keeping the separator condition gated only
by `item.updatedOn` and the neighboring schedule dates.
🤖 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.

Outside diff comments:
In
`@apps/customer-portal/webapp/src/features/operations/components/change-requests/ChangeRequestsList.tsx`:
- Around line 322-338: The Updated field in ChangeRequestsList must render
unconditionally, using `--` when `item.updatedOn` is unavailable and
`formatDateTime(item.updatedOn)` otherwise. Remove the `item.updatedOn` guard
from the Updated display block while keeping the separator condition gated only
by `item.updatedOn` and the neighboring schedule dates.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f03b0f5d-7566-435e-befd-298602e5c3b0

📥 Commits

Reviewing files that changed from the base of the PR and between fee8e6c and 1874af3.

📒 Files selected for processing (11)
  • apps/customer-portal/backend/modules/entity/types.bal
  • apps/customer-portal/backend/modules/types/types.bal
  • apps/customer-portal/backend/openapi.yaml
  • apps/customer-portal/backend/utils.bal
  • apps/customer-portal/webapp/src/components/list-view/ListCard.tsx
  • apps/customer-portal/webapp/src/features/announcements/components/AnnouncementDetailsPanel.tsx
  • apps/customer-portal/webapp/src/features/announcements/components/AnnouncementList.tsx
  • apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesList.tsx
  • apps/customer-portal/webapp/src/features/operations/components/change-requests/ChangeRequestsList.tsx
  • apps/customer-portal/webapp/src/features/operations/components/service-requests/ServiceRequestsList.tsx
  • apps/customer-portal/webapp/src/features/support/components/support-overview-cards/OutstandingCasesList.tsx

@Rashmika998
Rashmika998 merged commit 02d10e2 into wso2-open-operations:main Jul 22, 2026
2 checks passed
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