Policies admin: view a version's content, and edit it into a new draft #126

Closed
opened 2026-07-28 20:03:26 +00:00 by thatguygriff · 0 comments
Owner

Problem

The Policies admin page lists a policy's versions (number, status, published date) but gives no way to read what any of them actually says. A studio admin cannot check the wording of the currently published policy, look back at what an archived version said, or review a draft before publishing it — the only way to see the text is to query the database.

Editing is equally blind: the page offers a single empty "Add Draft Version" textarea, so revising an existing policy means retyping it from scratch.

Wanted

  • A View action on each version row that shows that version's content on the page, whatever its status (published, archived, or draft).
  • The content rendered the way students see it at booking and signup, so the viewer doubles as a preview.
  • The text editable from the viewer, with versioning that protects the audit trail:
    • editing a published or archived version saves the text as a new draft version and leaves the original untouched — acceptances are recorded against policy_version_id, so text a student has agreed to must never be rewritten;
    • editing a draft updates it in place, since nobody has accepted it and a new version number would be noise.
  • A version id that does not belong to the selected policy must not be viewable or editable through this page.

Notes

Admin page only. PATCH /policies/{id}/versions/{vid} already restricts in-place edits to drafts and needs no change.

## Problem The **Policies** admin page lists a policy's versions (number, status, published date) but gives no way to read what any of them actually says. A studio admin cannot check the wording of the currently published policy, look back at what an archived version said, or review a draft before publishing it — the only way to see the text is to query the database. Editing is equally blind: the page offers a single empty "Add Draft Version" textarea, so revising an existing policy means retyping it from scratch. ## Wanted - A **View** action on each version row that shows that version's content on the page, whatever its status (published, archived, or draft). - The content rendered the way students see it at booking and signup, so the viewer doubles as a preview. - The text editable from the viewer, with versioning that protects the audit trail: - editing a **published or archived** version saves the text as a **new draft version** and leaves the original untouched — acceptances are recorded against `policy_version_id`, so text a student has agreed to must never be rewritten; - editing a **draft** updates it in place, since nobody has accepted it and a new version number would be noise. - A version id that does not belong to the selected policy must not be viewable or editable through this page. ## Notes Admin page only. `PATCH /policies/{id}/versions/{vid}` already restricts in-place edits to drafts and needs no change.
thatguygriff added the enhancement label 2026-07-28 20:03:26 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#126