Skip to content

Commit 8f835ad

Browse files
authored
Merge pull request #7532 from woocommerce/issue/remove-uoe-feature-flag
[UOE] Remove feature flag
2 parents f471bbf + 3416938 commit 8f835ad

File tree

5 files changed

+10
-85
lines changed

5 files changed

+10
-85
lines changed

Experiments/Experiments/DefaultFeatureFlagService.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
3737
return buildConfig == .localDeveloper || buildConfig == .alpha
3838
case .inPersonPaymentGatewaySelection:
3939
return true
40-
case .unifiedOrderEditing:
41-
return true
4240
case .backgroundProductImageUpload:
4341
return true
4442
case .appleIDAccountDeletion:

Experiments/Experiments/FeatureFlag.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ public enum FeatureFlag: Int {
7474
///
7575
case inPersonPaymentGatewaySelection
7676

77-
/// Enable order editing from the order detailed screen.
78-
///
79-
case unifiedOrderEditing
80-
8177
/// Enable image upload after leaving the product form
8278
///
8379
case backgroundProductImageUpload

WooCommerce/Classes/ViewModels/Order Details/OrderDetailsDataSource.swift

Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -458,22 +458,12 @@ private extension OrderDetailsDataSource {
458458
cell.selectionStyle = .none
459459
if customerNote.isNotEmpty {
460460
cell.body = customerNote.quoted
461-
cell.onEditTapped = { [weak self] in
462-
self?.onCellAction?(.editCustomerNote, nil)
463-
}
464461
} else {
465462
cell.body = nil
466-
cell.onAddTapped = { [weak self] in
467-
self?.onCellAction?(.editCustomerNote, nil)
468-
}
469-
}
470-
471-
// TODO: Before releasing the feature, please the delete closures assignation above.
472-
if ServiceLocator.featureFlagService.isFeatureFlagEnabled(FeatureFlag.unifiedOrderEditing) {
473-
cell.onEditTapped = nil
474-
cell.onAddTapped = nil
475463
}
476464

465+
cell.onEditTapped = nil
466+
cell.onAddTapped = nil
477467
cell.addButtonTitle = NSLocalizedString("Add Customer Note", comment: "Title for the button to add the Customer Provided Note in Order Details")
478468
cell.editButtonAccessibilityLabel = NSLocalizedString(
479469
"Update Note",
@@ -900,22 +890,12 @@ private extension OrderDetailsDataSource {
900890

901891
if let formattedPostalAddress = shippingAddress?.formattedPostalAddress {
902892
cell.address = formattedPostalAddress
903-
cell.onEditTapped = { [weak self] in
904-
self?.onCellAction?(.editShippingAddress, nil)
905-
}
906893
} else {
907894
cell.address = nil
908-
cell.onAddTapped = { [weak self] in
909-
self?.onCellAction?(.editShippingAddress, nil)
910-
}
911-
}
912-
913-
// TODO: Before releasing the feature, please the delete closures assignation above.
914-
if ServiceLocator.featureFlagService.isFeatureFlagEnabled(FeatureFlag.unifiedOrderEditing) {
915-
cell.onEditTapped = nil
916-
cell.onAddTapped = nil
917895
}
918896

897+
cell.onEditTapped = nil
898+
cell.onAddTapped = nil
919899
cell.addButtonTitle = NSLocalizedString("Add Shipping Address", comment: "Title for the button to add the Shipping Address in Order Details")
920900
cell.editButtonAccessibilityLabel = NSLocalizedString(
921901
"Update Address",
@@ -1114,34 +1094,14 @@ extension OrderDetailsDataSource {
11141094
let customerInformation: Section? = {
11151095
var rows: [Row] = []
11161096

1117-
let isUnifiedEditingEnabled = ServiceLocator.featureFlagService.isFeatureFlagEnabled(FeatureFlag.unifiedOrderEditing)
1118-
11191097
/// Customer Note
1120-
if isUnifiedEditingEnabled {
1121-
if order.customerNote?.isNotEmpty == true {
1122-
/// When inside `.unifiedOrderEditing` only show the note if there is content for it.
1123-
rows.append(.customerNote)
1124-
}
1125-
} else {
1126-
/// Always visible to allow editing.
1098+
if order.customerNote?.isNotEmpty == true {
11271099
rows.append(.customerNote)
11281100
}
11291101

1130-
let orderContainsOnlyVirtualProducts = self.products.filter { (product) -> Bool in
1131-
return items.first(where: { $0.productID == product.productID}) != nil
1132-
}.allSatisfy { $0.virtual == true }
1133-
11341102
/// Shipping Address
1135-
if isUnifiedEditingEnabled {
1136-
/// When inside `.unifiedOrderEditing` only show the billing address if there is content for it.
1137-
if order.shippingAddress?.isEmpty == false {
1138-
rows.append(.shippingAddress)
1139-
}
1140-
} else {
1141-
/// Almost always visible to allow editing.
1142-
if order.shippingAddress != nil && orderContainsOnlyVirtualProducts == false {
1143-
rows.append(.shippingAddress)
1144-
}
1103+
if order.shippingAddress?.isEmpty == false {
1104+
rows.append(.shippingAddress)
11451105
}
11461106

11471107
/// Shipping Lines
@@ -1150,13 +1110,7 @@ extension OrderDetailsDataSource {
11501110
}
11511111

11521112
/// Billing Address
1153-
if isUnifiedEditingEnabled {
1154-
/// When inside `.unifiedOrderEditing` only show the billing address if there is content for it.
1155-
if order.billingAddress?.isEmpty == false {
1156-
rows.append(.billingDetail)
1157-
}
1158-
} else {
1159-
/// Always visible to allow editing.
1113+
if order.billingAddress?.isEmpty == false {
11601114
rows.append(.billingDetail)
11611115
}
11621116

@@ -1645,8 +1599,6 @@ extension OrderDetailsDataSource {
16451599
case createShippingLabel
16461600
case shippingLabelTrackingMenu(shippingLabel: ShippingLabel, sourceView: UIView)
16471601
case viewAddOns(addOns: [OrderItemAttribute])
1648-
case editCustomerNote
1649-
case editShippingAddress
16501602
}
16511603

16521604
enum Constants {

WooCommerce/Classes/ViewModels/Order Details/OrderDetailsViewModel.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,7 @@ extension OrderDetailsViewModel {
393393
viewController.show(productListVC, sender: nil)
394394
case .billingDetail:
395395
ServiceLocator.analytics.track(.orderDetailShowBillingTapped)
396-
let isUnifiedEditingEnabled = ServiceLocator.featureFlagService.isFeatureFlagEnabled(FeatureFlag.unifiedOrderEditing)
397-
let billingInformationViewController = BillingInformationViewController(order: order, editingEnabled: !isUnifiedEditingEnabled)
396+
let billingInformationViewController = BillingInformationViewController(order: order, editingEnabled: false)
398397
viewController.navigationController?.pushViewController(billingInformationViewController, animated: true)
399398
case .customFields:
400399
ServiceLocator.analytics.track(.orderViewCustomFieldsTapped)

WooCommerce/Classes/ViewRelated/Orders/Order Details/OrderDetailsViewController.swift

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ private extension OrderDetailsViewController {
142142
action: #selector(editOrder))
143143
editButton.accessibilityIdentifier = "order-details-edit-button"
144144
editButton.isEnabled = viewModel.editButtonIsEnabled
145-
if ServiceLocator.featureFlagService.isFeatureFlagEnabled(FeatureFlag.unifiedOrderEditing) {
146-
navigationItem.rightBarButtonItem = editButton
147-
}
145+
navigationItem.rightBarButtonItem = editButton
148146
}
149147

150148
/// Setup: EntityListener
@@ -388,10 +386,6 @@ private extension OrderDetailsViewController {
388386
shippingLabelTrackingMoreMenuTapped(shippingLabel: shippingLabel, sourceView: sourceView)
389387
case let .viewAddOns(addOns):
390388
itemAddOnsButtonTapped(addOns: addOns)
391-
case .editCustomerNote:
392-
editCustomerNoteTapped()
393-
case .editShippingAddress:
394-
editShippingAddressTapped()
395389
}
396390
}
397391

@@ -548,20 +542,6 @@ private extension OrderDetailsViewController {
548542
present(actionSheet, animated: true)
549543
}
550544

551-
func editCustomerNoteTapped() {
552-
let editNoteViewController = EditCustomerNoteHostingController(viewModel: viewModel.editNoteViewModel)
553-
present(editNoteViewController, animated: true)
554-
555-
ServiceLocator.analytics.track(event: WooAnalyticsEvent.OrderDetailsEdit.orderDetailEditFlowStarted(subject: .customerNote))
556-
}
557-
558-
func editShippingAddressTapped() {
559-
let viewModel = EditOrderAddressFormViewModel(order: viewModel.order, type: .shipping)
560-
let editAddressViewController = EditOrderAddressHostingController(viewModel: viewModel)
561-
let navigationController = WooNavigationController(rootViewController: editAddressViewController)
562-
present(navigationController, animated: true, completion: nil)
563-
}
564-
565545
@objc private func collectPaymentTapped() {
566546
collectPayment()
567547

0 commit comments

Comments
 (0)