mirror of
https://github.com/bitwarden/android.git
synced 2024-11-27 12:00:19 +03:00
Update various import and formatting issues (#689)
This commit is contained in:
parent
eeb22dbfee
commit
c487074de6
12 changed files with 22 additions and 12 deletions
|
@ -1,5 +1,7 @@
|
||||||
package com.x8bit.bitwarden.ui.platform.feature.settings.accountsecurity
|
package com.x8bit.bitwarden.ui.platform.feature.settings.accountsecurity
|
||||||
|
|
||||||
|
import android.Manifest
|
||||||
|
import android.os.Build
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
|
@ -30,8 +32,6 @@ import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import android.Manifest
|
|
||||||
import android.os.Build
|
|
||||||
import com.x8bit.bitwarden.R
|
import com.x8bit.bitwarden.R
|
||||||
import com.x8bit.bitwarden.data.platform.repository.model.VaultTimeout
|
import com.x8bit.bitwarden.data.platform.repository.model.VaultTimeout
|
||||||
import com.x8bit.bitwarden.data.platform.repository.model.VaultTimeoutAction
|
import com.x8bit.bitwarden.data.platform.repository.model.VaultTimeoutAction
|
||||||
|
|
|
@ -72,6 +72,7 @@ fun AutoFillScreen(
|
||||||
is AutoFillEvent.ShowToast -> {
|
is AutoFillEvent.ShowToast -> {
|
||||||
Toast.makeText(context, event.text(resources), Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, event.text(resources), Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoFillEvent.NavigateToBlockAutoFill -> {
|
AutoFillEvent.NavigateToBlockAutoFill -> {
|
||||||
onNavigateToBlockAutoFillScreen()
|
onNavigateToBlockAutoFillScreen()
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ fun BlockAutoFillScreen(
|
||||||
},
|
},
|
||||||
) { innerPadding ->
|
) { innerPadding ->
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(innerPadding)
|
.padding(innerPadding)
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.verticalScroll(rememberScrollState()),
|
.verticalScroll(rememberScrollState()),
|
||||||
|
|
|
@ -22,9 +22,9 @@ import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalView
|
import androidx.compose.ui.platform.LocalView
|
||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
import com.x8bit.bitwarden.R
|
import com.x8bit.bitwarden.R
|
||||||
|
import com.x8bit.bitwarden.ui.platform.feature.settings.appearance.model.AppTheme
|
||||||
import com.x8bit.bitwarden.ui.platform.manager.intent.IntentManager
|
import com.x8bit.bitwarden.ui.platform.manager.intent.IntentManager
|
||||||
import com.x8bit.bitwarden.ui.platform.manager.intent.IntentManagerImpl
|
import com.x8bit.bitwarden.ui.platform.manager.intent.IntentManagerImpl
|
||||||
import com.x8bit.bitwarden.ui.platform.feature.settings.appearance.model.AppTheme
|
|
||||||
import com.x8bit.bitwarden.ui.platform.manager.permissions.PermissionsManager
|
import com.x8bit.bitwarden.ui.platform.manager.permissions.PermissionsManager
|
||||||
import com.x8bit.bitwarden.ui.platform.manager.permissions.PermissionsManagerImpl
|
import com.x8bit.bitwarden.ui.platform.manager.permissions.PermissionsManagerImpl
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,9 @@ import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.x8bit.bitwarden.R
|
import com.x8bit.bitwarden.R
|
||||||
import com.x8bit.bitwarden.ui.platform.manager.permissions.PermissionsManager
|
|
||||||
import com.x8bit.bitwarden.ui.platform.components.BitwardenListHeaderText
|
import com.x8bit.bitwarden.ui.platform.components.BitwardenListHeaderText
|
||||||
import com.x8bit.bitwarden.ui.platform.components.BitwardenMultiSelectButton
|
import com.x8bit.bitwarden.ui.platform.components.BitwardenMultiSelectButton
|
||||||
|
import com.x8bit.bitwarden.ui.platform.manager.permissions.PermissionsManager
|
||||||
import com.x8bit.bitwarden.ui.vault.feature.addedit.handlers.VaultAddEditCardTypeHandlers
|
import com.x8bit.bitwarden.ui.vault.feature.addedit.handlers.VaultAddEditCardTypeHandlers
|
||||||
import com.x8bit.bitwarden.ui.vault.feature.addedit.handlers.VaultAddEditCommonHandlers
|
import com.x8bit.bitwarden.ui.vault.feature.addedit.handlers.VaultAddEditCommonHandlers
|
||||||
import com.x8bit.bitwarden.ui.vault.feature.addedit.handlers.VaultAddEditIdentityTypeHandlers
|
import com.x8bit.bitwarden.ui.vault.feature.addedit.handlers.VaultAddEditIdentityTypeHandlers
|
||||||
|
|
|
@ -905,6 +905,7 @@ class VaultAddEditViewModel @Inject constructor(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
is GeneratorResult.Username -> {
|
is GeneratorResult.Username -> {
|
||||||
updateLoginContent { loginType ->
|
updateLoginContent { loginType ->
|
||||||
loginType.copy(
|
loginType.copy(
|
||||||
|
|
|
@ -40,6 +40,7 @@ fun CipherView.toViewState(): VaultAddEditState.ViewState =
|
||||||
expirationYear = card?.expYear.orEmpty(),
|
expirationYear = card?.expYear.orEmpty(),
|
||||||
securityCode = card?.code.orEmpty(),
|
securityCode = card?.code.orEmpty(),
|
||||||
)
|
)
|
||||||
|
|
||||||
CipherType.IDENTITY -> VaultAddEditState.ViewState.Content.ItemType.Identity(
|
CipherType.IDENTITY -> VaultAddEditState.ViewState.Content.ItemType.Identity(
|
||||||
selectedTitle = identity?.title.toTitleOrDefault(),
|
selectedTitle = identity?.title.toTitleOrDefault(),
|
||||||
firstName = identity?.firstName.orEmpty(),
|
firstName = identity?.firstName.orEmpty(),
|
||||||
|
|
|
@ -49,8 +49,8 @@ fun NavController.navigateToVaultMoveToOrganization(
|
||||||
vaultItemId: String,
|
vaultItemId: String,
|
||||||
navOptions: NavOptions? = null,
|
navOptions: NavOptions? = null,
|
||||||
) {
|
) {
|
||||||
navigate(
|
navigate(
|
||||||
route = "$VAULT_MOVE_TO_ORGANIZATION_PREFIX/$vaultItemId",
|
route = "$VAULT_MOVE_TO_ORGANIZATION_PREFIX/$vaultItemId",
|
||||||
navOptions = navOptions,
|
navOptions = navOptions,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ fun Triple<CipherView?, List<CollectionView>, UserState?>.toViewState():
|
||||||
(currentCipher == null) -> {
|
(currentCipher == null) -> {
|
||||||
VaultMoveToOrganizationState.ViewState.Error(R.string.generic_error_message.asText())
|
VaultMoveToOrganizationState.ViewState.Error(R.string.generic_error_message.asText())
|
||||||
}
|
}
|
||||||
|
|
||||||
(userOrganizations?.isNotEmpty() == true) -> {
|
(userOrganizations?.isNotEmpty() == true) -> {
|
||||||
VaultMoveToOrganizationState.ViewState.Content(
|
VaultMoveToOrganizationState.ViewState.Content(
|
||||||
selectedOrganizationId = currentCipher
|
selectedOrganizationId = currentCipher
|
||||||
|
@ -58,6 +59,7 @@ fun Triple<CipherView?, List<CollectionView>, UserState?>.toViewState():
|
||||||
cipherToMove = currentCipher,
|
cipherToMove = currentCipher,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> VaultMoveToOrganizationState.ViewState.Empty
|
else -> VaultMoveToOrganizationState.ViewState.Empty
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,9 @@ import com.x8bit.bitwarden.data.platform.repository.util.bufferedMutableSharedFl
|
||||||
import com.x8bit.bitwarden.data.platform.util.asFailure
|
import com.x8bit.bitwarden.data.platform.util.asFailure
|
||||||
import com.x8bit.bitwarden.data.platform.util.asSuccess
|
import com.x8bit.bitwarden.data.platform.util.asSuccess
|
||||||
import com.x8bit.bitwarden.data.vault.datasource.disk.VaultDiskSource
|
import com.x8bit.bitwarden.data.vault.datasource.disk.VaultDiskSource
|
||||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.ShareCipherJsonRequest
|
|
||||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.SendFileResponseJson
|
import com.x8bit.bitwarden.data.vault.datasource.network.model.SendFileResponseJson
|
||||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.SendTypeJson
|
import com.x8bit.bitwarden.data.vault.datasource.network.model.SendTypeJson
|
||||||
|
import com.x8bit.bitwarden.data.vault.datasource.network.model.ShareCipherJsonRequest
|
||||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.SyncResponseJson
|
import com.x8bit.bitwarden.data.vault.datasource.network.model.SyncResponseJson
|
||||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.UpdateCipherResponseJson
|
import com.x8bit.bitwarden.data.vault.datasource.network.model.UpdateCipherResponseJson
|
||||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.UpdateSendResponseJson
|
import com.x8bit.bitwarden.data.vault.datasource.network.model.UpdateSendResponseJson
|
||||||
|
|
|
@ -76,7 +76,11 @@ class CustomFieldTypeTests {
|
||||||
val type = CustomFieldType.LINKED
|
val type = CustomFieldType.LINKED
|
||||||
|
|
||||||
val expected =
|
val expected =
|
||||||
VaultAddEditState.Custom.LinkedField(TEST_ID, "test", VaultLinkedFieldType.CARDHOLDER_NAME)
|
VaultAddEditState.Custom.LinkedField(
|
||||||
|
TEST_ID,
|
||||||
|
"test",
|
||||||
|
VaultLinkedFieldType.CARDHOLDER_NAME,
|
||||||
|
)
|
||||||
val actual = type.toCustomField(
|
val actual = type.toCustomField(
|
||||||
name = name,
|
name = name,
|
||||||
itemType = VaultAddEditState.ViewState.Content.ItemType.Card(),
|
itemType = VaultAddEditState.ViewState.Content.ItemType.Card(),
|
||||||
|
|
|
@ -180,7 +180,8 @@ class VaultMoveToOrganizationViewModelTest : BaseViewModelTest() {
|
||||||
organizations = createMockOrganizationList(),
|
organizations = createMockOrganizationList(),
|
||||||
selectedOrganizationId = "mockOrganizationId-1",
|
selectedOrganizationId = "mockOrganizationId-1",
|
||||||
cipherToMove = createMockCipherView(number = 1),
|
cipherToMove = createMockCipherView(number = 1),
|
||||||
), dialogState = null,
|
),
|
||||||
|
dialogState = null,
|
||||||
),
|
),
|
||||||
awaitItem(),
|
awaitItem(),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue