@beinformed/ui 1.48.0 → 1.49.1

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.
Files changed (111) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/esm/hooks/useForm.js +17 -2
  3. package/esm/hooks/useForm.js.map +1 -1
  4. package/esm/models/attributes/AttributeModel.js +2 -1
  5. package/esm/models/attributes/AttributeModel.js.map +1 -1
  6. package/esm/models/attributes/ChoiceAttributeModel.js +16 -1
  7. package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
  8. package/esm/models/attributes/ChoiceAttributeOptionCollection.js +10 -3
  9. package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  10. package/esm/models/concepts/ConceptRelationModel.js +7 -0
  11. package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
  12. package/esm/models/form/FormModel.js +22 -2
  13. package/esm/models/form/FormModel.js.map +1 -1
  14. package/esm/models/form/FormObjectModel.js +9 -1
  15. package/esm/models/form/FormObjectModel.js.map +1 -1
  16. package/esm/modularui/ModularUIRequest.js +1 -1
  17. package/esm/modularui/ModularUIRequest.js.map +1 -1
  18. package/esm/redux/_modularui/ModularUIActions.js +4 -10
  19. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  20. package/esm/redux/actions/FormAttributeSet.js +22 -6
  21. package/esm/redux/actions/FormAttributeSet.js.map +1 -1
  22. package/esm/redux/actions/FormAutosubmit.js +9 -1
  23. package/esm/redux/actions/FormAutosubmit.js.map +1 -1
  24. package/esm/redux/actions/FormAutoupdate.js +29 -0
  25. package/esm/redux/actions/FormAutoupdate.js.map +1 -0
  26. package/esm/redux/connectors/FormAttributeSet.js +3 -2
  27. package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
  28. package/esm/redux/types.js.map +1 -1
  29. package/esm/utils/fetch/types.js.map +1 -1
  30. package/lib/hooks/useForm.js +17 -2
  31. package/lib/hooks/useForm.js.flow +22 -7
  32. package/lib/hooks/useForm.js.map +1 -1
  33. package/lib/models/attributes/AttributeModel.js +2 -1
  34. package/lib/models/attributes/AttributeModel.js.flow +2 -1
  35. package/lib/models/attributes/AttributeModel.js.map +1 -1
  36. package/lib/models/attributes/ChoiceAttributeModel.js +16 -1
  37. package/lib/models/attributes/ChoiceAttributeModel.js.flow +23 -2
  38. package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
  39. package/lib/models/attributes/ChoiceAttributeOptionCollection.js +10 -3
  40. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.flow +16 -8
  41. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  42. package/lib/models/concepts/ConceptRelationModel.js +7 -0
  43. package/lib/models/concepts/ConceptRelationModel.js.flow +12 -0
  44. package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
  45. package/lib/models/form/FormModel.js +22 -2
  46. package/lib/models/form/FormModel.js.flow +25 -5
  47. package/lib/models/form/FormModel.js.map +1 -1
  48. package/lib/models/form/FormObjectModel.js +9 -1
  49. package/lib/models/form/FormObjectModel.js.flow +9 -1
  50. package/lib/models/form/FormObjectModel.js.map +1 -1
  51. package/lib/modularui/ModularUIRequest.js +1 -1
  52. package/lib/modularui/ModularUIRequest.js.flow +1 -1
  53. package/lib/modularui/ModularUIRequest.js.map +1 -1
  54. package/lib/redux/_modularui/ModularUIActions.js +4 -10
  55. package/lib/redux/_modularui/ModularUIActions.js.flow +8 -16
  56. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  57. package/lib/redux/actions/FormAttributeSet.js +22 -6
  58. package/lib/redux/actions/FormAttributeSet.js.flow +36 -11
  59. package/lib/redux/actions/FormAttributeSet.js.map +1 -1
  60. package/lib/redux/actions/FormAutosubmit.js +10 -1
  61. package/lib/redux/actions/FormAutosubmit.js.flow +10 -3
  62. package/lib/redux/actions/FormAutosubmit.js.map +1 -1
  63. package/lib/redux/actions/FormAutoupdate.js +37 -0
  64. package/lib/redux/actions/FormAutoupdate.js.flow +43 -0
  65. package/lib/redux/actions/FormAutoupdate.js.map +1 -0
  66. package/lib/redux/connectors/FormAttributeSet.js +3 -2
  67. package/lib/redux/connectors/FormAttributeSet.js.flow +4 -2
  68. package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
  69. package/lib/redux/types.js.flow +1 -0
  70. package/lib/redux/types.js.map +1 -1
  71. package/lib/utils/fetch/types.js.flow +2 -1
  72. package/lib/utils/fetch/types.js.map +1 -1
  73. package/package.json +18 -18
  74. package/src/hooks/useForm.js +22 -7
  75. package/src/models/attributes/AttributeModel.js +2 -1
  76. package/src/models/attributes/ChoiceAttributeModel.js +23 -2
  77. package/src/models/attributes/ChoiceAttributeOptionCollection.js +16 -8
  78. package/src/models/concepts/ConceptRelationModel.js +12 -0
  79. package/src/models/form/FormModel.js +25 -5
  80. package/src/models/form/FormObjectModel.js +9 -1
  81. package/src/modularui/ModularUIRequest.js +1 -1
  82. package/src/redux/_modularui/ModularUIActions.js +8 -16
  83. package/src/redux/actions/FormAttributeSet.js +36 -11
  84. package/src/redux/actions/FormAutosubmit.js +10 -3
  85. package/src/redux/actions/FormAutoupdate.js +43 -0
  86. package/src/redux/connectors/FormAttributeSet.js +4 -2
  87. package/src/redux/types.js +1 -0
  88. package/src/utils/fetch/types.js +2 -1
  89. package/types/hooks/useI18n.d.ts +1 -1
  90. package/types/models/application/ApplicationModel.d.ts +7 -0
  91. package/types/models/attributes/AttributeModel.d.ts +4 -3
  92. package/types/models/attributes/ChoiceAttributeModel.d.ts +4 -0
  93. package/types/models/attributes/ChoiceAttributeOptionCollection.d.ts +1 -1
  94. package/types/models/attributes/ChoiceAttributeOptionModel.d.ts +2 -1
  95. package/types/models/attributes/input-constraints/ConstraintModel.d.ts +1 -1
  96. package/types/models/base/ResourceCollection.d.ts +2 -1
  97. package/types/models/base/ResourceModel.d.ts +3 -2
  98. package/types/models/concepts/BusinessScenarioModel.d.ts +1 -1
  99. package/types/models/concepts/ConceptRelationModel.d.ts +19 -4
  100. package/types/models/content/ContentModel.d.ts +4 -0
  101. package/types/models/content/ContentTOCModel.d.ts +4 -0
  102. package/types/models/form/FormModel.d.ts +7 -1
  103. package/types/models/form/FormObjectModel.d.ts +11 -2
  104. package/types/models/links/normalizeLinkJSON.d.ts +2 -2
  105. package/types/models/list/ListModel.d.ts +4 -0
  106. package/types/models/panels/GroupingPanelModel.d.ts +4 -0
  107. package/types/models/tab/TabModel.d.ts +4 -0
  108. package/types/models/types.d.ts +2 -1
  109. package/types/models/user/UserServicesModel.d.ts +7 -0
  110. package/types/redux/types.d.ts +1 -0
  111. package/types/utils/fetch/types.d.ts +2 -1
