feat(portal): greet the teacher by full name on the dashboard (bd-2567) - #197
Merged
Conversation
"Welcome back, Ayesha!" -> "Welcome back, Ayesha Khan!"
`lastName` was already returned by the API (portal.routes.js selects
first_name AND last_name) and already on the User type — it was simply
never displayed.
Built by filter-then-join rather than `${firstName} ${lastName}`, because
a blank surname is expected rather than exceptional: data migrated from a
system with one combined name field leaves last_name empty, and
interpolation would render "Ayesha undefined" or leave a space dangling
before the "!". Both look broken, and this heading is the first thing a
teacher sees.
Ayesha + Khan -> "Ayesha Khan"
Ayesha + null -> "Ayesha"
Ayesha + " " -> "Ayesha"
Whether last_name is actually populated for NIETE users could not be
checked from here (no DB access), so the empty case is treated as the
likely path, not an edge case.
Tests red-first: 5 failing before, 14 files / 76 tests green after.
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.
Welcome back, Ayesha!→Welcome back, **Ayesha Khan**!lastNamewas already returned by the API (portal.routes.jsselectsfirst_nameANDlast_name) and already on theUsertype — it was just never shown.The interesting part is the missing surname
Built with filter-then-join rather than
${firstName} ${lastName}, because a blank surname is expected, not exceptional — data migrated from a system with one combined name field leaveslast_nameempty. Interpolation would render "Ayesha undefined" or leave a space dangling before the "!", and this heading is the first thing a teacher sees.I could not check from here whether
last_nameis actually populated for NIETE users (no DB access), so the empty case is treated as the likely path.Red-first: 5 failing → 14 files / 76 tests green. Build verified.
Closes: bd-2567
🤖 Generated with Claude Code