Skip to content

[CSM Portal Microapp] Build out the Updates page - #1182

Merged
rksk merged 4 commits into
wso2-open-operations:dev-app-csm-portalfrom
Hesara2003:feature/csm-microapp-updates-page
Jul 20, 2026
Merged

rksk merged 4 commits into
wso2-open-operations:dev-app-csm-portalfrom
Hesara2003:feature/csm-microapp-updates-page

Conversation

@Hesara2003

@Hesara2003 Hesara2003 commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

The Updates page in the CSM microapp was a ComingSoonPage placeholder — no way to check release notes between two update levels of a product version on mobile, even though the webapp has had this for a while.

Goals

  • Let an agent pick a product, version, and an update-level range, and see every update level in that range with its type (security/regular/mixed).
  • Show the full detail for a level on demand: description, instructions, bug fixes, added/modified/removed files, and security advisories.
  • Handle the upstream's "description is sometimes HTML, sometimes plain text" quirk correctly either way.

Approach

  • Ported the webapp's features/updates/ contract into the microapp's types/, services/, pages/ layout: updates.dto.ts/updates.model.ts mirror GET /updates/product-update-levels and POST /updates/levels/search, with the model layer normalizing the upstream's sometimes-JSON-encoded-as-string list fields into real arrays and pre-sorting search results by level key.
  • UpdatesPage.tsx replaces the placeholder: cascading Product → Version → Start level → End level selects, a result list, and a per-level detail dialog. Reuses the shared DialogPaper (stable paper-slot component) and the OPAQUE_POPUP pattern already established in TimeCardFiltersSheet/AnnouncementFiltersSheet for this theme's translucent dropdowns.
  • Trimmed from the webapp's version for a single-column mobile layout: no PDF export or report-preview dialog (a print/download flow doesn't suit a WebView well and wasn't asked for), and a single preferred date/time instead of the webapp's up-to-3-slot picker.
  • While wiring dialogs for this, noticed the call-requests feature's five dialogs (a separate, already-open PR) had the same paper-slot focus-loss bug as an earlier customer-portal fix — turned out this microapp already has a shared DialogPaper for exactly that reason. Fixed those to use it too, included here since it was found in the course of this work.

User stories

As an agent, I can look up what changed between two update levels of a product version from my phone, including security advisories, without needing the desktop webapp.

Release note

Added the Updates page (product/version/update-level range search) to the CSM Portal mobile app.

Documentation

N/A — internal CSM portal UI change, no external doc surface affected.

Automation tests

  • No automated test runner is wired up for this app yet.
  • Verified locally: tsc -b, eslint, and npm run build all clean.

Security checks

Test environment

  • Local dev server (Vite), manual browser testing.

Summary by CodeRabbit

  • New Features
    • Added a full “Updates” search page with product/version and update-level selection.
    • Added range validation so searches only run when the selected start/end levels are valid.
    • Added search results with per-level “View” dialogs showing update details (descriptions, bug fixes, file changes, security advisories, and related releases).
    • Added safe rendering for formatted update content and structured detail sections.

Mirrors the webapp's features/updates/types/updates.ts contract for
GET /updates/product-update-levels and POST /updates/levels/search.
The model layer normalizes the upstream's sometimes-JSON-encoded-as-
string list fields (bugFixes, filesAdded, etc.) into real arrays and
pre-sorts search results by level key, so the page never touches the
raw response shape.
updates.productLevels() backs the product/version/level pickers;
updates.search() is gated on a non-null input, same enabled-when-
present pattern as the webapp's usePostUpdateLevelsSearch.
Was a ComingSoonPage placeholder. Now: cascading product/version/
start-level/end-level pickers, a search result list of matched update
levels with a security/regular/mixed type chip, and a detail dialog
per level (description, instructions, bug fixes, file lists, security
advisories).

