[PM-28442] Added feature flag for migrate myvault to myitems (#6235)

This commit is contained in:
aj-rosado 2025-12-05 16:50:30 +00:00 committed by GitHub
parent 5e3e8a04aa
commit ca13e615ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 0 deletions

View File

@ -35,6 +35,7 @@ sealed class FlagKey<out T : Any> {
ForceUpdateKdfSettings,
CipherKeyEncryption,
NoLogoutOnKdfChange,
MigrateMyVaultToMyItems,
)
}
}
@ -89,6 +90,14 @@ sealed class FlagKey<out T : Any> {
override val defaultValue: Boolean = false
}
/**
* Data object holding the feature flag key for the Migrate My Vault to My Items feature.
*/
data object MigrateMyVaultToMyItems : FlagKey<Boolean>() {
override val keyName: String = "pm-20558-migrate-myvault-to-myitems"
override val defaultValue: Boolean = false
}
//region Dummy keys for testing
/**
* Data object holding the key for a [Boolean] flag to be used in tests.

View File

@ -28,6 +28,10 @@ class FlagKeyTest {
FlagKey.ForceUpdateKdfSettings.keyName,
"pm-18021-force-update-kdf-settings",
)
assertEquals(
FlagKey.MigrateMyVaultToMyItems.keyName,
"pm-20558-migrate-myvault-to-myitems",
)
}
@Test
@ -39,6 +43,7 @@ class FlagKeyTest {
FlagKey.CipherKeyEncryption,
FlagKey.BitwardenAuthenticationEnabled,
FlagKey.ForceUpdateKdfSettings,
FlagKey.MigrateMyVaultToMyItems,
).all {
!it.defaultValue
},

View File

@ -29,6 +29,7 @@ fun <T : Any> FlagKey<T>.ListItemContent(
FlagKey.CipherKeyEncryption,
FlagKey.ForceUpdateKdfSettings,
FlagKey.NoLogoutOnKdfChange,
FlagKey.MigrateMyVaultToMyItems,
-> {
@Suppress("UNCHECKED_CAST")
BooleanFlagItem(
@ -78,4 +79,5 @@ private fun <T : Any> FlagKey<T>.getDisplayLabel(): String = when (this) {
FlagKey.BitwardenAuthenticationEnabled -> {
stringResource(BitwardenString.bitwarden_authentication_enabled)
}
FlagKey.MigrateMyVaultToMyItems -> stringResource(BitwardenString.migrate_my_vault_to_my_items)
}

View File

@ -38,6 +38,7 @@
<string name="import_format_label_aegis_json">Aegis (.json)</string>
<string name="force_update_kdf_settings">Force update KDF settings</string>
<string name="avoid_logout_on_kdf_change">Avoid logout on KDF change</string>
<string name="migrate_my_vault_to_my_items">Migrate My Vault to My Items</string>
<!-- endregion Debug Menu -->
</resources>