Skip to content

Commit

Permalink
Added MenuOrder row in ProductSettingsRow
Browse files Browse the repository at this point in the history
  • Loading branch information
pmusolino committed Apr 23, 2020
1 parent 5af14d8 commit ad3512c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Expand Up @@ -154,4 +154,34 @@ enum ProductSettingsRows {

let cellTypes: [UITableViewCell.Type] = [SettingTitleAndValueTableViewCell.self]
}

struct MenuOrder: ProductSettingsRowMediator {
private let settings: ProductSettings

init(_ settings: ProductSettings) {
self.settings = settings
}

func configure(cell: UITableViewCell) {
guard let cell = cell as? SettingTitleAndValueTableViewCell else {
return
}

let titleView = NSLocalizedString("Menu Order", comment: "Menu order label in Product Settings")
cell.updateUI(title: titleView, value: nil)
cell.accessoryType = .disclosureIndicator
}

func handleTap(sourceViewController: UIViewController, onCompletion: @escaping (ProductSettings) -> Void) {
let viewController = ProductPurchaseNoteViewController(settings: settings) { (productSettings) in
self.settings.purchaseNote = productSettings.purchaseNote
onCompletion(self.settings)
}
sourceViewController.navigationController?.pushViewController(viewController, animated: true)
}

let reuseIdentifier: String = SettingTitleAndValueTableViewCell.reuseIdentifier

let cellTypes: [UITableViewCell.Type] = [SettingTitleAndValueTableViewCell.self]
}
}
8 changes: 8 additions & 0 deletions WooCommerce/WooCommerce.xcodeproj/project.pbxproj
Expand Up @@ -2285,10 +2285,18 @@
457151A8243B6E6200EB2DFA /* Slug */,
456CB50A2444BF8400992A05 /* Purchase Note */,
4524CD9F242D023300B2F20A /* List Selector Data Source */,
45A24E5C2451DB710050606B /* Menu Order */,
);
path = "Product Settings";
sourceTree = "<group>";
};
45A24E5C2451DB710050606B /* Menu Order */ = {
isa = PBXGroup;
children = (
);
path = "Menu Order";
sourceTree = "<group>";
};
45B9C63B23A8E4DB007FC4C5 /* Edit Price */ = {
isa = PBXGroup;
children = (
Expand Down

0 comments on commit ad3512c

Please sign in to comment.