Replace Slot ID column in lessons list with the lesson's date/time #48

Merged
thatguygriff merged 1 commits from feature/lessons-datetime-column into main 2026-07-05 18:57:16 +00:00
Owner

Closes #47

Summary

The Scheduler admin dashboard and instructor "My Lessons" pages showed a raw Slot ID column — the internal availability-slot database ID, which is meaningless to admins and instructors. This replaces it with the lesson's date/time window.

Changes

  • Booking\LessonController now takes Availability\AvailabilityRepository as a third constructor dependency (wired in AdminMenu; Plugin already passes the repository through).
  • row() looks up the lesson's slot by slot_id and formats its window via mysql2date('M j, Y g:i A', ...) as e.g. Jul 6, 2026 9:00 AM–10:00 AM. The date is repeated on the end time only when the slot crosses midnight. A lesson whose slot row no longer exists renders an em dash instead of failing.
  • templates/admin/lessons.php: "Slot ID" column header becomes "Date/Time"; row-shape docblock updated.

Tests

New tests/Unit/Booking/LessonControllerTest.php renders both the admin dashboard and instructor pages through the real template, asserting the formatted range appears (and "Slot ID" doesn't), plus midnight-crossing and missing-slot cases.

  • composer test — 225 tests, 695 assertions, all passing
  • composer lint — PHPStan level 10 clean
  • composer cs — PHPCS clean

🤖 Generated with Claude Code

Closes #47 ## Summary The Scheduler admin dashboard and instructor "My Lessons" pages showed a raw **Slot ID** column — the internal availability-slot database ID, which is meaningless to admins and instructors. This replaces it with the lesson's date/time window. ## Changes - `Booking\LessonController` now takes `Availability\AvailabilityRepository` as a third constructor dependency (wired in `AdminMenu`; `Plugin` already passes the repository through). - `row()` looks up the lesson's slot by `slot_id` and formats its window via `mysql2date('M j, Y g:i A', ...)` as e.g. **Jul 6, 2026 9:00 AM–10:00 AM**. The date is repeated on the end time only when the slot crosses midnight. A lesson whose slot row no longer exists renders an em dash instead of failing. - `templates/admin/lessons.php`: "Slot ID" column header becomes "Date/Time"; row-shape docblock updated. ## Tests New `tests/Unit/Booking/LessonControllerTest.php` renders both the admin dashboard and instructor pages through the real template, asserting the formatted range appears (and "Slot ID" doesn't), plus midnight-crossing and missing-slot cases. - `composer test` — 225 tests, 695 assertions, all passing - `composer lint` — PHPStan level 10 clean - `composer cs` — PHPCS clean 🤖 Generated with [Claude Code](https://claude.com/claude-code)
thatguygriff added 1 commit 2026-07-05 18:52:36 +00:00
Replace Slot ID column in lessons list with the lesson's date/time
CI / Tests (PHP 8.2) (pull_request) Successful in 1m20s
CI / Tests (PHP 8.1) (pull_request) Successful in 1m21s
CI / Coding Standards (pull_request) Successful in 1m45s
CI / PHPStan (pull_request) Successful in 3m22s
CI / No Debug Code (pull_request) Successful in 3s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m36s
CI / Build Plugin Zip (pull_request) Has been skipped
6ff733a71f
The admin dashboard and instructor My Lessons pages showed the raw
availability-slot database ID, which is meaningless to admins and
instructors. LessonController now takes AvailabilityRepository, looks up
each lesson's slot, and renders its window as e.g.
"Jul 6, 2026 9:00 AM-10:00 AM" via mysql2date. The date is repeated on
the end time only when a slot crosses midnight, and lessons whose slot
row no longer exists show an em dash.

Closes #47

Co-Authored-By: Claude Fable 5 <[email protected]>
thatguygriff merged commit 66f308e1da into main 2026-07-05 18:57:16 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#48