Skip to content

[Customer Portal][Web] feat: cases export and WSO2 case ID in partner global search - #982

Merged
cloby99 merged 3 commits into
wso2-open-operations:mainfrom
Rashmika998:feature/customer-portal-partner-search-v2
Jun 30, 2026
Merged

cloby99 merged 3 commits into
wso2-open-operations:mainfrom
Rashmika998:feature/customer-portal-partner-search-v2

Conversation

@Rashmika998

@Rashmika998 Rashmika998 commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Extends the partner global search with cases export (CSV/PDF) and improves the live search dropdown by surfacing the WSO2 case ID alongside a coloured case type chip for each case result.

Goals

  • Allow partner users to export their full case list (filtered by search query) to CSV or PDF without leaving the portal
  • Make case type immediately identifiable in the dropdown alongside the case reference ID

Approach

  • New casesExport.ts utility mirrors the existing projectsExport.ts pattern: paginated fetchAllCasesForExport via POST /search with types: ["cases"], plus downloadCaseListCsv / downloadCaseListPdf
  • Export buttons added to the cases section header in PartnerGlobalSearch and to the PartnerCasesPage header; both pass the active debounced search query to the fetch so exported data matches what the user sees
  • Dropdown case items updated to show formatCasesTableCaseIdentifier (the WSO2 case ID) as a secondary caption and the case type as a small coloured chip inline

Release note

Partner users can now export their cases list (CSV/PDF) from the global search page and the cases view-more page. The live search dropdown now shows the WSO2 case reference ID and a coloured case type chip for each case result.

Documentation

No public-facing documentation changes required.

Security checks

  • Export fetches data via the authenticated authFetch client; no credentials or tokens are included in exported files
  • No new endpoints introduced; reuses the existing POST /search API

Test plan

  • Open partner global search — cases section has an Export button
  • Export to CSV with no filter: all cases are included, columns are Title / Case ID / Case Type / Severity / Status / Created by / Created on / Project
  • Export to PDF with an active search query: only matching cases are exported
  • Open /partner/cases — Export button appears in the page header, respects ?q= filter
  • Type in the search dropdown and verify each case result shows ID: CS-xxxx | INT-xxxx with a coloured case type chip inline

🤖 Generated with Claude Code

…ner search dropdown

- Add casesExport.ts utility with fetchAllCasesForExport (paginated via
  POST /search), downloadCaseListCsv, and downloadCaseListPdf
- Add Export button to cases section in PartnerGlobalSearch (CSV + PDF,
  respects active search query filter)
- Add Export button to PartnerCasesPage header (same pattern, respects
  ?q= search query)
- Update search dropdown case items to show WSO2 case ID
  (formatCasesTableCaseIdentifier) as a second caption line below the title,
  matching the format used in the cases table
- Also pass debouncedSearchQuery to fetchAllProjectsForExport so project
  export respects the active filter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Rashmika998, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 14f5bd92-d15b-4e0f-9d48-de835f4f8cbc

📥 Commits

Reviewing files that changed from the base of the PR and between 1c682d9 and c3abfed.

📒 Files selected for processing (2)
  • apps/customer-portal/webapp/src/features/project-hub/components/PartnerGlobalSearch.tsx
  • apps/customer-portal/webapp/src/features/project-hub/utils/casesExport.ts
📝 Walkthrough

Walkthrough

Adds CSV/PDF export capability for cases in the Project Hub. A new casesExport.ts utility handles paginated fetch, row mapping, and file download. Both PartnerCasesPage and PartnerGlobalSearch are updated with export state, handlers, and an export button/dropdown menu wired to the debounced search query.

Changes

Cases Export Feature

Layer / File(s) Summary
casesExport utility: fetch, format, download
utils/casesExport.ts
New module with pagination constants, CSV/PDF column definitions, date/case-ID formatters, fetchAllCasesForExport (paginated /search calls), and downloadCaseListCsv/downloadCaseListPdf functions.
PartnerCasesPage export state and UI
pages/PartnerCasesPage.tsx
Adds useAuthApiClient, useErrorBanner, export format state, a ref-based concurrency guard, an anchor element for the dropdown, and an async export handler. Renders a disabled-aware export button with CSV/PDF menu in the page header.
PartnerGlobalSearch cases export and dropdown fix
components/PartnerGlobalSearch.tsx
Imports case export utilities; adds cases-specific export state and handleCasesExport; passes debouncedSearchQuery to project export; refactors the cases section header with an export button/menu; fixes dropdown item to highlight only c.title and display formatCasesTableCaseIdentifier as secondary text.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • wso2-open-operations/cs-tools#971: Directly related — modifies the same PartnerGlobalSearch.tsx and PartnerCasesPage.tsx files as part of the partner global search feature this PR extends.

Suggested labels

Type/New Feature, Area/Frontend, App/Customer Portal

Suggested reviewers

  • cloby99

Poem

🐰 Hop, hop, export away!
Cases as CSV or PDF today,
Paginated fetch, no duplicates near,
Debounced queries keep results clear,
Download buttons bloom in spring—
What a delightful data thing! 🌸

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific and matches the main changes: cases export plus WSO2 case ID in partner global search.
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.
Description check ✅ Passed The PR description covers the required core sections—purpose, goals, approach, release note, documentation, security, and test plan—despite some optional template sections being omitted.
✨ 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.

… search dropdown

Replace the plain-text case type caption with a coloured chip (same
alpha-bg/border pattern as the cases table) placed inline beside the
WSO2 case ID, so the two fields are visually distinct in the dropdown.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Rashmika998 Rashmika998 self-assigned this Jun 30, 2026
@Rashmika998 Rashmika998 added Type/Improvement Marks enhancements or improvements to existing features App/Customer Portal Area/Frontend labels Jun 30, 2026

@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/webapp/src/features/project-hub/utils/casesExport.ts`:
- Around line 107-110: The export search query handling in
fetchAllCasesForExport is not aligned with the visible search flow, since it
trims searchQuery while PartnerCasesPage and PartnerGlobalSearch pass the raw
debouncedSearchQuery into useGetGlobalSearch. Update the shared search
normalization so both the export path and the visible results path use the exact
same query value, or normalize once before both call sites; use
fetchAllCasesForExport, PartnerCasesPage, and PartnerGlobalSearch as the key
symbols to locate the related logic.
🪄 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: 80b5db35-53e1-403a-95ad-bf211da92e76

📥 Commits

Reviewing files that changed from the base of the PR and between 4e657a6 and 1c682d9.

📒 Files selected for processing (3)
  • apps/customer-portal/webapp/src/features/project-hub/components/PartnerGlobalSearch.tsx
  • apps/customer-portal/webapp/src/features/project-hub/pages/PartnerCasesPage.tsx
  • apps/customer-portal/webapp/src/features/project-hub/utils/casesExport.ts

…y functions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Rashmika998

Copy link
Copy Markdown
Contributor Author

The two pre-merge warnings have been addressed in the latest commits:

  • Docstring coverage: Added JSDoc comments to all functions in casesExport.ts (formatDate, formatCaseId, buildFilename, mapCasesToRows, downloadCaseListCsv, downloadCaseListPdf).
  • Description check: PR description updated to include all required template sections — Purpose, Goals, Approach, Release note, Documentation, Security checks, and Test plan.

Comment added by Claude on behalf of @Rashmika998.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

App/Customer Portal Area/Frontend Type/Improvement Marks enhancements or improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants