feat(ui): DisputeNavBadge component with role-based polling — closes #201#254
Open
spiffamani wants to merge 1 commit intoamina69:mainfrom
Open
feat(ui): DisputeNavBadge component with role-based polling — closes #201#254spiffamani wants to merge 1 commit intoamina69:mainfrom
spiffamani wants to merge 1 commit intoamina69:mainfrom
Conversation
…amina69#201) - Add useDisputeCount hook: polls GET /api/disputes every 5 min - ADMIN: counts all OPEN + UNDER_REVIEW disputes - USER/SHELTER: counts only disputes where raisedBy === currentUserId - Resets to 0 when user visits /disputes or /admin/disputes - Max display capped at 9+ - Add DisputeNavBadge component with aria-label for accessibility - Integrate DisputeNavBadge into Navbar Disputes link - Add 6 unit tests covering all acceptance criteria
|
Hey @spiffamani! 👋 It looks like this PR isn't linked to any issue. If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g.,
|
Owner
|
@spiffamani you have lint error |
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.

Summary
Implements
DisputeNavBadge— a count badge on the Disputes nav item,closing issue #201.
What's New
useDisputeCount.ts— PollsGET /api/disputesevery 5 minutesOPEN+UNDER_REVIEWdisputesraisedBy === currentUserId0when user visits/disputesor/admin/disputes9+DisputeNavBadge.tsx— Badge component witharia-labelfor accessibilityNavbar.tsx— Disputes nav link added withDisputeNavBadgeintegratedTasks Completed
usePolling/disputesor/admin/disputes9+Test Results
Checklist
npm test— 6/6 passingtsc --noEmit— 0 errorsusePollingpattern from existing hooksuseRoleGuardfor role detectionaria-labelwith count