Skip to content

Commit 3ba78bf

Browse files
committed
Remove order creation experimental toggle
1 parent 816dc6d commit 3ba78bf

File tree

1 file changed

+2
-55
lines changed

1 file changed

+2
-55
lines changed

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

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ private extension BetaFeaturesViewController {
7474
func configureSections() {
7575
self.sections = [
7676
productsSection(),
77-
orderCreationSection(),
7877
inPersonPaymentsSection(),
7978
productSKUInputScannerSection(),
8079
couponManagementSection()
@@ -86,11 +85,6 @@ private extension BetaFeaturesViewController {
8685
.orderAddOnsDescription])
8786
}
8887

89-
func orderCreationSection() -> Section? {
90-
return Section(rows: [.orderCreation,
91-
.orderCreationDescription])
92-
}
93-
9488
func inPersonPaymentsSection() -> Section? {
9589
var rows: [Row] = []
9690

@@ -144,11 +138,6 @@ private extension BetaFeaturesViewController {
144138
configureOrderAddOnsSwitch(cell: cell)
145139
case let cell as BasicTableViewCell where row == .orderAddOnsDescription:
146140
configureOrderAddOnsDescription(cell: cell)
147-
// Orders
148-
case let cell as SwitchTableViewCell where row == .orderCreation:
149-
configureOrderCreationSwitch(cell: cell)
150-
case let cell as BasicTableViewCell where row == .orderCreationDescription:
151-
configureOrderCreationDescription(cell: cell)
152141
// In-Person Payments in Canada
153142
case let cell as SwitchTableViewCell where row == .canadaInPersonPayments:
154143
configureCanadaInPersonPaymentsSwitch(cell: cell)
@@ -203,37 +192,6 @@ private extension BetaFeaturesViewController {
203192
cell.textLabel?.text = Localization.orderAddOnsDescription
204193
}
205194

206-
func configureOrderCreationSwitch(cell: SwitchTableViewCell) {
207-
configureCommonStylesForSwitchCell(cell)
208-
cell.title = Localization.orderCreationTitle
209-
210-
// Fetch switch's state stored value.
211-
let action = AppSettingsAction.loadOrderCreationSwitchState() { result in
212-
guard let isEnabled = try? result.get() else {
213-
return cell.isOn = false
214-
}
215-
cell.isOn = isEnabled
216-
}
217-
ServiceLocator.stores.dispatch(action)
218-
219-
// Change switch's state stored value
220-
cell.onChange = { isSwitchOn in
221-
let action = AppSettingsAction.setOrderCreationFeatureSwitchState(isEnabled: isSwitchOn, onCompletion: { result in
222-
// Roll back toggle if an error occurred
223-
if result.isFailure {
224-
cell.isOn.toggle()
225-
}
226-
})
227-
ServiceLocator.stores.dispatch(action)
228-
}
229-
cell.accessibilityIdentifier = "beta-features-order-order-creation-cell"
230-
}
231-
232-
func configureOrderCreationDescription(cell: BasicTableViewCell) {
233-
configureCommonStylesForDescriptionCell(cell)
234-
cell.textLabel?.text = Localization.orderCreationDescription
235-
}
236-
237195
func configureCanadaInPersonPaymentsSwitch(cell: SwitchTableViewCell) {
238196
configureCommonStylesForSwitchCell(cell)
239197
cell.title = Localization.canadaExtensionInPersonPaymentsTitle
@@ -390,10 +348,6 @@ private enum Row: CaseIterable {
390348
case orderAddOns
391349
case orderAddOnsDescription
392350

393-
// Orders.
394-
case orderCreation
395-
case orderCreationDescription
396-
397351
// In-Person Payments in Canada
398352
case canadaInPersonPayments
399353
case canadaInPersonPaymentsDescription
@@ -408,9 +362,9 @@ private enum Row: CaseIterable {
408362

409363
var type: UITableViewCell.Type {
410364
switch self {
411-
case .orderAddOns, .orderCreation, .canadaInPersonPayments, .productSKUInputScanner, .couponManagement:
365+
case .orderAddOns, .canadaInPersonPayments, .productSKUInputScanner, .couponManagement:
412366
return SwitchTableViewCell.self
413-
case .orderAddOnsDescription, .orderCreationDescription, .canadaInPersonPaymentsDescription,
367+
case .orderAddOnsDescription, .canadaInPersonPaymentsDescription,
414368
.productSKUInputScannerDescription, .couponManagementDescription:
415369
return BasicTableViewCell.self
416370
}
@@ -430,13 +384,6 @@ private extension BetaFeaturesViewController {
430384
"Test out viewing Order Add-Ons as we get ready to launch",
431385
comment: "Cell description on the beta features screen to enable the order add-ons feature")
432386

433-
static let orderCreationTitle = NSLocalizedString(
434-
"Order Creation",
435-
comment: "Cell title on the beta features screen to enable creating new orders")
436-
static let orderCreationDescription = NSLocalizedString(
437-
"Test out creating new manual orders as we get ready to launch",
438-
comment: "Cell description on the beta features screen to enable creating new orders")
439-
440387
static let canadaExtensionInPersonPaymentsTitle = NSLocalizedString(
441388
"In-Person Payments in Canada",
442389
comment: "Cell title on beta features screen to enable accepting in-person payments for stores in Canada ")

0 commit comments

Comments
 (0)