From 6da4bf845b5238ffa8437e7eff7f96478b79bb5f Mon Sep 17 00:00:00 2001 From: Micah Heneveld Date: Fri, 11 Jul 2025 14:20:19 -0700 Subject: [PATCH 1/2] Bug that was fixed: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 👍 Expected behavior When the user hits Verify Phone, the alert should confirm that the user is verified. When the user hits Unverify Phone, the alert should confirm that the user is unverified. 👎 Actual Behavior When attempting to verify the phone number, an alert incorrectly states that the user is unverified. However, when attempting to unverify the phone, the system incorrectly indicates that the user is verified. Followed stnguyen90's guidelines: We want to update the alerts to be specific to say: XYZ's email has been verified XYZ's email has been unverified XYZ's phone has been verified XYZ's phone has been unverified Note: The "s" should only be there if the name does not end with s. For example, if the user's name was "Charles", it should be "Charles' email has been verified" Changed these lines: message: `${$user.name || $user.email || $user.phone || 'The account'} has been ${ !$user.emailVerification ? 'unverified' : 'verified' }`, message: `${$user.name || $user.email || $user.phone || 'The account'} has been ${ $user.phoneVerification ? 'unverified' : 'verified' }`, To these lines: message: `${$user.name || $user.email || $user.phone || 'The account'}${( $user.name || $user.email || $user.phone || 'The account' ).endsWith('s') ? "'" : "'s"} email has been ${!$user.emailVerification ? 'unverified' : 'verified'}`, message: `${$user.name || $user.email || $user.phone || 'The account'}${( $user.name || $user.email || $user.phone || 'The account' ).endsWith('s') ? "'" : "'s"} phone has been ${!$user.phoneVerification ? 'unverified' : 'verified'}`, Current behavior: XYZ's email has been verified XYZ's email has been unverified XYZ's phone has been verified XYZ's phone has been unverified OR (If the user's name ends in a s) QRS' email has been verified QRS' email has been unverified QRS' phone has been verified QRS' phone has been unverified --- .../auth/user-[user]/updateStatus.svelte | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte index 229109f948..c3666df7e2 100644 --- a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte +++ b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte @@ -23,9 +23,11 @@ .users.updateEmailVerification($user.$id, !$user.emailVerification); await invalidate(Dependencies.USER); addNotification({ - message: `${$user.name || $user.email || $user.phone || 'The account'} has been ${ - !$user.emailVerification ? 'unverified' : 'verified' - }`, + message: `${$user.name || $user.email || $user.phone || 'The account'}${( + $user.name || $user.email || $user.phone || 'The account' + ).endsWith('s') + ? "'" + : "'s"} email has been ${!$user.emailVerification ? 'unverified' : 'verified'}`, type: 'success' }); trackEvent(Submit.UserUpdateVerificationEmail); @@ -45,9 +47,11 @@ .users.updatePhoneVerification($user.$id, !$user.phoneVerification); await invalidate(Dependencies.USER); addNotification({ - message: `${$user.name || $user.email || $user.phone || 'The account'} has been ${ - $user.phoneVerification ? 'unverified' : 'verified' - }`, + message: `${$user.name || $user.email || $user.phone || 'The account'}${( + $user.name || $user.email || $user.phone || 'The account' + ).endsWith('s') + ? "'" + : "'s"} phone has been ${!$user.phoneVerification ? 'unverified' : 'verified'}`, type: 'success' }); trackEvent(Submit.UserUpdateVerificationPhone); From 10b60f1794a25fad2625bff21f3973ff56964dda Mon Sep 17 00:00:00 2001 From: anthonythang1 <133295934+anthonythang1@users.noreply.github.com> Date: Tue, 12 Aug 2025 20:32:27 +0000 Subject: [PATCH 2/2] updated user status to consider name empty/exists --- .../auth/user-[user]/updateStatus.svelte | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte index c3666df7e2..ef7aee1416 100644 --- a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte +++ b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte @@ -22,12 +22,16 @@ .forProject(page.params.region, page.params.project) .users.updateEmailVerification($user.$id, !$user.emailVerification); await invalidate(Dependencies.USER); + + const hasName = $user.name && $user.name.trim() !== ''; + const isVerified = !$user.emailVerification; + + const message = hasName + ? `The email for ${$user.name} has been ${isVerified ? 'verified' : 'no longer verified'}` + : `The email has been ${isVerified ? 'verified' : 'no longer verified'}`; + addNotification({ - message: `${$user.name || $user.email || $user.phone || 'The account'}${( - $user.name || $user.email || $user.phone || 'The account' - ).endsWith('s') - ? "'" - : "'s"} email has been ${!$user.emailVerification ? 'unverified' : 'verified'}`, + message, type: 'success' }); trackEvent(Submit.UserUpdateVerificationEmail); @@ -46,12 +50,16 @@ .forProject(page.params.region, page.params.project) .users.updatePhoneVerification($user.$id, !$user.phoneVerification); await invalidate(Dependencies.USER); + + const hasName = $user.name && $user.name.trim() !== ''; + const isVerified = !$user.phoneVerification; + + const message = hasName + ? `The phone for ${$user.name} has been ${isVerified ? 'verified' : 'no longer verified'}` + : `The phone has been ${isVerified ? 'verified' : 'no longer verified'}`; + addNotification({ - message: `${$user.name || $user.email || $user.phone || 'The account'}${( - $user.name || $user.email || $user.phone || 'The account' - ).endsWith('s') - ? "'" - : "'s"} phone has been ${!$user.phoneVerification ? 'unverified' : 'verified'}`, + message, type: 'success' }); trackEvent(Submit.UserUpdateVerificationPhone);