Open
Conversation
added 5 commits
March 29, 2026 19:49
…-party approval UI - Create PendingApprovalBadge component showing pending approval count - Integrate badge into Navbar on Approvals nav link - Add approvalService with GET /shelter/approvals endpoint - Implement usePendingApprovals hook with 5-minute polling - Create ApprovalsPage for managing pending approvals - Add comprehensive unit tests (32 total): * PendingApprovalBadge component tests (9) * usePendingApprovals hook tests (8) * approvalService tests (6) * Navbar integration tests (9) * ApprovalsPage tests (10) Features: - Red badge displaying pending approval count - '9+' display cap for counts above 9 - Role-based visibility (SHELTER & ADMIN only) - Badge auto-hides when count reaches 0 - Real-time polling every 5 minutes - Loading, error, and forbidden states - Type-safe API responses - Full error handling
- Added AdoptionApprovalsState and ApprovalParty types to adoption.ts
- Created adoptionApprovalsService with getAdoptionApprovals method
- Implemented useAdoptionApprovals hook with:
* Fetches from GET /adoption/:id/approvals endpoint
* Returns {required, given, pending, quorumMet, escrowAccountId, isLoading, isError}
* Polls every 30s while quorumMet is false
* Stops polling once quorum is reached
* Stale time set to 30 seconds
- Added MSW handlers with pre-quorum and post-quorum mock shapes:
* adoption-pending: shows 3 required, 1 given, 2 pending, quorumMet: false
* adoption-approved: shows 3 required, 3 given, 0 pending, quorumMet: true
- Added comprehensive unit tests (18 total):
* useAdoptionApprovals hook tests (12 tests)
* adoptionApprovalsService tests (6 tests)
* Covers polling behavior, quorum state transitions, error handling
* Tests verify polling stops when quorumMet becomes true
|
@Mitch5000 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.
Implement ApprovalDecisionButtons Component
Summary
Approve/reject buttons for adoption approvals with rejection reason modal.
Changes
Tests
All passing - covers visibility, mutations, modals, and accessibility
Closes #178