Add the Archive items feature flag (#6337)

This commit is contained in:
David Perez
2026-01-08 14:55:04 -06:00
committed by GitHub
parent 203313eb1d
commit 577e3c04e3
4 changed files with 18 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ sealed class FlagKey<out T : Any> {
CipherKeyEncryption,
NoLogoutOnKdfChange,
MigrateMyVaultToMyItems,
ArchiveItems,
)
}
}
@@ -98,6 +99,14 @@ sealed class FlagKey<out T : Any> {
override val defaultValue: Boolean = false
}
/**
* Data object holding the feature flag key for the Archive Items feature.
*/
data object ArchiveItems : FlagKey<Boolean>() {
override val keyName: String = "pm-19148-innovation-archive"
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

@@ -32,6 +32,10 @@ class FlagKeyTest {
FlagKey.MigrateMyVaultToMyItems.keyName,
"pm-20558-migrate-myvault-to-myitems",
)
assertEquals(
FlagKey.ArchiveItems.keyName,
"pm-19148-innovation-archive",
)
}
@Test
@@ -44,6 +48,7 @@ class FlagKeyTest {
FlagKey.BitwardenAuthenticationEnabled,
FlagKey.ForceUpdateKdfSettings,
FlagKey.MigrateMyVaultToMyItems,
FlagKey.ArchiveItems,
).all {
!it.defaultValue
},

View File

@@ -30,6 +30,7 @@ fun <T : Any> FlagKey<T>.ListItemContent(
FlagKey.ForceUpdateKdfSettings,
FlagKey.NoLogoutOnKdfChange,
FlagKey.MigrateMyVaultToMyItems,
FlagKey.ArchiveItems,
-> {
@Suppress("UNCHECKED_CAST")
BooleanFlagItem(
@@ -79,5 +80,7 @@ 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)
FlagKey.ArchiveItems -> stringResource(BitwardenString.archive_items)
}

View File

@@ -39,6 +39,7 @@
<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>
<string name="archive_items">Archive Items</string>
<!-- endregion Debug Menu -->
</resources>