diff --git a/ui/CHANGELOG.md b/ui/CHANGELOG.md index afaf42dfe2..0174b73f6b 100644 --- a/ui/CHANGELOG.md +++ b/ui/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to the **Prowler UI** are documented in this file. ### 🐞 Fixed - Large scan report ZIP downloads now stream through a Next.js Route Handler instead of buffering the full file in a Server Action [(#11330)](https://github.com/prowler-cloud/prowler/pull/11330) +- Compliance requirement findings table now respects the page size selector [(#11365)](https://github.com/prowler-cloud/prowler/pull/11365) --- diff --git a/ui/components/compliance/compliance-accordion/client-accordion-content.tsx b/ui/components/compliance/compliance-accordion/client-accordion-content.tsx index 5239ba9dd5..4a0ba6b198 100644 --- a/ui/components/compliance/compliance-accordion/client-accordion-content.tsx +++ b/ui/components/compliance/compliance-accordion/client-accordion-content.tsx @@ -32,10 +32,12 @@ export const ClientAccordionContent = ({ const [expandedFindings, setExpandedFindings] = useState([]); const searchParams = useSearchParams(); const pageNumber = searchParams.get("page") || "1"; + const pageSize = searchParams.get("pageSize") || "10"; const complianceId = searchParams.get("complianceId"); const openFindingId = searchParams.get("id"); const sort = searchParams.get("sort") || FINDINGS_DEFAULT_SORT; const loadedPageRef = useRef(null); + const loadedPageSizeRef = useRef(null); const loadedSortRef = useRef(null); const loadedMutedRef = useRef(null); const isExpandedRef = useRef(false); @@ -52,11 +54,13 @@ export const ClientAccordionContent = ({ requirement.check_ids?.length > 0 && requirement.status !== "No findings" && (loadedPageRef.current !== pageNumber || + loadedPageSizeRef.current !== pageSize || loadedSortRef.current !== sort || loadedMutedRef.current !== mutedFilter || !isExpandedRef.current) ) { loadedPageRef.current = pageNumber; + loadedPageSizeRef.current = pageSize; loadedSortRef.current = sort; loadedMutedRef.current = mutedFilter; isExpandedRef.current = true; @@ -72,6 +76,7 @@ export const ClientAccordionContent = ({ ...(region && { "filter[region__in]": region }), }, page: parseInt(pageNumber, 10), + pageSize: parseInt(pageSize, 10), sort: encodedSort, }); @@ -111,6 +116,7 @@ export const ClientAccordionContent = ({ requirement, scanId, pageNumber, + pageSize, sort, region, mutedFilter,