Repository navigation
feat(dashboard): create audit trail list view component - #911
Merged
Merged
Conversation
- Add AuditTrailList: read-only card list of immutable blockchain events
for a delivery showing event type, timestamp, actor, transaction,
ledger and metadata
- Order events newest first with a toggle to oldest first
- Add copy-to-clipboard for event IDs with copied feedback
- Add per-card loading skeletons, an empty state with retry, an error
state with retry, and a no-delivery prompt
- Make cards keyboard navigable with Tab, Arrow Up/Down, Home and End
- Add useAuditTrail hook and auditTrailService for
GET /api/audit/delivery/{id}/events
- Add service, hook and component unit tests
|
@AdaBliss Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #796
Summary
Adds
AuditTrailList, a read-only list view of the immutable blockchain events for a delivery. Each event is a card with its type, timestamp, actor and metadata, shown newest first. It follows the Component -> Hook -> Service pattern.Changes
components/dashboard/AuditTrailList.tsx(new)<time>timestamp, the actor (display name, shortened address with the full address on hover, and role), transaction hash, ledger sequence and a metadata key/value grid.aria-live.hooks/useAuditTrail.ts(new): a TanStack Query hook. It provides sorted events (invalid timestamps sort last), the sort order state,retry, andcopyEventIdwith an auto-resettingcopiedEventId.services/auditTrailService.ts(new):getDeliveryEvents(deliveryId)callsGET /api/audit/delivery/{deliveryId}/eventsand throws on failure so the hook can track error state.types/auditTrail.ts(new): event and actor types.components/dashboard/index.ts: exportsAuditTrailList.The existing
AuditTimelineandauditServiceare unchanged.Tests
services/__tests__/auditTrailService.test.ts: endpoint, id encoding, error messages.hooks/__tests__/useAuditTrail.test.tsx: newest-first default, sort toggle, no fetch without a delivery, error and retry, clipboard copy, copied reset, clipboard failure, sort stability.components/dashboard/__tests__/AuditTrailList.test.tsx: the real hook runs and only the service is mocked. Covers:Fixtures live under
hooks/__tests__/fixtures. The component, hook and service contain no inline mock data.Checks
pnpm type-checkcurrently fails onmainbecause of parse errors inapp/page.tsxandcomponents/escrow/__tests__/CheckoutFlow.keyboard.test.tsx, which this PR does not touch.pnpm test: this PR adds no new failing suites. The suites that fail onmainare unchanged.Screenshots
Unit test run output is included above.