mirror of
https://github.com/bitwarden/android.git
synced 2026-03-11 12:44:17 -05:00
Add the Archive items feature flag (#6337)
This commit is contained in:
@@ -36,6 +36,7 @@ sealed class FlagKey<out T : Any> {
|
|||||||
CipherKeyEncryption,
|
CipherKeyEncryption,
|
||||||
NoLogoutOnKdfChange,
|
NoLogoutOnKdfChange,
|
||||||
MigrateMyVaultToMyItems,
|
MigrateMyVaultToMyItems,
|
||||||
|
ArchiveItems,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,6 +99,14 @@ sealed class FlagKey<out T : Any> {
|
|||||||
override val defaultValue: Boolean = false
|
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
|
//region Dummy keys for testing
|
||||||
/**
|
/**
|
||||||
* Data object holding the key for a [Boolean] flag to be used in tests.
|
* Data object holding the key for a [Boolean] flag to be used in tests.
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ class FlagKeyTest {
|
|||||||
FlagKey.MigrateMyVaultToMyItems.keyName,
|
FlagKey.MigrateMyVaultToMyItems.keyName,
|
||||||
"pm-20558-migrate-myvault-to-myitems",
|
"pm-20558-migrate-myvault-to-myitems",
|
||||||
)
|
)
|
||||||
|
assertEquals(
|
||||||
|
FlagKey.ArchiveItems.keyName,
|
||||||
|
"pm-19148-innovation-archive",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -44,6 +48,7 @@ class FlagKeyTest {
|
|||||||
FlagKey.BitwardenAuthenticationEnabled,
|
FlagKey.BitwardenAuthenticationEnabled,
|
||||||
FlagKey.ForceUpdateKdfSettings,
|
FlagKey.ForceUpdateKdfSettings,
|
||||||
FlagKey.MigrateMyVaultToMyItems,
|
FlagKey.MigrateMyVaultToMyItems,
|
||||||
|
FlagKey.ArchiveItems,
|
||||||
).all {
|
).all {
|
||||||
!it.defaultValue
|
!it.defaultValue
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ fun <T : Any> FlagKey<T>.ListItemContent(
|
|||||||
FlagKey.ForceUpdateKdfSettings,
|
FlagKey.ForceUpdateKdfSettings,
|
||||||
FlagKey.NoLogoutOnKdfChange,
|
FlagKey.NoLogoutOnKdfChange,
|
||||||
FlagKey.MigrateMyVaultToMyItems,
|
FlagKey.MigrateMyVaultToMyItems,
|
||||||
|
FlagKey.ArchiveItems,
|
||||||
-> {
|
-> {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
BooleanFlagItem(
|
BooleanFlagItem(
|
||||||
@@ -79,5 +80,7 @@ private fun <T : Any> FlagKey<T>.getDisplayLabel(): String = when (this) {
|
|||||||
FlagKey.BitwardenAuthenticationEnabled -> {
|
FlagKey.BitwardenAuthenticationEnabled -> {
|
||||||
stringResource(BitwardenString.bitwarden_authentication_enabled)
|
stringResource(BitwardenString.bitwarden_authentication_enabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
FlagKey.MigrateMyVaultToMyItems -> stringResource(BitwardenString.migrate_my_vault_to_my_items)
|
FlagKey.MigrateMyVaultToMyItems -> stringResource(BitwardenString.migrate_my_vault_to_my_items)
|
||||||
|
FlagKey.ArchiveItems -> stringResource(BitwardenString.archive_items)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
<string name="force_update_kdf_settings">Force update KDF settings</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="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="migrate_my_vault_to_my_items">Migrate My Vault to My Items</string>
|
||||||
|
<string name="archive_items">Archive Items</string>
|
||||||
|
|
||||||
<!-- endregion Debug Menu -->
|
<!-- endregion Debug Menu -->
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user