diff --git a/.buildkite/beta-builds.yml b/.buildkite/beta-builds.yml index 434463858bc6..b9e5d5019bcc 100644 --- a/.buildkite/beta-builds.yml +++ b/.buildkite/beta-builds.yml @@ -13,6 +13,7 @@ steps: ################# - label: "Gradle Wrapper Validation" command: | + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" validate_gradle_wrapper plugins: [$CI_TOOLKIT] @@ -27,14 +28,18 @@ steps: - label: "🕵️ Lint WordPress" key: wplint - command: ".buildkite/commands/lint.sh wordpress" + command: | + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + .buildkite/commands/lint.sh wordpress plugins: [$CI_TOOLKIT] artifact_paths: - "**/build/reports/lint-results*.*" - label: "🕵️ Lint Jetpack" key: jplint - command: ".buildkite/commands/lint.sh jetpack" + command: | + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + .buildkite/commands/lint.sh jetpack plugins: [$CI_TOOLKIT] artifact_paths: - "**/build/reports/lint-results*.*" @@ -47,7 +52,9 @@ steps: - label: ":wordpress: :android: Beta Build" key: wpbuild - command: ".buildkite/commands/beta-build.sh wordpress" + command: | + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + .buildkite/commands/beta-build.sh wordpress depends_on: wplint plugins: [$CI_TOOLKIT] notify: @@ -59,7 +66,9 @@ steps: - label: ":jetpack: :android: Beta Build" key: jpbuild - command: ".buildkite/commands/beta-build.sh jetpack" + command: | + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + .buildkite/commands/beta-build.sh jetpack depends_on: jplint plugins: [$CI_TOOLKIT] notify: @@ -76,5 +85,7 @@ steps: depends_on: - wpbuild - jpbuild - command: ".buildkite/commands/create-github-release.sh" + command: | + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + .buildkite/commands/create-github-release.sh plugins: [$CI_TOOLKIT] diff --git a/.buildkite/commands/checkout-editorial-branch.sh b/.buildkite/commands/checkout-editorial-branch.sh index f495193ae32f..6cae072807ea 100755 --- a/.buildkite/commands/checkout-editorial-branch.sh +++ b/.buildkite/commands/checkout-editorial-branch.sh @@ -1,5 +1,7 @@ #!/bin/bash -eu +echo '--- :git: Checkout Editorial Branch' + # EDITORIAL_BRANCH is passed as an environment variable from fastlane to Buildkite # if [[ -z "${EDITORIAL_BRANCH}" ]]; then diff --git a/.buildkite/commands/checkout-release-branch.sh b/.buildkite/commands/checkout-release-branch.sh index 7b6881194cf7..fe570fa93ad6 100755 --- a/.buildkite/commands/checkout-release-branch.sh +++ b/.buildkite/commands/checkout-release-branch.sh @@ -1,10 +1,8 @@ #!/bin/bash -eu -# RELEASE_VERSION is passed as an environment variable passed to Buildkite by ReleasesV2. -if [[ -z "${RELEASE_VERSION}" ]]; then - echo "RELEASE_VERSION is not set." - exit 1 -fi +echo "--- :git: Checkout Release Branch" + +RELEASE_VERSION="${1?Please provide a release version as an argument.}" # Buildkite, by default, checks out a specific commit. For many release actions, we need to be # on a release branch instead. diff --git a/.buildkite/complete-code-freeze.yml b/.buildkite/complete-code-freeze.yml index aea9b8822055..e2810cd52cf4 100644 --- a/.buildkite/complete-code-freeze.yml +++ b/.buildkite/complete-code-freeze.yml @@ -8,8 +8,7 @@ steps: echo '--- :robot_face: Use bot for git operations' source use-bot-for-git - echo '--- :git: Checkout Release Branch' - .buildkite/commands/checkout-release-branch.sh + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" echo '--- :ruby: Setup Ruby Tools' install_gems diff --git a/.buildkite/finalize-release.yml b/.buildkite/finalize-release.yml index 4253bd97c27f..c38a21e774c8 100644 --- a/.buildkite/finalize-release.yml +++ b/.buildkite/finalize-release.yml @@ -8,8 +8,7 @@ steps: echo '--- :robot_face: Use bot for git operations' source use-bot-for-git - echo '--- :git: Checkout Release Branch' - .buildkite/commands/checkout-release-branch.sh + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" echo '--- :ruby: Setup Ruby Tools' install_gems diff --git a/.buildkite/publish-release.yml b/.buildkite/publish-release.yml index 72b96d7ff4a1..9bacf47c4bc9 100644 --- a/.buildkite/publish-release.yml +++ b/.buildkite/publish-release.yml @@ -8,8 +8,7 @@ steps: echo '--- :robot_face: Use bot for git operations' source use-bot-for-git - echo '--- :git: Checkout Release Branch' - .buildkite/commands/checkout-release-branch.sh + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" echo '--- :ruby: Setup Ruby tools' install_gems diff --git a/.buildkite/release-builds.yml b/.buildkite/release-builds.yml index abefd4942a40..1bfe1e5e9371 100644 --- a/.buildkite/release-builds.yml +++ b/.buildkite/release-builds.yml @@ -13,6 +13,7 @@ steps: ################# - label: "Gradle Wrapper Validation" command: | + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" validate_gradle_wrapper priority: 1 plugins: [$CI_TOOLKIT] @@ -28,7 +29,9 @@ steps: - label: "🕵️ Lint WordPress" key: wplint - command: ".buildkite/commands/lint.sh wordpress" + command: | + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + .buildkite/commands/lint.sh wordpress priority: 1 plugins: [$CI_TOOLKIT] artifact_paths: @@ -36,7 +39,9 @@ steps: - label: "🕵️ Lint Jetpack" key: jplint - command: ".buildkite/commands/lint.sh jetpack" + command: | + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + .buildkite/commands/lint.sh jetpack priority: 1 plugins: [$CI_TOOLKIT] artifact_paths: @@ -50,7 +55,9 @@ steps: - label: ":wordpress: :android: Release Build" key: wpbuild - command: ".buildkite/commands/release-build.sh wordpress" + command: | + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + .buildkite/commands/release-build.sh wordpress priority: 1 depends_on: wplint plugins: [$CI_TOOLKIT] @@ -63,7 +70,9 @@ steps: - label: ":jetpack: :android: Release Build" key: jpbuild - command: ".buildkite/commands/release-build.sh jetpack" + command: | + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + .buildkite/commands/release-build.sh jetpack priority: 1 depends_on: jplint plugins: [$CI_TOOLKIT] @@ -81,6 +90,8 @@ steps: depends_on: - wpbuild - jpbuild - command: ".buildkite/commands/create-github-release.sh" + command: | + .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + .buildkite/commands/create-github-release.sh priority: 1 plugins: [$CI_TOOLKIT] diff --git a/.buildkite/update-release-notes.yml b/.buildkite/update-release-notes.yml index bc781f42589b..5443723ab506 100644 --- a/.buildkite/update-release-notes.yml +++ b/.buildkite/update-release-notes.yml @@ -9,7 +9,6 @@ steps: echo '--- :robot_face: Use bot for git operations' source use-bot-for-git - echo '--- :git: Checkout Editorial Branch' .buildkite/commands/checkout-editorial-branch.sh echo '--- :ruby: Setup Ruby Tools' diff --git a/WordPress/build.gradle b/WordPress/build.gradle index fbc56a234d1a..859cf0ba901a 100644 --- a/WordPress/build.gradle +++ b/WordPress/build.gradle @@ -72,9 +72,10 @@ sentry { logcat.enabled = false } autoInstallation.enabled = false - includeSourceContext = true - autoUploadSourceContext = true includeDependenciesReport = false + + includeSourceContext = gradle.ext.isCi + includeProguardMapping = gradle.ext.isCi /* Sentry won't send source context or add performance instrumentations for debug builds so we can save build times. Sending events will still work in debug builds (if enabled in WPCrashLoggingDataProvider). @@ -127,7 +128,6 @@ android { buildConfigField "boolean", "UNIFIED_COMMENTS_DETAILS", "false" buildConfigField "boolean", "COMMENTS_SNIPPET", "false" buildConfigField "boolean", "READER_COMMENTS_MODERATION", "false" - buildConfigField "boolean", "SITE_INTENT_QUESTION", "true" buildConfigField "boolean", "SITE_NAME", "false" buildConfigField "boolean", "LAND_ON_THE_EDITOR", "false" buildConfigField "boolean", "QRCODE_AUTH_FLOW", "false" @@ -197,7 +197,7 @@ android { targetCompatibility JvmTarget.fromTarget(libs.versions.java.get()).target } - flavorDimensions "app", "buildType" + flavorDimensions = ['app', 'buildType'] productFlavors { wordpress { @@ -254,6 +254,7 @@ android { // Used for local development - preferred variant for developers. // AppName: WordPress Beta/Jetpack Beta wasabi { + isDefault true applicationIdSuffix ".beta" dimension "buildType" } @@ -261,7 +262,6 @@ android { // Used for CI builds on PRs (aka "Prototype Builds"). Can be used locally when a developer needs to install multiple versions of the app on the same device. // AppName: WordPress Pre-Alpha/Jetpack Pre-Alpha jalapeno { - isDefault true applicationIdSuffix ".prealpha" dimension "buildType" } @@ -301,7 +301,7 @@ android { checkGeneratedSources = true lintConfig file("${project.rootDir}/config/lint/lint.xml") baseline file("${project.rootDir}/config/lint/baseline.xml") - sarifReport = System.getenv('CI') ? true : false + sarifReport = gradle.ext.isCi } packagingOptions { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/personalization/PersonalizationActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/personalization/PersonalizationActivity.kt index 11dd6689cf87..207f4e13e400 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/personalization/PersonalizationActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/personalization/PersonalizationActivity.kt @@ -6,6 +6,7 @@ import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity import androidx.compose.foundation.Image import androidx.compose.foundation.border +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -45,6 +46,7 @@ import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -247,7 +249,19 @@ fun DashboardCardStateRow( onCardToggled: (cardType: CardType, enabled: Boolean) -> Unit, modifier: Modifier = Modifier ) { - Column(modifier = modifier.fillMaxWidth()) { + val title = stringResource(id = cardState.title) + val label = stringResource(id = R.string.personalization_screen_card_accessibility_label, title) + + Column( + modifier = modifier + .fillMaxWidth() + .clickable(onClickLabel = label) { + onCardToggled(cardState.cardType, !cardState.enabled) + } + .semantics( + mergeDescendants = true, + ) { }, + ) { Row( modifier = Modifier .fillMaxWidth() @@ -255,7 +269,7 @@ fun DashboardCardStateRow( start = 16.dp, end = 16.dp ), - verticalAlignment = Alignment.CenterVertically + verticalAlignment = Alignment.CenterVertically, ) { Column( modifier = Modifier @@ -279,7 +293,10 @@ fun DashboardCardStateRow( onCardToggled(cardState.cardType, it) }, modifier = Modifier - .weight(.1f), + .clickable(onClickLabel = label) { + onCardToggled(cardState.cardType, !cardState.enabled) + } + .weight(.1f) ) } HorizontalDivider( @@ -318,7 +335,7 @@ fun ShortcutStateRow( ) { Image( painter = painterResource(id = state.icon), - contentDescription = null, // Add appropriate content description + contentDescription = uiStringText(state.label), contentScale = ContentScale.Fit, modifier = Modifier .size(24.dp) @@ -347,7 +364,8 @@ fun ShortcutStateRow( painter = painterResource(id = actionIcon), tint = actionIconTint, contentDescription = stringResource( - R.string.personalization_screen_shortcuts_add_or_remove_shortcut_button + R.string.personalization_screen_shortcuts_accessibility_label, + uiStringText(state.label) ), ) } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppSettingsFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppSettingsFragment.java index 33073bab4f5b..b0da91659936 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppSettingsFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppSettingsFragment.java @@ -97,6 +97,9 @@ public class AppSettingsFragment extends PreferenceFragment private WPSwitchPreference mStripImageLocation; private WPSwitchPreference mReportCrashPref; private WPSwitchPreference mOpenWebLinksWithJetpack; + @Nullable private PreferenceScreen mExperimentalFeaturesSettings; + @Nullable private WPSwitchPreference mExperimentalBlockEditorPref; + @Nullable private WPSwitchPreference mExperimentalBlockEditorStylesPref; private Preference mWhatsNew; @@ -177,12 +180,18 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { .getPrefAndSetChangeListener(this, R.string.pref_key_site_video_encoder_bitrate, this); mPrivacySettings = (PreferenceScreen) WPPrefUtils .getPrefAndSetClickListener(this, R.string.pref_key_privacy_settings, this); + mExperimentalFeaturesSettings = (PreferenceScreen) WPPrefUtils + .getPrefAndSetClickListener(this, R.string.pref_key_experimental_features_settings, this); mStripImageLocation = (WPSwitchPreference) WPPrefUtils .getPrefAndSetChangeListener(this, R.string.pref_key_strip_image_location, this); mReportCrashPref = (WPSwitchPreference) WPPrefUtils .getPrefAndSetChangeListener(this, R.string.pref_key_send_crash, this); + mExperimentalBlockEditorPref = (WPSwitchPreference) WPPrefUtils + .getPrefAndSetChangeListener(this, R.string.pref_key_experimental_block_editor, this); + mExperimentalBlockEditorStylesPref = (WPSwitchPreference) WPPrefUtils + .getPrefAndSetChangeListener(this, R.string.pref_key_experimental_block_editor_theme_styles, this); mOpenWebLinksWithJetpack = (WPSwitchPreference) WPPrefUtils @@ -260,6 +269,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Override public void onViewStateRestored(Bundle savedInstanceState) { super.onViewStateRestored(savedInstanceState); addPrivacyToolbar(); + addExperimentalFeaturesToolbar(); } private void addJetpackBadgeAsFooterIfEnabled(LayoutInflater inflater, ListView listView) { @@ -405,6 +415,8 @@ public boolean onPreferenceClick(Preference preference) { return handleDevicePreferenceClick(); } else if (preference == mPrivacySettings) { return handlePrivacyClick(); + } else if (preference == mExperimentalFeaturesSettings) { + return handleExperimentalFeaturesClick(); } else if (preference == mWhatsNew) { return handleFeatureAnnouncementClick(); } else if (preference == mLanguagePreference) { @@ -473,6 +485,12 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { } else if (preference == mReportCrashPref) { AnalyticsTracker.track(Stat.PRIVACY_SETTINGS_REPORT_CRASHES_TOGGLED, Collections .singletonMap(TRACK_ENABLED, newValue)); + } else if (preference == mExperimentalBlockEditorPref) { + AnalyticsTracker.track(Stat.EXPERIMENTAL_BLOCK_EDITOR_TOGGLED, Collections + .singletonMap(TRACK_ENABLED, newValue)); + } else if (preference == mExperimentalBlockEditorStylesPref) { + AnalyticsTracker.track(Stat.EXPERIMENTAL_BLOCK_EDITOR_THEME_STYLES_TOGGLED, Collections + .singletonMap(TRACK_ENABLED, newValue)); } else if (preference == mOpenWebLinksWithJetpack) { handleOpenLinksInJetpack((Boolean) newValue); } @@ -617,6 +635,32 @@ private boolean addPrivacyToolbar() { return true; } + private boolean handleExperimentalFeaturesClick() { + AnalyticsTracker.track(Stat.APP_SETTINGS_EXPERIMENTAL_FEATURES_TAPPED); + + boolean isToolbarAdded = addExperimentalFeaturesToolbar(); + + if (!isToolbarAdded) { + return false; + } + + AnalyticsTracker.track(Stat.EXPERIMENTAL_FEATURES_SETTINGS_OPENED); + return true; + } + + private boolean addExperimentalFeaturesToolbar() { + if (mExperimentalFeaturesSettings == null || !isAdded()) { + return false; + } + + String title = getString(R.string.preference_experimental_features_settings); + Dialog dialog = mExperimentalFeaturesSettings.getDialog(); + if (dialog != null) { + WPActivityUtils.addToolbarToDialog(this, dialog, title); + } + return true; + } + private boolean handleFeatureAnnouncementClick() { if (getActivity() instanceof AppCompatActivity) { AnalyticsTracker.track(Stat.FEATURE_ANNOUNCEMENT_SHOWN_FROM_APP_SETTINGS); diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/privacy/banner/PrivacyBannerFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/prefs/privacy/banner/PrivacyBannerFragment.kt index 3e2481afeab2..ff7ffb992f70 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/privacy/banner/PrivacyBannerFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/privacy/banner/PrivacyBannerFragment.kt @@ -13,7 +13,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialog import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.launch import org.wordpress.android.ui.WPBottomSheetDialogFragment -import org.wordpress.android.ui.compose.theme.AppThemeM2 +import org.wordpress.android.ui.compose.theme.AppThemeM3 import org.wordpress.android.util.DisplayUtilsWrapper import org.wordpress.android.util.extensions.fillScreen import org.wordpress.android.viewmodel.main.WPMainActivityViewModel @@ -34,7 +34,7 @@ class PrivacyBannerFragment : WPBottomSheetDialogFragment() { ): View { return ComposeView(requireContext()).apply { setContent { - AppThemeM2 { + AppThemeM3 { PrivacyBannerScreen(viewModel) } } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/privacy/banner/PrivacyBannerScreen.kt b/WordPress/src/main/java/org/wordpress/android/ui/prefs/privacy/banner/PrivacyBannerScreen.kt index 61338d15e459..4e653360ab32 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/privacy/banner/PrivacyBannerScreen.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/privacy/banner/PrivacyBannerScreen.kt @@ -15,12 +15,13 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.CornerSize import androidx.compose.foundation.verticalScroll -import androidx.compose.material.Button -import androidx.compose.material.ButtonDefaults -import androidx.compose.material.CircularProgressIndicator -import androidx.compose.material.MaterialTheme -import androidx.compose.material.Text -import androidx.compose.material.contentColorFor +import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults +import androidx.compose.material3.CircularProgressIndicator +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Switch +import androidx.compose.material3.Text +import androidx.compose.material3.contentColorFor import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue @@ -35,8 +36,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import org.wordpress.android.R -import org.wordpress.android.ui.compose.components.buttons.WPSwitch -import org.wordpress.android.ui.compose.theme.AppThemeM2 +import org.wordpress.android.ui.compose.theme.AppThemeM3 @Composable fun PrivacyBannerScreen(viewModel: PrivacyBannerViewModel) { @@ -57,7 +57,7 @@ fun PrivacyBannerScreen( onSavePressed: () -> Unit, onSettingsPressed: () -> Unit, ) { - Box(Modifier.background(MaterialTheme.colors.surface)) { + Box(Modifier.background(MaterialTheme.colorScheme.surface)) { Column( Modifier .padding(vertical = 16.dp) @@ -66,12 +66,12 @@ fun PrivacyBannerScreen( Text( text = stringResource(R.string.privacy_banner_title), modifier = Modifier.padding(horizontal = 16.dp), - style = MaterialTheme.typography.h6 + style = MaterialTheme.typography.titleLarge ) Text( modifier = Modifier.padding(top = 8.dp, start = 16.dp, end = 16.dp), - style = MaterialTheme.typography.body2, + style = MaterialTheme.typography.bodyMedium, text = stringResource(R.string.privacy_banner_description) ) @@ -87,7 +87,7 @@ fun PrivacyBannerScreen( text = stringResource(R.string.privacy_banner_analytics), ) Spacer(modifier = Modifier.weight(1f)) - WPSwitch( + Switch( modifier = Modifier.padding(end = 16.dp), checked = state.analyticsSwitchEnabled, onCheckedChange = { onSwitchChanged(it) }, @@ -99,7 +99,7 @@ fun PrivacyBannerScreen( style = TextStyle( lineHeight = 20.sp, fontSize = 14.sp, - color = MaterialTheme.colors.onSurface.copy( + color = MaterialTheme.colorScheme.onSurface.copy( alpha = 0.60f ), ), @@ -115,7 +115,7 @@ fun PrivacyBannerScreen( style = TextStyle( lineHeight = 20.sp, fontSize = 14.sp, - color = MaterialTheme.colors.error, + color = MaterialTheme.colorScheme.error, ), text = stringResource(R.string.privacy_banner_error_save) ) @@ -133,12 +133,12 @@ fun PrivacyBannerScreen( .weight(1f) .fillMaxHeight(), colors = ButtonDefaults.buttonColors( - backgroundColor = MaterialTheme.colors.surface, - contentColor = contentColorFor(MaterialTheme.colors.surface) + containerColor = MaterialTheme.colorScheme.surface, + contentColor = contentColorFor(MaterialTheme.colorScheme.surface) ), - border = ButtonDefaults.outlinedBorder, + border = ButtonDefaults.outlinedButtonBorder(), shape = MaterialTheme.shapes.small.copy(CornerSize(8.dp)), - elevation = ButtonDefaults.elevation( + elevation = ButtonDefaults.buttonElevation( defaultElevation = 0.dp, pressedElevation = 0.dp, disabledElevation = 0.dp, @@ -159,7 +159,7 @@ fun PrivacyBannerScreen( colors = ButtonDefaults.buttonColors( contentColor = Color.White, ), - elevation = ButtonDefaults.elevation( + elevation = ButtonDefaults.buttonElevation( defaultElevation = 0.dp, pressedElevation = 0.dp, disabledElevation = 0.dp, @@ -191,7 +191,7 @@ fun PrivacyBannerScreen( @Preview(name = "Smaller screen", device = Devices.NEXUS_5) @Composable private fun PreviewPrivacyBanner() { - AppThemeM2 { + AppThemeM3 { PrivacyBannerScreen( state = PrivacyBannerViewModel.UiState( analyticsSwitchEnabled = false, @@ -206,7 +206,7 @@ private fun PreviewPrivacyBanner() { @Preview(name = "With error") @Composable private fun PreviewError() { - AppThemeM2 { + AppThemeM3 { PrivacyBannerScreen( state = PrivacyBannerViewModel.UiState( analyticsSwitchEnabled = false, diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitecreation/SiteCreationStep.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitecreation/SiteCreationStep.kt index 1ad8731904b0..5c52044987ea 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitecreation/SiteCreationStep.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitecreation/SiteCreationStep.kt @@ -8,7 +8,6 @@ import org.wordpress.android.ui.sitecreation.SiteCreationStep.SITE_DESIGNS import org.wordpress.android.ui.sitecreation.SiteCreationStep.SITE_NAME import org.wordpress.android.ui.sitecreation.SiteCreationStep.SITE_PREVIEW import org.wordpress.android.util.config.PlansInSiteCreationFeatureConfig -import org.wordpress.android.util.config.SiteIntentQuestionFeatureConfig import org.wordpress.android.util.config.SiteNameFeatureConfig import org.wordpress.android.util.wizard.WizardStep import javax.inject.Inject @@ -20,18 +19,15 @@ enum class SiteCreationStep : WizardStep { @Singleton class SiteCreationStepsProvider @Inject constructor( - private val siteIntentQuestionFeatureConfig: SiteIntentQuestionFeatureConfig, private val siteNameFeatureConfig: SiteNameFeatureConfig, private val plansInSiteCreationFeatureConfig: PlansInSiteCreationFeatureConfig ) { private val isSiteNameEnabled get() = siteNameFeatureConfig.isEnabled() - private val isIntentsEnabled get() = siteIntentQuestionFeatureConfig.isEnabled() private val isPlansEnabled get() = plansInSiteCreationFeatureConfig.isEnabled() fun getSteps(): List = when { isPlansEnabled -> listOf(INTENTS, SITE_DESIGNS, DOMAINS, PLANS, PROGRESS, SITE_PREVIEW) isSiteNameEnabled -> listOf(INTENTS, SITE_NAME, SITE_DESIGNS, PROGRESS, SITE_PREVIEW) - isIntentsEnabled -> listOf(INTENTS, SITE_DESIGNS, DOMAINS, PROGRESS, SITE_PREVIEW) - else -> listOf(SITE_DESIGNS, DOMAINS, PROGRESS, SITE_PREVIEW) + else -> listOf(INTENTS, SITE_DESIGNS, DOMAINS, PROGRESS, SITE_PREVIEW) } } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostAverageViewsPerDayUseCase.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostAverageViewsPerDayUseCase.kt index cd586ae04536..6fa7c1e999d1 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostAverageViewsPerDayUseCase.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostAverageViewsPerDayUseCase.kt @@ -7,7 +7,6 @@ import org.wordpress.android.fluxc.store.StatsStore.PostDetailType import org.wordpress.android.fluxc.store.stats.PostDetailStore import org.wordpress.android.modules.BG_THREAD import org.wordpress.android.modules.UI_THREAD -import org.wordpress.android.ui.stats.refresh.NavigationTarget.ViewDayAverageStats import org.wordpress.android.ui.stats.refresh.lists.BLOCK_ITEM_COUNT import org.wordpress.android.ui.stats.refresh.lists.VIEW_ALL_ITEM_COUNT import org.wordpress.android.ui.stats.refresh.lists.detail.PostDetailMapper.ExpandedYearUiState @@ -16,12 +15,10 @@ import org.wordpress.android.ui.stats.refresh.lists.sections.BaseStatsUseCase.Us import org.wordpress.android.ui.stats.refresh.lists.sections.BaseStatsUseCase.UseCaseMode.VIEW_ALL import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Header -import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Link import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Title import org.wordpress.android.ui.stats.refresh.lists.sections.insights.InsightUseCaseFactory import org.wordpress.android.ui.stats.refresh.utils.StatsPostProvider import org.wordpress.android.ui.stats.refresh.utils.StatsSiteProvider -import org.wordpress.android.ui.utils.ListItemInteraction import javax.inject.Inject import javax.inject.Named @@ -77,7 +74,7 @@ class PostAverageViewsPerDayUseCase( items.add( header ) - val shownYears = domainModel.yearsAverage.sortedByDescending { it.year }.takeLast(itemsToLoad) + val shownYears = domainModel.yearsAverage.sortedByDescending { it.year }.take(itemsToLoad) val yearList = postDetailMapper.mapYears( shownYears, uiState, @@ -86,14 +83,17 @@ class PostAverageViewsPerDayUseCase( ) items.addAll(yearList) - if (useCaseMode == BLOCK && domainModel.yearsAverage.size > itemsToLoad) { + + // We don't currently have a detail view for this + // https://github.com/wordpress-mobile/WordPress-Android/issues/21458 + /*if (useCaseMode == BLOCK && domainModel.yearsAverage.size > itemsToLoad) { items.add( Link( text = R.string.stats_insights_view_more, - navigateAction = ListItemInteraction.create(this::onLinkClick) + navigateAction = ListItemInteraction.create(navigateTo(ViewDayAverageStats)) ) ) - } + }*/ return items } @@ -101,10 +101,6 @@ class PostAverageViewsPerDayUseCase( return this != null && this.yearsAverage.isNotEmpty() && this.yearsAverage.any { it.value > 0 } } - private fun onLinkClick() { - navigateTo(ViewDayAverageStats) - } - override fun buildLoadingItem(): List { return listOf(Title(R.string.stats_detail_average_views_per_day)) } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostMonthsAndYearsUseCase.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostMonthsAndYearsUseCase.kt index 14aca692439b..74eef4d2d2d2 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostMonthsAndYearsUseCase.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostMonthsAndYearsUseCase.kt @@ -77,7 +77,7 @@ class PostMonthsAndYearsUseCase( items.add( header ) - val shownYears = domainModel.yearsTotal.sortedByDescending { it.year }.takeLast(itemsToLoad) + val shownYears = domainModel.yearsTotal.sortedByDescending { it.year }.take(itemsToLoad) val yearList = postDetailMapper.mapYears( shownYears, uiState, diff --git a/WordPress/src/main/java/org/wordpress/android/util/config/SiteIntentQuestionFeatureConfig.kt b/WordPress/src/main/java/org/wordpress/android/util/config/SiteIntentQuestionFeatureConfig.kt deleted file mode 100644 index 8ada802c8cd8..000000000000 --- a/WordPress/src/main/java/org/wordpress/android/util/config/SiteIntentQuestionFeatureConfig.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.wordpress.android.util.config - -import org.wordpress.android.BuildConfig -import org.wordpress.android.annotation.FeatureInDevelopment -import javax.inject.Inject - -/** - * Configuration of the Site Intent Question step in the Site Creation flow - */ -@FeatureInDevelopment -class SiteIntentQuestionFeatureConfig -@Inject constructor(appConfig: AppConfig) : FeatureConfig(appConfig, BuildConfig.SITE_INTENT_QUESTION) diff --git a/WordPress/src/main/res/values/key_strings.xml b/WordPress/src/main/res/values/key_strings.xml index b9ba660c74b6..7c540dd5871b 100644 --- a/WordPress/src/main/res/values/key_strings.xml +++ b/WordPress/src/main/res/values/key_strings.xml @@ -12,6 +12,9 @@ wp_pref_privacy_settings wp_pref_send_usage_stats wp_pref_send_crash_stats + wp_pref_experimental_features_settings + MANUAL_FEATURE_CONFIGexperimental_block_editor + MANUAL_FEATURE_CONFIGexperimental_block_editor_theme_styles wp_pref_device_settings wp_pref_app_experimental_section wp_pref_language diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index 961232556cd6..43cf9bf27844 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -940,6 +940,9 @@ Privacy notice for California users The California Consumer Privacy Act ("CCPA") requires us to provide California residents with some additional information about the categories of personal information we collect and share, where we get that personal information, and how and why we use it. Read CCPA privacy notice + Experimental features + Experimental block editor + Experimental block editor styles Remove location from media Appearance Light @@ -4845,7 +4848,8 @@ translators: %s: Select control option value e.g: "Auto, 25%". --> Recent actions taken on your site. @string/quick_start_sites Learn how to make the most of your site with the app. - Add or Remove shortcuts + Toggle %s card + Toggle %s shortcut All cards are hidden Tap the personalise button to show more cards. diff --git a/WordPress/src/main/res/xml/app_settings.xml b/WordPress/src/main/res/xml/app_settings.xml index 87c72b1fdfee..ce2acc568786 100644 --- a/WordPress/src/main/res/xml/app_settings.xml +++ b/WordPress/src/main/res/xml/app_settings.xml @@ -63,6 +63,23 @@ + + + + + + + + diff --git a/WordPress/src/test/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostAverageViewsPerDayUseCaseTest.kt b/WordPress/src/test/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostAverageViewsPerDayUseCaseTest.kt index 2d4e1c20a395..6a2d477743c9 100644 --- a/WordPress/src/test/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostAverageViewsPerDayUseCaseTest.kt +++ b/WordPress/src/test/java/org/wordpress/android/ui/stats/refresh/lists/detail/PostAverageViewsPerDayUseCaseTest.kt @@ -31,12 +31,10 @@ import org.wordpress.android.ui.stats.refresh.lists.sections.BaseStatsUseCase.Us import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.ExpandableItem import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Header -import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Link import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.ListItemWithIcon import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Title import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Type.EXPANDABLE_ITEM import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Type.HEADER -import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Type.LINK import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Type.LIST_ITEM_WITH_ICON import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.Type.TITLE import org.wordpress.android.ui.stats.refresh.utils.StatsPostProvider @@ -164,7 +162,8 @@ class PostAverageViewsPerDayUseCaseTest : BaseUnitTest() { assertMonth(this[3], "Jan", month.count.toString()) } - @Test + // See https://github.com/wordpress-mobile/WordPress-Android/pull/21457 + /*@Test fun `adds view more button when hasMore`() = test { val forced = false val data = List(10) { year } @@ -207,6 +206,12 @@ class PostAverageViewsPerDayUseCaseTest : BaseUnitTest() { } } + private fun assertLink(item: BlockListItem) { + assertThat(item.type).isEqualTo(LINK) + assertThat((item as Link).text).isEqualTo(R.string.stats_insights_view_more) + } + */ + @Test fun `maps error item to UI model`() = test { val forced = false @@ -278,11 +283,6 @@ class PostAverageViewsPerDayUseCaseTest : BaseUnitTest() { return item } - private fun assertLink(item: BlockListItem) { - assertThat(item.type).isEqualTo(LINK) - assertThat((item as Link).text).isEqualTo(R.string.stats_insights_view_more) - } - private suspend fun loadData(refresh: Boolean, forced: Boolean): UseCaseModel { var result: UseCaseModel? = null useCase.liveData.observeForever { result = it } diff --git a/build.gradle b/build.gradle index f623dbcc9e7e..f195d06b1204 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ measureBuilds { findProperty('appsMetricsToken') ) } - attachGradleScanId = System.getenv('CI')?.toBoolean() ?: false + attachGradleScanId = gradle.ext.isCi } allprojects { diff --git a/config/gradle/gradle_build_cache.gradle b/config/gradle/gradle_build_cache.gradle index e228570fb5e1..e126efe58013 100644 --- a/config/gradle/gradle_build_cache.gradle +++ b/config/gradle/gradle_build_cache.gradle @@ -1,6 +1,6 @@ // Only run build cache on CI builds. -if (System.getenv('CI')) { +if (gradle.ext.isCi) { buildCache { remote(HttpBuildCache) { url = "http://10.0.2.215:5071/cache/" diff --git a/config/gradle/gradle_build_scan.gradle b/config/gradle/gradle_build_scan.gradle index 3dcb900ee7f2..3cc0913ff88c 100644 --- a/config/gradle/gradle_build_scan.gradle +++ b/config/gradle/gradle_build_scan.gradle @@ -1,6 +1,6 @@ // Only run build scan on CI builds. -if (System.getenv('CI')) { +if (gradle.ext.isCi) { develocity { buildScan { termsOfUseUrl = 'https://gradle.com/terms-of-service' diff --git a/fastlane/lanes/release.rb b/fastlane/lanes/release.rb index 0605bbd0417c..42c70f25737f 100644 --- a/fastlane/lanes/release.rb +++ b/fastlane/lanes/release.rb @@ -548,19 +548,30 @@ def commit_version_bump end def trigger_buildkite_release_build(branch:, beta:) + environment = { + RELEASE_VERSION: current_release_version + } + pipeline_file = beta ? 'beta-builds.yml' : 'release-builds.yml' message = beta ? 'Beta Builds' : 'Release Builds' - build_url = buildkite_trigger_build( - buildkite_organization: 'automattic', - buildkite_pipeline: 'wordpress-android', - branch: branch, - pipeline_file: pipeline_file, - message: message - ) + # If we're running on CI, we can directly start the release pipeline jobs within the same build + if is_ci + buildkite_pipeline_upload( + pipeline_file: pipeline_file, + environment: environment + ) + else + build_url = buildkite_trigger_build( + buildkite_organization: 'automattic', + buildkite_pipeline: 'wordpress-android', + branch: branch, + pipeline_file: pipeline_file, + message: message + ) - message = "This build triggered a build on #{branch}:
- #{build_url}" - buildkite_annotate(style: 'info', context: 'trigger-release-build', message: message) if is_ci + UI.success("Release build triggered on #{branch}: #{build_url}") + end end def create_backmerge_pr(source_branch: "release/#{current_release_version}", target_branch: nil) diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java index d8b4ceaa94c8..46efebe88cf2 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java @@ -912,6 +912,7 @@ public enum Stat { SETTINGS_DID_CHANGE, APP_SETTINGS_APPEARANCE_CHANGED, APP_SETTINGS_PRIVACY_SETTINGS_TAPPED, + APP_SETTINGS_EXPERIMENTAL_FEATURES_TAPPED, APP_SETTINGS_OPEN_DEVICE_SETTINGS_TAPPED, APP_SETTINGS_MAX_IMAGE_SIZE_CHANGED, APP_SETTINGS_IMAGE_QUALITY_CHANGED, @@ -921,6 +922,9 @@ public enum Stat { APP_SETTINGS_VIDEO_QUALITY_CHANGED, PRIVACY_SETTINGS_OPENED, PRIVACY_SETTINGS_REPORT_CRASHES_TOGGLED, + EXPERIMENTAL_FEATURES_SETTINGS_OPENED, + EXPERIMENTAL_BLOCK_EDITOR_TOGGLED, + EXPERIMENTAL_BLOCK_EDITOR_THEME_STYLES_TOGGLED, SHARING_BUTTONS_EDIT_SHARING_BUTTONS_CHANGED, SHARING_BUTTONS_EDIT_MORE_SHARING_BUTTONS_CHANGED, PEOPLE_MANAGEMENT_USER_INVITED, diff --git a/settings.gradle b/settings.gradle index 91c6fd427de2..b94b55d21474 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,6 +16,8 @@ plugins { id "com.gradle.develocity" version "3.18.1" } +gradle.ext.isCi = System.getenv('CI')?.toBoolean() ?: false + dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories {