Skip to content

Commit

Permalink
Merge pull request #21259 from wordpress-mobile/issue/self-hosted-use…
Browse files Browse the repository at this point in the history
…rs-feature-flag

Self hosted users feature flag
  • Loading branch information
nbradbury authored Sep 26, 2024
2 parents 2210956 + 0cf9a3e commit 6b99ae8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
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.
* @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 SELF_HOSTED_USERS_REMOTE_FIELD = "self_hosted_users"

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

0 comments on commit 6b99ae8

Please sign in to comment.