From 793547aea57ece49bfce9049908042ca01b76100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Wed, 15 Jan 2025 17:53:40 +0300 Subject: [PATCH 1/5] Remove shipping labels survey --- .../kotlin/com/woocommerce/android/AppUrls.kt | 2 - .../android/analytics/AnalyticsTracker.kt | 1 - .../android/model/FeatureFeedbackSettings.kt | 1 - .../ui/feedback/FeedbackSurveyFragment.kt | 2 - .../android/ui/feedback/SurveyType.kt | 2 - .../ui/orders/details/OrderDetailFragment.kt | 72 ------------------- .../ui/orders/details/OrderDetailViewState.kt | 3 - .../main/res/layout/fragment_order_detail.xml | 9 --- WooCommerce/src/main/res/values/strings.xml | 2 - 9 files changed, 94 deletions(-) diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/AppUrls.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/AppUrls.kt index 38ae2c52a45..15f8b0b18b0 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/AppUrls.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/AppUrls.kt @@ -35,8 +35,6 @@ object AppUrls { const val CROWDSIGNAL_MAIN_SURVEY = "https://automattic.survey.fm/woo-app-general-feedback-user-survey" const val CROWDSIGNAL_PRODUCT_SURVEY = "https://automattic.survey.fm/woo-app-feature-feedback-products" - const val CROWDSIGNAL_SHIPPING_LABELS_SURVEY = - "https://automattic.survey.fm/woo-app-feature-feedback-shipping-labels" const val CROWDSIGNAL_ANALYTICS_HUB_SURVEY = "https://automattic.survey.fm/woo-app-analytics-hub-production" diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsTracker.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsTracker.kt index e53b8b04a19..29b51c2ba5c 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsTracker.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsTracker.kt @@ -359,7 +359,6 @@ class AnalyticsTracker private constructor( const val VALUE_FEEDBACK_CANCELED = "canceled" const val VALUE_FEEDBACK_DISMISSED = "dismissed" const val VALUE_FEEDBACK_GIVEN = "gave_feedback" - const val VALUE_SHIPPING_LABELS_M4_FEEDBACK = "shipping_labels_m4" const val VALUE_PRODUCT_ADDONS_FEEDBACK = "product_addons" const val VALUE_ANALYTICS_HUB_FEEDBACK = "analytics_hub" const val VALUE_ORDER_SHIPPING_LINES_FEEDBACK = "order_shipping_lines" diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/model/FeatureFeedbackSettings.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/model/FeatureFeedbackSettings.kt index ceca0cae89d..f28cb7b1715 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/model/FeatureFeedbackSettings.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/model/FeatureFeedbackSettings.kt @@ -24,7 +24,6 @@ data class FeatureFeedbackSettings( } enum class Feature { - SHIPPING_LABEL_M4, PRODUCT_ADDONS, SIMPLE_PAYMENTS_AND_ORDER_CREATION, ANALYTICS_HUB, diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/FeedbackSurveyFragment.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/FeedbackSurveyFragment.kt index 0031d555228..2c298823492 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/FeedbackSurveyFragment.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/FeedbackSurveyFragment.kt @@ -24,7 +24,6 @@ import com.woocommerce.android.analytics.AnalyticsTracker.Companion.VALUE_FEEDBA import com.woocommerce.android.analytics.AnalyticsTracker.Companion.VALUE_FEEDBACK_STORE_SETUP_CONTEXT import com.woocommerce.android.analytics.AnalyticsTracker.Companion.VALUE_ORDER_SHIPPING_LINES_FEEDBACK import com.woocommerce.android.analytics.AnalyticsTracker.Companion.VALUE_PRODUCT_ADDONS_FEEDBACK -import com.woocommerce.android.analytics.AnalyticsTracker.Companion.VALUE_SHIPPING_LABELS_M4_FEEDBACK import com.woocommerce.android.analytics.AnalyticsTracker.Companion.VALUE_SIMPLE_PAYMENTS_FEEDBACK import com.woocommerce.android.databinding.FragmentFeedbackSurveyBinding import com.woocommerce.android.extensions.navigateSafely @@ -52,7 +51,6 @@ class FeedbackSurveyFragment : BaseFragment(R.layout.fragment_feedback_survey) { SurveyType.PRODUCT -> VALUE_FEEDBACK_PRODUCT_M3_CONTEXT SurveyType.STORE_ONBOARDING -> VALUE_FEEDBACK_STORE_SETUP_CONTEXT SurveyType.ORDER_CREATION -> VALUE_SIMPLE_PAYMENTS_FEEDBACK - SurveyType.SHIPPING_LABELS -> VALUE_SHIPPING_LABELS_M4_FEEDBACK SurveyType.ADDONS -> VALUE_PRODUCT_ADDONS_FEEDBACK SurveyType.ANALYTICS_HUB -> VALUE_ANALYTICS_HUB_FEEDBACK SurveyType.ORDER_SHIPPING_LINES -> VALUE_ORDER_SHIPPING_LINES_FEEDBACK diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/SurveyType.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/SurveyType.kt index 1215a8ea77f..61d3c96fc81 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/SurveyType.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/SurveyType.kt @@ -6,7 +6,6 @@ import com.woocommerce.android.BuildConfig @Suppress("MagicNumber") enum class SurveyType(private val untaggedUrl: String, private val milestone: Int? = null) { PRODUCT(AppUrls.CROWDSIGNAL_PRODUCT_SURVEY, 4), - SHIPPING_LABELS(AppUrls.CROWDSIGNAL_SHIPPING_LABELS_SURVEY, 4), ORDER_CREATION(AppUrls.ORDER_CREATION_SURVEY, 1), MAIN(AppUrls.CROWDSIGNAL_MAIN_SURVEY), ADDONS(AppUrls.ADDONS_SURVEY), @@ -20,7 +19,6 @@ enum class SurveyType(private val untaggedUrl: String, private val milestone: In private val milestoneTag get() = when (this) { PRODUCT -> "&product-milestone=$milestone" - SHIPPING_LABELS -> "&shipping_label_milestone=$milestone" else -> "" } diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/details/OrderDetailFragment.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/details/OrderDetailFragment.kt index ab95658e0ef..ff3f326aef2 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/details/OrderDetailFragment.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/details/OrderDetailFragment.kt @@ -29,10 +29,7 @@ import androidx.navigation.fragment.navArgs import androidx.transition.TransitionManager import com.google.android.material.snackbar.Snackbar import com.google.android.material.transition.MaterialContainerTransform -import com.woocommerce.android.FeedbackPrefs -import com.woocommerce.android.NavGraphMainDirections import com.woocommerce.android.R -import com.woocommerce.android.analytics.AnalyticsEvent.FEATURE_FEEDBACK_BANNER import com.woocommerce.android.analytics.AnalyticsEvent.ORDER_DETAIL_PRODUCT_TAPPED import com.woocommerce.android.analytics.AnalyticsTracker import com.woocommerce.android.analytics.AnalyticsTracker.Companion.KEY_ORDER_ID @@ -51,12 +48,6 @@ import com.woocommerce.android.extensions.show import com.woocommerce.android.extensions.takeIfNotEqualTo import com.woocommerce.android.extensions.whenNotNullNorEmpty import com.woocommerce.android.extensions.windowSizeClass -import com.woocommerce.android.model.FeatureFeedbackSettings -import com.woocommerce.android.model.FeatureFeedbackSettings.Feature.SHIPPING_LABEL_M4 -import com.woocommerce.android.model.FeatureFeedbackSettings.FeedbackState -import com.woocommerce.android.model.FeatureFeedbackSettings.FeedbackState.DISMISSED -import com.woocommerce.android.model.FeatureFeedbackSettings.FeedbackState.GIVEN -import com.woocommerce.android.model.FeatureFeedbackSettings.FeedbackState.UNANSWERED import com.woocommerce.android.model.GiftCardSummary import com.woocommerce.android.model.Order import com.woocommerce.android.model.Order.OrderStatus @@ -69,7 +60,6 @@ import com.woocommerce.android.tools.ProductImageMap import com.woocommerce.android.ui.base.BaseFragment import com.woocommerce.android.ui.base.UIMessageResolver import com.woocommerce.android.ui.compose.theme.WooThemeWithBackground -import com.woocommerce.android.ui.feedback.SurveyType import com.woocommerce.android.ui.main.AppBarStatus import com.woocommerce.android.ui.main.MainNavigationRouter import com.woocommerce.android.ui.orders.CustomAmountCard @@ -143,9 +133,6 @@ class OrderDetailFragment : @Inject lateinit var cardReaderManager: CardReaderManager - @Inject - lateinit var feedbackPrefs: FeedbackPrefs - private var _binding: FragmentOrderDetailBinding? = null private val binding get() = _binding!! @@ -160,10 +147,6 @@ class OrderDetailFragment : updateActivityTitle() } - private val feedbackState - get() = feedbackPrefs.getFeatureFeedbackSettings(SHIPPING_LABEL_M4)?.feedbackState - ?: UNANSWERED - override val activityAppBarStatus: AppBarStatus get() = AppBarStatus.Hidden @@ -409,9 +392,6 @@ class OrderDetailFragment : new.isProductListMenuVisible?.takeIfNotEqualTo(old?.isProductListMenuVisible) { showProductListMenuButton(it) } - new.isCreateShippingLabelBannerVisible.takeIfNotEqualTo(old?.isCreateShippingLabelBannerVisible) { - displayShippingLabelsWIPCard(it) - } new.isProductListVisible?.takeIfNotEqualTo(old?.isProductListVisible) { binding.orderDetailProductList.isVisible = it } @@ -827,58 +807,6 @@ class OrderDetailFragment : } } - private fun displayShippingLabelsWIPCard(show: Boolean) { - if (show && feedbackState != DISMISSED) { - binding.orderDetailShippingLabelsWipCard.isVisible = true - - binding.orderDetailShippingLabelsWipCard.initView( - getString(R.string.orderdetail_shipping_label_m2_wip_title), - getString(R.string.orderdetail_shipping_label_m3_wip_message), - onGiveFeedbackClick = { onGiveFeedbackClicked() }, - onDismissClick = { onDismissProductWIPNoticeCardClicked() } - ) - } else { - binding.orderDetailShippingLabelsWipCard.isVisible = false - } - } - - private fun onGiveFeedbackClicked() { - val context = AnalyticsTracker.VALUE_SHIPPING_LABELS_M4_FEEDBACK - - AnalyticsTracker.track( - FEATURE_FEEDBACK_BANNER, - mapOf( - AnalyticsTracker.KEY_FEEDBACK_CONTEXT to context, - AnalyticsTracker.KEY_FEEDBACK_ACTION to AnalyticsTracker.VALUE_FEEDBACK_GIVEN - ) - ) - registerFeedbackSetting(GIVEN) - NavGraphMainDirections - .actionGlobalFeedbackSurveyFragment(SurveyType.SHIPPING_LABELS) - .apply { findNavController().navigateSafely(this) } - } - - private fun onDismissProductWIPNoticeCardClicked() { - val context = AnalyticsTracker.VALUE_SHIPPING_LABELS_M4_FEEDBACK - - AnalyticsTracker.track( - FEATURE_FEEDBACK_BANNER, - mapOf( - AnalyticsTracker.KEY_FEEDBACK_CONTEXT to context, - AnalyticsTracker.KEY_FEEDBACK_ACTION to AnalyticsTracker.VALUE_FEEDBACK_DISMISSED - ) - ) - registerFeedbackSetting(DISMISSED) - displayShippingLabelsWIPCard(false) - } - - private fun registerFeedbackSetting(state: FeedbackState) { - FeatureFeedbackSettings( - SHIPPING_LABEL_M4, - state - ).registerItself(feedbackPrefs) - } - private fun displayUndoSnackbar( message: String, actionListener: View.OnClickListener, diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/details/OrderDetailViewState.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/details/OrderDetailViewState.kt index f9de62ac8e4..eb00cadcab3 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/details/OrderDetailViewState.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/details/OrderDetailViewState.kt @@ -29,9 +29,6 @@ data class OrderDetailViewState( false } - val isCreateShippingLabelBannerVisible: Boolean - get() = isCreateShippingLabelButtonVisible == true && isProductListVisible == true - @Parcelize data class OrderInfo( val order: Order? = null, diff --git a/WooCommerce/src/main/res/layout/fragment_order_detail.xml b/WooCommerce/src/main/res/layout/fragment_order_detail.xml index 9e0015ea764..303acbf75f3 100644 --- a/WooCommerce/src/main/res/layout/fragment_order_detail.xml +++ b/WooCommerce/src/main/res/layout/fragment_order_detail.xml @@ -54,15 +54,6 @@ android:orientation="vertical" tools:ignore="UselessParent"> - - - Remaining products Print shipping label Print shipping labels from your device! - Create shipping labels from your device!! We are working on making it easier for you to print shipping labels directly from you device! For now, if you have created shipping labels for this order in your store admin with WooCommerce Shipping, you can print them in your Order Details here. - You can now create shipping labels for all physical orders directly from your device with the free WooCommerce Shipping plugin. Tap on "Create shipping label" to try our beta feature! Create shipping label Learn more about creating labels with your mobile device Custom fields From e92235c0c4cdf81a3885cf5fcc53e3911e2ea553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Wed, 15 Jan 2025 18:09:39 +0300 Subject: [PATCH 2/5] Update RELEASE-NOTES --- RELEASE-NOTES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index d8082f0ddce..93f9b7ae3b1 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -5,6 +5,7 @@ ----- - [*] Fixes missing text in Blaze Campaigns card on larger display and font sizes [https://github.com/woocommerce/woocommerce-android/pull/13300] - [*] Puerto Rico is now available in the list of countries that are supported by in-person payments [https://github.com/woocommerce/woocommerce-android/pull/13200] +- [*] Removed an outdated feedback survey [https://github.com/woocommerce/woocommerce-android/pull/13319] 21.4 ----- From 70c5af30081fde8c3d67932c8430dfd3cf0d7452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Thu, 16 Jan 2025 11:21:27 +0300 Subject: [PATCH 3/5] Remove shipping labels survey from tests --- .../com/woocommerce/android/ui/feedback/SurveyTypeTest.kt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/feedback/SurveyTypeTest.kt b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/feedback/SurveyTypeTest.kt index da07cc1c456..d06cce4a417 100644 --- a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/feedback/SurveyTypeTest.kt +++ b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/feedback/SurveyTypeTest.kt @@ -3,7 +3,6 @@ package com.woocommerce.android.ui.feedback import com.woocommerce.android.BuildConfig import com.woocommerce.android.ui.feedback.SurveyType.MAIN import com.woocommerce.android.ui.feedback.SurveyType.PRODUCT -import com.woocommerce.android.ui.feedback.SurveyType.SHIPPING_LABELS import org.assertj.core.api.Assertions.assertThat import org.junit.Test @@ -20,11 +19,6 @@ class SurveyTypeTest { assertThat(PRODUCT.url.contains(Regex("product-milestone=$anyDigitAndNothingAfter"))).isTrue() } - @Test - fun `ShippingLabels SurveyType url should include a milestone tag`() { - assertThat(SHIPPING_LABELS.url.contains(Regex("shipping_label_milestone=$anyDigitAndNothingAfter"))).isTrue() - } - @Test fun `Main SurveyType url should NOT include a milestone tag`() { assertThat(MAIN.url.contains(Regex("milestone=$anyDigitAndNothingAfter"))).isFalse() From 1adf8b69c881fd38baf3676bb72f420e426266bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Thu, 16 Jan 2025 11:22:33 +0300 Subject: [PATCH 4/5] Fix IDE warnings in SurveyTypeTest --- .../woocommerce/android/ui/feedback/SurveyTypeTest.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/feedback/SurveyTypeTest.kt b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/feedback/SurveyTypeTest.kt index d06cce4a417..684654a9e86 100644 --- a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/feedback/SurveyTypeTest.kt +++ b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/feedback/SurveyTypeTest.kt @@ -9,29 +9,29 @@ import org.junit.Test class SurveyTypeTest { @Test fun `SurveyType url should include platform tag for any URL`() { - assertThat(SurveyType.values()).allSatisfy { + assertThat(SurveyType.entries.toTypedArray()).allSatisfy { assertThat(it.url.contains("woo-mobile-platform=android")).isTrue() } } @Test fun `Product SurveyType url should include a milestone tag`() { - assertThat(PRODUCT.url.contains(Regex("product-milestone=$anyDigitAndNothingAfter"))).isTrue() + assertThat(PRODUCT.url.contains(Regex("product-milestone=$ANY_DIGIT_AND_NOTHING_AFTER"))).isTrue() } @Test fun `Main SurveyType url should NOT include a milestone tag`() { - assertThat(MAIN.url.contains(Regex("milestone=$anyDigitAndNothingAfter"))).isFalse() + assertThat(MAIN.url.contains(Regex("milestone=$ANY_DIGIT_AND_NOTHING_AFTER"))).isFalse() } @Test fun `SurveyType url should include app version form tag for any URL`() { - assertThat(SurveyType.values()).allSatisfy { + assertThat(SurveyType.entries.toTypedArray()).allSatisfy { assertThat(it.url.contains("app-version=${BuildConfig.VERSION_NAME}")).isTrue() } } companion object { - const val anyDigitAndNothingAfter = "\\d(?!\\S)" + const val ANY_DIGIT_AND_NOTHING_AFTER = "\\d(?!\\S)" } } From 10fd03304e5a730521a9f38b80841c9a7e235363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Thu, 16 Jan 2025 15:07:58 +0300 Subject: [PATCH 5/5] Update RELEASE-NOTES.txt --- RELEASE-NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 93f9b7ae3b1..e3205e3eade 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -5,7 +5,7 @@ ----- - [*] Fixes missing text in Blaze Campaigns card on larger display and font sizes [https://github.com/woocommerce/woocommerce-android/pull/13300] - [*] Puerto Rico is now available in the list of countries that are supported by in-person payments [https://github.com/woocommerce/woocommerce-android/pull/13200] -- [*] Removed an outdated feedback survey [https://github.com/woocommerce/woocommerce-android/pull/13319] +- [*] Removed the outdated feedback survey for shipping labels [https://github.com/woocommerce/woocommerce-android/pull/13319] 21.4 -----