feat(admin): surface member address fields on detail page

未关闭
#1,973 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
typescript
领域
full-stack

调研方向

Start with MemberDetailPage.tsx, packages/api/src/routes/admin/users/byId.ts, and packages/api/src/db/schema/users.ts:103-117; compare the country picker with apps/web/src/hooks/useVocab.ts and the countries endpoint in packages/api/src/routes/vocab.ts. Done means the Identity tab edits and previews all requested address fields, supports re-geocoding, and the admin GET/PATCH responses handle them without changing soft-delete or restore controls.

由索引模型根据 Issue 内容生成。

描述

Summary

The admin member detail page's Identity tab does not currently expose city, region, countryId, publicLocation, showOnMap, or the geocoded latitude/longitude. Staff editing a member can't fix a typo'd city or toggle map visibility without going to the public dossier.

Requirements

  • MemberDetailPage.tsx Identity tab gains an Address section with editable fields:
    • City (text)
    • Region / state (text)
    • Country (vocab picker reusing the existing countries vocab endpoint)
    • Public location string (free-form override shown on the public dossier byline)
    • showOnMap toggle
  • Read-only preview of the geocoded result ("Pin: 42.36°N, 71.06°W") with a "Re-geocode now" button that bypasses the normal change-detection trigger
  • PATCH /admin/users/:id body schema extended (packages/api/src/routes/admin/users/byId.ts) to accept city, region, countryId, publicLocation, showOnMap
  • GET /admin/users/:id response includes the existing address fields and geocoded_at so the UI can render the timestamp
  • Soft-delete / restore controls left untouched

Context

profiles has city, region, countryId, publicLocation, latitude, longitude, showOnMap already (packages/api/src/db/schema/users.ts:103-117). The admin PATCH route just doesn't accept them yet; the detail page just doesn't display them yet.

Depends on #1972 for the geocoded-value population and geocoded_at column.

Implementation Notes

Country picker: the vocab endpoint at packages/api/src/routes/vocab.ts already exposes countries; the web account page uses the same dataset for its country picker (see apps/web/src/hooks/useVocab.ts). Reuse it to avoid a parallel vocab fetch.

showOnMap defaults to false per the schema — admins flipping it on is an explicit consent decision and should be paired with a small note like "Surfaces this member on the public community map at /map."

主要语言
HTML
星标
33
派生
107
平均合并
14 小时 6 分钟
30 天内合并 PR
19

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

USRSE/usrse.github.io 的其他 Issue

查看 USRSE/usrse.github.io 的全部 Issue

相似的 Issue

更多 Web Dev Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。