[PM-37254] feat: Add fill-assist-targeting-rules feature flag (#6952)

This commit is contained in:
aj-rosado
2026-05-21 17:28:27 +01:00
committed by GitHub
parent e4fb873d34
commit afe296c3db
4 changed files with 20 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ sealed class FlagKey<out T : Any> {
V2EncryptionTde,
NewItemTypes,
DebugDisableSelfHostPremiumCheck,
FillAssistTargetingRules,
)
}
}
@@ -152,6 +153,14 @@ sealed class FlagKey<out T : Any> {
override val defaultValue: Boolean = false
}
/**
* Data object holding the feature flag key for the Fill Assist Targeting Rules feature.
*/
data object FillAssistTargetingRules : FlagKey<Boolean>() {
override val keyName: String = "fill-assist-targeting-rules"
override val defaultValue: Boolean = false
}
/**
* Debug-only flag that, when enabled, makes self-hosted environments behave as cloud
* environments for premium-upgrade gating. Used by QA to test the premium upgrade flow

View File

@@ -48,6 +48,10 @@ class FlagKeyTest {
FlagKey.NewItemTypes.keyName,
"pm-32009-new-item-types",
)
assertEquals(
FlagKey.FillAssistTargetingRules.keyName,
"fill-assist-targeting-rules",
)
assertEquals(
FlagKey.ManageDevices.keyName,
"pm-4516-devices-add-last-activity-date",
@@ -68,6 +72,7 @@ class FlagKeyTest {
FlagKey.V2EncryptionPassword,
FlagKey.V2EncryptionTde,
FlagKey.NewItemTypes,
FlagKey.FillAssistTargetingRules,
FlagKey.ManageDevices,
).all {
!it.defaultValue

View File

@@ -36,6 +36,7 @@ fun <T : Any> FlagKey<T>.ListItemContent(
FlagKey.V2EncryptionPassword,
FlagKey.V2EncryptionTde,
FlagKey.NewItemTypes,
FlagKey.FillAssistTargetingRules,
FlagKey.DebugDisableSelfHostPremiumCheck,
-> {
@Suppress("UNCHECKED_CAST")
@@ -94,6 +95,10 @@ private fun <T : Any> FlagKey<T>.getDisplayLabel(): String = when (this) {
FlagKey.V2EncryptionPassword -> stringResource(BitwardenString.v2_encryption_password)
FlagKey.V2EncryptionTde -> stringResource(BitwardenString.v2_encryption_tde)
FlagKey.NewItemTypes -> stringResource(BitwardenString.new_item_types)
FlagKey.FillAssistTargetingRules -> {
stringResource(BitwardenString.fill_assist_targeting_rules)
}
FlagKey.DebugDisableSelfHostPremiumCheck -> {
stringResource(BitwardenString.debug_disable_self_host_premium_check)
}

View File

@@ -52,6 +52,7 @@
<string name="v2_encryption_password">V2 Encryption - Password</string>
<string name="manage_devices">Manage devices</string>
<string name="new_item_types">New Item Types</string>
<string name="fill_assist_targeting_rules">Fill Assist Targeting Rules</string>
<string name="debug_disable_self_host_premium_check">Debug: Disable self-host premium check</string>
<!-- endregion Debug Menu -->