Update UI Components to Use Next.js API Responses for Real Data
Description:
Modify the UI components in the Compliance Dashboard to fetch and display real compliance check and vulnerability report data from the Next.js API endpoints.
Tasks:
-
Update Compliance Dashboard UI
- Modify components to fetch data from
/api/compliance-scans. - Display compliance check results in tables and charts.
- Implement loading and error states.
- Modify components to fetch data from
-
Update Vulnerability Reports UI
- Modify components to fetch data from
/api/policy-scans. - Display vulnerability details including severity, namespace, and affected policies.
- Implement sorting, filtering, and pagination.
- Modify components to fetch data from
-
Refactor API Calls
- Use React hooks (
useEffect,useState) orreact-queryfor efficient data fetching. - Optimize API request handling to reduce unnecessary re-fetching.
- Use React hooks (
-
Testing & Validation
- Write unit tests for API data fetching logic.
- Perform integration tests to ensure UI updates correctly with real data.
Acceptance Criteria:
- Compliance Dashboard and Vulnerability Reports UI display real data from Next.js API.
- API responses are correctly handled with error and loading states.
- UI components include sorting, filtering, and pagination where applicable.
- Tests validate API integration and UI updates.
Edited by Manuel Ucles