-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(ui): add Resources Inventory feature #9492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui): add Resources Inventory feature #9492
Conversation
|
✅ All necessary |
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
🔒 Container Security ScanImage: ✅ No Vulnerabilities DetectedThe container image passed all security checks. No known CVEs were found.📋 Resources:
|
- Update types to match API response (resource-group-overview) - Change endpoint from /overviews/resources-types to /overviews/resource_groups - Update resource group IDs to match API values (compute, IAM, security, etc.) - Add new fields: total_findings, severity breakdown - Remove deprecated fields: misconfigurations - Update card component to use resource_group filter - Move resources-inventory from _new-overview to _overview
🔒 Container Security ScanImage: 📊 Vulnerability Summary
10 package(s) affected
|
…ntory links - Add resource_group filter to resources page DataTableFilterCustom - Change resource inventory card links to navigate to /resources instead of /findings - Filter by resource_group when clicking on resource inventory cards
- Resources page: add Provider filter, use __in format for multi-select filters - Resources page: rename resource_group to group, remove type filter - Overview card: use filter[group__in] instead of filter[resource_group] - Overview card: transform provider_id__in to provider__in for resources endpoint
4baa5cd to
6e10501
Compare
6e10501 to
5f9cecb
Compare
- Update endpoint from /overviews/groups to /overviews/resource-groups - Fix filter key from group__in to groups__in for /resources endpoint - Add spacing between filter rows in resources page
alejandrobailo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review Comments
1. Hardcoded Row Limit
File: ui/app/(prowler)/_overview/resources-inventory/_components/resources-inventory.tsx:19-20
const firstRow = items.slice(0, 4);
const secondRow = items.slice(4, 8);This silently drops items beyond index 8 (there are 16 resource groups defined). Consider either:
- Making row count configurable
- Adding "Show More" functionality
- Sorting by importance/findings count
2. Type Assertion in Resources Page
File: ui/app/(prowler)/resources/page.tsx:53-55
const providerDetails = providersData
? (createProviderDetailsMappingById(providerIds, providersData) as {
[id: string]: FilterEntity;
}[])
: [];The type assertion suggests a potential type mismatch. Consider fixing the return type of createProviderDetailsMappingById instead.
3. Error Handling Inconsistency
File: ui/actions/overview/resources-inventory/resources-inventory.ts:29-32
} catch (error) {
console.error("Error fetching resource group overview:", error);
return undefined;
}Silent failure with console.error may hide issues in production. Consider:
- Using a centralized error handler
- Adding error boundaries at the component level
- Logging to a proper monitoring service
4. Unused Function Export
File: ui/actions/overview/resources-inventory/index.ts:5
export { getEmptyResourceInventoryItems } from "./resources-inventory.adapter";getEmptyResourceInventoryItems is exported but not used anywhere in the codebase. Remove if not needed.
5. Minor: Hardcoded Hover Color
File: ui/app/(prowler)/_overview/resources-inventory/_components/resources-inventory-card-item.tsx:86
className="flex-1 cursor-pointer transition-all hover:border-rose-500/60"Uses hardcoded rose-500 instead of a semantic color variable. Consider using a design token.
- Sort resource groups by failedFindings (desc) to prioritize groups with issues - Remove type assertion in createProviderDetailsMappingById usage - Remove unused getEmptyResourceInventoryItems export from public API - Replace hardcoded rose-500 with semantic bg-fail token
Context
Screen.Recording.2026-01-15.at.14.32.55.mov
This PR implements the Resources Inventory feature for the Overview page, providing a visual breakdown of cloud resources organized by resource groups (Compute, Storage, IAM, Network, etc.) with their associated security findings.
Description
New Features
Resources Inventory Component:
API Integration:
/api/v1/overviews/resource-groupsendpointResources Page Updates:
group__intogroups__into match API specTechnical Changes
ui/actions/overview/resources-inventory/- Server actions and types for resource group overview APIui/app/(prowler)/_overview/resources-inventory/- SSR component, skeleton, and card componentsui/components/shadcn/card/resource-stats-card.tsx- Reusable card component for resource statisticsui/app/(prowler)/resources/page.tsxwith group filter supportImportant Notes
Checklist
UI
API
Dependencies
This PR depends on the API changes in PR #9694 which adds:
/api/v1/overviews/resource-groupsendpointresource_groupsfield to findingsgroupsfield to resourcesfilter[groups__in]for resources endpointfilter[resource_groups__in]for findings endpointLicense
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.