Skip to content

Commit d086a62

Browse files
prowler-botpedroootjfagoagas
authored
fix(ui): honor page size select in compliance req findings (#11368)
Co-authored-by: Pedro Martín <pedromarting3@gmail.com> Co-authored-by: Pepe Fagoaga <pepe@prowler.com>
1 parent a7c2b6c commit d086a62

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

ui/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to the **Prowler UI** are documented in this file.
77
### 🐞 Fixed
88

99
- 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)
10+
- Compliance requirement findings table now respects the page size selector [(#11365)](https://github.com/prowler-cloud/prowler/pull/11365)
1011

1112
---
1213

ui/components/compliance/compliance-accordion/client-accordion-content.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ export const ClientAccordionContent = ({
3232
const [expandedFindings, setExpandedFindings] = useState<FindingProps[]>([]);
3333
const searchParams = useSearchParams();
3434
const pageNumber = searchParams.get("page") || "1";
35+
const pageSize = searchParams.get("pageSize") || "10";
3536
const complianceId = searchParams.get("complianceId");
3637
const openFindingId = searchParams.get("id");
3738
const sort = searchParams.get("sort") || FINDINGS_DEFAULT_SORT;
3839
const loadedPageRef = useRef<string | null>(null);
40+
const loadedPageSizeRef = useRef<string | null>(null);
3941
const loadedSortRef = useRef<string | null>(null);
4042
const loadedMutedRef = useRef<string | null>(null);
4143
const isExpandedRef = useRef(false);
@@ -52,11 +54,13 @@ export const ClientAccordionContent = ({
5254
requirement.check_ids?.length > 0 &&
5355
requirement.status !== "No findings" &&
5456
(loadedPageRef.current !== pageNumber ||
57+
loadedPageSizeRef.current !== pageSize ||
5558
loadedSortRef.current !== sort ||
5659
loadedMutedRef.current !== mutedFilter ||
5760
!isExpandedRef.current)
5861
) {
5962
loadedPageRef.current = pageNumber;
63+
loadedPageSizeRef.current = pageSize;
6064
loadedSortRef.current = sort;
6165
loadedMutedRef.current = mutedFilter;
6266
isExpandedRef.current = true;
@@ -72,6 +76,7 @@ export const ClientAccordionContent = ({
7276
...(region && { "filter[region__in]": region }),
7377
},
7478
page: parseInt(pageNumber, 10),
79+
pageSize: parseInt(pageSize, 10),
7580
sort: encodedSort,
7681
});
7782

@@ -111,6 +116,7 @@ export const ClientAccordionContent = ({
111116
requirement,
112117
scanId,
113118
pageNumber,
119+
pageSize,
114120
sort,
115121
region,
116122
mutedFilter,

0 commit comments

Comments
 (0)