[Customer Portal] Populate updatedOn for cases and stop falling back to createdOn - #1206
Conversation
📝 WalkthroughWalkthroughThe Case contracts now include required ChangesCase updated timestamp propagation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.yamlTraceback (most recent call last): 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. Comment |
There was a problem hiding this comment.
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 winRender the Updated field when
updatedOnis unavailable.The
{item.updatedOn && (...)}guard removes the entire field, so records withoutupdatedOnshow 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
📒 Files selected for processing (11)
apps/customer-portal/backend/modules/entity/types.balapps/customer-portal/backend/modules/types/types.balapps/customer-portal/backend/openapi.yamlapps/customer-portal/backend/utils.balapps/customer-portal/webapp/src/components/list-view/ListCard.tsxapps/customer-portal/webapp/src/features/announcements/components/AnnouncementDetailsPanel.tsxapps/customer-portal/webapp/src/features/announcements/components/AnnouncementList.tsxapps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesList.tsxapps/customer-portal/webapp/src/features/operations/components/change-requests/ChangeRequestsList.tsxapps/customer-portal/webapp/src/features/operations/components/service-requests/ServiceRequestsList.tsxapps/customer-portal/webapp/src/features/support/components/support-overview-cards/OutstandingCasesList.tsx
Summary
/cases/searchresponse never populatedupdatedOn— the entity and portalCasetypes only declaredcreatedOn, so the Dashboard and Support case lists showed the created date labeled as "Updated."updatedOnto the entity (entity/types.bal) and portal (types/types.bal)Caserecords, mapped it insearchCases(utils.bal), and updatedopenapi.yamlto mark it as a required field on theCaseschema.updatedOnnow guaranteed by the backend, removed the?? createdOnfallbacks 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— addupdatedOntoCasemodules/types/types.bal— addupdatedOntoCaseutils.bal— mapupdatedOninsearchCasesopenapi.yaml— addupdatedOntoCaseschema, mark requiredFrontend
components/list-view/ListCard.tsxfeatures/announcements/components/AnnouncementDetailsPanel.tsxfeatures/announcements/components/AnnouncementList.tsxfeatures/dashboard/components/cases-table/CasesList.tsxfeatures/operations/components/change-requests/ChangeRequestsList.tsxfeatures/operations/components/service-requests/ServiceRequestsList.tsxfeatures/support/components/support-overview-cards/OutstandingCasesList.tsxEach drops the
updatedOn ?? createdOnfallback now that the backend always returnsupdatedOn.Test plan
bal buildcompiles cleanly with the type/mapper changesupdatedOnis present/absentSummary by CodeRabbit