Skip to content

[Customer Portal][FE][Web] : Enhance Dashboard Cases Table with Created By Column and My Cases / All Cases Filtering - #723

Merged
maheshika merged 24 commits into
wso2-open-operations:mainfrom
dileepapeiris:BT-Tasks-V2
May 25, 2026
Merged

maheshika merged 24 commits into
wso2-open-operations:mainfrom
dileepapeiris:BT-Tasks-V2

Conversation

@dileepapeiris

@dileepapeiris dileepapeiris commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

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

  • All announcement and case lists now display "Updated" dates instead of "Created" dates, falling back to "Created" if "Updated" is not present. This change is reflected in labels, sorting, and display logic across components such as ListCard, AnnouncementList, and AnnouncementDetailsPanel. [1] [2] [3] [4] [5]
  • The default sort field for announcements and cases is changed from "createdOn" to "updatedOn" in types, constants, utility functions, and tests. [1] [2] [3] [4] [5] [6]

Dashboard Cases Table Enhancements

  • Adds a new "Created by" column to the cases table, displaying the creator of each case. Adjusts table layout and skeletons to accommodate the new column. [1] [2] [3] [4] [5] [6] [7]
  • Table headers and column labels are updated for clarity (e.g., "Updated" instead of "Created").

Dashboard View Mode (My Cases / All Cases)

  • Introduces a tab bar to switch between "My Cases" and "All Cases" views in the dashboard. Updates data fetching logic to filter cases accordingly. [1] [2] [3] [4] [5] [6] [7] [8]

Constants and Types Updates

  • Updates constants and enums related to sorting fields and labels to reflect the switch from "Created" to "Updated". [1] [2]

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

    • Added view mode tabs ("My Cases" and "All Cases") to the dashboard cases table.
    • Added "Created by" column to the cases table.
  • Bug Fixes

    • Updated timestamp displays to show "Updated" dates instead of "Created" dates across announcements, cases, service requests, and change requests.
    • Changed default sorting order from "Created on" to "Updated on" across cases, announcements, service requests, change requests, engagements, and security reports.

Review Change Stack

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.
@dileepapeiris dileepapeiris self-assigned this May 25, 2026
@coderabbitai

coderabbitai Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 760f9a45-1412-4f73-8b02-948b0dba40ff

📥 Commits

Reviewing files that changed from the base of the PR and between 8439957 and 21f6c32.

📒 Files selected for processing (37)
  • 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/announcements/constants/announcementsConstants.ts
  • apps/customer-portal/webapp/src/features/announcements/pages/AnnouncementsPage.tsx
  • apps/customer-portal/webapp/src/features/announcements/types/announcements.ts
  • apps/customer-portal/webapp/src/features/announcements/utils/__tests__/announcements.test.ts
  • apps/customer-portal/webapp/src/features/announcements/utils/announcements.ts
  • apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesList.tsx
  • apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesTable.tsx
  • apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesTableHeader.tsx
  • apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesTableSkeleton.tsx
  • apps/customer-portal/webapp/src/features/dashboard/components/cases-table/__tests__/CasesList.test.tsx
  • apps/customer-portal/webapp/src/features/dashboard/components/cases-table/__tests__/CasesTable.test.tsx
  • apps/customer-portal/webapp/src/features/dashboard/components/cases-table/__tests__/CasesTableHeader.test.tsx
  • apps/customer-portal/webapp/src/features/dashboard/constants/casesTable.ts
  • apps/customer-portal/webapp/src/features/dashboard/pages/DashboardItemsPage.tsx
  • apps/customer-portal/webapp/src/features/dashboard/types/casesTable.ts
  • apps/customer-portal/webapp/src/features/dashboard/utils/casesTable.ts
  • apps/customer-portal/webapp/src/features/engagements/constants/engagements.ts
  • apps/customer-portal/webapp/src/features/engagements/hooks/useEngagementsPageState.ts
  • apps/customer-portal/webapp/src/features/engagements/utils/__tests__/engagements.test.ts
  • apps/customer-portal/webapp/src/features/engagements/utils/engagements.ts
  • 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/operations/constants/operationsConstants.ts
  • apps/customer-portal/webapp/src/features/operations/pages/OperationsPage.tsx
  • apps/customer-portal/webapp/src/features/operations/pages/ServiceRequestsPage.tsx
  • apps/customer-portal/webapp/src/features/operations/types/changeRequests.ts
  • apps/customer-portal/webapp/src/features/operations/utils/__tests__/operationsPages.test.ts
  • apps/customer-portal/webapp/src/features/operations/utils/operationsPages.ts
  • apps/customer-portal/webapp/src/features/security/components/SecurityReportAnalysis.tsx
  • apps/customer-portal/webapp/src/features/security/constants/securityConstants.ts
  • apps/customer-portal/webapp/src/features/security/utils/securityPage.ts
  • apps/customer-portal/webapp/src/features/support/components/support-overview-cards/OutstandingCasesList.tsx
  • apps/customer-portal/webapp/src/features/support/pages/AllCasesPage.tsx
  • apps/customer-portal/webapp/src/features/support/pages/SupportPage.tsx

