fix: advocate dropdown on client list shows claims dept only

This commit is contained in:
lorentz 2026-04-08 10:05:10 +00:00
parent d45daacf28
commit 851487a8dd
3 changed files with 1560 additions and 5 deletions

View file

@ -13,7 +13,18 @@
"Bash(git push:*)",
"Bash(curl -s -X POST https://login.microsoftonline.com/480673c9-b57f-4366-b0ea-e317cbc6c160/oauth2/v2.0/token -H 'Content-Type: application/x-www-form-urlencoded' -d 'client_id=f6c778cf-c850-47d0-85e7-aff1d1c3288b&client_secret=0Wi8Q~6hvmszI1W4WeK3iI~NeSixFggyhcC_Qavk&scope=https://graph.microsoft.com/.default&grant_type=client_credentials')",
"Bash(python3 -c \"import sys,json; d=json.load\\(sys.stdin\\); print\\(d.get\\('id',''\\), d.get\\('name',''\\), d.get\\('error',''\\)\\)\")",
"Bash(python3 -c \"import sys,json; d=json.load\\(sys.stdin\\); print\\(json.dumps\\(d, indent=2\\)\\)\")"
"Bash(python3 -c \"import sys,json; d=json.load\\(sys.stdin\\); print\\(json.dumps\\(d, indent=2\\)\\)\")",
"Bash(psql:*)",
"Bash(npx prisma:*)",
"Bash(node -e ':*)",
"Bash(node:*)",
"Bash(grep -E \"^buffer$|^bl$|^readable\")",
"Bash(ls /opt/projects/OnDeck/ondeck/.env*)",
"Bash(python3 -c \"import sys,json; d=json.load\\(sys.stdin\\); deps={**d.get\\('dependencies',{}\\), **d.get\\('devDependencies',{}\\)}; [print\\(k,v\\) for k,v in deps.items\\(\\) if any\\(x in k.lower\\(\\) for x in ['xlsx','excel','sheet','xml','zip']\\)]\")",
"Bash(python3 -c \"import sys,json; d=json.load\\(sys.stdin\\); deps={**d.get\\('dependencies',{}\\), **d.get\\('devDependencies',{}\\)}; [print\\(k\\) for k in sorted\\(deps.keys\\(\\)\\)]\")",
"Bash(npx tsx:*)",
"Bash(tee /tmp/shape-import-console.txt)",
"Bash(python3:*)"
]
}
}

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,7 @@ interface SimpleUser {
id: string
displayName: string | null
email: string
department?: string | null
}
interface ClientWithRelations extends Client {
@ -82,7 +83,7 @@ export function ClientList({ initialClients = [], designations = [] }: ClientLis
}
useEffect(() => {
fetch('/api/users?isActive=true&limit=200')
fetch('/api/users?isActive=true&limit=200&fields=department')
.then((r) => r.json())
.then((d) => setUsers(d.users || []))
.catch(() => {})
@ -142,9 +143,11 @@ export function ClientList({ initialClients = [], designations = [] }: ClientLis
</SelectTrigger>
<SelectContent>
<SelectItem value="_all">All Advocates</SelectItem>
{users.map((u) => (
<SelectItem key={u.id} value={u.id}>{u.displayName || u.email}</SelectItem>
))}
{users
.filter((u) => u.department?.toLowerCase().includes('claims'))
.map((u) => (
<SelectItem key={u.id} value={u.id}>{u.displayName || u.email}</SelectItem>
))}
</SelectContent>
</Select>
<Select value={teamMemberFilter || '_all'} onValueChange={handleFilterChange(setTeamMemberFilter)}>