[PM-24226] Reorder SSH key fields (#5754)

This commit is contained in:
Patrick Honkonen
2025-08-19 18:00:41 -04:00
committed by GitHub
parent 3e55f561c9
commit b010c9a29d
2 changed files with 40 additions and 39 deletions

View File

@@ -27,20 +27,6 @@ fun LazyListScope.vaultAddEditSshKeyItems(
) {
item {
Spacer(modifier = Modifier.height(8.dp))
BitwardenTextField(
label = stringResource(id = BitwardenString.public_key),
value = sshKeyState.publicKey,
readOnly = true,
onValueChange = { },
textFieldTestTag = "PublicKeyEntry",
cardStyle = CardStyle.Top(),
modifier = Modifier
.fillMaxWidth()
.standardHorizontalMargin(),
)
}
item {
BitwardenPasswordField(
label = stringResource(id = BitwardenString.private_key),
value = sshKeyState.privateKey,
@@ -50,6 +36,20 @@ fun LazyListScope.vaultAddEditSshKeyItems(
showPasswordChange = { sshKeyTypeHandlers.onPrivateKeyVisibilityChange(it) },
showPasswordTestTag = "ViewPrivateKeyButton",
passwordFieldTestTag = "PrivateKeyEntry",
cardStyle = CardStyle.Top(),
modifier = Modifier
.fillMaxWidth()
.standardHorizontalMargin(),
)
}
item {
BitwardenTextField(
label = stringResource(id = BitwardenString.public_key),
value = sshKeyState.publicKey,
readOnly = true,
onValueChange = { },
textFieldTestTag = "PublicKeyEntry",
cardStyle = CardStyle.Middle(),
modifier = Modifier
.fillMaxWidth()

View File

@@ -63,32 +63,9 @@ fun VaultItemSshKeyContent(
onExpandClick = { isExpanded = !isExpanded },
applyIconBackground = commonState.iconData is IconData.Local,
)
item(key = "publicKey") {
Spacer(modifier = Modifier.height(8.dp))
BitwardenTextField(
label = stringResource(id = BitwardenString.public_key),
value = sshKeyItemState.publicKey,
onValueChange = { },
singleLine = false,
readOnly = true,
actions = {
BitwardenStandardIconButton(
vectorIconRes = BitwardenDrawable.ic_copy,
contentDescription = stringResource(id = BitwardenString.copy_public_key),
onClick = vaultSshKeyItemTypeHandlers.onCopyPublicKeyClick,
modifier = Modifier.testTag(tag = "SshKeyCopyPublicKeyButton"),
)
},
cardStyle = CardStyle.Top(),
modifier = Modifier
.testTag("SshKeyItemPublicKeyEntry")
.fillMaxWidth()
.standardHorizontalMargin()
.animateItem(),
)
}
item(key = "privateKey") {
Spacer(modifier = Modifier.height(8.dp))
BitwardenPasswordField(
label = stringResource(id = BitwardenString.private_key),
value = sshKeyItemState.privateKey,
@@ -106,7 +83,7 @@ fun VaultItemSshKeyContent(
showPassword = sshKeyItemState.showPrivateKey,
showPasswordTestTag = "ViewPrivateKeyButton",
showPasswordChange = vaultSshKeyItemTypeHandlers.onShowPrivateKeyClick,
cardStyle = CardStyle.Middle(),
cardStyle = CardStyle.Top(),
modifier = Modifier
.testTag("SshKeyItemPrivateKeyEntry")
.fillMaxWidth()
@@ -115,6 +92,30 @@ fun VaultItemSshKeyContent(
)
}
item(key = "publicKey") {
BitwardenTextField(
label = stringResource(id = BitwardenString.public_key),
value = sshKeyItemState.publicKey,
onValueChange = { },
singleLine = false,
readOnly = true,
actions = {
BitwardenStandardIconButton(
vectorIconRes = BitwardenDrawable.ic_copy,
contentDescription = stringResource(id = BitwardenString.copy_public_key),
onClick = vaultSshKeyItemTypeHandlers.onCopyPublicKeyClick,
modifier = Modifier.testTag(tag = "SshKeyCopyPublicKeyButton"),
)
},
cardStyle = CardStyle.Middle(),
modifier = Modifier
.testTag("SshKeyItemPublicKeyEntry")
.fillMaxWidth()
.standardHorizontalMargin()
.animateItem(),
)
}
item(key = "fingerprint") {
BitwardenTextField(
label = stringResource(id = BitwardenString.fingerprint),