P4: Componentize Add Class + Onboarding into shared AddClassForm - #29
Merged
Conversation
Extract flat enroll UI/logic into AddClassForm (enrollClass via store.add_class). Thin shells keep modal/welcome chrome only. Add parseJoinRef helper + CI unit tests for join-ref → bare classId. Co-authored-by: Sander Vonk <sandervonk@users.noreply.github.com>
Relative TS imports break under --experimental-strip-types; keep join-ref helper in the existing leaf paths module. Co-authored-by: Sander Vonk <sandervonk@users.noreply.github.com>
CI already copies .env.test → .env; do not commit local env. Co-authored-by: Sander Vonk <sandervonk@users.noreply.github.com>
Co-authored-by: Sander Vonk <sandervonk@users.noreply.github.com>
Co-authored-by: Sander Vonk <sandervonk@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
P4 Vue slice (non-destructive): extract shared Add Class / Onboarding enroll UI into one component. Flat
enrollClass/store.add_classonly — no nested writers, no nested delete, no server/rules changes.Pairs with merged mvtt-server#32 (
05d58c2).Before / after structure
Before
AddClass.vue(~291 lines) — full join/add UI + enroll logicOnboarding.vue(~133 lines) — duplicated email/picker +add_classenrollAfter
src/components/Portal/AddClassForm.vue— shared form owns:store.add_class(...)→enrollClass({ classId })AddClass.vue— thin shell (title chrome +variant="add")Onboarding.vue— thin shell (welcome chrome +variant="welcome")parseJoinRefinsrc/common/paths.ts— join-ref → bareclassId(+ teacher when prefixed; dual-read flag for short ids)Files
src/components/Portal/AddClassForm.vuesrc/views/Portal/AddClass.vuesrc/views/Portal/Onboarding.vuesrc/common/paths.tsparseJoinRef+JoinRefParts(P4 flat enroll)scripts/test-join-class.mjsparseJoinRefpackage.jsontest:join-classscript.github/workflows/ci.yml.gitignore.env(CI copies.env.test)Flat-only notes
classes/{email}/classes/...writes on this pathclassIdenrollment pointers via existingstore.add_class→enrollClassparseJoinRef+class_from_ref)Out of scope
Verification (local)
npm run test:join-class✅npm run lint✅npm run build✅Test plan
npm run test:join-classnpm run lintnpm run build