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

Offen
#2,016 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
68/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Ruhig
Tech-Stack
typescript
Bereich
frontend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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)
Vorherrschende Sprache
HTML
Sterne
33
Forks
107
Ø Merge
14 Std. 6 Min.
Gemergte PRs (30 T.)
19

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus USRSE/usrse.github.io

Alle Issues in USRSE/usrse.github.io

Ähnliche Issues

Weitere Issues zu Web Dev

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.