Skip to content

[Customer Portal][FE][Web] Remove Recommended Update Levels Feature and Related Cleanup - #754

Merged
Rashmika998 merged 2 commits into
wso2-open-operations:mainfrom
dileepapeiris:BT-Tasks-V7
May 28, 2026
Merged

Rashmika998 merged 2 commits into
wso2-open-operations:mainfrom
dileepapeiris:BT-Tasks-V7

Conversation

@dileepapeiris

@dileepapeiris dileepapeiris commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

This pull request removes all code related to the "recommended update levels" feature from the customer portal webapp. This includes deleting the query hook, removing related constants, and cleaning up associated test mocks.

Key removals related to "recommended update levels":

API and Query Code Removal:

  • Deleted the useGetRecommendedUpdateLevels hook, which previously fetched recommended update levels from the backend.
  • Removed the RECOMMENDED_UPDATE_LEVELS key from the ApiQueryKeys constant in apiConstants.ts.

Test and Constant Cleanup:

  • Removed the mock for useGetRecommendedUpdateLevels from the UpdateHistoryTab.test.tsx test file.
  • Deleted the UPDATES_RECOMMENDED_LEVELS_LOAD_ERROR constant from updatesConstants.ts.

Summary by CodeRabbit

  • Refactor
    • Removed the recommended update levels feature, including API query logic, error messaging, and related test fixtures.

Review Change Stack

Delete the useGetRecommendedUpdateLevels hook (removed file) and remove the UPDATES_RECOMMENDED_LEVELS_LOAD_ERROR constant from updatesConstants.ts. Cleans up obsolete code related to fetching recommended update levels and removes an unused error message.
Delete the RECOMMENDED_UPDATE_LEVELS entry from ApiQueryKeys and remove the corresponding mock for useGetRecommendedUpdateLevels in UpdateHistoryTab tests. Keeps constants and tests in sync after the recommended update levels hook/feature was removed.
@dileepapeiris dileepapeiris self-assigned this May 28, 2026
@coderabbitai

coderabbitai Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The PR removes the useGetRecommendedUpdateLevels React Query hook and its related constants. Specifically, the hook module is deleted, the RECOMMENDED_UPDATE_LEVELS query-key constant is removed from ApiQueryKeys, the UPDATES_RECOMMENDED_LEVELS_LOAD_ERROR error message is deleted, and test mocks for the hook are cleaned up.

Changes

Removal of recommended update levels hook and constants

Layer / File(s) Summary
Remove useGetRecommendedUpdateLevels hook and supporting constants
apps/customer-portal/webapp/src/features/updates/api/useGetRecommendedUpdateLevels.ts, apps/customer-portal/webapp/src/constants/apiConstants.ts, apps/customer-portal/webapp/src/features/updates/constants/updatesConstants.ts, apps/customer-portal/webapp/src/features/project-details/components/deployments/__tests__/UpdateHistoryTab.test.tsx
The useGetRecommendedUpdateLevels hook module is deleted, removing the React Query-based authenticated fetch for recommended update levels. The RECOMMENDED_UPDATE_LEVELS query key and UPDATES_RECOMMENDED_LEVELS_LOAD_ERROR error message constant are removed. Test mocks for the deleted hook are cleaned up in UpdateHistoryTab.test.tsx.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • wso2-open-operations/cs-tools#201: Introduces PendingUpdatesPage workflow that fetches recommended update levels, directly impacted by removal of the useGetRecommendedUpdateLevels hook.
  • wso2-open-operations/cs-tools#235: Refactors update-page flow to drop GET-based recommended update levels in favor of POST search, directly aligns with this removal.
  • wso2-open-operations/cs-tools#247: Switches from useGetRecommendedUpdateLevels to useGetProductUpdateLevels in AllUpdatesTab, enabled by this hook removal.

Suggested labels

Type/Task, Type/Improvement, App/Customer Portal, Area/Frontend, Platform/Web

Suggested reviewers

  • Rashmika998

Poem

🐰 A hook takes its final bow,
Constants fade and tests bow out,
The recommended levels now rest in peace,
Cleaner code brings sweet release.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description lacks required sections from the template (Purpose/Goals/Approach/User stories/Release note/Documentation/Training/etc.) and only provides a brief summary of code removals. Fill out the complete PR description template with sections for Purpose, Goals, Approach, User stories, Release note, Documentation, and other required fields.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly and specifically describes the main change: removal of the recommended update levels feature and related cleanup across the codebase.

✏️ 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/Task General task that does not fit into other categories App/Customer Portal Area/Frontend Platform/Web labels May 28, 2026
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

@dileepapeiris dileepapeiris changed the title Bt tasks v7 [Customer Portal][FE][Web] Remove Recommended Update Levels Feature and Related Cleanup May 28, 2026
@Rashmika998
Rashmika998 merged commit fe60a4b into wso2-open-operations:main May 28, 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/Task General task that does not fit into other categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants