From cef027de90d01be94d305b6f0df2bc529c712513 Mon Sep 17 00:00:00 2001 From: Irfan Omur Date: Sun, 3 Mar 2024 12:21:21 +0300 Subject: [PATCH 1/2] Remove usage of `InAppReviewsFeatureConfig` --- .../org/wordpress/android/ui/review/ReviewViewModel.kt | 8 ++------ .../wordpress/android/ui/review/ReviewViewModelTest.kt | 7 +------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/review/ReviewViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/review/ReviewViewModel.kt index 579f97bc187f..c54010baac66 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/review/ReviewViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/review/ReviewViewModel.kt @@ -5,19 +5,15 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import org.wordpress.android.ui.prefs.AppPrefsWrapper -import org.wordpress.android.util.config.InAppReviewsFeatureConfig import org.wordpress.android.viewmodel.Event import javax.inject.Inject -class ReviewViewModel @Inject constructor( - private val appPrefsWrapper: AppPrefsWrapper, - private val inAppReviewsFeatureConfig: InAppReviewsFeatureConfig -) : ViewModel() { +class ReviewViewModel @Inject constructor(private val appPrefsWrapper: AppPrefsWrapper) : ViewModel() { private val _launchReview = MutableLiveData>() val launchReview = _launchReview as LiveData> fun onPublishingPost(isFirstTimePublishing: Boolean) { - if (inAppReviewsFeatureConfig.isEnabled() && !appPrefsWrapper.isInAppReviewsShown() && isFirstTimePublishing) { + if (!appPrefsWrapper.isInAppReviewsShown() && isFirstTimePublishing) { if (appPrefsWrapper.getPublishedPostCount() < TARGET_COUNT_POST_PUBLISHED) { appPrefsWrapper.incrementPublishedPostCount() } diff --git a/WordPress/src/test/java/org/wordpress/android/ui/review/ReviewViewModelTest.kt b/WordPress/src/test/java/org/wordpress/android/ui/review/ReviewViewModelTest.kt index be459d325fe5..dc83739ec55d 100644 --- a/WordPress/src/test/java/org/wordpress/android/ui/review/ReviewViewModelTest.kt +++ b/WordPress/src/test/java/org/wordpress/android/ui/review/ReviewViewModelTest.kt @@ -10,7 +10,6 @@ import org.mockito.junit.MockitoJUnitRunner import org.mockito.kotlin.whenever import org.wordpress.android.eventToList import org.wordpress.android.ui.prefs.AppPrefsWrapper -import org.wordpress.android.util.config.InAppReviewsFeatureConfig import kotlin.test.assertEquals @RunWith(MockitoJUnitRunner::class) @@ -19,9 +18,6 @@ class ReviewViewModelTest { @JvmField val rule = InstantTaskExecutorRule() - @Mock - lateinit var inAppReviewsFeatureConfig: InAppReviewsFeatureConfig - @Mock lateinit var appPrefsWrapper: AppPrefsWrapper @@ -31,8 +27,7 @@ class ReviewViewModelTest { @Before fun setup() { - whenever(inAppReviewsFeatureConfig.isEnabled()).thenReturn(true) - viewModel = ReviewViewModel(appPrefsWrapper, inAppReviewsFeatureConfig) + viewModel = ReviewViewModel(appPrefsWrapper) events = mutableListOf() events = viewModel.launchReview.eventToList() } From 75b8d0672392067a0308566136f272ac104a4401 Mon Sep 17 00:00:00 2001 From: Irfan Omur Date: Sun, 3 Mar 2024 12:22:14 +0300 Subject: [PATCH 2/2] Remove feature config for in app reviews --- WordPress/build.gradle | 1 - .../util/config/InAppReviewsFeatureConfig.kt | 16 ---------------- 2 files changed, 17 deletions(-) delete mode 100644 WordPress/src/main/java/org/wordpress/android/util/config/InAppReviewsFeatureConfig.kt diff --git a/WordPress/build.gradle b/WordPress/build.gradle index 1a7c673ac696..16814e20780e 100644 --- a/WordPress/build.gradle +++ b/WordPress/build.gradle @@ -142,7 +142,6 @@ android { buildConfigField "boolean", "PLANS_IN_SITE_CREATION", "false" buildConfigField "boolean", "READER_IMPROVEMENTS", "false" buildConfigField "boolean", "BLOGANUARY_DASHBOARD_NUDGE", "false" - buildConfigField "boolean", "IN_APP_REVIEWS", "false" buildConfigField "boolean", "DYNAMIC_DASHBOARD_CARDS", "false" buildConfigField "boolean", "STATS_TRAFFIC_TAB", "false" diff --git a/WordPress/src/main/java/org/wordpress/android/util/config/InAppReviewsFeatureConfig.kt b/WordPress/src/main/java/org/wordpress/android/util/config/InAppReviewsFeatureConfig.kt deleted file mode 100644 index 9bb5777f063d..000000000000 --- a/WordPress/src/main/java/org/wordpress/android/util/config/InAppReviewsFeatureConfig.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.wordpress.android.util.config - -import org.wordpress.android.BuildConfig -import org.wordpress.android.annotation.Feature -import javax.inject.Inject - -private const val IN_APP_REVIEWS_REMOTE_FIELD = "in_app_reviews" - -@Feature(IN_APP_REVIEWS_REMOTE_FIELD, false) -class InAppReviewsFeatureConfig @Inject constructor( - appConfig: AppConfig -) : FeatureConfig( - appConfig, - BuildConfig.IN_APP_REVIEWS, - IN_APP_REVIEWS_REMOTE_FIELD -)