@beinformed/ui 1.21.4 → 1.21.7
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.
- package/CHANGELOG.md +6 -0
- package/esm/models/attributes/AttributeModel.js +3 -3
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +3 -3
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/DatetimeAttributeModel.js +3 -3
- package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/esm/models/error/ErrorCollection.js +4 -4
- package/esm/models/error/ErrorCollection.js.map +1 -1
- package/esm/models/error/ErrorResponse.js +1 -1
- package/esm/models/error/ErrorResponse.js.map +1 -1
- package/esm/models/form/FormModel.js +4 -4
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +2 -2
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js +3 -3
- package/lib/models/attributes/AttributeModel.js.flow +6 -5
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +3 -3
- package/lib/models/attributes/ChoiceAttributeModel.js.flow +2 -2
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js +3 -3
- package/lib/models/attributes/DatetimeAttributeModel.js.flow +2 -2
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/error/ErrorCollection.js +4 -4
- package/lib/models/error/ErrorCollection.js.flow +6 -6
- package/lib/models/error/ErrorCollection.js.map +1 -1
- package/lib/models/error/ErrorResponse.js +1 -1
- package/lib/models/error/ErrorResponse.js.flow +1 -1
- package/lib/models/error/ErrorResponse.js.map +1 -1
- package/lib/models/form/FormModel.js +4 -4
- package/lib/models/form/FormModel.js.flow +9 -7
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js +2 -2
- package/lib/models/form/FormObjectModel.js.flow +4 -3
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/package.json +1 -1
- package/src/models/attributes/AttributeModel.js +6 -5
- package/src/models/attributes/ChoiceAttributeModel.js +2 -2
- package/src/models/attributes/DatetimeAttributeModel.js +2 -2
- package/src/models/error/ErrorCollection.js +6 -6
- package/src/models/error/ErrorResponse.js +1 -1
- package/src/models/form/FormModel.js +9 -7
- package/src/models/form/FormObjectModel.js +4 -3
|
@@ -92,7 +92,8 @@ export default class AttributeModel
|
|
|
92
92
|
this._errorCollection.addServerError(
|
|
93
93
|
attribute.message.id,
|
|
94
94
|
attribute.message.message,
|
|
95
|
-
attribute.message.parameters
|
|
95
|
+
attribute.message.parameters,
|
|
96
|
+
attribute.message.layouthint
|
|
96
97
|
);
|
|
97
98
|
}
|
|
98
99
|
|
|
@@ -710,9 +711,9 @@ export default class AttributeModel
|
|
|
710
711
|
addServerError(error: FormErrorAnchor) {
|
|
711
712
|
this._errorCollection.addServerError(
|
|
712
713
|
error.id,
|
|
713
|
-
error.layouthint,
|
|
714
714
|
error.message,
|
|
715
|
-
error.properties
|
|
715
|
+
error.properties,
|
|
716
|
+
error.layouthint
|
|
716
717
|
);
|
|
717
718
|
}
|
|
718
719
|
|
|
@@ -813,9 +814,9 @@ export default class AttributeModel
|
|
|
813
814
|
if (this.hasValue()) {
|
|
814
815
|
this._errorCollection.addServerError(
|
|
815
816
|
error.id,
|
|
816
|
-
error.layouthint,
|
|
817
817
|
error.message,
|
|
818
|
-
this.formatParameters(error.properties)
|
|
818
|
+
this.formatParameters(error.properties),
|
|
819
|
+
error.layouthint
|
|
819
820
|
);
|
|
820
821
|
} else {
|
|
821
822
|
this.addServerConstraint(
|
|
@@ -396,7 +396,7 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
396
396
|
* Registers an error that was received from a server response
|
|
397
397
|
*/
|
|
398
398
|
addServerError(error: FormErrorAnchor) {
|
|
399
|
-
const { id,
|
|
399
|
+
const { id, message, properties, layouthint } = error;
|
|
400
400
|
|
|
401
401
|
const ANSWER_OPTION_KEY = "answer-option-key";
|
|
402
402
|
|
|
@@ -412,7 +412,7 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
|
|
415
|
-
this._errorCollection.addServerError(id,
|
|
415
|
+
this._errorCollection.addServerError(id, message, properties, layouthint);
|
|
416
416
|
}
|
|
417
417
|
|
|
418
418
|
/**
|
|
@@ -425,12 +425,12 @@ class DatetimeAttributeModel extends StringAttributeModel {
|
|
|
425
425
|
* Registers an error that was received from a server response
|
|
426
426
|
*/
|
|
427
427
|
addServerError(error: FormErrorAnchor) {
|
|
428
|
-
const { id,
|
|
428
|
+
const { id, message, properties, layouthint } = error;
|
|
429
429
|
if (properties && has(properties, "format") && this.formatLabel) {
|
|
430
430
|
properties.format = this.formatLabel;
|
|
431
431
|
}
|
|
432
432
|
|
|
433
|
-
this._errorCollection.addServerError(id,
|
|
433
|
+
this._errorCollection.addServerError(id, message, properties, layouthint);
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
/**
|
|
@@ -43,9 +43,9 @@ export default class ErrorCollection extends BaseCollection<ErrorModel> {
|
|
|
43
43
|
*/
|
|
44
44
|
addError(
|
|
45
45
|
id: string,
|
|
46
|
-
layouthint?: LayoutHintCollection,
|
|
47
46
|
defaultMessage?: string,
|
|
48
|
-
parameters?: MessageParameters
|
|
47
|
+
parameters?: MessageParameters,
|
|
48
|
+
layouthint?: LayoutHintCollection
|
|
49
49
|
) {
|
|
50
50
|
const itemIdx = this.findById(id);
|
|
51
51
|
|
|
@@ -68,14 +68,14 @@ export default class ErrorCollection extends BaseCollection<ErrorModel> {
|
|
|
68
68
|
*/
|
|
69
69
|
addServerError(
|
|
70
70
|
id: string,
|
|
71
|
-
layouthint?: LayoutHintCollection,
|
|
72
71
|
defaultMessage?: string,
|
|
73
|
-
parameters?: MessageParameters
|
|
72
|
+
parameters?: MessageParameters,
|
|
73
|
+
layouthint?: LayoutHintCollection
|
|
74
74
|
) {
|
|
75
75
|
if (parameters) {
|
|
76
|
-
this.addError(id,
|
|
76
|
+
this.addError(id, defaultMessage, parameters, layouthint);
|
|
77
77
|
} else {
|
|
78
|
-
this.addError(id,
|
|
78
|
+
this.addError(id, defaultMessage, undefined, layouthint);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -513,15 +513,16 @@ class FormModel extends ResourceModel {
|
|
|
513
513
|
if (error.parameters) {
|
|
514
514
|
this.errorCollection.addServerError(
|
|
515
515
|
error.id,
|
|
516
|
-
error.layouthint,
|
|
517
516
|
error.message,
|
|
518
|
-
error.parameters
|
|
517
|
+
error.parameters,
|
|
518
|
+
error.layouthint
|
|
519
519
|
);
|
|
520
520
|
} else {
|
|
521
521
|
this.errorCollection.addServerError(
|
|
522
522
|
error.id,
|
|
523
|
-
error.
|
|
524
|
-
|
|
523
|
+
error.message,
|
|
524
|
+
undefined,
|
|
525
|
+
error.layouthint
|
|
525
526
|
);
|
|
526
527
|
}
|
|
527
528
|
}
|
|
@@ -1003,7 +1004,8 @@ class FormModel extends ResourceModel {
|
|
|
1003
1004
|
this.errorCollection.addServerError(
|
|
1004
1005
|
error.id,
|
|
1005
1006
|
error.message,
|
|
1006
|
-
error.properties
|
|
1007
|
+
error.properties,
|
|
1008
|
+
error.layouthint
|
|
1007
1009
|
);
|
|
1008
1010
|
});
|
|
1009
1011
|
}
|
|
@@ -1024,9 +1026,9 @@ class FormModel extends ResourceModel {
|
|
|
1024
1026
|
} else {
|
|
1025
1027
|
this.errorCollection.addServerError(
|
|
1026
1028
|
error.id,
|
|
1027
|
-
new LayoutHintCollection(error.layouthint),
|
|
1028
1029
|
error.message,
|
|
1029
|
-
error.properties
|
|
1030
|
+
error.properties,
|
|
1031
|
+
new LayoutHintCollection(error.layouthint)
|
|
1030
1032
|
);
|
|
1031
1033
|
}
|
|
1032
1034
|
});
|
|
@@ -401,9 +401,9 @@ export default class FormObjectModel extends BaseModel {
|
|
|
401
401
|
} else {
|
|
402
402
|
this._errorCollection.addServerError(
|
|
403
403
|
error.id,
|
|
404
|
-
error.layouthint,
|
|
405
404
|
error.message,
|
|
406
|
-
error.properties
|
|
405
|
+
error.properties,
|
|
406
|
+
error.layouthint
|
|
407
407
|
);
|
|
408
408
|
}
|
|
409
409
|
}
|
|
@@ -463,7 +463,8 @@ export default class FormObjectModel extends BaseModel {
|
|
|
463
463
|
this.errorCollection.addServerError(
|
|
464
464
|
error.id,
|
|
465
465
|
error.message,
|
|
466
|
-
error.properties
|
|
466
|
+
error.properties,
|
|
467
|
+
error.layouthint
|
|
467
468
|
);
|
|
468
469
|
}
|
|
469
470
|
}
|