Ported from the webapp's CsmUpdatesPage, trimmed for a single-column
mobile layout: no PDF export/report-preview dialog (print/download
flows don't translate well to a WebView, and weren't asked for) and a
single date/time value per slot instead of the webapp's multi-slot
picker. Reuses HtmlOrText's same regex-sniff + DOMPurify approach,
since update descriptions come back as HTML sometimes and plain text
other times from the same field. Select dropdowns use the same
OPAQUE_POPUP fix already established in TimeCardFiltersSheet et al.,
since this theme's popups are translucent by default.
@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 0a2b20a5-2fec-4700-98ae-2b83621f7b81

📥 Commits

Reviewing files that changed from the base of the PR and between 3303a78 and 00d619c.

📒 Files selected for processing (1)
  • apps/csm-portal/microapp/src/pages/UpdatesPage.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/csm-portal/microapp/src/pages/UpdatesPage.tsx

📝 Walkthrough

Walkthrough

Changes

The updates placeholder page is replaced with a product, version, and update-level search flow. New DTOs, normalized models, React Query services, endpoint constants, result rendering, sanitized descriptions, file lists, security advisories, and detail dialogs are added.

Updates feature

Layer / File(s) Summary
Update contracts and normalization
apps/csm-portal/microapp/src/types/updates.dto.ts, apps/csm-portal/microapp/src/types/updates.model.ts, apps/csm-portal/microapp/src/types/index.ts
Defines update DTOs and UI models, normalizes encoded arrays and timestamps, transforms response groups, and exports the new types.
Update endpoints and query service
apps/csm-portal/microapp/src/config/endpoints.ts, apps/csm-portal/microapp/src/services/updates.ts
Adds product-level and search endpoints with React Query options for cached product levels and conditional search requests.
Updates filtering and search UI
apps/csm-portal/microapp/src/pages/UpdatesPage.tsx
Adds dependent filters, validation, search state handling, loading/error/empty states, and update-level result actions.
Update details dialog
apps/csm-portal/microapp/src/pages/UpdatesPage.tsx
Renders descriptions, instructions, file changes, security advisories, sanitized content, and a styled details dialog.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant UpdatesPage
  participant updates
  participant API
  User->>UpdatesPage: Select product, version, and levels
  UpdatesPage->>updates: Request product levels
  updates->>API: GET product update levels
  API-->>updates: Product level data
  User->>UpdatesPage: Submit valid search
  UpdatesPage->>updates: Search with selected levels
  updates->>API: POST update-level search
  API-->>updates: Grouped update descriptions
  updates-->>UpdatesPage: Normalized result groups
  User->>UpdatesPage: Select View
  UpdatesPage-->>User: Show update details dialog
Loading

Possibly related PRs

Suggested labels: Type/New Feature, Area/Frontend, App/CSM Portal

Suggested reviewers: rashmika998, cloby99, rksk, shayanmalinda

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% 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 concise and accurately summarizes the main change: building out the Updates page in the CSM Portal microapp.
Description check ✅ Passed The description is mostly complete and covers the core template sections, with only several optional sections omitted.
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

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.

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/csm-portal/microapp/src/pages/UpdatesPage.tsx`:
- Around line 375-376: Update the Description rendering condition in the
UpdatesPage JSX to use isMeaningful(desc.description), matching the existing
Instructions check, while preserving the current UpdateSection title and
content.
🪄 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: b8efdabf-219c-477b-8943-0a6f19c61fb8

📥 Commits

Reviewing files that changed from the base of the PR and between ee0bb94 and 3303a78.

📒 Files selected for processing (6)
  • apps/csm-portal/microapp/src/config/endpoints.ts
  • apps/csm-portal/microapp/src/pages/UpdatesPage.tsx
  • apps/csm-portal/microapp/src/services/updates.ts
  • apps/csm-portal/microapp/src/types/index.ts
  • apps/csm-portal/microapp/src/types/updates.dto.ts
  • apps/csm-portal/microapp/src/types/updates.model.ts

Comment thread apps/csm-portal/microapp/src/pages/UpdatesPage.tsx Outdated
…tructions

Description used a plain truthy check while Instructions used
isMeaningful (filters out "", "n/a", "na"). Same upstream field
shape, same treatment now.
@Hesara2003

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@rksk
rksk merged commit 21be448 into wso2-open-operations:dev-app-csm-portal Jul 20, 2026
1 check 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