Skip to content

Commit

Permalink
PM-13908 fixing copy on step2 and step3 and making vault url dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
dseverns-livefront committed Oct 25, 2024
1 parent 0960f61 commit 7f70e49
Show file tree
Hide file tree
Showing 67 changed files with 163 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ fun ImportLoginsScreen(

ImportLoginsState.ViewState.ImportStepTwo -> {
ImportLoginsStepTwoContent(
vaultUrl = state.currentWebVaultUrl,
onBackClick = handler.onMoveToStepOne,
onContinueClick = handler.onMoveToStepThree,
onHelpClick = handler.onHelpClick,
Expand Down Expand Up @@ -355,6 +356,7 @@ private fun ImportLoginsStepOneContent(

@Composable
private fun ImportLoginsStepTwoContent(
vaultUrl: String,
onContinueClick: () -> Unit,
onBackClick: () -> Unit,
onHelpClick: () -> Unit,
Expand All @@ -363,8 +365,14 @@ private fun ImportLoginsStepTwoContent(
val instruction1 = createAnnotatedString(
mainString = stringResource(
R.string.on_your_computer_open_a_new_browser_tab_and_go_to_vault_bitwarden_com,
vaultUrl,
),
highlights = listOf(
stringResource(
R.string.go_to_vault_bitwarden_com_highlight,
vaultUrl,
),
),
highlights = listOf(stringResource(R.string.go_to_vault_bitwarden_com_highlight)),
highlightStyle = bitwardenBoldSpanStyle,
)
val instruction2Text = stringResource(R.string.log_in_to_the_bitwarden_web_app)
Expand Down Expand Up @@ -618,12 +626,14 @@ private class ImportLoginsDialogContentPreviewProvider :
viewState = ImportLoginsState.ViewState.InitialContent,
isVaultSyncing = false,
showBottomSheet = false,
currentWebVaultUrl = "vault.bitwarden.com",
),
ImportLoginsState(
dialogState = ImportLoginsState.DialogState.ImportLater,
viewState = ImportLoginsState.ViewState.InitialContent,
isVaultSyncing = false,
showBottomSheet = false,
currentWebVaultUrl = "vault.bitwarden.com",
),
)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.x8bit.bitwarden.ui.vault.feature.importlogins

import android.net.Uri
import androidx.lifecycle.viewModelScope
import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.data.platform.repository.EnvironmentRepository
import com.x8bit.bitwarden.data.vault.repository.VaultRepository
import com.x8bit.bitwarden.data.vault.repository.model.SyncVaultDataResult
import com.x8bit.bitwarden.ui.platform.base.BaseViewModel
Expand All @@ -19,14 +21,21 @@ import javax.inject.Inject
@HiltViewModel
class ImportLoginsViewModel @Inject constructor(
private val vaultRepository: VaultRepository,
private val environmentRepository: EnvironmentRepository,
) :
BaseViewModel<ImportLoginsState, ImportLoginsEvent, ImportLoginsAction>(
initialState = ImportLoginsState(
null,
viewState = ImportLoginsState.ViewState.InitialContent,
isVaultSyncing = false,
showBottomSheet = false,
),
initialState = run {
val vaultUrl = environmentRepository.environment.environmentUrlData.webVault
?: environmentRepository.environment.environmentUrlData.base
ImportLoginsState(
null,
viewState = ImportLoginsState.ViewState.InitialContent,
isVaultSyncing = false,
showBottomSheet = false,
// attempt to trim the scheme of the vault url
currentWebVaultUrl = Uri.parse(vaultUrl).host ?: vaultUrl,
)
},
) {
override fun handleAction(action: ImportLoginsAction) {
when (action) {
Expand Down Expand Up @@ -197,6 +206,7 @@ data class ImportLoginsState(
val viewState: ViewState,
val isVaultSyncing: Boolean,
val showBottomSheet: Boolean,
val currentWebVaultUrl: String,
) {
/**
* Dialog states for the [ImportLoginsViewModel].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fun ImportLoginsInstructionStep(
Spacer(Modifier.height(24.dp))
Text(
text = createClickableAnnotatedString(
mainString = stringResource(R.string.need_help_checkout_out_import_help),
mainString = stringResource(R.string.need_help_check_out_import_help),
highlights = listOf(
ClickableTextHighlight(
textToHighlight = stringResource(R.string.import_help_highlight),
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-af-rZA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ Wil u na die rekening omskakel?</string>
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">For your security, be sure to delete your saved password file.</string>
<string name="delete_your_saved_password_file">delete your saved password file.</string>
<string name="need_help_checkout_out_import_help">Need help? Checkout out import help.</string>
<string name="need_help_check_out_import_help">Need help? Checkout out import help.</string>
<string name="import_help_highlight">import help</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Save the exported file somewhere on your computer you can find easily.</string>
<string name="save_the_exported_file_highlight">Save the exported file</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ar-rSA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">For your security, be sure to delete your saved password file.</string>
<string name="delete_your_saved_password_file">delete your saved password file.</string>
<string name="need_help_checkout_out_import_help">Need help? Checkout out import help.</string>
<string name="need_help_check_out_import_help">Need help? Checkout out import help.</string>
<string name="import_help_highlight">import help</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Save the exported file somewhere on your computer you can find easily.</string>
<string name="save_the_exported_file_highlight">Save the exported file</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-az-rAZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ Bu hesaba keçmək istəyirsiniz?</string>
<string name="then_done_highlight">\"Hazırdır\"a toxunun</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">Təhlükəsizliyiniz üçün saxlanılmış parol faylınızı sildiyinizə əmin olun.</string>
<string name="delete_your_saved_password_file">saxlanılmış parol faylınızı silin.</string>
<string name="need_help_checkout_out_import_help">Kömək lazımdır? Daxilə köçürmə üzrə kömək səhifəmizə baxın.</string>
<string name="need_help_check_out_import_help">Kömək lazımdır? Daxilə köçürmə üzrə kömək səhifəmizə baxın.</string>
<string name="import_help_highlight">daxilə köçürmə üzrə kömək</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Xaricə köçürdüyünüz faylı kompüterinizdə rahatlıqla tapa biləcəyiniz yerdə saxlayın.</string>
<string name="save_the_exported_file_highlight">Xaricə köçürülən faylı saxlayın</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-be-rBY/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">For your security, be sure to delete your saved password file.</string>
<string name="delete_your_saved_password_file">delete your saved password file.</string>
<string name="need_help_checkout_out_import_help">Need help? Checkout out import help.</string>
<string name="need_help_check_out_import_help">Need help? Checkout out import help.</string>
<string name="import_help_highlight">import help</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Save the exported file somewhere on your computer you can find easily.</string>
<string name="save_the_exported_file_highlight">Save the exported file</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-bg-rBG/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@
<string name="then_done_highlight">а след това натиснете Готово</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">За по-сигурно изтрийте файла със запазените пароли.</string>
<string name="delete_your_saved_password_file">изтрийте файла със запазените пароли.</string>
<string name="need_help_checkout_out_import_help">Имате ли нужда от помощ? Прегледайте помощта относно внасянето.</string>
<string name="need_help_check_out_import_help">Имате ли нужда от помощ? Прегледайте помощта относно внасянето.</string>
<string name="import_help_highlight">помощта относно внасянето</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Запазете изнесения файл някъде в компютъра си, така че да може да го намерите лесно.</string>
<string name="save_the_exported_file_highlight">Запазете изнесения файл</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-bn-rBD/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ Do you want to switch to this account?</string>
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">For your security, be sure to delete your saved password file.</string>
<string name="delete_your_saved_password_file">delete your saved password file.</string>
<string name="need_help_checkout_out_import_help">Need help? Checkout out import help.</string>
<string name="need_help_check_out_import_help">Need help? Checkout out import help.</string>
<string name="import_help_highlight">import help</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Save the exported file somewhere on your computer you can find easily.</string>
<string name="save_the_exported_file_highlight">Save the exported file</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-bs-rBA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ Skeniranje će biti izvršeno automatski.</string>
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">For your security, be sure to delete your saved password file.</string>
<string name="delete_your_saved_password_file">delete your saved password file.</string>
<string name="need_help_checkout_out_import_help">Need help? Checkout out import help.</string>
<string name="need_help_check_out_import_help">Need help? Checkout out import help.</string>
<string name="import_help_highlight">import help</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Save the exported file somewhere on your computer you can find easily.</string>
<string name="save_the_exported_file_highlight">Save the exported file</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ca-rES/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ Voleu canviar a aquest compte?</string>
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">For your security, be sure to delete your saved password file.</string>
<string name="delete_your_saved_password_file">delete your saved password file.</string>
<string name="need_help_checkout_out_import_help">Need help? Checkout out import help.</string>
<string name="need_help_check_out_import_help">Need help? Checkout out import help.</string>
<string name="import_help_highlight">import help</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Save the exported file somewhere on your computer you can find easily.</string>
<string name="save_the_exported_file_highlight">Save the exported file</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-cs-rCZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ Chcete se přepnout na tento účet?</string>
<string name="then_done_highlight">a poté klepněte na tlačítko Hotovo</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">Z důvodu bezpečnosti nezapomeňte smazat soubor s uloženým heslem.</string>
<string name="delete_your_saved_password_file">smazat soubor s uloženým heslem.</string>
<string name="need_help_checkout_out_import_help">Potřebujete pomoc? Podívejte se na nápovědu pro import.</string>
<string name="need_help_check_out_import_help">Potřebujete pomoc? Podívejte se na nápovědu pro import.</string>
<string name="import_help_highlight">nápověda pro import</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Uložte exportovaný soubor někde na Vašem počítači, kde jej můžete snadno najít.</string>
<string name="save_the_exported_file_highlight">Uložit exportovaný soubor</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-cy-rGB/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ Do you want to switch to this account?</string>
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">For your security, be sure to delete your saved password file.</string>
<string name="delete_your_saved_password_file">delete your saved password file.</string>
<string name="need_help_checkout_out_import_help">Need help? Checkout out import help.</string>
<string name="need_help_check_out_import_help">Need help? Checkout out import help.</string>
<string name="import_help_highlight">import help</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Save the exported file somewhere on your computer you can find easily.</string>
<string name="save_the_exported_file_highlight">Save the exported file</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-da-rDK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ Skift til denne konto?</string>
<string name="then_done_highlight">dernæst Færdig</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">Sørg af sikkerhedshensyn for at slette den gemte adgangskodefil.</string>
<string name="delete_your_saved_password_file">slet den gemte adgangskodefil.</string>
<string name="need_help_checkout_out_import_help">Behov for hjælp? Tjek import-hjælp ud.</string>
<string name="need_help_check_out_import_help">Behov for hjælp? Tjek import-hjælp ud.</string>
<string name="import_help_highlight">import-hjælp</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Gem den eksporterede fil et sted på computeren, hvor man nemt kan finde den.</string>
<string name="save_the_exported_file_highlight">Gem den eksporterede fil</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-de-rDE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ Möchtest du zu diesem Konto wechseln?</string>
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">Zu deiner eigenen Sicherheit solltest du deine gespeicherte Passwortdatei löschen.</string>
<string name="delete_your_saved_password_file">lösche deine gespeicherte Passwortdatei.</string>
<string name="need_help_checkout_out_import_help">Brauchst du Hilfe? Schau dir die Importhilfe an.</string>
<string name="need_help_check_out_import_help">Brauchst du Hilfe? Schau dir die Importhilfe an.</string>
<string name="import_help_highlight">Importhilfe</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Speichere die exportierte Datei irgendwo auf deinem Computer, so dass du sie leicht wiederfinden kannst.</string>
<string name="save_the_exported_file_highlight">Speichere die exportierte Datei</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-el-rGR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">For your security, be sure to delete your saved password file.</string>
<string name="delete_your_saved_password_file">delete your saved password file.</string>
<string name="need_help_checkout_out_import_help">Need help? Checkout out import help.</string>
<string name="need_help_check_out_import_help">Need help? Checkout out import help.</string>
<string name="import_help_highlight">import help</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Save the exported file somewhere on your computer you can find easily.</string>
<string name="save_the_exported_file_highlight">Save the exported file</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-en-rGB/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ Do you want to switch to this account?</string>
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">For your security, be sure to delete your saved password file.</string>
<string name="delete_your_saved_password_file">delete your saved password file.</string>
<string name="need_help_checkout_out_import_help">Need help? Checkout out import help.</string>
<string name="need_help_check_out_import_help">Need help? Checkout out import help.</string>
<string name="import_help_highlight">import help</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Save the exported file somewhere on your computer you can find easily.</string>
<string name="save_the_exported_file_highlight">Save the exported file</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-en-rIN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ Do you want to switch to this account?</string>
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">For your security, be sure to delete your saved password file.</string>
<string name="delete_your_saved_password_file">delete your saved password file.</string>
<string name="need_help_checkout_out_import_help">Need help? Checkout out import help.</string>
<string name="need_help_check_out_import_help">Need help? Checkout out import help.</string>
<string name="import_help_highlight">import help</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Save the exported file somewhere on your computer you can find easily.</string>
<string name="save_the_exported_file_highlight">Save the exported file</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-es-rES/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ seleccione Agregar TOTP para almacenar la clave de forma segura</string>
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">For your security, be sure to delete your saved password file.</string>
<string name="delete_your_saved_password_file">delete your saved password file.</string>
<string name="need_help_checkout_out_import_help">Need help? Checkout out import help.</string>
<string name="need_help_check_out_import_help">Need help? Checkout out import help.</string>
<string name="import_help_highlight">import help</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Save the exported file somewhere on your computer you can find easily.</string>
<string name="save_the_exported_file_highlight">Save the exported file</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-et-rEE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ Soovid selle konto peale lülituda?</string>
<string name="then_done_highlight">then Done</string>
<string name="for_your_security_be_sure_to_delete_your_saved_password_file">For your security, be sure to delete your saved password file.</string>
<string name="delete_your_saved_password_file">delete your saved password file.</string>
<string name="need_help_checkout_out_import_help">Need help? Checkout out import help.</string>
<string name="need_help_check_out_import_help">Need help? Checkout out import help.</string>
<string name="import_help_highlight">import help</string>
<string name="save_the_exported_file_somewhere_on_your_computer_you_can_find_easily">Save the exported file somewhere on your computer you can find easily.</string>
<string name="save_the_exported_file_highlight">Save the exported file</string>
Expand Down
Loading

0 comments on commit 7f70e49

Please sign in to comment.