Skip to content

Commit 7125053

Browse files
authored
Merge pull request #7680 from woocommerce/issue/7605-remove-bgProductImageUpload-feature-flag
Remove `backgroundProductImageUpload` feature flag
2 parents 63a3e84 + 6f968cd commit 7125053

22 files changed

+179
-483
lines changed

Experiments/Experiments/DefaultFeatureFlagService.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
77
switch featureFlag {
88
case .barcodeScanner:
99
return buildConfig == .localDeveloper || buildConfig == .alpha
10-
case .couponView:
11-
return true
1210
case .productSKUInputScanner:
1311
return true
1412
case .inbox:
@@ -17,18 +15,10 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
1715
return buildConfig == .localDeveloper || buildConfig == .alpha
1816
case .splitViewInOrdersTab:
1917
return buildConfig == .localDeveloper || buildConfig == .alpha
20-
case .couponDeletion:
21-
return true
22-
case .couponEditing:
23-
return true
24-
case .couponCreation:
25-
return true
2618
case .updateOrderOptimistically:
2719
return buildConfig == .localDeveloper || buildConfig == .alpha
2820
case .shippingLabelsOnboardingM1:
2921
return buildConfig == .localDeveloper || buildConfig == .alpha
30-
case .backgroundProductImageUpload:
31-
return true
3222
case .appleIDAccountDeletion:
3323
return true
3424
case .newToWooCommerceLinkInLoginPrologue:

Experiments/Experiments/FeatureFlag.swift

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ public enum FeatureFlag: Int {
1414
///
1515
case reviews
1616

17-
/// Displays the option to view coupons
18-
///
19-
case couponView
20-
2117
/// Barcode scanner for product SKU input
2218
///
2319
case productSKUInputScanner
@@ -34,18 +30,6 @@ public enum FeatureFlag: Int {
3430
///
3531
case splitViewInOrdersTab
3632

37-
/// Displays the option to delete coupons
38-
///
39-
case couponDeletion
40-
41-
/// Displays the option to edit a coupon
42-
///
43-
case couponEditing
44-
45-
/// Displays the option to create a coupon
46-
///
47-
case couponCreation
48-
4933
/// Enable optimistic updates for orders
5034
///
5135
case updateOrderOptimistically
@@ -54,10 +38,6 @@ public enum FeatureFlag: Int {
5438
///
5539
case shippingLabelsOnboardingM1
5640

57-
/// Enable image upload after leaving the product form
58-
///
59-
case backgroundProductImageUpload
60-
6141
/// Enable IPP reader manuals consolidation screen
6242
///
6343
case consolidatedCardReaderManuals

WooCommerce/Classes/ServiceLocator/LegacyProductImageUploader.swift

Lines changed: 0 additions & 37 deletions
This file was deleted.

WooCommerce/Classes/ServiceLocator/ServiceLocator.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ final class ServiceLocator {
3838

3939
/// Product image uploader
4040
///
41-
private static var _productImageUploader: ProductImageUploaderProtocol =
42-
featureFlagService.isFeatureFlagEnabled(.backgroundProductImageUpload) ? ProductImageUploader(): LegacyProductImageUploader()
41+
private static var _productImageUploader: ProductImageUploaderProtocol = ProductImageUploader()
4342

4443
/// Push Notifications Manager
4544
///

WooCommerce/Classes/ViewRelated/Coupons/CouponDetails/CouponDetails.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,11 @@ struct CouponDetails: View {
8686
])
8787
}
8888

89-
if viewModel.isDeletingEnabled {
90-
buttons.append(.destructive(Text(Localization.deleteCoupon), action: {
91-
ServiceLocator.analytics.track(.couponDetails, withProperties: ["action": "tapped_delete"])
92-
showingDeletionConfirmAlert = true
93-
}))
94-
}
89+
buttons.append(.destructive(Text(Localization.deleteCoupon), action: {
90+
ServiceLocator.analytics.track(.couponDetails, withProperties: ["action": "tapped_delete"])
91+
showingDeletionConfirmAlert = true
92+
}))
93+
9594

9695
buttons.append(.cancel())
9796

WooCommerce/Classes/ViewRelated/Coupons/CouponDetails/CouponDetailsViewModel.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ final class CouponDetailsViewModel: ObservableObject {
128128
private let currencySettings: CurrencySettings
129129

130130
let isEditingEnabled: Bool
131-
let isDeletingEnabled: Bool
132131

133132
// Closure to be triggered when the coupon is updated successfully
134133
let onUpdate: () -> Void
@@ -149,8 +148,7 @@ final class CouponDetailsViewModel: ObservableObject {
149148
self.onDeletion = onDeletion
150149
self.onUpdate = onUpdate
151150

152-
isEditingEnabled = featureFlags.isFeatureFlagEnabled(.couponEditing) && coupon.discountType != .other
153-
isDeletingEnabled = featureFlags.isFeatureFlagEnabled(.couponDeletion)
151+
isEditingEnabled = coupon.discountType != .other
154152
populateDetails()
155153
}
156154

WooCommerce/Classes/ViewRelated/Coupons/CouponListViewController.swift

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,9 @@ private extension CouponListViewController {
253253

254254
func configureNavigationBarItems(hasCoupons: Bool) {
255255
if hasCoupons {
256-
navigationItem.rightBarButtonItems = viewModel.isCreationEnabled
257-
? [createCouponButtonItem, searchBarButtonItem]
258-
: [searchBarButtonItem]
256+
navigationItem.rightBarButtonItems = [createCouponButtonItem, searchBarButtonItem]
259257
} else {
260-
navigationItem.rightBarButtonItems = viewModel.isCreationEnabled
261-
? [createCouponButtonItem]
262-
: []
258+
navigationItem.rightBarButtonItems = [createCouponButtonItem]
263259
}
264260
}
265261

@@ -382,21 +378,14 @@ private extension CouponListViewController {
382378
}
383379

384380
func buildNoResultConfig() -> EmptyStateViewController.Config {
385-
if viewModel.isCreationEnabled {
386-
return .withButton(
387-
message: .init(string: Localization.couponCreationSuggestionMessage),
388-
image: .emptyCouponsImage,
389-
details: Localization.emptyStateDetails,
390-
buttonTitle: Localization.createCouponAction
391-
) { [weak self] button in
392-
guard let self = self else { return }
393-
self.displayCouponTypeBottomSheet()
394-
}
395-
} else {
396-
return .simple(
397-
message: .init(string: Localization.emptyStateMessage),
398-
image: .emptyCouponsImage
399-
)
381+
return .withButton(
382+
message: .init(string: Localization.couponCreationSuggestionMessage),
383+
image: .emptyCouponsImage,
384+
details: Localization.emptyStateDetails,
385+
buttonTitle: Localization.createCouponAction
386+
) { [weak self] button in
387+
guard let self = self else { return }
388+
self.displayCouponTypeBottomSheet()
400389
}
401390
}
402391

WooCommerce/Classes/ViewRelated/Coupons/CouponListViewModel.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ final class CouponListViewModel {
6161
///
6262
private let storageManager: StorageManagerType
6363

64-
/// Marks if the Coupon Creation feature is enabled or not
65-
let isCreationEnabled: Bool
66-
6764
// MARK: - Initialization and setup
6865
//
6966
init(siteID: Int64,
@@ -78,7 +75,6 @@ final class CouponListViewModel {
7875
self.resultsController = Self.createResultsController(siteID: siteID,
7976
storageManager: storageManager)
8077

81-
isCreationEnabled = featureFlags.isFeatureFlagEnabled(.couponCreation)
8278
configureSyncingCoordinator()
8379
configureResultsController()
8480
configureFeedbackBannerVisibility()

WooCommerce/Classes/ViewRelated/Dashboard/Settings/Beta features/BetaFeaturesViewController.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ private extension BetaFeaturesViewController {
9494
}
9595

9696
func couponManagementSection() -> Section? {
97-
guard ServiceLocator.featureFlagService.isFeatureFlagEnabled(.couponView) else {
98-
return nil
99-
}
100-
return Section(rows: [.couponManagement,
101-
.couponManagementDescription])
97+
Section(rows: [.couponManagement, .couponManagementDescription])
10298
}
10399

104100
/// Register table cells.

WooCommerce/Classes/ViewRelated/MainTabBarController.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,6 @@ private extension MainTabBarController {
571571

572572
private extension MainTabBarController {
573573
func observeProductImageUploadStatusUpdates() {
574-
guard featureFlagService.isFeatureFlagEnabled(.backgroundProductImageUpload) else {
575-
return
576-
}
577574
productImageUploadErrorsSubscription = productImageUploader.errors.sink { [weak self] error in
578575
guard let self = self else { return }
579576
switch error.error {

0 commit comments

Comments
 (0)