a2n-seattle / a2n-seattle/rms-app
Display Cognito name attribute for Borrower/Owner (fall back to email)
- Ngôn ngữ chính
- TypeScript
- Star
- 1
- Fork
- 1
- Merge trung bình
- 27 phút
- Pull request đã merge (30 ngày)
- 4
Mô tả
# Why?
**As a** user viewing items, reservations, or history
**I want** to see people's actual names instead of raw email addresses
**So that** the UI is more readable and matches how the org actually refers to people.
# What?
Everywhere the frontend currently renders a `borrower`/`owner` (or similar user-identifying) field as a raw email string — item detail pages, dashboard tabs (Currently Borrowed/Owned/Scheduled/History), resources table, reservation lists — resolve it to that person's Cognito `name` attribute instead, falling back to the raw email if:
- No Cognito user exists for that email, or
- The user's Cognito profile has no `name` attribute set.
Likely needs a small backend or BFF-layer helper (e.g. a batched Cognito `AdminGetUser`/`ListUsers` lookup, cached per-request or short-TTL to avoid a lookup per row) rather than doing this per-component on the frontend, since `web/` doesn't have direct Cognito admin access today. Consider whether this belongs as a new small API (e.g. `ResolveUserNames`) that batches a list of emails into a list of display names, called once per page render rather than N times.
# Testing
Unit test for the resolution helper (found → name, not found → falls back to email, profile exists but no name attribute → falls back to email). Jest/RTL test confirming the table/detail components render the resolved name.
# Additional context
Cognito admin lookups need appropriate IAM permissions from whichever Lambda performs them — confirm the relevant function's execution role allows `cognito-idp:AdminGetUser` or `cognito-idp:ListUsers` as part of implementation.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.