feat(ui): add ConfigHistory page to display audit logs - #374
Conversation
|
@VivekTekwani021 is attempting to deploy a commit to the Yash Pouranik's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds a protected project audit log route and sidebar link. The new ChangesConfiguration audit log
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant Sidebar
participant MainLayout
participant ConfigHistory
participant ProjectScopedAPI
User->>Sidebar: Select Audit Log
Sidebar->>MainLayout: Navigate to project audit-log route
MainLayout->>ConfigHistory: Render protected page
ConfigHistory->>ProjectScopedAPI: Request project-scoped audit logs
ProjectScopedAPI-->>ConfigHistory: Return logs and pagination data
ConfigHistory-->>User: Display filtered audit log entries
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
review? |
|
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web-dashboard/src/pages/ConfigHistory.jsx`:
- Around line 217-259: Update the useEffect that currently defines
loadInitialData to call the existing fetchLogs(1, category) directly, removing
the duplicated request, mounted flag, and separate error handling. Ensure
fetchLogs remains responsible for loading state, error state, and toast
notifications for initial loads and category changes, and update its
dependencies as needed for the effect to use it safely.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a7e962ff-3bd8-476b-b462-6a3096966108
📒 Files selected for processing (3)
apps/web-dashboard/src/App.jsxapps/web-dashboard/src/components/Layout/Sidebar.jsxapps/web-dashboard/src/pages/ConfigHistory.jsx
|
I think this is not important as of now |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="geturbackend/urBackend"
pr_number="374"
gh api "repos/$repo/pulls/$pr_number/comments?per_page=100" \
--paginate \
--jq '.[] | select(.user.login == "coderabbitai[bot]" or .user.login == "coderabbitai") | {id, html_url, path, line, body}'Length of output: 3830 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="geturbackend/urBackend"
requester="yash-pouranik"
issue_body=$(cat <<'EOF'
## Summary
Consolidate the duplicated configuration audit-log request logic in `apps/web-dashboard/src/pages/ConfigHistory.jsx`.
## Rationale
`fetchLogs` displays an error toast when a request fails. The separate initial-load and category-change logic only sets the page error state. This produces different failure behavior for equivalent audit-log requests.
## Required changes
- Remove the duplicated request implementation in the `useEffect` initial-load/category-change path.
- Use the shared `fetchLogs(1, category)` path for initial load and category changes.
- Keep loading state, error state, and error toast behavior consistent for initial load, category changes, refresh, retry, and pagination.
- Update React hook dependencies as needed.
## Affected area
- `apps/web-dashboard/src/pages/ConfigHistory.jsx`
## Acceptance criteria
- The page has one implementation for fetching configuration audit logs.
- A failed initial load displays the same error toast behavior as refresh, retry, and pagination failures.
- A failed category change displays the same error toast behavior as refresh, retry, and pagination failures.
- Existing loading, empty, retry, and pagination behavior remains intact.
## References
- Deferred from PR `#374`: https://github.com/geturbackend/urBackend/pull/374
- Code review comment: https://github.com/geturbackend/urBackend/pull/374#discussion_r3690248783
- Requested by: `@yash-pouranik`
EOF
)
gh issue create \
--repo "$repo" \
--title "Refactor ConfigHistory audit-log loading to use shared fetch logic" \
--body "$issue_body" \
--assignee "$requester"Length of output: 1914
It is assigned to you and links to PR You are interacting with an AI system. |
project change log UI
Summary by CodeRabbit