feat(admin): build attach-to-entity picker UI on FormDetailPage

Open
#2,016 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
typescript
Domain
frontend

Research direction

Start in apps/admin/src/pages/forms/FormDetailPage.tsx, specifically the Identity tab, and review the new apps/admin/src/hooks/useArtifactPicker.ts helper. Trace the /admin/events, /admin/announcements, and /admin/groups endpoints, then implement selection and PATCH /admin/forms/:id with both entity fields. Done means admins can attach an entity, the database pairing constraint is respected, and group-scoped forms warn for non-group entities.

Written by the indexing model from the issue text.

Description

Summary

FormDetailPage currently displays the attached entity (event/announcement/group) and offers a Detach action, but there's no UI to attach a form to an entity if it's currently unattached. v1 ships with admins setting entityType/entityId via the API.

Requirements

  • Build a typeahead/picker that lets admin browse events, announcements, or groups and select one to attach
  • On selection, PATCH /admin/forms/:id with { entityType, entityId }
  • Respect the DB CHECK constraint (both fields must end up set or both null)
  • Validation: if form's scope is group, surface a warning when attaching to a non-group entity

Context

Plan 4 noted this as deferred. Now that forms ship, the API path works but admins need the UI to use it.

Files

  • apps/admin/src/pages/forms/FormDetailPage.tsx (Identity tab)
  • New helper: apps/admin/src/hooks/useArtifactPicker.ts (consumes /admin/events, /admin/announcements, /admin/groups for typeahead)
Dominant language
HTML
Stars
33
Forks
104
Avg merge
12h 3m
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from USRSE/usrse.github.io

All issues in USRSE/usrse.github.io

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.