Skip to content

Commit

Permalink
Merge pull request #13319 from woocommerce/remove-shipping-labels-survey
Browse files Browse the repository at this point in the history
Remove shipping labels survey
  • Loading branch information
JorgeMucientes authored Jan 16, 2025
2 parents 696e505 + 10fd033 commit c34c16b
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 105 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 the outdated feedback survey for shipping labels [https://github.com/woocommerce/woocommerce-android/pull/13319]

21.4
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ data class FeatureFeedbackSettings(
}

enum class Feature {
SHIPPING_LABEL_M4,
PRODUCT_ADDONS,
SIMPLE_PAYMENTS_AND_ORDER_CREATION,
ANALYTICS_HUB,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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 -> ""
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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!!

Expand All @@ -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

Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ data class OrderDetailViewState(
false
}

val isCreateShippingLabelBannerVisible: Boolean
get() = isCreateShippingLabelButtonVisible == true && isProductListVisible == true

@Parcelize
data class OrderInfo(
val order: Order? = null,
Expand Down
9 changes: 0 additions & 9 deletions WooCommerce/src/main/res/layout/fragment_order_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@
android:orientation="vertical"
tools:ignore="UselessParent">

<!-- Shipping Labels work in progress notice card -->
<com.woocommerce.android.ui.products.FeatureWIPNoticeCard
android:id="@+id/orderDetail_shippingLabelsWipCard"
style="@style/Woo.Card.Expandable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
tools:visibility="visible" />

<!-- Order Status -->
<com.woocommerce.android.ui.orders.details.views.OrderDetailOrderStatusView
android:id="@+id/orderDetail_orderStatus"
Expand Down
2 changes: 0 additions & 2 deletions WooCommerce/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1007,9 +1007,7 @@
<string name="orderdetail_shipping_label_unpackaged_products_header">Remaining products</string>
<string name="orderdetail_shipping_label_print">Print shipping label</string>
<string name="orderdetail_shipping_label_wip_title">Print shipping labels from your device!</string>
<string name="orderdetail_shipping_label_m2_wip_title">Create shipping labels from your device!!</string>
<string name="orderdetail_shipping_label_wip_message">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.</string>
<string name="orderdetail_shipping_label_m3_wip_message">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!</string>
<string name="orderdetail_shipping_label_create_shipping_label">Create shipping label</string>
<string name="orderdetail_shipping_label_notice">Learn more about creating labels with your mobile device</string>
<string name="orderdetail_custom_fields">Custom fields</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,35 @@ 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

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()
}

@Test
fun `ShippingLabels SurveyType url should include a milestone tag`() {
assertThat(SHIPPING_LABELS.url.contains(Regex("shipping_label_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)"
}
}

0 comments on commit c34c16b

Please sign in to comment.