Verified contact onboarding#99
Conversation
|
Refer to the comments on #85 (comment) and #91 (comment) respectively for clarification to the requirements relevant to the current PR. |
| {user.fullName && <p className="truncate text-sm text-gray-500">{user.email}</p>} | ||
| <p className="mt-1 flex items-center gap-1.5 truncate text-xs text-gray-500"> | ||
| <Phone className="h-3.5 w-3.5 shrink-0" /> | ||
| {user.phoneNumber || 'No phone on file'} |
There was a problem hiding this comment.
I think it would be nicer if phone numbers (not limited to this instance) would be displayed with a whitespace between the country code and the actual number so the number itself is more easily readable.
There was a problem hiding this comment.
When a user who has not completed their profile (e..g missing contact number and birth month) logs in, they are directed to a page to complete their profile but there is currently no way to navigate out of the page. The only way to navigate out is to clear the cookies. I think a back button which redirects them back to the login page (and clears any necessary data/cookies) would suffice.
| <p className="mt-1 text-sm text-gray-500">Used by coordinators for walk and safety follow-up.</p> | ||
| </div> | ||
| <Link | ||
| href="/complete-profile" |
There was a problem hiding this comment.
If a user has already completed their profile, while clicking the button will redirect them to the /complete-profile page, the page itself redirects them back to the home page so there is no way for the user to change their contact number.
| className="w-full bg-green-600 text-white py-3 px-4 rounded-xl hover:bg-green-700 disabled:opacity-50 font-medium transition-colors" | ||
| > | ||
| {isJoining ? 'Joining...' : walk.joinBlockedInfo?.label || 'Join Walk'} | ||
| {isJoining ? 'Joining...' : walk.joinBlockedInfo?.label || (!roundRequirement.complete ? 'Complete Requirements' : 'Join Walk')} |
There was a problem hiding this comment.
Rather than changing the button text, maybe you can consider displaying Requirements not complete (or Please complete requirements to join walk as a warning (in red or yellow) while disabling the Join Walk button instead?
| </label> | ||
|
|
||
| <div className="space-y-2"> | ||
| <label className="space-y-1"> |
There was a problem hiding this comment.
| <label className="space-y-1"> | |
| <label className="block space-y-1"> |
There is currently no gap between both input fields (unlike the phone number/sms code input fields in https://github.com/seanlim/primap/pull/99/changes#diff-85407fd95558f0a2143d3445d579f0ced30463e5ff4c063c02d151f36c2cc977R177

| import { revalidatePath } from 'next/cache' | ||
|
|
||
| export async function updateProfile(fullName: string) { | ||
| export async function updateProfile(input: string | { fullName: string }) { |
There was a problem hiding this comment.
Why should updateProfile accept both string and object inputs now?
| export const DEFAULT_MAX_MEDIA_PER_REPORT = 10 | ||
| export const DEFAULT_HIGH_PARTICIPATION_THRESHOLD = 8 | ||
| export const DEFAULT_INDEMNITY_FORM_URL = | ||
| 'https://docs.google.com/forms/d/e/1FAIpQLSeyEo0vrWJVWliNvA5Q9xaz1CX7dimhJlRYUbojbbLO9ewtBQ/viewform' |
There was a problem hiding this comment.
Unless I'm missing out on specific details, I think there should be a clarification on whether Dr. Andie re-uses the same indemnity form every round or create a new form. Nonetheless this can be kept for now, just wanted to raise this up.
There was a problem hiding this comment.
I think an extra test case for users without phone number can be included.
There was a problem hiding this comment.
Currently there is no indicator whether a user is underage or require guardian, which I think would be nice as an extra label added beside the current Contact complete/Missing contact label
There was a problem hiding this comment.
Perhaps you can consider having a unit test for verifying guardian otp as well?
Summary
/complete-profile, leaving existing users incomplete until they finish the gatedocumentation/pr99-manual-test-guide.mdCloses #85
Closes #91
Validation
npm test -- --reporter=dot— 79 files, 938 tests passedNEXT_PUBLIC_SUPABASE_URL=https://example.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=dummy NEXT_PUBLIC_MAPBOX_TOKEN=dummy NEXT_PUBLIC_APP_URL=http://localhost:3000 npm run build/logindesktop/mobile passed; under-18 signup reveals guardian fields and phone auto-formatting worksNotes
npm run lintstill reports existing unrelated repo-wide issues in map hooks, analytics typing, and older test mocks.http://localhost:3000.