mirror of
https://github.com/bitwarden/android.git
synced 2026-04-09 23:26:25 -05:00
PM-34228: feat: Add feature flag for forthcoming attachment updates (#6739)
This commit is contained in:
@@ -38,6 +38,7 @@ sealed class FlagKey<out T : Any> {
|
||||
ArchiveItems,
|
||||
SendEmailVerification,
|
||||
MobilePremiumUpgrade,
|
||||
AttachmentUpdates,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -116,6 +117,14 @@ sealed class FlagKey<out T : Any> {
|
||||
override val defaultValue: Boolean = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Data object holding the feature flag key for the Attachment Feature Updates.
|
||||
*/
|
||||
data object AttachmentUpdates : FlagKey<Boolean>() {
|
||||
override val keyName: String = "pm-34224-mobile-attachment-updates"
|
||||
override val defaultValue: Boolean = false
|
||||
}
|
||||
|
||||
//region Dummy keys for testing
|
||||
/**
|
||||
* Data object holding the key for a [Boolean] flag to be used in tests.
|
||||
|
||||
@@ -40,6 +40,10 @@ class FlagKeyTest {
|
||||
FlagKey.MobilePremiumUpgrade.keyName,
|
||||
"PM-31697-premium-upgrade-path",
|
||||
)
|
||||
assertEquals(
|
||||
FlagKey.AttachmentUpdates.keyName,
|
||||
"pm-34224-mobile-attachment-updates",
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -54,6 +58,7 @@ class FlagKeyTest {
|
||||
FlagKey.ArchiveItems,
|
||||
FlagKey.SendEmailVerification,
|
||||
FlagKey.MobilePremiumUpgrade,
|
||||
FlagKey.AttachmentUpdates,
|
||||
).all {
|
||||
!it.defaultValue
|
||||
},
|
||||
|
||||
@@ -32,6 +32,7 @@ fun <T : Any> FlagKey<T>.ListItemContent(
|
||||
FlagKey.ArchiveItems,
|
||||
FlagKey.SendEmailVerification,
|
||||
FlagKey.MobilePremiumUpgrade,
|
||||
FlagKey.AttachmentUpdates,
|
||||
-> {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
BooleanFlagItem(
|
||||
@@ -85,4 +86,5 @@ private fun <T : Any> FlagKey<T>.getDisplayLabel(): String = when (this) {
|
||||
FlagKey.ArchiveItems -> stringResource(BitwardenString.archive_items)
|
||||
FlagKey.SendEmailVerification -> stringResource(BitwardenString.send_email_verification)
|
||||
FlagKey.MobilePremiumUpgrade -> stringResource(BitwardenString.mobile_premium_upgrade)
|
||||
FlagKey.AttachmentUpdates -> stringResource(BitwardenString.attachment_updates)
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<string name="trigger_cookie_acquisition">Trigger cookie acquisition</string>
|
||||
<string name="clear_sso_cookies">Clear SSO cookies</string>
|
||||
<string name="mobile_premium_upgrade">Mobile Premium Upgrade</string>
|
||||
<string name="attachment_updates">Attachment Updates</string>
|
||||
|
||||
<!-- endregion Debug Menu -->
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user