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
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Internal] Migration to POS specific product model [https://github.com/woocommerce/woocommerce-android/pull/14598]
- [*] Enhance the shipping label creation screen by making the selected hazardous box tappable [https://github.com/woocommerce/woocommerce-android/pull/14576]
- [*] Shipping Labels: Enhance selected package UI in the create shipping label flow [https://github.com/woocommerce/woocommerce-android/pull/14579]
- [***] Performance improvements for users logging in with WordPress.com accounts [https://github.com/woocommerce/woocommerce-android/pull/14610]
- [*] Fix an issue where there is delay before displaying the continue button in Site Picker screen [https://github.com/woocommerce/woocommerce-android/pull/14611]

23.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ package com.woocommerce.android.applicationpasswords
import com.woocommerce.android.AppPrefsWrapper
import com.woocommerce.android.BuildConfig
import com.woocommerce.android.util.DeviceInfo
import com.woocommerce.android.util.FeatureFlag.APP_PASSWORDS_FOR_JETPACK_SITES
import com.woocommerce.android.util.IsRemoteFeatureFlagEnabled
import com.woocommerce.android.util.RemoteFeatureFlag
import jakarta.inject.Inject
import org.wordpress.android.fluxc.network.rest.wpapi.applicationpasswords.ApplicationPasswordsConfiguration

class WooApplicationPasswordsConfiguration @Inject constructor(
private val appPrefs: AppPrefsWrapper
private val appPrefs: AppPrefsWrapper,
private val isRemoteFeatureFlagEnabled: IsRemoteFeatureFlagEnabled
) : ApplicationPasswordsConfiguration {
override val applicationName: String =
"${BuildConfig.APPLICATION_ID}.app-client.${DeviceInfo.name.replace(' ', '-')}"

override suspend fun isEnabledForJetpackAccess(): Boolean =
APP_PASSWORDS_FOR_JETPACK_SITES.isEnabled() && appPrefs.jetpackAppPasswordsEnabled
override suspend fun isEnabledForJetpackAccess(): Boolean {
return appPrefs.jetpackAppPasswordsEnabled &&
isRemoteFeatureFlagEnabled(RemoteFeatureFlag.APP_PASSWORDS_FOR_JETPACK_SITES)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.view.View
import android.widget.CompoundButton
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import com.google.android.material.snackbar.BaseTransientBottomBar
import com.google.android.material.snackbar.Snackbar
import com.woocommerce.android.AppPrefs
Expand All @@ -16,8 +17,10 @@ import com.woocommerce.android.tools.SelectedSite
import com.woocommerce.android.tools.SiteConnectionType
import com.woocommerce.android.ui.prefs.MainSettingsFragment.AppSettingsListener
import com.woocommerce.android.util.AnalyticsUtils
import com.woocommerce.android.util.FeatureFlag
import com.woocommerce.android.util.IsRemoteFeatureFlagEnabled
import com.woocommerce.android.util.RemoteFeatureFlag
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import javax.inject.Inject

@AndroidEntryPoint
Expand All @@ -29,6 +32,9 @@ class BetaFeaturesFragment : Fragment(R.layout.fragment_settings_beta) {
@Inject
lateinit var selectedSite: SelectedSite

@Inject
lateinit var isRemoteFeatureFlagEnabled: IsRemoteFeatureFlagEnabled

private val settingsListener by lazy {
activity as? AppSettingsListener
}
Expand Down Expand Up @@ -59,9 +65,11 @@ class BetaFeaturesFragment : Fragment(R.layout.fragment_settings_beta) {
}

private fun FragmentSettingsBetaBinding.bindJetpackAppPasswordsToggle() {
// TODO check the remote feature flag state once available
val isJetpackSite = selectedSite.connectionType != SiteConnectionType.ApplicationPasswords
jetpackAppPasswordsToggle.isVisible = FeatureFlag.APP_PASSWORDS_FOR_JETPACK_SITES.isEnabled() && isJetpackSite
viewLifecycleOwner.lifecycleScope.launch {
val isJetpackSite = selectedSite.connectionType != SiteConnectionType.ApplicationPasswords
jetpackAppPasswordsToggle.isVisible = isJetpackSite &&
isRemoteFeatureFlagEnabled(RemoteFeatureFlag.APP_PASSWORDS_FOR_JETPACK_SITES)
}

jetpackAppPasswordsToggle.isChecked = AppPrefs.jetpackAppPasswordsEnabled
jetpackAppPasswordsToggle.setOnCheckedChangeListener { _, isChecked ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ enum class FeatureFlag {
ORDER_CREATION_AUTO_TAX_RATE,
WOO_POS_HISTORICAL_ORDERS_M1,
WOO_POS_LOCAL_CATALOG_M1,
AI_PRODUCT_IMAGE_BACKGROUND_REMOVAL,
APP_PASSWORDS_FOR_JETPACK_SITES;
AI_PRODUCT_IMAGE_BACKGROUND_REMOVAL;

fun isEnabled(context: Context? = null): Boolean {
return when (this) {
Expand All @@ -26,8 +25,7 @@ enum class FeatureFlag {
BETTER_CUSTOMER_SEARCH_M2,
ORDER_CREATION_AUTO_TAX_RATE,
AI_PRODUCT_IMAGE_BACKGROUND_REMOVAL,
WOO_POS_LOCAL_CATALOG_M1,
APP_PASSWORDS_FOR_JETPACK_SITES -> PackageUtils.isDebugBuild()
WOO_POS_LOCAL_CATALOG_M1 -> PackageUtils.isDebugBuild()
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.woocommerce.android.util

import com.woocommerce.android.config.WPComRemoteFeatureFlagRepository
import com.woocommerce.android.util.RemoteFeatureFlag.APP_PASSWORDS_FOR_JETPACK_SITES
import com.woocommerce.android.util.RemoteFeatureFlag.LOCAL_NOTIFICATION_1D_AFTER_FREE_TRIAL_EXPIRES
import com.woocommerce.android.util.RemoteFeatureFlag.LOCAL_NOTIFICATION_1D_BEFORE_FREE_TRIAL_EXPIRES
import com.woocommerce.android.util.RemoteFeatureFlag.LOCAL_NOTIFICATION_STORE_CREATION_READY
Expand All @@ -15,7 +16,8 @@ class IsRemoteFeatureFlagEnabled @Inject constructor(
LOCAL_NOTIFICATION_STORE_CREATION_READY,
LOCAL_NOTIFICATION_1D_BEFORE_FREE_TRIAL_EXPIRES,
LOCAL_NOTIFICATION_1D_AFTER_FREE_TRIAL_EXPIRES,
WOO_POS ->
WOO_POS,
APP_PASSWORDS_FOR_JETPACK_SITES ->
PackageUtils.isDebugBuild() ||
wpComRemoteFeatureFlagRepository.isRemoteFeatureFlagEnabled(featureFlag.remoteKey)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ enum class RemoteFeatureFlag(val remoteKey: String) {
LOCAL_NOTIFICATION_1D_BEFORE_FREE_TRIAL_EXPIRES("woo_notification_1d_before_free_trial_expires"),
LOCAL_NOTIFICATION_1D_AFTER_FREE_TRIAL_EXPIRES("woo_notification_1d_after_free_trial_expires"),
WOO_POS("woo_pos"),
APP_PASSWORDS_FOR_JETPACK_SITES("woo_app_passwords_for_jetpack_sites")
}
1 change: 1 addition & 0 deletions WooCommerce/src/main/res/layout/fragment_settings_beta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
android:id="@+id/jetpackAppPasswordsToggle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:toggleOptionDesc="@string/settings_enable_jetpack_app_passwords_message"
app:toggleOptionTitle="@string/settings_enable_jetpack_app_passwords_title" />

Expand Down