From 21b41fd4db384f9ca099c877bd23648c32c84c09 Mon Sep 17 00:00:00 2001 From: Dave Severns <149429124+dseverns-livefront@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:26:54 -0400 Subject: [PATCH] PM-10617 + PM-11270 fixes after QA review (#3944) --- .../CompleteRegistrationScreen.kt | 41 ++++++++++++------- app/src/main/res/values/strings.xml | 4 ++ 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationScreen.kt index b281b7a7b3..25f0f728ff 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationScreen.kt @@ -141,11 +141,10 @@ fun CompleteRegistrationScreen( .nestedScroll(scrollBehavior.nestedScrollConnection), topBar = { BitwardenTopAppBar( - title = if (state.onboardingEnabled) { - stringResource(id = R.string.create_account) - } else { - stringResource(id = R.string.set_password) - }, + title = stringResource( + id = R.string.create_account + .takeIf { state.onboardingEnabled } + ?: R.string.set_password), scrollBehavior = scrollBehavior, navigationIcon = rememberVectorPainter(id = R.drawable.ic_back), navigationIconContentDescription = stringResource(id = R.string.back), @@ -236,11 +235,17 @@ private fun CompleteRegistrationContent( var showPassword by rememberSaveable { mutableStateOf(false) } BitwardenPasswordField( - label = stringResource(id = R.string.master_password), + label = stringResource( + id = R.string.master_password_required + .takeIf { showNewOnboardingUi } + ?: R.string.master_password, + ), showPassword = showPassword, showPasswordChange = { showPassword = it }, value = passwordInput, onValueChange = handler.onPasswordInputChange, + hint = stringResource(id = R.string.master_password_important_hint) + .takeIf { !showNewOnboardingUi }, modifier = Modifier .testTag("MasterPasswordEntry") .fillMaxWidth() @@ -257,7 +262,11 @@ private fun CompleteRegistrationContent( ) Spacer(modifier = Modifier.height(16.dp)) BitwardenPasswordField( - label = stringResource(id = R.string.retype_master_password), + label = stringResource( + id = R.string.retype_master_password_required + .takeIf { showNewOnboardingUi } + ?: R.string.retype_master_password, + ), value = confirmPasswordInput, showPassword = showPassword, showPasswordChange = { showPassword = it }, @@ -270,16 +279,18 @@ private fun CompleteRegistrationContent( ) Spacer(modifier = Modifier.height(16.dp)) BitwardenTextField( - label = stringResource(id = R.string.master_password_hint), + label = stringResource( + id = R.string.master_password_hint_not_specified + .takeIf { showNewOnboardingUi } + ?: R.string.master_password_hint, + ), value = passwordHintInput, onValueChange = handler.onPasswordHintChange, - hint = if (showNewOnboardingUi) { - stringResource( - R.string.bitwarden_cannot_recover_a_lost_or_forgotten_master_password, - ) - } else { - stringResource(id = R.string.master_password_description) - }, + hint = stringResource( + id = R.string.bitwarden_cannot_recover_a_lost_or_forgotten_master_password + .takeIf { showNewOnboardingUi } + ?: R.string.master_password_hint_description, + ), modifier = Modifier .testTag("MasterPasswordHintLabel") .fillMaxWidth() diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1903b81468..3539863a51 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -50,6 +50,7 @@ Account already added Would you like to switch to it now? Master password + Master password (required) More My vault Authenticator @@ -166,6 +167,7 @@ Please consider helping us out with a good review! Regenerate password Re-type master password + Re-type master password (required) Search vault Security Select @@ -1004,4 +1006,6 @@ Do you want to switch to this account? You can return to complete this step anytime in Settings. You can now use autofill to log into apps and websites using your saved passwords. Now, you can explore everything else Bitwarden has to offer. You\'re all set! + Master password hint + Important: Your master password cannot be recovered if you forget it! 12 characters minimum.