[Customer Portal][FE][Web] : Enhance Dashboard Cases Table with Created By Column and My Cases / All Cases Filtering - #723
Conversation
Set default sort field to `updatedOn` in AllCasesPage and SupportPage so case lists surface recently updated items. Also reorder the sortFieldOptions in AllCasesPage to show "Updated on" before "Created on" while keeping severity and status options intact.
Change the default SecurityReportCaseSortField fallback to updatedOn and update OutstandingCasesList to display updatedOn via formatRelativeTime. This makes sorting and the UI reflect the last update time of cases rather than their creation time, surfacing more recent activity.
Move the "Created date" option to appear after "Updated date" in SECURITY_REPORT_SORT_OPTIONS in securityConstants.ts. This adjusts the sort options order for the security report UI; no other functional changes were made.
Set default sorting for change requests and security/service cases to use UpdatedOn (most recent first). Changes include: add ChangeRequestSortField import and set sortBy to ChangeRequestSortField.UpdatedOn with SortOrder.DESC in buildChangeRequestSearchRequest; switch severity->UpdatedOn mapping in buildServiceRequestsPageCaseSearchRequest; update SecurityReportAnalysis default sortField to updatedOn. Also adjust type import ordering in operationsPages.ts.
Introduce ChangeRequestSortField enum (updatedOn, createdOn) for the search API sortBy.field and add a unit test to assert default change request sorting is updatedOn desc. Update service request case search tests to expect updatedOn (and adjust the legacy Severity-sort normalization expectations) to reflect the new default sort field.
Change operations and service request lists to sort by updatedOn instead of createdOn so items are ordered by most recent activity. Add buildChangeRequestSearchRequest import and use a memoized changeRequestOverviewSearchRequest (based on filterMetadata.changeRequestStates) in place of the previous inline filters for fetching change requests. Also update the default session sort field in ServiceRequestsPage to UpdatedOn.
Display a service request's updatedOn (falling back to createdOn) in the list UI so the most recent change is shown. Rename created-prefix constant to UPDATED_PREFIX and swap the service request sort field options so the "Updated on" option corresponds to UpdatedOn and "Created on" to CreatedOn, aligning labels with values.
Map Severity sorting to UpdatedOn (instead of CreatedOn) in engagements utilities and normalize sortField accordingly so severity-sorted lists use the latest update timestamp. Update ChangeRequestsList to show updatedOn (falling back to createdOn) and use the UPDATED prefix constant for the timestamp label, keeping sorting and displayed timestamps consistent after updates.
Change the default engagements sort field from CreatedOn to UpdatedOn in the page state hook and update the engagements utils tests to match. Tests now expect parseEngagementsSortField to return UpdatedOn for unknown/legacy values and buildEngagementSearchRequest to normalize legacy Severity/unknown sorts to UpdatedOn in the API payload. This aligns sorting behavior to use last-updated timestamp rather than creation time.
Set dashboard lists to default to UpdatedOn descending by adding a memoized listSortBy ({ field: 'updatedOn', order: SortOrder.DESC }) in DashboardItemsPage and passing it as sortBy to the list queries. Also import SortOrder. Reorder engagement sort options so "Updated on" appears before "Created on" to match the new default ordering.
Change the cases table to surface the updated timestamp instead of created: update the column header to "Updated", display row.updatedOn (falling back to createdOn) for date and time formatting, and set the default sort field to updatedOn (descending). This ensures the list reflects recent activity rather than creation time.
Change the default sortField in buildAnnouncementCaseSearchRequest from CreatedOn to UpdatedOn so announcement case searches are ordered by last update. Update the corresponding unit test (CasesTable.test.tsx) to expect sortBy.field = 'updatedOn'. This aligns sorting behavior and tests with the intended ordering by update timestamp.
Change AnnouncementSortField enum to use UpdatedOn ("updatedOn") instead of CreatedOn so sorting uses the announcement update timestamp. Update unit test to expect "updatedOn" for sortBy.field to reflect the new enum value.
Change announcements sorting to use the updated date. Rename the sort label to ANNOUNCEMENTS_SORT_UPDATED_LABEL and update ANNOUNCEMENTS_SORT_FIELD_OPTIONS to use AnnouncementSortField.UpdatedOn. Also set the page default sortField to AnnouncementSortField.UpdatedOn so lists are ordered by last update.
Switch announcement and list card displays to show the resource's updated timestamp instead of the created timestamp. Use caseItem.updatedOn with a fallback to createdOn in ListCard, and rename variables in AnnouncementDetailsPanel and AnnouncementList to use updatedOnLabel and show "Updated {date}" in the UI.
Provide a fallback to createdOn when updatedOn is missing to avoid passing undefined to date formatting helpers. Updated AnnouncementDetailsPanel and AnnouncementList to call formatAnnouncementDateDisplay with data.updatedOn ?? data.createdOn, and Updated OutstandingCasesList to call formatRelativeTime with c.updatedOn ?? c.createdOn ?? undefined. This ensures consistent date displays when updatedOn is not populated.
Import DashboardCasesViewMode and add parseDashboardCasesViewMode to map TabBar tab ids to the DashboardCasesViewMode enum. The function returns MY when the tab id matches, and defaults to ALL otherwise, enabling consistent mapping for the dashboard cases view selection.
Introduce DashboardCasesViewMode enum (MyCases / AllCases) and add view-related props to CasesTableHeaderProps (viewTabs, activeViewMode, onViewModeChange) to support My vs All tabs on the dashboard outstanding cases table. Update parseDashboardCasesViewMode to recognize the new enum values as well as legacy tabId strings ("my" / "all") and return the appropriate enum, defaulting to AllCases.
Introduce a TabBar to CasesTableHeader: import TabBar, add viewTabs, activeViewMode and onViewModeChange props, and wrap the view tabs and filter button in a responsive Box to align controls. Update CasesTableSkeleton to better match the dashboard cases column order (Updated, Details, Severity, Status, Created by, Assigned to), refine skeleton variants/sizes, add a data-testid on the first row, and adjust alignment and widths for a more accurate loading state.
Introduce a 'Created by' column in CasesList (import header constant, adjust table min widths, update colSpan values, and add truncated display cell). Add dashboard view mode support in CasesTable: new viewMode state, include createdByMe in the query when MyCases is active, update effect deps, and wire viewTabs/activeViewMode/onViewModeChange props to the header. Update unit tests to mock the tab bar and dashboard util, assert view tabs render, and verify onViewModeChange is called when a tab is clicked.
Update CasesList.test.tsx to include a createdBy field on the test case fixture and add assertions for the "Created by" header and the creator name "Jane Smith". This ensures the CasesList component renders the case creator information correctly.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (37)
📝 WalkthroughWalkthroughThis PR changes the default case list sorting and timestamp display across the customer portal from ChangesTimestamp and Sort Field Updates Across Features
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
The merge-base changed after approval.
The merge-base changed after approval.
Description
This pull request updates the customer portal's case and announcement lists to consistently use the "Updated" date (falling back to "Created" if no update exists) instead of the "Created" date throughout the UI, sorting, and filtering logic. It also introduces a new "Created by" column to the dashboard cases table and adds support for viewing "My Cases" vs. "All Cases" via a new tab bar. Several UI elements and constants are updated for clarity and consistency.
Announcement and Case List Date Handling
ListCard,AnnouncementList, andAnnouncementDetailsPanel. [1] [2] [3] [4] [5]Dashboard Cases Table Enhancements
Dashboard View Mode (My Cases / All Cases)
Constants and Types Updates
These changes improve the user experience by ensuring that users see the most relevant (recently updated) information and have clearer navigation and filtering options in the dashboard.
Summary by CodeRabbit
New Features
Bug Fixes