Build out admin Add Staff Announcement page #76

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

The /admin/staff-announcements/create page should become the staff workflow for publishing announcements to the admin dashboard. Staff need a validated form for creating internal announcements that are visible to the appropriate staff users, attributed to the author, and ordered consistently in the dashboard Announcements panel.

The current Laravel checkout has an admin Add Staff Announcement route, sidebar entry, and placeholder view. The admin dashboard currently renders a hard-coded announcements array from Admin\DashboardController, not a persistent announcement model/table. This issue tracks creating or confirming the canonical staff-announcements data model and replacing the placeholder with the creation workflow that feeds the dashboard.

Scope

  • Replace the current /admin/staff-announcements/create placeholder with a real staff announcement form.
  • Create or confirm a persistent staff-announcements model/table.
  • Capture title, body/content, publish status or visibility state, published date, and author/staff attribution.
  • Render persisted announcements in the admin dashboard Announcements panel.
  • Preserve or migrate existing hard-coded announcement content if it should remain visible.
  • Validate all submitted fields server-side.
  • Use existing admin form styling, submit-lock behavior, validation feedback, and success messages.
  • Restrict creation to appropriate staff/admin roles.
  • Log announcement creation in activity/audit logs where practical.

Acceptance Criteria

  • Authorized staff can visit /admin/staff-announcements/create and see a real form instead of the placeholder.
  • Users without the required staff role cannot access or submit the form.
  • The form requires a title and body/content.
  • The form supports the chosen publish/visibility state, such as draft or published, if that state is part of the model.
  • Submitting valid data creates a persistent staff announcement attributed to the current staff user.
  • Published staff announcements appear in the admin dashboard Announcements panel.
  • Draft/unpublished announcements, if supported, do not appear in the dashboard panel.
  • Announcements are ordered predictably, with newest or most recently published entries first.
  • Existing hard-coded announcements are either migrated, intentionally preserved as seed/default content, or intentionally removed with tests updated.
  • Validation errors return clear feedback without creating an announcement.
  • Successful creation redirects with success feedback and does not double-submit when submit-lock is active.
  • The page follows existing admin dashboard styling and supports light/dark mode.

Test Coverage Required

  • Feature test confirming authorized staff can render /admin/staff-announcements/create.
  • Authorization tests confirming insufficient-role users cannot access or submit announcements.
  • Feature test confirming a valid submission creates a persistent staff announcement.
  • Validation tests for missing title, missing body/content, invalid publish state, and length constraints.
  • Feature test confirming published announcements appear on the admin dashboard.
  • Feature test confirming draft/unpublished announcements stay hidden if drafts are supported.
  • Feature test confirming author attribution and published timestamp are stored.
  • View assertion confirming the placeholder text is replaced by the creation form and submit-lock behavior.
  • Activity/audit logging assertion for announcement creation where practical.
  • Regression test documenting what happens to the existing hard-coded dashboard announcements.
  • 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 Staff Announcement route exists
  • Admin sidebar links to Add Staff Announcement
  • Add Staff Announcement placeholder view exists
  • Admin dashboard has an Announcements panel
  • Current dashboard announcements are hard-coded in Admin\DashboardController
  • Create or confirm the canonical staff-announcements model/table
  • Define announcement fields and publish/visibility states
  • Replace the placeholder with a validated creation form
  • Persist author/staff attribution and published timestamp
  • Render persisted published announcements in the dashboard Announcements panel
  • Decide whether to migrate, seed, preserve, or remove hard-coded announcement content
  • Add success and validation feedback plus submit-lock protection
  • Add activity/audit logging for creation where practical
  • Add tests for access control, form rendering, validation, persistence, attribution, dashboard rendering, draft visibility, and hard-coded announcement regression
  • Confirm staff can publish an announcement and see it on the admin dashboard
The `/admin/staff-announcements/create` page should become the staff workflow for publishing announcements to the admin dashboard. Staff need a validated form for creating internal announcements that are visible to the appropriate staff users, attributed to the author, and ordered consistently in the dashboard Announcements panel. The current Laravel checkout has an admin Add Staff Announcement route, sidebar entry, and placeholder view. The admin dashboard currently renders a hard-coded announcements array from `Admin\DashboardController`, not a persistent announcement model/table. This issue tracks creating or confirming the canonical staff-announcements data model and replacing the placeholder with the creation workflow that feeds the dashboard. ## Scope - Replace the current `/admin/staff-announcements/create` placeholder with a real staff announcement form. - Create or confirm a persistent staff-announcements model/table. - Capture title, body/content, publish status or visibility state, published date, and author/staff attribution. - Render persisted announcements in the admin dashboard Announcements panel. - Preserve or migrate existing hard-coded announcement content if it should remain visible. - Validate all submitted fields server-side. - Use existing admin form styling, submit-lock behavior, validation feedback, and success messages. - Restrict creation to appropriate staff/admin roles. - Log announcement creation in activity/audit logs where practical. ## Acceptance Criteria - Authorized staff can visit `/admin/staff-announcements/create` and see a real form instead of the placeholder. - Users without the required staff role cannot access or submit the form. - The form requires a title and body/content. - The form supports the chosen publish/visibility state, such as draft or published, if that state is part of the model. - Submitting valid data creates a persistent staff announcement attributed to the current staff user. - Published staff announcements appear in the admin dashboard Announcements panel. - Draft/unpublished announcements, if supported, do not appear in the dashboard panel. - Announcements are ordered predictably, with newest or most recently published entries first. - Existing hard-coded announcements are either migrated, intentionally preserved as seed/default content, or intentionally removed with tests updated. - Validation errors return clear feedback without creating an announcement. - Successful creation redirects with success feedback and does not double-submit when submit-lock is active. - The page follows existing admin dashboard styling and supports light/dark mode. ## Test Coverage Required - Feature test confirming authorized staff can render `/admin/staff-announcements/create`. - Authorization tests confirming insufficient-role users cannot access or submit announcements. - Feature test confirming a valid submission creates a persistent staff announcement. - Validation tests for missing title, missing body/content, invalid publish state, and length constraints. - Feature test confirming published announcements appear on the admin dashboard. - Feature test confirming draft/unpublished announcements stay hidden if drafts are supported. - Feature test confirming author attribution and published timestamp are stored. - View assertion confirming the placeholder text is replaced by the creation form and submit-lock behavior. - Activity/audit logging assertion for announcement creation where practical. - Regression test documenting what happens to the existing hard-coded dashboard announcements. - 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 Staff Announcement route exists - [x] Admin sidebar links to Add Staff Announcement - [x] Add Staff Announcement placeholder view exists - [x] Admin dashboard has an Announcements panel - [x] Current dashboard announcements are hard-coded in `Admin\DashboardController` - [ ] Create or confirm the canonical staff-announcements model/table - [ ] Define announcement fields and publish/visibility states - [ ] Replace the placeholder with a validated creation form - [ ] Persist author/staff attribution and published timestamp - [ ] Render persisted published announcements in the dashboard Announcements panel - [ ] Decide whether to migrate, seed, preserve, or remove hard-coded announcement content - [ ] Add success and validation feedback plus submit-lock protection - [ ] Add activity/audit logging for creation where practical - [ ] Add tests for access control, form rendering, validation, persistence, attribution, dashboard rendering, draft visibility, and hard-coded announcement regression - [ ] Confirm staff can publish an announcement and see it on the admin dashboard
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#76
No description provided.