Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ android {
buildConfigField "boolean", "MY_SITE_IMPROVEMENTS", "false"
buildConfigField "boolean", "SEEN_UNSEEN_WITH_COUNTER", "false"
buildConfigField "boolean", "CONTACT_INFO_BLOCK_AVAILABLE", "true"
buildConfigField "boolean", "LAYOUT_GRID_BLOCK_AVAILABLE", "true"
buildConfigField "boolean", "LIKES_ENHANCEMENTS", "false"
buildConfigField "boolean", "IS_JETPACK_APP", "false"
buildConfigField "String", "TRACKS_EVENT_PREFIX", '"wpandroid_"'
Expand Down Expand Up @@ -158,6 +159,7 @@ android {
buildConfigField "long", "REMOTE_CONFIG_FETCH_INTERVAL", "3600"
buildConfigField "boolean", "ENABLE_FEATURE_CONFIGURATION", "false"
buildConfigField "boolean", "CONTACT_INFO_BLOCK_AVAILABLE", "true"
buildConfigField "boolean", "LAYOUT_GRID_BLOCK_AVAILABLE", "false"
}

zalpha { // alpha version - enable experimental features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
import org.wordpress.android.util.analytics.AnalyticsUtils;
import org.wordpress.android.util.analytics.AnalyticsUtils.BlockEditorEnabledSource;
import org.wordpress.android.util.config.ContactInfoBlockFeatureConfig;
import org.wordpress.android.util.config.LayoutGridBlockFeatureConfig;
import org.wordpress.android.util.crashlogging.CrashLoggingExtKt;
import org.wordpress.android.util.helpers.MediaFile;
import org.wordpress.android.util.helpers.MediaGallery;
Expand Down Expand Up @@ -406,6 +407,7 @@ enum RestartEditorOptions {
@Inject StoriesEventListener mStoriesEventListener;
@Inject ContactInfoBlockFeatureConfig mContactInfoBlockFeatureConfig;
@Inject UpdateFeaturedImageUseCase mUpdateFeaturedImageUseCase;
@Inject LayoutGridBlockFeatureConfig mLayoutGridBlockFeatureConfig;

private StorePostViewModel mViewModel;
private StorageUtilsViewModel mStorageUtilsViewModel;
Expand Down Expand Up @@ -2300,6 +2302,7 @@ private GutenbergPropsBuilder getGutenbergPropsBuilder() {

return new GutenbergPropsBuilder(
mContactInfoBlockFeatureConfig.isEnabled() && SiteUtils.supportsContactInfoFeature(mSite),
mLayoutGridBlockFeatureConfig.isEnabled() && SiteUtils.supportsLayoutGridFeature(mSite),
SiteUtils.supportsStoriesFeature(mSite),
mSite.isUsingWpComRestApi(),
enableXPosts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,11 @@ public static boolean supportsStoriesFeature(SiteModel site) {
}

public static boolean supportsContactInfoFeature(SiteModel site) {
return site != null & (site.isWPCom() || checkMinimalJetpackVersion(site, WP_CONTACT_INFO_JETPACK_VERSION));
return site != null && (site.isWPCom() || checkMinimalJetpackVersion(site, WP_CONTACT_INFO_JETPACK_VERSION));
}

public static boolean supportsLayoutGridFeature(SiteModel site) {
return site != null && (site.isWPCom() || site.isWPComAtomic());
}

public static boolean isNonAtomicBusinessPlanSite(@Nullable SiteModel site) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.wordpress.android.util.config

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

@FeatureInDevelopment
class LayoutGridBlockFeatureConfig
@Inject constructor(appConfig: AppConfig) : FeatureConfig(appConfig, BuildConfig.LAYOUT_GRID_BLOCK_AVAILABLE)
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
ext.wordPressUtilsVersion = 'develop-bb54ee34c5fec5fa7375ce90a356adb5adbdcae0'
ext.wordPressLoginVersion = '0.0.2'
ext.detektVersion = '1.15.0'
ext.gutenbergMobileVersion = 'v1.56.0-alpha1'
ext.gutenbergMobileVersion = 'v1.56.0-alpha3'

repositories {
maven {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import org.wordpress.mobile.WPAndroidGlue.GutenbergProps
@Parcelize
data class GutenbergPropsBuilder(
private val enableContactInfoBlock: Boolean,
private val enableLayoutGridBlock: Boolean,
private val enableMediaFilesCollectionBlocks: Boolean,
private val enableMentions: Boolean,
private val enableXPosts: Boolean,
Expand All @@ -24,6 +25,7 @@ data class GutenbergPropsBuilder(
) : Parcelable {
fun build(activity: Activity, isHtmlModeEnabled: Boolean) = GutenbergProps(
enableContactInfoBlock = enableContactInfoBlock,
enableLayoutGridBlock = enableLayoutGridBlock,
enableMediaFilesCollectionBlocks = enableMediaFilesCollectionBlocks,
enableMentions = enableMentions,
enableXPosts = enableXPosts,
Expand Down