Skip to content

Commit e61e97c

Browse files
authored
Merge pull request #8294 from woocommerce/issue/8292-release-products-onboarding-features
[Products Onboarding] Release onboarding banner and product templates
2 parents 0de8555 + fafcf64 commit e61e97c

File tree

5 files changed

+5
-26
lines changed

5 files changed

+5
-26
lines changed

Experiments/Experiments/ABTest.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ public enum ABTest: String, CaseIterable {
2525
///
2626
case nativeJetpackSetupFlow = "woocommerceios_login_jetpack_setup_flow_v2"
2727

28-
/// A/B test for the Products Onboarding banner on the My Store dashboard.
29-
/// Experiment ref: pbxNRc-26F-p2
30-
case productsOnboardingBanner = "woocommerceios_products_onboarding_first_product_banner"
31-
32-
/// A/B test for the Products Onboarding product creation type bottom sheet after tapping the "Add Product" CTA.
33-
/// Experiment ref: pbxNRc-28r-p2
34-
case productsOnboardingTemplateProducts = "woocommerceios_products_onboarding_template_products"
35-
3628
/// Returns a variation for the given experiment
3729
public var variation: Variation {
3830
ExPlat.shared?.experiment(rawValue) ?? .control
@@ -43,7 +35,7 @@ public enum ABTest: String, CaseIterable {
4335
/// When adding a new experiment, add it to the appropriate case depending on its context (logged-in or logged-out experience).
4436
public var context: ExperimentContext {
4537
switch self {
46-
case .aaTestLoggedIn, .productsOnboardingBanner, .productsOnboardingTemplateProducts, .nativeJetpackSetupFlow:
38+
case .aaTestLoggedIn, .nativeJetpackSetupFlow:
4739
return .loggedIn
4840
case .aaTestLoggedOut, .abTestLoginWithWPComOnly:
4941
return .loggedOut

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- [*] Account deletion is now supported for all users in settings or in the empty stores screen (in the ellipsis menu). [https://github.com/woocommerce/woocommerce-ios/pull/8179, https://github.com/woocommerce/woocommerce-ios/pull/8272]
66
- [*] In-Person Payments: We removed any references to Simple Payments from Orders, and the red badge from the Menu tab and Menu Payments icon announcing the new Payments section. [https://github.com/woocommerce/woocommerce-ios/pull/8183]
77
- [internal] Store creation flow was improved with native implementation. It is available from the login prologue (`Get Started` CTA), login email error screen, and store picker (`Add a store` CTA from the empty stores screen or at the bottom of the store list). [Example testing steps in https://github.com/woocommerce/woocommerce-ios/pull/8251]
8+
- [internal] New stores have two new Products onboarding features: A banner with an `Add a Product` CTA on the My Store screen, and the option to add new products using templates. [https://github.com/woocommerce/woocommerce-ios/pull/8294]
89

910
11.4
1011
-----

WooCommerce/Classes/ViewRelated/Dashboard/DashboardViewModel.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Combine
33
import enum Networking.DotcomError
44
import enum Storage.StatsVersion
55
import protocol Experiments.FeatureFlagService
6-
import enum Experiments.ABTest
76

87
/// Syncs data for dashboard stats UI and determines the state of the dashboard UI based on stats version.
98
final class DashboardViewModel {
@@ -147,14 +146,9 @@ final class DashboardViewModel {
147146
stores.dispatch(action)
148147
}
149148

150-
/// Sets the view model for the products onboarding banner if the user hasn't dismissed it before,
151-
/// and if the user is part of the treatment group for the products onboarding A/B test.
149+
/// Sets the view model for the products onboarding banner if the user hasn't dismissed it before.
152150
///
153151
private func setProductsOnboardingBannerIfNeeded() {
154-
guard ABTest.productsOnboardingBanner.variation == .treatment(nil) else {
155-
return
156-
}
157-
158152
let getVisibility = AppSettingsAction.getFeatureAnnouncementVisibility(campaign: .productsOnboarding) { [weak self] result in
159153
guard let self else { return }
160154
if case let .success(isVisible) = result, isVisible {

WooCommerce/Classes/ViewRelated/Products/Add Product/AddProductCoordinator.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Yosemite
33
import WooFoundation
44
import protocol Storage.StorageManagerType
55
import class Networking.ProductsRemote
6-
import enum Experiments.ABTest
76

87
/// Controls navigation for the flow to add a product given a navigation controller.
98
/// This class is not meant to be retained so that its life cycle is throughout the navigation. Example usage:
@@ -18,7 +17,6 @@ final class AddProductCoordinator: Coordinator {
1817
private let sourceBarButtonItem: UIBarButtonItem?
1918
private let sourceView: UIView?
2019
private let productImageUploader: ProductImageUploaderProtocol
21-
private let isProductCreationTypeEnabled: Bool
2220
private let storage: StorageManagerType
2321

2422
/// ResultController to to track the current product count.
@@ -37,30 +35,26 @@ final class AddProductCoordinator: Coordinator {
3735
init(siteID: Int64,
3836
sourceBarButtonItem: UIBarButtonItem,
3937
sourceNavigationController: UINavigationController,
40-
isProductCreationTypeEnabled: Bool = ABTest.productsOnboardingTemplateProducts.variation == .treatment(nil),
4138
storage: StorageManagerType = ServiceLocator.storageManager,
4239
productImageUploader: ProductImageUploaderProtocol = ServiceLocator.productImageUploader) {
4340
self.siteID = siteID
4441
self.sourceBarButtonItem = sourceBarButtonItem
4542
self.sourceView = nil
4643
self.navigationController = sourceNavigationController
4744
self.productImageUploader = productImageUploader
48-
self.isProductCreationTypeEnabled = isProductCreationTypeEnabled
4945
self.storage = storage
5046
}
5147

5248
init(siteID: Int64,
5349
sourceView: UIView,
5450
sourceNavigationController: UINavigationController,
55-
isProductCreationTypeEnabled: Bool = ABTest.productsOnboardingTemplateProducts.variation == .treatment(nil),
5651
storage: StorageManagerType = ServiceLocator.storageManager,
5752
productImageUploader: ProductImageUploaderProtocol = ServiceLocator.productImageUploader) {
5853
self.siteID = siteID
5954
self.sourceBarButtonItem = nil
6055
self.sourceView = sourceView
6156
self.navigationController = sourceNavigationController
6257
self.productImageUploader = productImageUploader
63-
self.isProductCreationTypeEnabled = isProductCreationTypeEnabled
6458
self.storage = storage
6559
}
6660

@@ -84,10 +78,10 @@ final class AddProductCoordinator: Coordinator {
8478
private extension AddProductCoordinator {
8579

8680
/// Defines if the product creation bottom sheet should be presented.
87-
/// Currently returns `true` when the feature is enabled and the store is eligible for displaying template options.
81+
/// Currently returns `true` when the store is eligible for displaying template options.
8882
///
8983
func shouldPresentProductCreationBottomSheet() -> Bool {
90-
isProductCreationTypeEnabled && isTemplateOptionsEligible()
84+
isTemplateOptionsEligible()
9185
}
9286

9387
/// Returns `true` when the number of products is fewer than 3.

WooCommerce/WooCommerceTests/ViewRelated/Dashboard/DashboardViewModelTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ final class DashboardViewModelTests: XCTestCase {
9191

9292
func test_products_onboarding_announcements_take_precedence() {
9393
// Given
94-
MockABTesting.setVariation(.treatment(nil), for: .productsOnboardingBanner)
9594
stores.whenReceivingAction(ofType: ProductAction.self) { action in
9695
switch action {
9796
case let .checkProductsOnboardingEligibility(_, completion):
@@ -127,7 +126,6 @@ final class DashboardViewModelTests: XCTestCase {
127126

128127
func test_onboarding_announcement_not_displayed_when_previously_dismissed() {
129128
// Given
130-
MockABTesting.setVariation(.treatment(nil), for: .productsOnboardingBanner)
131129
stores.whenReceivingAction(ofType: ProductAction.self) { action in
132130
switch action {
133131
case let .checkProductsOnboardingEligibility(_, completion):

0 commit comments

Comments
 (0)