[PM-17995] Adjust custom fields section (#4835)

This commit is contained in:
André Bispo
2025-03-13 11:33:39 +00:00
committed by GitHub
parent e16ad44d5e
commit da63c9e36b
4 changed files with 14 additions and 12 deletions

View File

@@ -136,6 +136,7 @@ fun LazyListScope.vaultAddEditAdditionalOptions(
modifier = Modifier.fillMaxWidth(),
)
}
Spacer(modifier = Modifier.height(height = 8.dp))
}
item(key = "addCustomFieldButton") {
@@ -145,7 +146,7 @@ fun LazyListScope.vaultAddEditAdditionalOptions(
.fillMaxWidth()
.standardHorizontalMargin(),
) {
Spacer(modifier = Modifier.height(height = 16.dp))
Spacer(modifier = Modifier.height(height = 8.dp))
VaultAddEditCustomFieldsButton(
onFinishNamingClick = commonTypeHandlers.onAddNewCustomFieldClick,
options = persistentListOfNotNull(

View File

@@ -67,7 +67,7 @@ fun VaultAddEditCustomFieldsButton(
}
val focusManager = LocalFocusManager.current
BitwardenOutlinedButton(
label = stringResource(id = R.string.new_custom_field),
label = stringResource(id = R.string.add_field),
onClick = {
// Clear any current focused item such as an unrelated text field.
focusManager.clearFocus()

View File

@@ -1226,5 +1226,6 @@ Do you want to switch to this account?</string>
<string name="show_more">Show more</string>
<string name="no_folder">No folder</string>
<string name="show_less">Show less</string>
<string name="add_field">Add field</string>
<string name="x_ellipses">%s...</string>
</resources>

View File

@@ -2285,7 +2285,7 @@ class VaultAddEditScreenTest : BaseComposeTest() {
}
@Test
fun `clicking New Custom Field button should allow creation of Linked type`() {
fun `clicking Add field button should allow creation of Linked type`() {
mutableStateFlow.value = DEFAULT_STATE_LOGIN
// Expand the additional options UI before interacting with it
@@ -2294,7 +2294,7 @@ class VaultAddEditScreenTest : BaseComposeTest() {
.performClick()
composeTestRule
.onNodeWithTextAfterScroll(text = "New custom field")
.onNodeWithTextAfterScroll(text = "Add field")
.performClick()
composeTestRule
@@ -2869,7 +2869,7 @@ class VaultAddEditScreenTest : BaseComposeTest() {
}
@Test
fun `clicking New Custom Field button should allow creation of Text type`() {
fun `clicking Add field button should allow creation of Text type`() {
mutableStateFlow.value = DEFAULT_STATE_SECURE_NOTES
// Expand the additional options UI before interacting with it
@@ -2878,7 +2878,7 @@ class VaultAddEditScreenTest : BaseComposeTest() {
.performClick()
composeTestRule
.onNodeWithTextAfterScroll(text = "New custom field")
.onNodeWithTextAfterScroll(text = "Add field")
.performClick()
composeTestRule
@@ -2910,7 +2910,7 @@ class VaultAddEditScreenTest : BaseComposeTest() {
}
@Test
fun `clicking New Custom Field button should not display linked type`() {
fun `clicking Add field button should not display linked type`() {
mutableStateFlow.value = DEFAULT_STATE_SECURE_NOTES
// Expand the additional options UI before interacting with it
@@ -2919,7 +2919,7 @@ class VaultAddEditScreenTest : BaseComposeTest() {
.performClick()
composeTestRule
.onNodeWithTextAfterScroll(text = "New custom field")
.onNodeWithTextAfterScroll(text = "Add field")
.performClick()
composeTestRule
@@ -2933,7 +2933,7 @@ class VaultAddEditScreenTest : BaseComposeTest() {
}
@Test
fun `clicking New Custom Field button should allow creation of Boolean type`() {
fun `clicking Add field button should allow creation of Boolean type`() {
mutableStateFlow.value = DEFAULT_STATE_SECURE_NOTES
// Expand the additional options UI before interacting with it
@@ -2942,7 +2942,7 @@ class VaultAddEditScreenTest : BaseComposeTest() {
.performClick()
composeTestRule
.onNodeWithTextAfterScroll(text = "New custom field")
.onNodeWithTextAfterScroll(text = "Add field")
.performClick()
composeTestRule
@@ -2974,7 +2974,7 @@ class VaultAddEditScreenTest : BaseComposeTest() {
}
@Test
fun `clicking New Custom Field button should allow creation of Hidden type`() {
fun `clicking Add field button should allow creation of Hidden type`() {
mutableStateFlow.value = DEFAULT_STATE_SECURE_NOTES
// Expand the additional options UI before interacting with it
@@ -2983,7 +2983,7 @@ class VaultAddEditScreenTest : BaseComposeTest() {
.performClick()
composeTestRule
.onNodeWithTextAfterScroll(text = "New custom field")
.onNodeWithTextAfterScroll(text = "Add field")
.performClick()
composeTestRule