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

[Global Styles] Adds Global Styles API Call and passes the value to the editor via a new prop #14597

Merged
merged 10 commits into from
Jun 29, 2021
1 change: 1 addition & 0 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ android {
buildConfigField "boolean", "MP4_COMPOSER_VIDEO_OPTIMIZATION", "false"
buildConfigField "boolean", "BLOGGING_REMINDERS", "false"
buildConfigField "boolean", "MANAGE_CATEGORIES", "false"
buildConfigField "boolean", "GLOBAL_STYLE_SUPPORT", "false"

manifestPlaceholders = [magicLinkScheme:"wordpress"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
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.config.GlobalStyleSupportFeatureConfig;
import org.wordpress.android.util.helpers.MediaFile;
import org.wordpress.android.util.helpers.MediaGallery;
import org.wordpress.android.util.image.ImageManager;
Expand Down Expand Up @@ -411,6 +412,7 @@ enum RestartEditorOptions {
@Inject StoriesEventListener mStoriesEventListener;
@Inject ContactInfoBlockFeatureConfig mContactInfoBlockFeatureConfig;
@Inject UpdateFeaturedImageUseCase mUpdateFeaturedImageUseCase;
@Inject GlobalStyleSupportFeatureConfig mGlobalStyleSupportFeatureConfig;
@Inject LayoutGridBlockFeatureConfig mLayoutGridBlockFeatureConfig;

private StorePostViewModel mViewModel;
Expand Down Expand Up @@ -3589,7 +3591,8 @@ public void onEventMainThread(UploadService.UploadMediaRetryEvent event) {
}

private void refreshEditorTheme() {
FetchEditorThemePayload payload = new FetchEditorThemePayload(mSite);
FetchEditorThemePayload payload =
new FetchEditorThemePayload(mSite, mGlobalStyleSupportFeatureConfig.isEnabled());
mDispatcher.dispatch(EditorThemeActionBuilder.newFetchEditorThemeAction(payload));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.wordpress.android.util.config

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

/**
* Configuration of the Global Style Support
*/
@FeatureInDevelopment
class GlobalStyleSupportFeatureConfig
@Inject constructor(appConfig: AppConfig) : FeatureConfig(appConfig, BuildConfig.GLOBAL_STYLE_SUPPORT)
4 changes: 2 additions & 2 deletions 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'
ext.gutenbergMobileVersion = 'develop-a716641e22ae3b64e068bda95a517988e95669f4'

repositories {
maven {
Expand Down Expand Up @@ -133,7 +133,7 @@ ext {
androidxWorkVersion = "2.4.0"

daggerVersion = '2.29.1'
fluxCVersion = '1.19.2'
fluxCVersion = '1.20.1-beta-1'

appCompatVersion = '1.0.2'
coreVersion = '1.3.2'
Expand Down