@@ -65,6 +65,18 @@ export default class ConceptRelationModel implements IModelWithChildModels {
65
65
  return this._relation.relationDirection;
66
66
  }
67
67
 
68
+ /**
69
+ * Get type of relation type,
70
+ */
71
+ get relationTypeType():
72
+ | "None"
73
+ | "Sub-Class"
74
+ | "Composition"
75
+ | "Association"
76
+ | "Unknown" {
77
+ return this._relation.relationTypeType ?? "Unknown";
78
+ }
79
+
68
80
  /**
69
81
  */
70
82
  get condition(): string {
@@ -1013,6 +1013,27 @@ class FormModel extends ResourceModel {
1013
1013
  return this;
1014
1014
  }
1015
1015
 
1016
+ /**
1017
+ * Updates the current form object with new information about the object,
1018
+ * like for example a new dynamicschema. Used for autoupdate functionality that makes it possible
1019
+ * to update the options of a next missing attribute in a form-tree iq question
1020
+ */
1021
+ updateCurrentFormObject(receivedForm: ModularUIModel) {
1022
+ if (receivedForm instanceof FormModel) {
1023
+ const receivedFormData = receivedForm.data ?? {};
1024
+ const hasMissing = has(receivedFormData, "missing");
1025
+ const hasErrors = has(receivedFormData, "errors");
1026
+
1027
+ if (hasErrors) {
1028
+ this.handleErrors(receivedForm);
1029
+ }
1030
+
1031
+ if (hasMissing) {
1032
+ this.handleMissing(receivedForm);
1033
+ }
1034
+ }
1035
+ }
1036
+
1016
1037
  /**
1017
1038
  */
1018
1039
  updateValidations(data: any): FormModel {
@@ -1125,11 +1146,10 @@ class FormModel extends ResourceModel {
1125
1146
  }
1126
1147
 
1127
1148
  this.currentFormObject.attributeCollection.map((attribute) => {
1128
- if (
1129
- receivedForm.currentFormObject &&
1130
- receivedForm.currentFormObject.hasAttributeByKey(attribute.key)
1131
- ) {
1132
- attribute.addMissingError();
1149
+ const receivedAttribute =
1150
+ receivedForm.currentFormObject?.getAttributeByKey(attribute.key);
1151
+ if (receivedAttribute) {
1152
+ attribute.addMissingError(receivedAttribute);
1133
1153
  } else {
1134
1154
  attribute.removeMissingError();
1135
1155
  }
@@ -218,7 +218,15 @@ export default class FormObjectModel extends BaseModel {
218
218
  }
219
219
 
220
220
  /**
221
- * Indicates if object is dynamic. A dynamic object should be submitted on each attribute change
221
+ * Indicates if object is dynamic.
222
+ *
223
+ * A subtle difference exists between objects for wizard style instrument dialogs and other objects.
224
+ * In the 'missing object' response, wizard style objects will include only the first attribute(s) to be answered,
225
+ * while other objects will include the complete set of attributes of that object.
226
+ *
227
+ * This difference is condensed in the term of 'dynamic objects': these objects start (in the 'missing object' response)
228
+ * with a very select set of attributes to be answered, and each successive 'missing elements' response will include next attributes to be answered.
229
+ * When an object is dynamic, the form contributions will mention a "dynamicObject": true property.
222
230
  */
223
231
  get isDynamic(): boolean {
224
232
  return this.getContribution("dynamicObject", false);
@@ -156,7 +156,7 @@ class ModularUIRequest {
156
156
  const {
157
157
  targetModel,
158
158
  forceTargetModel,
159
- updateModel,
159
+ updateHandler,
160
160
  childmodels,
161
161
  isValidationRequest,
162
162
  removeOnUnmount,
@@ -17,7 +17,10 @@ import type {
17
17
  ResetModularUIAction,
18
18
  UpdateStatusAction,
19
19
  } from "./types";
20
- import type { RequestModularUIOptions } from "../../utils/fetch/types";
20
+ import type {
21
+ RequestModularUIOptions,
22
+ UpdateHandler,
23
+ } from "../../utils/fetch/types";
21
24
 
22
25
  /**
23
26
  */
@@ -88,22 +91,11 @@ export const updateStatus = (
88
91
  const loadModelSuccessAction = (
89
92
  key: string,
90
93
  model: ModularUIModel,
91
- modelToUpdate: ?ModularUIModel,
94
+ updateHandler: UpdateHandler | void,
92
95
  ): UpdateModelAction | SetModelAction => {
93
- if (modelToUpdate) {
94
- // $FlowFixMe[prop-missing]
95
- if (typeof modelToUpdate["update"] === "function") {
96
- const clonedModel = modelToUpdate.clone();
97
- clonedModel.update(model);
98
-
99
- return updateModel(clonedModel);
100
- }
101
-
102
- throw new Error(
103
- `loadModel action: updateModel is set as option for ${key}, but the model is missing an update methode`,
104
- );
96
+ if (updateHandler) {
97
+ return updateModel(updateHandler(model));
105
98
  }
106
-
107
99
  return setModel(key, model);
108
100
  };
109
101
 
@@ -127,7 +119,7 @@ export const loadModel = (
127
119
  /**
128
120
  */
129
121
  successAction: (model) =>
130
- loadModelSuccessAction(key, model, options?.updateModel),
122
+ loadModelSuccessAction(key, model, options?.updateHandler),
131
123
  /**
132
124
  */
133
125
  errorAction: (error) => {
@@ -6,6 +6,7 @@ import { getSetting } from "../../constants/Settings";
6
6
  import { validateFormObject } from "./FormValidations";
7
7
  import { autosaveFormObject } from "./FormAutosave";
8
8
  import { autosubmitFormObject } from "./FormAutosubmit";
9
+ import { autoupdateFormObject } from "./FormAutoupdate";
9
10
 
10
11
  import type { Dispatch, ThunkAction, UpdateFormOptions } from "../types";
11
12
  import type { AttributeType } from "../../models/types";
@@ -23,7 +24,8 @@ export const updateFormAttribute =
23
24
  inputvalue: string,
24
25
  options: UpdateFormOptions = {
25
26
  autosubmit: false,
26
- autosave: false,
27
+ autosave: false, // autosave commits the form in the background
28
+ autoupdate: false, // autoupdate does not commit and updates the form with for example a new dynamicschema (work-around for form-tree iq)
27
29
  forceUpdate: false,
28
30
  validate: true,
29
31
  },
@@ -56,18 +58,41 @@ export const updateFormAttribute =
56
58
  }
57
59
  }
58
60
 
59
- if (options.autosave && newForm.isValid && newForm.isChanged()) {
60
- dispatch(autosaveFormObject(newForm));
61
+ if (options.autoupdate && newForm.isValid) {
62
+ const autoupdateAction = autoupdateFormObject(newForm, attribute);
63
+ if (autoupdateAction) {
64
+ return dispatch(autoupdateAction);
65
+ }
61
66
  }
62
67
 
63
- if (
64
- options.validate &&
65
- newForm.currentFormObject?.hasDynamicValidations &&
66
- getSetting("USE_INSTANT_SERVER_VALIDATION")
67
- ) {
68
- // server form validations happens async, don't wait for the form to return
69
- dispatch(validateFormObject(newForm));
70
- }
68
+ handleAutoSave(dispatch, newForm, options);
69
+
70
+ handleValidate(dispatch, newForm, options);
71
71
 
72
72
  return dispatch(updateForm(newForm));
73
73
  };
74
+
75
+ const handleAutoSave = (
76
+ dispatch: Dispatch,
77
+ newForm: FormModel,
78
+ options: UpdateFormOptions,
79
+ ) => {
80
+ if (options.autosave && newForm.isValid && newForm.isChanged()) {
81
+ dispatch(autosaveFormObject(newForm));
82
+ }
83
+ };
84
+
85
+ const handleValidate = (
86
+ dispatch: Dispatch,
87
+ newForm: FormModel,
88
+ options: UpdateFormOptions,
89
+ ) => {
90
+ if (
91
+ options.validate &&
92
+ newForm.currentFormObject?.hasDynamicValidations &&
93
+ getSetting("USE_INSTANT_SERVER_VALIDATION")
94
+ ) {
95
+ // server form validations happens async, don't wait for the form to return
96
+ dispatch(validateFormObject(newForm));
97
+ }
98
+ };
@@ -1,9 +1,9 @@
1
1
  // @flow
2
2
  import { loadModularUI } from "../_modularui/ModularUIActions";
3
3
  import { HTTP_METHODS } from "../../constants/Constants";
4
+ import FormModel from "../../models/form/FormModel";
4
5
 
5
- import type { AttributeType } from "../../models/types";
6
- import type FormModel from "../../models/form/FormModel";
6
+ import type { ModularUIModel, AttributeType } from "../../models/types";
7
7
  import type { ThunkAction } from "../types";
8
8
 
9
9
  /**
@@ -28,7 +28,14 @@ export const autosubmitFormObject = (
28
28
  return loadModularUI(form.connectKey, form.selfhref, {
29
29
  method: HTTP_METHODS.POST,
30
30
  data: form.formdata,
31
- updateModel: form,
31
+ updateHandler: (newModel: ModularUIModel): ModularUIModel => {
32
+ if (newModel instanceof FormModel) {
33
+ const clonedModel: FormModel = form.clone();
34
+ clonedModel.update(newModel);
35
+ return clonedModel;
36
+ }
37
+ return newModel;
38
+ },
32
39
  });
33
40
  }
34
41
 
@@ -0,0 +1,43 @@
1
+ // @flow
2
+ import { loadModularUI } from "../_modularui/ModularUIActions";
3
+ import { HTTP_METHODS } from "../../constants/Constants";
4
+
5
+ import FormModel from "../../models/form/FormModel";
6
+
7
+ import type { AttributeType, ModularUIModel } from "../../models/types";
8
+ import type { ThunkAction } from "../types";
9
+
10
+ /**
11
+ */
12
+ export const autoupdateFormObject = (
13
+ form: FormModel,
14
+ attribute: AttributeType,
15
+ ): ?ThunkAction => {
16
+ // As long as we have form objects,
17
+ // and the current attribute is not found in the current form object, go back.
18
+ // When a form has a result, the current form object is null
19
+ while (
20
+ form.allObjects.length > 0 &&
21
+ (!form.currentFormObject ||
22
+ !form.currentFormObject.hasAttributeByKey(attribute.key))
23
+ ) {
24
+ form.setPreviousObject();
25
+ }
26
+
27
+ if (form.isChanged()) {
28
+ return loadModularUI(form.connectKey, form.selfhref, {
29
+ method: HTTP_METHODS.POST,
30
+ data: form.formdata,
31
+ updateHandler: (newModel: ModularUIModel): ModularUIModel => {
32
+ if (newModel instanceof FormModel) {
33
+ const clonedModel: FormModel = form.clone();
34
+ clonedModel.updateCurrentFormObject(newModel);
35
+ return clonedModel;
36
+ }
37
+ return newModel;
38
+ },
39
+ });
40
+ }
41
+
42
+ return null;
43
+ };
@@ -24,6 +24,7 @@ type OwnProps = {
24
24
  formLayout?: "vertical" | "horizontal" | "compact",
25
25
  autosubmit?: boolean,
26
26
  autosave?: boolean,
27
+ autoupdate?: boolean,
27
28
  };
28
29
 
29
30
  type DispatchProps = {
@@ -50,8 +51,9 @@ const mapDispatchToProps = (
50
51
  attribute: AttributeType,
51
52
  value: string,
52
53
  options: UpdateFormOptions = {
53
- autosubmit: ownProps.autosubmit || false,
54
- autosave: ownProps.autosave || false,
54
+ autosubmit: ownProps.autosubmit ?? false,
55
+ autosave: ownProps.autosave ?? false,
56
+ autoupdate: ownProps.autoupdate ?? false,
55
57
  },
56
58
  ) =>
57
59
  dispatch(
@@ -46,6 +46,7 @@ export type PreferenceValue =
46
46
  export type UpdateFormOptions = {
47
47
  autosubmit: boolean,
48
48
  autosave: boolean,
49
+ autoupdate: boolean,
49
50
  forceUpdate?: boolean,
50
51
  /** Default true: Activate/deactivate the form object validate by an update */
51
52
  validate?: boolean,
@@ -31,11 +31,12 @@ export type RequestBaseOptions = {
31
31
 
32
32
  export type RequestOptions = { ...RequestURLOptions, ...RequestBaseOptions };
33
33
 
34
+ export type UpdateHandler = (newModel: ModularUIModel) => ModularUIModel;
34
35
  export type RequestModularUIOptions = {
35
36
  ...RequestBaseOptions,
36
37
  targetModel?: TargetModel,
37
38
  forceTargetModel?: boolean,
38
- updateModel?: ModularUIModel,
39
+ updateHandler?: UpdateHandler | void,
39
40
  childmodels?: boolean,
40
41
  isValidationRequest?: boolean,
41
42
  removeOnUnmount?: boolean,
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  */
3
- export function useTranslate(): (...any: any[]) => any;
3
+ export function useTranslate(): ((...any) => any);
4
4
  /**
5
5
  */
6
6
  export function useMessage(id: string, defaultMessage?: string, placeholders?: Object | null): any;
@@ -3,6 +3,9 @@
3
3
  */
4
4
  export default class ApplicationModel extends ResourceModel {
5
5
  _userServices: UserServicesModel | null;
6
+ /**
7
+ */
8
+ setChildModels(models: Array<ModularUIModel>): void;
6
9
  /**
7
10
  * Set the userservices for this application
8
11
  */
@@ -32,9 +35,13 @@ export default class ApplicationModel extends ResourceModel {
32
35
  * only available when the user services are available
33
36
  */
34
37
  get userHref(): Href;
38
+ /**
39
+ */
40
+ get userMustChangePassword(): boolean;
35
41
  }
36
42
  import ResourceModel from "../base/ResourceModel";
37
43
  import UserServicesModel from "../user/UserServicesModel";
44
+ import { ModularUIModel } from "../types";
38
45
  import { AuthenticationType } from "../types";
39
46
  import LinkCollection from "../links/LinkCollection";
40
47
  import LinkModel from "../links/LinkModel";
@@ -36,7 +36,7 @@ export default class AttributeModel extends BaseModel {
36
36
  getInitialChildModelLinks(): Array<LinkModel>;
37
37
  /**
38
38
  */
39
- setChildModels(models: Array<ModularUIModel>): void;
39
+ setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>): void;
40
40
  /**
41
41
  * Set the concept
42
42
  */
@@ -281,7 +281,7 @@ export default class AttributeModel extends BaseModel {
281
281
  /**
282
282
  * Registers a missing error that was received from the server
283
283
  */
284
- addMissingError(): void;
284
+ addMissingError(receivedAttribute?: AttributeType): void;
285
285
  /**
286
286
  */
287
287
  removeMissingError(): void;
@@ -386,10 +386,11 @@ import LinkCollection from "../links/LinkCollection";
386
386
  import LayoutHintRuleCollection from "./layouthint-rules/LayoutHintRuleCollection";
387
387
  import LinkModel from "../links/LinkModel";
388
388
  import { ModularUIModel } from "../types";
389
+ import ErrorResponse from "../error/ErrorResponse";
389
390
  import ContentConfiguration from "../contentconfiguration/ContentConfiguration";
390
391
  import ContentConfigurationElements from "../contentconfiguration/ContentConfigurationElements";
391
392
  import { FormErrorAnchor } from "../types";
392
- import { MessageParameters } from "../../i18n/types";
393
393
  import { AttributeType } from "../types";
394
+ import { MessageParameters } from "../../i18n/types";
394
395
  import AttributeCollection from "./AttributeCollection";
395
396
  import AttributeContent from "./AttributeContent";
@@ -60,6 +60,9 @@ export default class ChoiceAttributeModel extends AttributeModel {
60
60
  * Check if options need to be rendered as tree
61
61
  */
62
62
  get isTree(): boolean;
63
+ /**
64
+ */
65
+ mergeAttribute(oldAttribute: AttributeType, addNotExistingOptions?: boolean, removeNotExistingOptions?: boolean): void;
63
66
  /**
64
67
  * Update attribute by name and value
65
68
  */
@@ -78,4 +81,5 @@ export default class ChoiceAttributeModel extends AttributeModel {
78
81
  import AttributeModel from "./AttributeModel";
79
82
  import ChoiceAttributeOptionCollection from "./ChoiceAttributeOptionCollection";
80
83
  import LinkModel from "../links/LinkModel";
84
+ import { AttributeType } from "../types";
81
85
  import ContentConfigurationElements from "../contentconfiguration/ContentConfigurationElements";
@@ -72,7 +72,7 @@ declare class ChoiceAttributeOptionCollection extends ResourceCollection<ChoiceA
72
72
  get headers(): ListHeaderModel[];
73
73
  /**
74
74
  */
75
- mergeOptions(withOptions: ChoiceAttributeOptionCollection, addNotExistingOptions?: boolean): void;
75
+ mergeOptions(withOptions: ChoiceAttributeOptionCollection, addNotExistingOptions?: boolean, removeNotExistingOptions?: boolean): void;
76
76
  }
77
77
  import ChoiceAttributeOptionModel from "./ChoiceAttributeOptionModel";
78
78
  import ResourceCollection from "../base/ResourceCollection";
@@ -35,7 +35,7 @@ declare class ChoiceAttributeOptionModel extends BaseModel {
35
35
  getInitialChildModelLinks(): Array<LinkModel>;
36
36
  /**
37
37
  */
38
- setChildModels(models: Array<ModularUIModel>): void;
38
+ setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>): void;
39
39
  /**
40
40
  * Set the concept
41
41
  */
@@ -143,4 +143,5 @@ import AttributeCollection from "./AttributeCollection";
143
143
  import AttributeContent from "./AttributeContent";
144
144
  import LinkModel from "../links/LinkModel";
145
145
  import { ModularUIModel } from "../types";
146
+ import ErrorResponse from "../error/ErrorResponse";
146
147
  import ListItemModel from "../list/ListItemModel";
@@ -5,7 +5,7 @@ export default class ConstraintModel {
5
5
  */
6
6
  constructor(id: string, validateMethod: Function | null, defaultMessage: string | null, parameters: Object | null, useClientsideValidation?: boolean);
7
7
  _id: string;
8
- _validateMethod: (value: any) => boolean;
8
+ _validateMethod: ((value: any) => boolean) | null;
9
9
  _defaultMessage: string | null;
10
10
  _parameters: Object | null;
11
11
  _useClientsideValidation: boolean;
@@ -12,8 +12,9 @@ declare class ResourceCollection<T, IModelWithChildModels> extends BaseCollectio
12
12
  /**
13
13
  * Pass through models for setchildmodels to items of this collection
14
14
  */
15
- setChildModels(models: Array<ModularUIModel>): void;
15
+ setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>): void;
16
16
  }
17
17
  import BaseCollection from "./BaseCollection";
18
18
  import LinkModel from "../links/LinkModel";
19
19
  import { ModularUIModel } from "../types";
20
+ import ErrorResponse from "../error/ErrorResponse";
@@ -80,7 +80,7 @@ declare class ResourceModel extends BaseModel {
80
80
  /**
81
81
  * Add child models to this model
82
82
  */
83
- addChildModels(models: Array<ModularUIModel>): this;
83
+ addChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>): this;
84
84
  /**
85
85
  * Template to set expanded child models
86
86
  * Use this hook to separate the retrieved child models into the correct models.
@@ -88,7 +88,7 @@ declare class ResourceModel extends BaseModel {
88
88
  * @abstract
89
89
  * @example <caption>Put all models of instance List and GroupingPanel into the panels property</caption>
90
90
  */
91
- setChildModels(models: Array<ModularUIModel>): void;
91
+ setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>): void;
92
92
  /**
93
93
  */
94
94
  dehydrate(): Object;
@@ -98,4 +98,5 @@ import { ModularUIModel } from "../types";
98
98
  import LinkCollection from "../links/LinkCollection";
99
99
  import LinkModel from "../links/LinkModel";
100
100
  import Href from "../href/Href";
101
+ import ErrorResponse from "../error/ErrorResponse";
101
102
  import ModularUIResponse from "../../modularui/ModularUIResponse";
@@ -4,7 +4,7 @@ export default BusinessScenarioModel;
4
4
  declare class BusinessScenarioModel extends ConceptDetailModel {
5
5
  /**
6
6
  */
7
- static isOfConceptType(conceptTypeHref: string | null, settingName: "STEP" | "PERSONA" | "SCENARIO"): boolean;
7
+ static isOfConceptType(conceptTypeHref: string | null, settingNames: Array<"STEP" | "PERSONA" | "SCENARIO" | "SYSTEM">): boolean;
8
8
  _scenarioSteps: Array<ConceptDetailModel>;
9
9
  /**
10
10
  */
@@ -14,13 +14,12 @@ export default class ConceptRelationModel {
14
14
  */
15
15
  setChildModels(models: Array<ModularUIModel>): void;
16
16
  /**
17
- * Get key of relation
18
17
  */
19
- get key(): string;
18
+ get type(): string;
20
19
  /**
21
- * Get Text fragments
20
+ * Get key of relation
22
21
  */
23
- get textfragments(): textfragmentJSON[];
22
+ get key(): string;
24
23
  /**
25
24
  * Get Label of relation
26
25
  */
@@ -29,6 +28,13 @@ export default class ConceptRelationModel {
29
28
  * Get direction of relation
30
29
  */
31
30
  get direction(): string;
31
+ /**
32
+ * Get type of relation type,
33
+ */
34
+ get relationTypeType(): "None" | "Sub-Class" | "Composition" | "Association" | "Unknown";
35
+ /**
36
+ */
37
+ get condition(): string;
32
38
  /**
33
39
  * Set concept information
34
40
  */
@@ -37,8 +43,17 @@ export default class ConceptRelationModel {
37
43
  * Get other concept
38
44
  */
39
45
  get concept(): ConceptLinkModel;
46
+ /**
47
+ * Get Text fragments
48
+ */
49
+ get textfragments(): textfragmentJSON[];
50
+ /**
51
+ * Get Properties
52
+ */
53
+ get properties(): propertyJSON[];
40
54
  }
41
55
  import ConceptLinkModel from "./ConceptLinkModel";
42
56
  import LinkModel from "../links/LinkModel";
43
57
  import { ModularUIModel } from "../types";
44
58
  import { textfragmentJSON } from "../types";
59
+ import { propertyJSON } from "../types";
@@ -5,6 +5,9 @@ export default class ContentModel extends ResourceModel {
5
5
  _section: SectionModel;
6
6
  _contentType: ContentTypeModel | null;
7
7
  _filterCollection: FilterCollection;
8
+ /**
9
+ */
10
+ setChildModels(models: Array<ModularUIModel>): void;
8
11
  /**
9
12
  * Set concept type
10
13
  */
@@ -69,6 +72,7 @@ import ResourceModel from "../base/ResourceModel";
69
72
  import SectionModel from "./SectionModel";
70
73
  import ContentTypeModel from "./ContentTypeModel";
71
74
  import FilterCollection from "../filters/FilterCollection";
75
+ import { ModularUIModel } from "../types";
72
76
  import ContentLinkModel from "./ContentLinkModel";
73
77
  import SubSectionModel from "./SubSectionModel";
74
78
  import Href from "../href/Href";
@@ -4,6 +4,9 @@
4
4
  export default class ContentTOCModel extends ResourceModel {
5
5
  _contentType: ContentTypeModel | null;
6
6
  _filterCollection: FilterCollection;
7
+ /**
8
+ */
9
+ setChildModels(models: Array<ModularUIModel>): void;
7
10
  /**
8
11
  */
9
12
  set contentType(contentType: ContentTypeModel);
@@ -34,4 +37,5 @@ export default class ContentTOCModel extends ResourceModel {
34
37
  import ResourceModel from "../base/ResourceModel";
35
38
  import ContentTypeModel from "./ContentTypeModel";
36
39
  import FilterCollection from "../filters/FilterCollection";
40
+ import { ModularUIModel } from "../types";
37
41
  import ContentLinkModel from "./ContentLinkModel";
@@ -193,7 +193,7 @@ declare class FormModel extends ResourceModel {
193
193
  */
194
194
  getResultData(): {
195
195
  [key: string]: AttributeSetModel;
196
- };
196
+ } | null;
197
197
  /**
198
198
  */
199
199
  get resultData(): Object;
@@ -280,6 +280,12 @@ declare class FormModel extends ResourceModel {
280
280
  * Merge existing form with new form
281
281
  */
282
282
  update(receivedForm: ModularUIModel): FormModel;
283
+ /**
284
+ * Updates the current form object with new information about the object,
285
+ * like for example a new dynamicschema. Used for autoupdate functionality that makes it possible
286
+ * to update the options of a next missing attribute in a form-tree iq question
287
+ */
288
+ updateCurrentFormObject(receivedForm: ModularUIModel): void;
283
289
  /**
284
290
  */
285
291
  updateValidations(data: any): FormModel;
@@ -40,7 +40,7 @@ export default class FormObjectModel extends BaseModel {
40
40
  getInitialChildModelLinks(): Array<LinkModel>;
41
41
  /**
42
42
  */
43
- setChildModels(models: Array<ModularUIModel>): void;
43
+ setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>): void;
44
44
  /**
45
45
  * get key
46
46
  */
@@ -53,7 +53,15 @@ export default class FormObjectModel extends BaseModel {
53
53
  */
54
54
  get hasEndResultConfiguration(): boolean;
55
55
  /**
56
- * Indicates if object is dynamic. A dynamic object should be submitted on each attribute change
56
+ * Indicates if object is dynamic.
57
+ *
58
+ * A subtle difference exists between objects for wizard style instrument dialogs and other objects.
59
+ * In the 'missing object' response, wizard style objects will include only the first attribute(s) to be answered,
60
+ * while other objects will include the complete set of attributes of that object.
61
+ *
62
+ * This difference is condensed in the term of 'dynamic objects': these objects start (in the 'missing object' response)
63
+ * with a very select set of attributes to be answered, and each successive 'missing elements' response will include next attributes to be answered.
64
+ * When an object is dynamic, the form contributions will mention a "dynamicObject": true property.
57
65
  */
58
66
  get isDynamic(): boolean;
59
67
  /**
@@ -194,5 +202,6 @@ import ErrorCollection from "../error/ErrorCollection";
194
202
  import { AttributeType } from "../types";
195
203
  import LinkModel from "../links/LinkModel";
196
204
  import { ModularUIModel } from "../types";
205
+ import ErrorResponse from "../error/ErrorResponse";
197
206
  import { FormErrorAnchor } from "../types";
198
207
  import { MessageParameters } from "../../i18n";
@@ -3,7 +3,7 @@ export default normalizeLinkJSON;
3
3
  * Normalize various link formats from services into a concistent format
4
4
  * @private
5
5
  */
6
- declare function normalizeLinkJSON(data: Object, contributions: Object): {
6
+ declare function normalizeLinkJSON(data: Object, contributions: Object): Array<{
7
7
  data: any;
8
8
  contributions: any;
9
- }[];
9
+ }>;
@@ -11,6 +11,9 @@ export default class ListModel extends ResourceModel {
11
11
  _listItemCollection: ListItemCollection;
12
12
  _grouping: GroupingModel;
13
13
  _selfhref: ListHref;
14
+ /**
15
+ */
16
+ setChildModels(models: Array<ModularUIModel>): void;
14
17
  /**
15
18
  * Add detail model to the {ListModel}
16
19
  */
@@ -136,4 +139,5 @@ import ActionCollection from "../actions/ActionCollection";
136
139
  import ListItemCollection from "../list/ListItemCollection";
137
140
  import GroupingModel from "../grouping/GroupingModel";
138
141
  import ListHref from "../href/ListHref";
142
+ import { ModularUIModel } from "../types";
139
143
  import ListItemModel from "../list/ListItemModel";