fix(ui): exclude service filter from finding group resources endpoint (#10652)

This commit is contained in:
Alan Buscaglia
2026-04-10 14:06:47 +02:00
committed by GitHub
parent dad84f0ee2
commit 1aa91cf60f
4 changed files with 23 additions and 3 deletions
+1
View File
@@ -26,6 +26,7 @@ All notable changes to the **Prowler UI** are documented in this file.
- Deleting the active organization now switches to the target org before deleting, preventing JWT rejection from the backend [(#10491)](https://github.com/prowler-cloud/prowler/pull/10491)
- Clear Filters now resets all filters including muted findings and auto-applies, Clear all in pills only removes pill-visible sub-filters, and the discard icon is now an Undo text button [(#10446)](https://github.com/prowler-cloud/prowler/pull/10446)
- Send to Jira modal now dynamically fetches and displays available issue types per project instead of hardcoding `"Task"`, fixing failures on non-English Jira instances [(#10534)](https://github.com/prowler-cloud/prowler/pull/10534)
- Exclude service filter from finding group resources endpoint to prevent empty results when a service filter is active [(#10652)](https://github.com/prowler-cloud/prowler/pull/10652)
---
+16 -1
View File
@@ -41,10 +41,25 @@ function splitCsvFilterValues(value: string | string[] | undefined): string[] {
return [];
}
/**
* Filters that belong to finding-groups but are NOT valid for the
* finding-group resources sub-endpoint. These must be stripped before
* calling the resources API to avoid empty results.
*/
const FINDING_GROUP_ONLY_FILTERS = ["filter[service__in]"] as const;
function normalizeFindingGroupResourceFilters(
filters: Record<string, string | string[] | undefined>,
): Record<string, string | string[] | undefined> {
const normalized = { ...filters };
const normalized = Object.fromEntries(
Object.entries(filters).filter(
([key]) =>
!FINDING_GROUP_ONLY_FILTERS.includes(
key as (typeof FINDING_GROUP_ONLY_FILTERS)[number],
),
),
);
const exactStatusFilter = normalized["filter[status]"];
if (exactStatusFilter !== undefined) {
@@ -270,7 +270,9 @@ export function FindingsGroupDrillDown({
colSpan={columns.length}
className="h-24 text-center"
>
No resources found.
{Object.keys(filters).length > 0
? "No resources found for the selected filters."
: "No resources found."}
</TableCell>
</TableRow>
) : null}
@@ -363,7 +363,9 @@ export function InlineResourceContainer({
colSpan={columns.length}
className="h-24 text-center"
>
No resources found.
{Object.keys(filters).length > 0
? "No resources found for the selected filters."
: "No resources found."}
</TableCell>
</TableRow>
)}