feat(admin): form approval workflow before publishing

Abierto
#1,975 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Tranquilo
Stack tecnológico
html

Línea de trabajo

Start by reviewing the existing merge, unmerge, and role-change audit conventions under /admin/users/*, then confirm the form builder integration from #1974 and its forms schema. Done means authors can submit drafts, authorized reviewers can approve or request changes with comments, transitions are audited, self-approval is blocked, and published edits require re-approval.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

Require an explicit admin approval step before a form built in the admin UI becomes available for public submission. Authors compose drafts, designated approvers review and publish (or send back with comments), and an audit trail captures every state transition.

Requirements

  • Form lifecycle states: `draft` → `in_review` → `published` (+ `changes_requested`, `archived`)
  • Submit-for-review action available to form authors
  • Approval queue view in the admin (`/forms/queue` or similar) listing forms awaiting review
  • Approve / request-changes actions, both gated by a new policy (e.g., `canApproveForms` — likely super_admin only)
  • Reviewers can leave a comment when requesting changes; comment surfaces to the author
  • Each state transition writes to `audit_log` with actor, before-state, after-state, and any comment
  • Author cannot approve their own form (self-promotion guard analogous to PATCH role)
  • Published forms cannot be edited in place — editing creates a new draft revision that must be re-approved

Context

Form misconfiguration (wrong required fields, leaky PII collection, broken submit URL) is a real failure mode once forms drive event registration and surveys. A required-approval gate gives the leadership team a check before anything lands on the public site.

This depends on #1974 (the form builder integration) being in place so there's something to approve in the first place.

Implementation Notes

  • The state machine can live on the `forms` table as a status enum + a small `form_reviews` table for the comment/transition history.
  • The audit_log entries pattern follows the existing merge / unmerge / role-change conventions on `/admin/users/*`.
  • Consider whether "approve" requires two approvers (review by one, publish by another) — probably overkill for v1; single approver per form.
  • Edit-after-publish creates a draft revision — model this as a new row pointing back to the published form via `parent_form_id`, or as a versioned `form_revisions` table; pick whichever fits the builder library's schema model best.
Lenguaje dominante
HTML
Estrellas
33
Forks
107
Merge medio
14 h 6 min
PR fusionados (30 d)
19

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de USRSE/usrse.github.io

Todos los issues de USRSE/usrse.github.io

Issues similares

Más issues de Security

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.