fix(classroom): 課題詳細の Google Classroom 配信ボタンを復活 (#1045)#1046
Conversation
The post-assignment button gated on the assignment's own googleClassroomCourseId, but the v2 refactor moved GC linkage to the class (group), so assignments have no courseId and the button disappeared. Gate the button on an effective courseId (assignment OR group), keeping the posted/unposted branch on the assignment's own alternateLink. Extract resolveGoogleCourseId as an exported pure backend helper and pin the group fallback with a unit test. Closes #1045 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🤖 autopilot status
Linked issue #1045. Maintained by autopilot (single writer); do not edit. |
|
🚀 Preview deployed: https://smalruby.jp/smalruby3-editor/topic/autopilot-1045/ |
review follow-ups for #1045: - add teacher-class-detail.test.jsx to scratch-gui .prettierignore whitelist and reformat it with prettier (code-style rule: new smalruby files must be prettier-covered) - correct the post/view assignment button labels in docs/classroom/ui-ux.md to match the actual UI text (課題を配信 / 課題を確認) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
[Must] 新規テスト 対応済み:
|
|
[Question] 表示 gate をクラス(group)単位の courseId に広げたことで、Google Classroom 連携済みクラスを Microsoft でログインした先生(co-teacher 等)が開くと「課題を配信」ボタンが表示されるが押しても無反応になる可能性があります。
|
|
[FYI] |
|
🤖 敵対的レビュー完了。指摘 3 件(Must 1 / Question 1 / FYI 1)。Must と FYI は修正済み(f9e6eb9ce1)。Question は設計判断のため人間レビューに委ねます。 |
…lot-1045 fix(classroom): 課題詳細の Google Classroom 配信ボタンを復活 (#1045)
概要
授業支援 EPIC #974 のクラス管理刷新で消えていた Google Classroom への課題配信ボタンを、課題詳細画面(課題名入力の右隣)に復活させる。
根本原因
配信ボタンの表示条件が 課題(classroom)単位の
googleClassroomCourseIdに依存していた。刷新で GC 連携が クラス(group)単位に移り、個々の課題は courseId が null になるためボタンが常に非表示になっていた。変更内容
teacher-class-detail.jsx): 表示 gate を「実効 courseId(課題 OR クラス)」に変更。投稿済み/未投稿の分岐は従来どおり 課題単位のgoogleClassroomAlternateLinkをキーにする(クラス連携済みでもこの課題が未投稿なら「配信」、投稿後は「課題を確認」リンク)。handler.ts): 既に実装済みの group フォールバックを、resolveGoogleCourseIdという exported な純粋関数に抽出し、handlePostAssignmentから利用。挙動は不変。teacher-class-detail.test.jsx(新規)— クラスのみ連携/課題のみ連携/両方無し/投稿済みの 4 ケースで表示条件を pin。handler-assignment.test.tsにresolveGoogleCourseIdの group フォールバックを pin。docs/classroom/ui-ux.mdにクラス詳細の配信/確認ボタンと表示条件を追記。テスト
npm exec jest test/unit/components/teacher-class-detail.test.jsx→ 4 passed(RED→GREEN 確認済み)。DoD
docs/classroom/ui-ux.md更新Closes #1045