Build out admin Add Site News page #73

Open
opened 2026-05-07 20:45:09 -05:00 by jimmyb · 0 comments
Owner

The /admin/site-news/create page should become the staff workflow for publishing site news updates. Staff need a form that can create a news post with validated title/body/status metadata, attribute the post to the author, and fit into the existing admin dashboard UI.

The current Laravel checkout has an admin Add Site News route, sidebar entry, and placeholder view, but there is no obvious current site_news model/table in the migrations. Blog entries exist separately and should not be treated as site news unless the implementation intentionally decides to reuse that model. This issue tracks confirming or creating the canonical site news data model and replacing the placeholder with the creation form. The companion management/listing workflow is tracked by #74.

Scope

  • Replace the current /admin/site-news/create placeholder with a real site news creation form.
  • Confirm or create the canonical data model/table for site news posts.
  • Capture core fields such as title, body/content, publish status, published date, and author/staff attribution.
  • Support draft vs published behavior if that is part of the chosen site news model.
  • Validate all submitted fields server-side.
  • Use existing admin form styling, submit-lock behavior, validation feedback, and success messages.
  • Record creation in activity/audit logs.
  • Keep the site news creation workflow separate from personal blog entries unless reuse is explicitly chosen and documented.

Acceptance Criteria

  • Authorized site-content staff can visit /admin/site-news/create and see a real form instead of the placeholder.
  • Users without the required content-management role cannot access or submit the form.
  • The form includes required fields for title and body/content.
  • The form supports the chosen publish state workflow, such as draft/published.
  • Server-side validation rejects missing or invalid required fields with clear feedback.
  • Successful submission creates a site news record with the current staff user as author/creator.
  • Published posts store an appropriate published timestamp.
  • Draft posts, if supported, do not appear as published public content.
  • The form uses existing admin card/form/button styling and x-admin.submit-lock or equivalent submit protection.
  • Successful creation redirects to an appropriate edit/detail/list page with success feedback.
  • Creation is logged with actor, site news ID, title, and publish state.

Test Coverage Required

  • Feature test confirming authorized content staff can render /admin/site-news/create.
  • Authorization tests confirming insufficient-role users cannot access or submit site news creation.
  • Feature test confirming valid submissions create a site news record.
  • Validation tests for missing title, missing body/content, invalid publish state, and any length constraints.
  • Feature tests confirming draft vs published behavior if both states are supported.
  • Feature test confirming author/creator attribution is stored.
  • Feature test confirming successful creation redirects with success feedback.
  • Activity/audit logging assertion for site news creation where practical.
  • View assertion confirming the placeholder text is replaced by the creation form and submit-lock behavior.
  • Tests should use Pest and focused feature coverage.
  • Run the focused affected tests, then run vendor/bin/pint --dirty --format agent before closing the issue.

Progress Checklist

  • Admin Add Site News route exists
  • Admin sidebar links to Add Site News
  • Add Site News placeholder view exists
  • Admin card, form, button, and submit-lock patterns exist elsewhere
  • Confirm or create the canonical site news model/table
  • Define site news fields and publish states
  • Replace the placeholder with a validated creation form
  • Persist author/creator attribution
  • Add success and validation feedback
  • Add activity/audit logging for creation
  • Redirect to the appropriate site news edit/list page after creation
  • Add tests for access control, form rendering, validation, persistence, attribution, publish states, redirect feedback, and logging
  • Confirm #73 creation behavior connects cleanly to #74 site news management
The `/admin/site-news/create` page should become the staff workflow for publishing site news updates. Staff need a form that can create a news post with validated title/body/status metadata, attribute the post to the author, and fit into the existing admin dashboard UI. The current Laravel checkout has an admin Add Site News route, sidebar entry, and placeholder view, but there is no obvious current `site_news` model/table in the migrations. Blog entries exist separately and should not be treated as site news unless the implementation intentionally decides to reuse that model. This issue tracks confirming or creating the canonical site news data model and replacing the placeholder with the creation form. The companion management/listing workflow is tracked by #74. ## Scope - Replace the current `/admin/site-news/create` placeholder with a real site news creation form. - Confirm or create the canonical data model/table for site news posts. - Capture core fields such as title, body/content, publish status, published date, and author/staff attribution. - Support draft vs published behavior if that is part of the chosen site news model. - Validate all submitted fields server-side. - Use existing admin form styling, submit-lock behavior, validation feedback, and success messages. - Record creation in activity/audit logs. - Keep the site news creation workflow separate from personal blog entries unless reuse is explicitly chosen and documented. ## Acceptance Criteria - Authorized site-content staff can visit `/admin/site-news/create` and see a real form instead of the placeholder. - Users without the required content-management role cannot access or submit the form. - The form includes required fields for title and body/content. - The form supports the chosen publish state workflow, such as draft/published. - Server-side validation rejects missing or invalid required fields with clear feedback. - Successful submission creates a site news record with the current staff user as author/creator. - Published posts store an appropriate published timestamp. - Draft posts, if supported, do not appear as published public content. - The form uses existing admin card/form/button styling and `x-admin.submit-lock` or equivalent submit protection. - Successful creation redirects to an appropriate edit/detail/list page with success feedback. - Creation is logged with actor, site news ID, title, and publish state. ## Test Coverage Required - Feature test confirming authorized content staff can render `/admin/site-news/create`. - Authorization tests confirming insufficient-role users cannot access or submit site news creation. - Feature test confirming valid submissions create a site news record. - Validation tests for missing title, missing body/content, invalid publish state, and any length constraints. - Feature tests confirming draft vs published behavior if both states are supported. - Feature test confirming author/creator attribution is stored. - Feature test confirming successful creation redirects with success feedback. - Activity/audit logging assertion for site news creation where practical. - View assertion confirming the placeholder text is replaced by the creation form and submit-lock behavior. - Tests should use Pest and focused feature coverage. - Run the focused affected tests, then run `vendor/bin/pint --dirty --format agent` before closing the issue. ## Progress Checklist - [x] Admin Add Site News route exists - [x] Admin sidebar links to Add Site News - [x] Add Site News placeholder view exists - [x] Admin card, form, button, and submit-lock patterns exist elsewhere - [ ] Confirm or create the canonical site news model/table - [ ] Define site news fields and publish states - [ ] Replace the placeholder with a validated creation form - [ ] Persist author/creator attribution - [ ] Add success and validation feedback - [ ] Add activity/audit logging for creation - [ ] Redirect to the appropriate site news edit/list page after creation - [ ] Add tests for access control, form rendering, validation, persistence, attribution, publish states, redirect feedback, and logging - [ ] Confirm #73 creation behavior connects cleanly to #74 site news management
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MyVideoGameList/myvideogamelist.com#73
No description provided.