📝 Walkthrough

Walkthrough

This PR changes the default case list sorting and timestamp display across the customer portal from createdOn to updatedOn (falling back to createdOn when unavailable). The dashboard cases table additionally gains a view-mode selector ("My Cases" / "All Cases") and a new "Created By" column. All features (announcements, engagements, operations, security, support) are updated to use the new timestamp and sort preferences consistently.

Changes

Timestamp and Sort Field Updates Across Features

Layer / File(s) Summary
Announcements feature: UpdatedOn display and sorting
apps/customer-portal/webapp/src/features/announcements/types/announcements.ts, apps/customer-portal/webapp/src/features/announcements/constants/announcementsConstants.ts, 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/components/list-view/ListCard.tsx, apps/customer-portal/webapp/src/features/announcements/pages/AnnouncementsPage.tsx, apps/customer-portal/webapp/src/features/announcements/utils/announcements.ts, apps/customer-portal/webapp/src/features/announcements/utils/__tests__/announcements.test.ts
AnnouncementSortField enum replaces CreatedOn with UpdatedOn, constants use updated-date label, and detail/list components display updatedOn with fallback to createdOn. Default page sort and search request builder both use UpdatedOn.
Dashboard cases: View mode selection and table columns
apps/customer-portal/webapp/src/features/dashboard/types/casesTable.ts, apps/customer-portal/webapp/src/features/dashboard/constants/casesTable.ts, apps/customer-portal/webapp/src/features/dashboard/utils/casesTable.ts, apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesTableHeader.tsx, apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesList.tsx, apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesTableSkeleton.tsx, apps/customer-portal/webapp/src/features/dashboard/components/cases-table/CasesTable.tsx, apps/customer-portal/webapp/src/features/dashboard/components/cases-table/__tests__/CasesList.test.tsx, apps/customer-portal/webapp/src/features/dashboard/components/cases-table/__tests__/CasesTable.test.tsx, apps/customer-portal/webapp/src/features/dashboard/components/cases-table/__tests__/CasesTableHeader.test.tsx
DashboardCasesViewMode enum enables My Cases / All Cases view selection via tabs in table header. Table columns now show Updated date, Created By, Status, and Assigned To. Search request includes createdByMe filter when viewing own cases and sorts by updatedOn. Skeleton updated to match column count. Tests verify tab interactions and sort behavior.
Dashboard: Consistent sort order across all list queries
apps/customer-portal/webapp/src/features/dashboard/pages/DashboardItemsPage.tsx
Shared listSortBy (updatedOn descending) is passed to all dashboard section queries (Cases, Service Requests, Security Report Analysis, Engagements, Change Requests) for consistent ordering.
Engagements feature: UpdatedOn as default sort
apps/customer-portal/webapp/src/features/engagements/constants/engagements.ts, apps/customer-portal/webapp/src/features/engagements/hooks/useEngagementsPageState.ts, apps/customer-portal/webapp/src/features/engagements/utils/engagements.ts, apps/customer-portal/webapp/src/features/engagements/utils/__tests__/engagements.test.ts
Sort options reordered to prioritize UpdatedOn. Default page state and search request builder use UpdatedOn instead of CreatedOn. Sort field parser maps unknown and legacy Severity values to UpdatedOn. Tests updated to reflect new defaults.
Operations feature: Change requests and service requests sorting
apps/customer-portal/webapp/src/features/operations/types/changeRequests.ts, apps/customer-portal/webapp/src/features/operations/constants/operationsConstants.ts, apps/customer-portal/webapp/src/features/operations/components/change-requests/ChangeRequestsList.tsx, apps/customer-portal/webapp/src/features/operations/pages/OperationsPage.tsx, apps/customer-portal/webapp/src/features/operations/pages/ServiceRequestsPage.tsx, apps/customer-portal/webapp/src/features/operations/components/service-requests/ServiceRequestsList.tsx, apps/customer-portal/webapp/src/features/operations/utils/operationsPages.ts, apps/customer-portal/webapp/src/features/operations/utils/__tests__/operationsPages.test.ts
New ChangeRequestSortField enum and buildChangeRequestSearchRequest function sort change requests by UpdatedOn. Change requests display uses "Updated:" prefix instead of "Created:". Service request sort options reordered and parsing updated to prefer UpdatedOn. Operations page builds search requests via updated utilities. Tests verify sort field mappings.
Security and Support features: UpdatedOn display and sorting
apps/customer-portal/webapp/src/features/security/components/SecurityReportAnalysis.tsx, apps/customer-portal/webapp/src/features/security/constants/securityConstants.ts, apps/customer-portal/webapp/src/features/security/utils/securityPage.ts, apps/customer-portal/webapp/src/features/support/components/support-overview-cards/OutstandingCasesList.tsx, apps/customer-portal/webapp/src/features/support/pages/AllCasesPage.tsx, apps/customer-portal/webapp/src/features/support/pages/SupportPage.tsx
Security Report Analysis and Support pages default to UpdatedOn sort instead of CreatedOn. Sort option arrays reordered to list UpdatedOn before CreatedOn. Component display prefers updatedOn timestamp with fallback to createdOn. Sort field parser uses UpdatedOn as default for unknown values.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • wso2-open-operations/cs-tools#101: Both PRs modify OutstandingCasesList.tsx to prefer c.updatedOn with a fallback to c.createdOn for the card's displayed time.
  • wso2-open-operations/cs-tools#418: Both PRs modify the SecurityReportAnalysis sorting behavior—switching the default sort from createdOn to updatedOn and introducing selectable sort fields.

