openchs-models 1.27.8 → 1.27.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,13 +11,16 @@ var _BaseEntity = _interopRequireDefault(require("../BaseEntity"));
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
|
|
14
16
|
class ValidationResult {
|
|
15
|
-
constructor(success, formIdentifier, messageKey, extra, questionGroupIndex) {
|
|
17
|
+
constructor(success, formIdentifier, messageKey, extra, questionGroupIndex, validationType = ValidationResult.ValidationTypes.Form) {
|
|
16
18
|
this.success = success;
|
|
17
19
|
this.formIdentifier = formIdentifier;
|
|
18
20
|
this.messageKey = messageKey;
|
|
19
21
|
this.extra = extra;
|
|
20
22
|
this.questionGroupIndex = questionGroupIndex;
|
|
23
|
+
this.validationType = validationType;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
addQuestionGroupIndex(index) {
|
|
@@ -42,7 +45,7 @@ class ValidationResult {
|
|
|
42
45
|
|
|
43
46
|
|
|
44
47
|
static clone(validationResult) {
|
|
45
|
-
return new ValidationResult(validationResult.success, validationResult.formIdentifier, validationResult.messageKey, validationResult.extra, validationResult.questionGroupIndex);
|
|
48
|
+
return new ValidationResult(validationResult.success, validationResult.formIdentifier, validationResult.messageKey, validationResult.extra, validationResult.questionGroupIndex, validationResult.validationType);
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
static findByFormIdentifier(validationResults, formIdentifier) {
|
|
@@ -59,5 +62,10 @@ class ValidationResult {
|
|
|
59
62
|
|
|
60
63
|
}
|
|
61
64
|
|
|
65
|
+
_defineProperty(ValidationResult, "ValidationTypes", {
|
|
66
|
+
Form: "Form",
|
|
67
|
+
Rule: "Rule"
|
|
68
|
+
});
|
|
69
|
+
|
|
62
70
|
var _default = ValidationResult;
|
|
63
71
|
exports.default = _default;
|