updated model
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
cadded3217
commit
1b391272c5
@ -25,6 +25,7 @@ import VDS
|
|||||||
public var readOnly: Bool = false
|
public var readOnly: Bool = false
|
||||||
public var showError: Bool?
|
public var showError: Bool?
|
||||||
public var errorMessage: String?
|
public var errorMessage: String?
|
||||||
|
public var initialErrorMessage: String?
|
||||||
|
|
||||||
public var fieldKey: String?
|
public var fieldKey: String?
|
||||||
public var groupName: String = FormValidator.defaultGroupName
|
public var groupName: String = FormValidator.defaultGroupName
|
||||||
@ -89,9 +90,11 @@ import VDS
|
|||||||
|
|
||||||
if let ruleErrorMessage = errorMessage, fieldKey != nil {
|
if let ruleErrorMessage = errorMessage, fieldKey != nil {
|
||||||
self.errorMessage = ruleErrorMessage
|
self.errorMessage = ruleErrorMessage
|
||||||
|
} else {
|
||||||
|
self.errorMessage = initialErrorMessage
|
||||||
}
|
}
|
||||||
|
|
||||||
self.isValid = valid
|
isValid = valid
|
||||||
updateUI?()
|
updateUI?()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,6 +106,7 @@ import VDS
|
|||||||
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
|
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
|
||||||
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
|
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
|
||||||
errorMessage = try typeContainer.decodeIfPresent(String.self, forKey: .errorMessage)
|
errorMessage = try typeContainer.decodeIfPresent(String.self, forKey: .errorMessage)
|
||||||
|
initialErrorMessage = errorMessage
|
||||||
enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) ?? true
|
enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) ?? true
|
||||||
required = try typeContainer.decodeIfPresent(Bool.self, forKey: .required) ?? true
|
required = try typeContainer.decodeIfPresent(Bool.self, forKey: .required) ?? true
|
||||||
readOnly = try typeContainer.decodeIfPresent(Bool.self, forKey: .readOnly) ?? false
|
readOnly = try typeContainer.decodeIfPresent(Bool.self, forKey: .readOnly) ?? false
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user