Suggested labels

Type/New Feature, Type/Improvement, Type/UX, App/Customer Portal, Area/Frontend, Platform/Web

Suggested reviewers

  • Rashmika998
  • v15a1
  • SasmithaDilshan

🐰 A timestamp refresh, so grand,
Now updated dates make their stand,
View modes let you choose,
Sorting without the blues,
Across the portal, so carefully planned! 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main changes: enhancing the dashboard cases table with a new 'Created By' column and adding 'My Cases/All Cases' filtering tabs.
Description check ✅ Passed The PR description covers the main changes comprehensively: date handling updates, dashboard cases table enhancements, view mode filtering, and constants/types updates. While the description template has many optional sections, the provided description includes sufficient detail about the actual changes.
Docstring Coverage ✅ Passed Docstring coverage is 95.24% 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.

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

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

@dileepapeiris dileepapeiris added Type/Improvement Marks enhancements or improvements to existing features Type/Task General task that does not fit into other categories Type/UX Refers to user experience-related tasks or issues App/Customer Portal Area/Frontend Platform/Web labels May 25, 2026
@dileepapeiris dileepapeiris changed the title Enhance Dashboard Cases Table with Created By Column and My Cases / All Cases Filtering [Customer Portal][FE][Web] : Enhance Dashboard Cases Table with Created By Column and My Cases / All Cases Filtering May 25, 2026
cloby99
cloby99 previously approved these changes May 25, 2026
@dileepapeiris
dileepapeiris dismissed cloby99’s stale review May 25, 2026 06:27

The merge-base changed after approval.

Rashmika998
Rashmika998 previously approved these changes May 25, 2026
@dileepapeiris
dileepapeiris dismissed Rashmika998’s stale review May 25, 2026 06:34

The merge-base changed after approval.

@maheshika
maheshika merged commit 9e0696e into wso2-open-operations:main May 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

App/Customer Portal Area/Frontend Platform/Web Type/Improvement Marks enhancements or improvements to existing features Type/Task General task that does not fit into other categories Type/UX Refers to user experience-related tasks or issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants