PM-15514 add feature flag key for app review prompt (#4414)

This commit is contained in:
Dave Severns
2024-12-03 15:49:37 -05:00
committed by GitHub
parent df846374f5
commit 97285f463e
5 changed files with 20 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ sealed class FlagKey<out T : Any> {
VerifiedSsoDomainEndpoint,
CredentialExchangeProtocolImport,
CredentialExchangeProtocolExport,
AppReviewPrompt,
)
}
}
@@ -122,6 +123,15 @@ sealed class FlagKey<out T : Any> {
override val isRemotelyConfigured: Boolean = true
}
/**
* Data object holding the feature flag key for the App Review Prompt feature.
*/
data object AppReviewPrompt : FlagKey<Boolean>() {
override val keyName: String = "app-review-prompt"
override val defaultValue: Boolean = false
override val isRemotelyConfigured: Boolean = true
}
//region Dummy keys for testing
/**
* Data object holding the key for a [Boolean] flag to be used in tests.

View File

@@ -31,6 +31,7 @@ fun <T : Any> FlagKey<T>.ListItemContent(
FlagKey.VerifiedSsoDomainEndpoint,
FlagKey.CredentialExchangeProtocolImport,
FlagKey.CredentialExchangeProtocolExport,
FlagKey.AppReviewPrompt,
-> BooleanFlagItem(
label = flagKey.getDisplayLabel(),
key = flagKey as FlagKey<Boolean>,
@@ -77,4 +78,5 @@ private fun <T : Any> FlagKey<T>.getDisplayLabel(): String = when (this) {
FlagKey.VerifiedSsoDomainEndpoint -> stringResource(R.string.verified_sso_domain_verified)
FlagKey.CredentialExchangeProtocolImport -> stringResource(R.string.cxp_import)
FlagKey.CredentialExchangeProtocolExport -> stringResource(R.string.cxp_export)
FlagKey.AppReviewPrompt -> stringResource(R.string.app_review_prompt)
}

View File

@@ -20,5 +20,6 @@
<string name="restart_onboarding_details">This will reset the onboarding status for the current user, if available. After clicking the button you will immediately be redirected to the onboarding flow. Onboarding flag must be enabled.</string>
<string name="restart_onboarding_carousel">Show Onboarding Carousel</string>
<string name="restart_onboarding_carousel_details">This will force the change to app state which will cause the first time carousel to show. The carousel will continue to show for any \"new\" account until a login is completed. May need to exit debug menu manually.</string>
<string name="app_review_prompt">App Review Prompt</string>
<!-- /Debug Menu -->
</resources>

View File

@@ -35,4 +35,9 @@ class FlagKeyTest {
fun `SshKeyCipherItems default value should be false`() {
assertFalse(FlagKey.SshKeyCipherItems.defaultValue)
}
@Test
fun `AppReviewPrompt default value should be false`() {
assertFalse(FlagKey.AppReviewPrompt.defaultValue)
}
}

View File

@@ -116,6 +116,7 @@ private val DEFAULT_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
FlagKey.VerifiedSsoDomainEndpoint to true,
FlagKey.CredentialExchangeProtocolImport to true,
FlagKey.CredentialExchangeProtocolExport to true,
FlagKey.AppReviewPrompt to true,
)
private val UPDATED_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
@@ -128,6 +129,7 @@ private val UPDATED_MAP_VALUE: Map<FlagKey<Any>, Any> = mapOf(
FlagKey.VerifiedSsoDomainEndpoint to false,
FlagKey.CredentialExchangeProtocolImport to false,
FlagKey.CredentialExchangeProtocolExport to false,
FlagKey.AppReviewPrompt to false,
)
private val DEFAULT_STATE = DebugMenuState(