Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self hosted users feature flag #21259

Merged
merged 10 commits into from
Sep 26, 2024
1 change: 1 addition & 0 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ android {
buildConfigField "boolean", "READER_ANNOUNCEMENT_CARD", "false"
buildConfigField "boolean", "VOICE_TO_CONTENT", "false"
buildConfigField "boolean", "READER_FLOATING_BUTTON", "false"
buildConfigField "boolean", "ENABLE_SELF_HOSTED_USERS", "false"

// Override these constants in jetpack product flavor to enable/ disable features
buildConfigField "boolean", "ENABLE_SITE_CREATION", "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package org.wordpress.android.util.config

/**
* This class represents an abstract experiment configuration. An experiment has a list of variants.
* To add an experiment don't forget to update the `remote_config_defaults.xml` file.
dcalhoun marked this conversation as resolved.
Show resolved Hide resolved
* @param appConfig class that loads the feature configuration
* @param remoteField is the key of the feature flag in the remote config file
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package org.wordpress.android.util.config

/**
* A class that represents a feature configuration which enables the feature to be remotely turned on or off.
* To add a feature don't forget to update the remote_config_defaults.xml file.
* @param appConfig class that loads the feature configuration
* @param buildConfigValue is the field in the BuildConfig file. This flag overrides the remote value. Use this field
* to enable the feature to a certain build (debug, test build) so it doesn't have to rely on remote configuration.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.wordpress.android.util.config

import org.wordpress.android.BuildConfig
import org.wordpress.android.annotation.Feature
import javax.inject.Inject

/**
* Configuration of the self-hosted users feature
*/
private const val ENABLE_SELF_HOSTED_USERS_REMOTE_FIELD = "enable_self_hosted_users"
dcalhoun marked this conversation as resolved.
Show resolved Hide resolved

@Feature(ENABLE_SELF_HOSTED_USERS_REMOTE_FIELD, false)
class SelfHostedUsersFeatureConfig
@Inject constructor(appConfig: AppConfig) : FeatureConfig(
appConfig,
BuildConfig.ENABLE_SELF_HOSTED_USERS,
ENABLE_SELF_HOSTED_USERS_REMOTE_FIELD
) {
override fun isEnabled(): Boolean {
return super.isEnabled() && BuildConfig.DEBUG
}
}
Loading