[9.2] [Security Solution] Installation review pagination: Frontend (#248259)#250009
[9.2] [Security Solution] Installation review pagination: Frontend (#248259)#250009nikitaindik merged 3 commits intoelastic:9.2from
Conversation
…#248259) **Partially addresses: elastic#241656 **Backend PR: elastic#247375 >⚠️ Note: This PR should be merged only when the [backend PR](elastic#247375) is merged and released in Serverless (after Monday 19-Jan-2026). ## Summary This PR builds on top of the [backend PR](elastic#247375) and adds frontend changes for the installation review pagination. ## Changes - If `page` parameter is not passed, it's defaulted to 1. If `per_page` parameter is not passed it's defaulted to 20. - UI code now sends `page` and `per_page` parameters. - Client-side sorting and filtering was removed. It now happens on the backend. - Added Cypress tests to match the test plan. - Refactored `reviewRuleInstallationHandler` to make it more readable, as suggested in the feedback for the backend PR. (cherry picked from commit 2a85280) # Conflicts: # x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table_context.tsx # x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_installation/review_rule_installation_route.ts # x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/install_prebuilt_rules/review_installation.ts
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
|
maximpn
left a comment
There was a problem hiding this comment.
@nikitaindik Thanks for encompassing my suggestions to the backport 🙏
The diff is pretty close to the original PR. Testing has shown it works in the expected way.
| refetchInterval: 60000, // Refetch available rules for installation every minute | ||
| keepPreviousData: true, // Use this option so that the state doesn't jump between "success" and "loading" on page change | ||
| // Fetch rules to install only after background installation of security_detection_rules package is complete | ||
| enabled: isUpgradeReviewRequestEnabled({ |
There was a problem hiding this comment.
Ideally we could have a single hook for that purpose named something like usePrebuiltRulesAvailable. It could encapsulate the dependent hooks and return the clear result. isUpgradeReviewRequestEnabled was originally related to the prebuilt rules upgrade review API endpoint.
Let's note it for the future.
| } | ||
| ); | ||
|
|
||
| const rules = useMemo(() => reviewResponse?.rules ?? [], [reviewResponse]); |
There was a problem hiding this comment.
It does't look like useMemo is required here.
| const rulesMatchingFilterCount = reviewResponse?.total ?? 0; | ||
| const installableRulesCount = reviewResponse?.stats.num_rules_to_install ?? 0; | ||
|
|
||
| const tags = useMemo(() => reviewResponse?.stats?.tags ?? [], [reviewResponse]); |
There was a problem hiding this comment.
It does't look like useMemo is required here.
...rebuilt_rules/logic/rule_assets/prebuilt_rule_assets_client/methods/fetch_latest_versions.ts
Outdated
Show resolved
Hide resolved
|
run docs-build |
Backport
This will backport the following commits from
mainto9.2:Questions ?
Please refer to the Backport tool documentation