Skip to content

Commit 2ce1e2e

Browse files
committed
Add view model for coupon allowed emails screen
1 parent f9da38a commit 2ce1e2e

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Foundation
2+
3+
/// View model for `CouponAllowedEmails` view.
4+
///
5+
final class CouponAllowedEmailsViewModel: ObservableObject {
6+
7+
@Published var allowedEmails: String
8+
9+
@Published private(set) var foundInvalidPatterns: Bool = false
10+
11+
init(allowedEmails: String) {
12+
self.allowedEmails = allowedEmails
13+
}
14+
15+
/// Validate the input
16+
///
17+
func validateEmails() {
18+
19+
}
20+
}

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,7 @@
16271627
DECE13FB27993F6500816ECD /* TitleAndSubtitleAndStatusTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DECE13F927993F6500816ECD /* TitleAndSubtitleAndStatusTableViewCell.swift */; };
16281628
DECE13FC27993F6500816ECD /* TitleAndSubtitleAndStatusTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DECE13FA27993F6500816ECD /* TitleAndSubtitleAndStatusTableViewCell.xib */; };
16291629
DECE1400279A595200816ECD /* Coupon+Woo.swift in Sources */ = {isa = PBXBuildFile; fileRef = DECE13FF279A595200816ECD /* Coupon+Woo.swift */; };
1630+
DEDB2D262845D31900CE7D35 /* CouponAllowedEmailsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEDB2D252845D31900CE7D35 /* CouponAllowedEmailsViewModel.swift */; };
16301631
DEDB886B26E8531E00981595 /* ShippingLabelPackageAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEDB886A26E8531E00981595 /* ShippingLabelPackageAttributes.swift */; };
16311632
DEE6437626D87C4100888A75 /* PrintCustomsFormsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEE6437526D87C4100888A75 /* PrintCustomsFormsView.swift */; };
16321633
DEE6437826D8DAD900888A75 /* InProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEE6437726D8DAD900888A75 /* InProgressView.swift */; };
@@ -3378,6 +3379,7 @@
33783379
DECE13F927993F6500816ECD /* TitleAndSubtitleAndStatusTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleAndSubtitleAndStatusTableViewCell.swift; sourceTree = "<group>"; };
33793380
DECE13FA27993F6500816ECD /* TitleAndSubtitleAndStatusTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TitleAndSubtitleAndStatusTableViewCell.xib; sourceTree = "<group>"; };
33803381
DECE13FF279A595200816ECD /* Coupon+Woo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Coupon+Woo.swift"; sourceTree = "<group>"; };
3382+
DEDB2D252845D31900CE7D35 /* CouponAllowedEmailsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CouponAllowedEmailsViewModel.swift; sourceTree = "<group>"; };
33813383
DEDB886A26E8531E00981595 /* ShippingLabelPackageAttributes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShippingLabelPackageAttributes.swift; sourceTree = "<group>"; };
33823384
DEE6437526D87C4100888A75 /* PrintCustomsFormsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrintCustomsFormsView.swift; sourceTree = "<group>"; };
33833385
DEE6437726D8DAD900888A75 /* InProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressView.swift; sourceTree = "<group>"; };
@@ -7757,6 +7759,7 @@
77577759
DE69C54C27BB719A000BB888 /* CouponRestrictions.swift */,
77587760
DE69C54927BB715D000BB888 /* CouponRestrictionsViewModel.swift */,
77597761
DEC1508127F450AC00F4487C /* CouponAllowedEmails.swift */,
7762+
DEDB2D252845D31900CE7D35 /* CouponAllowedEmailsViewModel.swift */,
77607763
);
77617764
path = UsageDetails;
77627765
sourceTree = "<group>";
@@ -9475,6 +9478,7 @@
94759478
DE26B52C277DA11800A2EA0A /* CouponListView.swift in Sources */,
94769479
AEA622B2274669D3002A9B57 /* AddOrderCoordinator.swift in Sources */,
94779480
4535EE7A281ADD56004212B4 /* CouponCodeInputFormatter.swift in Sources */,
9481+
DEDB2D262845D31900CE7D35 /* CouponAllowedEmailsViewModel.swift in Sources */,
94789482
0282DD96233C960C006A5FDB /* SearchResultCell.swift in Sources */,
94799483
260C32BE2527A2DE00157BC2 /* IssueRefundViewModel.swift in Sources */,
94809484
2678897C270E6E8B00BD249E /* SimplePaymentsAmount.swift in Sources */,

0 commit comments

Comments
 (0)