kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Add attendance stub pages and initial route wiring

Open akolson opened this issue 9 months ago • 8 comments

Overview

Create stub AttendanceHistoryPage, AttendanceNewPage, and AttendanceEditPage components and wire them to their routes in attendanceRoutes.js. Also connects the "Mark attendance" and "View history" links in AttendanceBlock (#14235) to their respective routes. Stubs only need to render enough to confirm navigation works — full page implementations follow in subsequent issues.

Complexity: Low

Target branch: release-v0.19.x

Context

Before individual pages can be built and tested, the routing skeleton needs to exist. This issue establishes the navigation structure for the attendance feature — stub pages act as placeholders so routes are reachable from AttendanceBlock immediately, and each subsequent page issue can be verified end-to-end as it lands.

The Change

Stub components — minimal placeholder pages, each rendering only a page title:

  • AttendanceHistoryPage.vue (kolibri/plugins/coach/frontend/views/attendance/AttendanceHistoryPage.vue)
  • AttendanceNewPage.vue (kolibri/plugins/coach/frontend/views/attendance/AttendanceNewPage.vue)
  • AttendanceEditPage.vue (kolibri/plugins/coach/frontend/views/attendance/AttendanceEditPage.vue)

attendanceRoutes.js (kolibri/plugins/coach/frontend/routes/attendanceRoutes.js):

  • CLASS/attendance/new → AttendanceNewPage
  • CLASS/attendance/history → AttendanceHistoryPage
  • CLASS/attendance/:attendanceId → AttendanceEditPage
  • Each route dispatches initClassInfo on enter

Route integration (kolibri/plugins/coach/frontend/routes/index.js):

  • attendanceRoutes imported and spread into the main route array

app.js (kolibri/plugins/coach/frontend/app.js):

  • ATTENDANCE_NEW, ATTENDANCE_HISTORY, and ATTENDANCE_EDIT added to skipLoading so the loading spinner is not shown on navigation between attendance pages

AttendanceBlock link wiring — connects "Mark attendance" and "View history" to their respective routes now that they exist

Out of Scope

  • Full implementation of any attendance page (separate issues)

Acceptance Criteria

General

  • [ ] AttendanceHistoryPage, AttendanceNewPage, and AttendanceEditPage stub components exist under kolibri/plugins/coach/frontend/views/attendance/
  • [ ] attendanceRoutes.js registers all three routes with correct paths and initClassInfo handlers
  • [ ] ATTENDANCE_NEW, ATTENDANCE_HISTORY, and ATTENDANCE_EDIT page name constants are defined
  • [ ] attendanceRoutes is imported and spread into the main route array in routes/index.js
  • [ ] ATTENDANCE_NEW, ATTENDANCE_HISTORY, and ATTENDANCE_EDIT are added to the skipLoading array in app.js
  • [ ] "Mark attendance" and "View history" links in AttendanceBlock navigate to their respective routes

Testing

  • [ ] Navigating to each route renders the correct stub component

References

  • Issue #14235 — AttendanceBlock (links wired in this issue)
  • lessonsRoutes.js — example of existing coach route patterns

🤖 This issue was written with AI assistance, under supervision, review and final edits by [@akolson] 🤖

akolson avatar Feb 24 '26 17:02 akolson

Hi! 👋

Thanks so much for your interest! This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. If there are no unassigned 'help wanted' issues available, please wait until new ones are added.

We really appreciate your willingness to help. 😊

Are you preparing for Google Summer of Code? See our GSoC guidelines.

learning-equality-bot avatar Feb 24 '26 18:02 learning-equality-bot

Hi @hk2166! Thank you for reaching out. Unless directly related to the issue you have been assigned, please be sure to use Learning Equality's developer community (or gsoc) channel(s) to seek help. We look forward to supporting you there. Thank you!

akolson avatar Feb 24 '26 20:02 akolson

I think we may also need to import the attendance routes and spread into the main route array in app.js, and the page names need to be added to skipLoading? Just to complete the integration.

rtibbles avatar Mar 06 '26 22:03 rtibbles

Implementation Plan Summary — Issue #14236

Stakeholder Feedback Acknowledged

  • @learning-equality-bot / @akolson: Noted — this work is being done by an assigned contributor, not an external volunteer.
  • @rtibbles: Great catch — the plan includes both importing attendance routes into the main route array in routes/index.js and adding page names to skipLoading + the initClassInfo skip list in app.js. Both are covered as explicit tasks.

Plan Overview

7 tasks, all frontend-only, targeting the release-v0.19.x branch:

Task Description Files
1 Add ATTENDANCE_EDIT constant constants/index.js
2 Create 3 stub page components (AttendanceNewPage, AttendanceHistoryPage, AttendanceEditPage) views/attendance/*.vue
3 Create attendanceRoutes.js with 3 routes (each dispatches initClassInfo) routes/attendanceRoutes.js
4 Import + spread attendance routes into routes/index.js routes/index.js
5 Add attendance pages to skipLoading array and initClassInfo skip list in app.js app.js
6 Write Jest tests verifying stub components render views/attendance/__tests__/AttendancePages.spec.js
7 Verify existing AttendanceBlock tests + full coach test suite pass (no changes)

Key Design Decisions

  • Route ordering: ATTENDANCE_NEW and ATTENDANCE_HISTORY are listed before ATTENDANCE_EDIT (:attendanceId param) to prevent new/history being matched as attendance IDs.
  • AttendanceBlock links: Already point to ATTENDANCE_NEW and ATTENDANCE_HISTORY — they'll work once the routes exist. No changes to AttendanceBlock needed.
  • Stub components: Use Composition API setup() with createTranslator for i18n-ready headings.

Full plan: PLAN/index.md in the working branch.

rtibblesbot avatar Mar 11 '26 16:03 rtibblesbot

Phase Complete: Attendance Route Stubs

Stakeholder Feedback Acknowledged

  • @rtibbles: Attendance routes are now imported and spread into the main route array in routes/index.js, and all three page names (ATTENDANCE_NEW, ATTENDANCE_HISTORY, ATTENDANCE_EDIT) are added to both skipLoading and the initClassInfo skip list in app.js.
  • @learning-equality-bot / @akolson: Noted — these comments are directed at external contributors, not this assigned work.

Changes Made (8 files, 1 commit)

File Change
constants/index.js Added ATTENDANCE_EDIT constant
views/attendance/AttendanceNewPage.vue Stub page component
views/attendance/AttendanceHistoryPage.vue Stub page component
views/attendance/AttendanceEditPage.vue Stub page component
routes/attendanceRoutes.js Route definitions (3 routes with initClassInfo handler)
routes/index.js Import + spread attendance routes
app.js Added to skipLoading and initClassInfo skip list
views/attendance/__tests__/AttendancePages.spec.js Tests for stub components

Test Results

  • New tests: 3/3 pass (AttendancePages.spec.js)
  • Existing tests: 8/8 AttendanceBlock tests pass
  • Full coach suite: 235/235 tests pass (20/20 suites)
  • Lint: All checks pass

rtibblesbot avatar Mar 11 '26 16:03 rtibblesbot

Self-Review Complete — Phase 4

Summary

Reviewed git diff release-v0.19.x...HEAD (8 files, 165 additions) against issue requirements.

Acceptance Criteria: All Met

  • ✅ Three stub components (AttendanceNewPage, AttendanceHistoryPage, AttendanceEditPage) under views/attendance/
  • ✅ attendanceRoutes.js with correct paths and initClassInfo handlers
  • ✅ All three page name constants defined (ATTENDANCE_EDIT added; NEW/HISTORY from #14235)
  • ✅ Routes imported and spread into routes/index.js
  • ✅ skipLoading entries in app.js
  • ✅ AttendanceBlock links wired (from #14235, already on release branch)
  • ✅ Tests pass (3/3)

Stakeholder Feedback

  • @rtibbles: Routes are imported into routes/index.js and page names are added to skipLoading in app.js — both items are implemented as requested.
  • @learning-equality-bot, @akolson: Community management comments acknowledged — no code changes needed.

Review Findings

No blocking or suggestion-level issues found. One nitpick: defaultHandler doesn't return the notLoading dispatch promise, but this matches existing patterns in other coach route files.

Route ordering is correct (static paths before parameterized), stubs use Composition API + createTranslator per conventions.

rtibblesbot avatar Mar 11 '26 16:03 rtibblesbot

Implementation update for PR #14362:

Stakeholder feedback acknowledgment:

  • @rtibbles: Your feedback about importing attendance routes into the main route array in routes/index.js and adding page names to skipLoading in app.js has been addressed. Both integrations are included in the PR — attendanceRoutes is spread into the main routes array (index.js:42), and all three page names (ATTENDANCE_NEW, ATTENDANCE_HISTORY, ATTENDANCE_EDIT) are in the skipLoading list (app.js:95-97).

  • @learning-equality-bot and @akolson: Noted the contribution guidelines. This work is being done as part of the assigned development effort for this issue.

All acceptance criteria from the issue are met. CI is passing.

rtibblesbot avatar Mar 11 '26 16:03 rtibblesbot

Fixed in #14362

rtibbles avatar Mar 11 '26 17:03 rtibbles