mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-09 21:14:22 +00:00
fix(ui): exclude service filter from finding group resources endpoint (#10652)
This commit is contained in:
@@ -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)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user