@beinformed/ui 1.9.0-beta.9 → 1.9.3

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 (130) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/esm/hooks/useForm.js.map +1 -1
  3. package/esm/hooks/useNotification.js.map +1 -1
  4. package/esm/hooks/useRouter.js.map +1 -1
  5. package/esm/models/attributes/AttributeContent.js +49 -20
  6. package/esm/models/attributes/AttributeContent.js.map +1 -1
  7. package/esm/models/attributes/AttributeDataHelper.js +1 -1
  8. package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
  9. package/esm/models/attributes/HelptextAttributeModel.js +3 -1
  10. package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
  11. package/esm/models/caseview/CaseViewModel.js +26 -12
  12. package/esm/models/caseview/CaseViewModel.js.map +1 -1
  13. package/esm/models/contentconfiguration/ContentConfigurationResults.js +2 -2
  14. package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  15. package/esm/models/form/FormObjectModel.js +8 -2
  16. package/esm/models/form/FormObjectModel.js.map +1 -1
  17. package/esm/models/layouthint/LayoutHintCollection.js +3 -2
  18. package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
  19. package/esm/models/list/ListDetailModel.js +25 -0
  20. package/esm/models/list/ListDetailModel.js.map +1 -1
  21. package/esm/models/list/ListModel.js +22 -16
  22. package/esm/models/list/ListModel.js.map +1 -1
  23. package/esm/models/panels/GroupingPanelModel.js +19 -17
  24. package/esm/models/panels/GroupingPanelModel.js.map +1 -1
  25. package/esm/modularui/ModularUIRequest.js +2 -1
  26. package/esm/modularui/ModularUIRequest.js.map +1 -1
  27. package/esm/redux/actions/FormAutosave.js +2 -1
  28. package/esm/redux/actions/FormAutosave.js.map +1 -1
  29. package/esm/redux/actions/FormValidations.js +2 -1
  30. package/esm/redux/actions/FormValidations.js.map +1 -1
  31. package/lib/hooks/useForm.js.flow +10 -5
  32. package/lib/hooks/useForm.js.map +1 -1
  33. package/lib/hooks/useNotification.js.flow +5 -2
  34. package/lib/hooks/useNotification.js.map +1 -1
  35. package/lib/hooks/useRouter.js.flow +12 -5
  36. package/lib/hooks/useRouter.js.map +1 -1
  37. package/lib/models/attributes/AttributeContent.js +51 -20
  38. package/lib/models/attributes/AttributeContent.js.flow +38 -13
  39. package/lib/models/attributes/AttributeContent.js.map +1 -1
  40. package/lib/models/attributes/AttributeDataHelper.js +1 -1
  41. package/lib/models/attributes/AttributeDataHelper.js.flow +2 -1
  42. package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
  43. package/lib/models/attributes/HelptextAttributeModel.js +3 -1
  44. package/lib/models/attributes/HelptextAttributeModel.js.flow +1 -1
  45. package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
  46. package/lib/models/attributes/__tests__/AttributeContent.spec.js.flow +4 -2
  47. package/lib/models/attributes/__tests__/AttributeDataHelper.spec.js.flow +9 -3
  48. package/lib/models/attributes/__tests__/HelptextAttributeModel.spec.js.flow +1 -1
  49. package/lib/models/caseview/CaseViewModel.js +27 -13
  50. package/lib/models/caseview/CaseViewModel.js.flow +17 -7
  51. package/lib/models/caseview/CaseViewModel.js.map +1 -1
  52. package/lib/models/caseview/__tests__/CaseViewModel.spec.js.flow +68 -184
  53. package/lib/models/concepts/__mock__/business_scenario.js.flow +14 -1
  54. package/lib/models/concepts/__mock__/conceptdetail.js.flow +15 -6
  55. package/lib/models/concepts/__tests__/BusinessScenarioModel.spec.js.flow +5 -6
  56. package/lib/models/concepts/__tests__/ConceptDetailModel.spec.js.flow +58 -3
  57. package/lib/models/contentconfiguration/ContentConfigurationResults.js +2 -2
  58. package/lib/models/contentconfiguration/ContentConfigurationResults.js.flow +2 -2
  59. package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  60. package/lib/models/contentconfiguration/__tests__/ContentConfigurationResults.spec.js.flow +6 -6
  61. package/lib/models/form/FormObjectModel.js +8 -2
  62. package/lib/models/form/FormObjectModel.js.flow +5 -1
  63. package/lib/models/form/FormObjectModel.js.map +1 -1
  64. package/lib/models/form/__tests__/FormObjectModel.spec.js.flow +2 -2
  65. package/lib/models/layouthint/LayoutHintCollection.js +4 -2
  66. package/lib/models/layouthint/LayoutHintCollection.js.flow +8 -7
  67. package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
  68. package/lib/models/list/ListDetailModel.js +25 -0
  69. package/lib/models/list/ListDetailModel.js.flow +19 -0
  70. package/lib/models/list/ListDetailModel.js.map +1 -1
  71. package/lib/models/list/ListModel.js +23 -16
  72. package/lib/models/list/ListModel.js.flow +9 -5
  73. package/lib/models/list/ListModel.js.map +1 -1
  74. package/lib/models/list/__tests__/ListDetailModel.spec.js.flow +64 -0
  75. package/lib/models/list/__tests__/ListModel.spec.js.flow +64 -2
  76. package/lib/models/panels/GroupingPanelModel.js +21 -18
  77. package/lib/models/panels/GroupingPanelModel.js.flow +10 -9
  78. package/lib/models/panels/GroupingPanelModel.js.map +1 -1
  79. package/lib/models/panels/__tests__/GroupingPanelModel.spec.js.flow +90 -0
  80. package/lib/models/types.js.flow +24 -6
  81. package/lib/modularui/ModularUIRequest.js +2 -1
  82. package/lib/modularui/ModularUIRequest.js.flow +1 -0
  83. package/lib/modularui/ModularUIRequest.js.map +1 -1
  84. package/lib/redux/actions/FormAutosave.js +2 -1
  85. package/lib/redux/actions/FormAutosave.js.flow +1 -0
  86. package/lib/redux/actions/FormAutosave.js.map +1 -1
  87. package/lib/redux/actions/FormValidations.js +2 -1
  88. package/lib/redux/actions/FormValidations.js.flow +1 -0
  89. package/lib/redux/actions/FormValidations.js.map +1 -1
  90. package/package.json +15 -15
  91. package/src/hooks/useForm.js +10 -5
  92. package/src/hooks/useNotification.js +5 -2
  93. package/src/hooks/useRouter.js +12 -5
  94. package/src/models/attributes/AttributeContent.js +38 -13
  95. package/src/models/attributes/AttributeDataHelper.js +2 -1
  96. package/src/models/attributes/HelptextAttributeModel.js +1 -1
  97. package/src/models/attributes/__tests__/AttributeContent.spec.js +4 -2
  98. package/src/models/attributes/__tests__/AttributeDataHelper.spec.js +9 -3
  99. package/src/models/attributes/__tests__/HelptextAttributeModel.spec.js +1 -1
  100. package/src/models/caseview/CaseViewModel.js +17 -7
  101. package/src/models/caseview/__tests__/CaseViewModel.spec.js +68 -184
  102. package/src/models/caseview/__tests__/caseview.json +38 -0
  103. package/src/models/caseview/__tests__/caseviewContributions.json +147 -0
  104. package/src/models/concepts/__mock__/business_scenario.js +14 -1
  105. package/src/models/concepts/__mock__/business_scenario_step.json +64 -0
  106. package/src/models/concepts/__mock__/conceptdetail.js +15 -6
  107. package/src/models/concepts/__mock__/conceptdetail_data.json +117 -17
  108. package/src/models/concepts/__mock__/concepttype_Calculation.json +75 -0
  109. package/src/models/concepts/__tests__/BusinessScenarioModel.spec.js +5 -6
  110. package/src/models/concepts/__tests__/ConceptDetailModel.spec.js +58 -3
  111. package/src/models/contentconfiguration/ContentConfigurationResults.js +2 -2
  112. package/src/models/contentconfiguration/__tests__/ContentConfigurationResults.spec.js +6 -6
  113. package/src/models/form/FormObjectModel.js +5 -1
  114. package/src/models/form/__tests__/FormObjectModel.spec.js +2 -2
  115. package/src/models/form/__tests__/FormWithContentData.json +2 -1
  116. package/src/models/layouthint/LayoutHintCollection.js +8 -7
  117. package/src/models/list/ListDetailModel.js +19 -0
  118. package/src/models/list/ListModel.js +9 -5
  119. package/src/models/list/__tests__/ListDetailModel.spec.js +64 -0
  120. package/src/models/list/__tests__/ListModel.spec.js +64 -2
  121. package/src/models/list/__tests__/caselist-34.contributions.json +1 -1
  122. package/src/models/list/__tests__/listContributions.json +1 -1
  123. package/src/models/panels/GroupingPanelModel.js +10 -9
  124. package/src/models/panels/__tests__/GroupingPanelModel.spec.js +90 -0
  125. package/src/models/panels/__tests__/groupingPanel.json +30 -0
  126. package/src/models/panels/__tests__/groupingPanelContributions.json +46 -0
  127. package/src/models/types.js +24 -6
  128. package/src/modularui/ModularUIRequest.js +1 -0
  129. package/src/redux/actions/FormAutosave.js +1 -0
  130. package/src/redux/actions/FormValidations.js +1 -0
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "concept": {
3
- "_id": "StaandehoudingScSt",
3
+ "_id": "DurationDrivingBan",
4
4
  "_links": {
5
5
  "self": {
6
- "href": "/concepts/Incident/Business design/Business scenario/Scenario incident.bixml/StaandehoudingScSt"
6
+ "href": "/concepts/_Models and content/Police incident handling/Models/Sanctions/Driving ban/Duration driving ban.bixml/DurationDrivingBan"
7
7
  },
8
8
  "api_doc": {
9
9
  "href": "/api-docs/v3/concepts/(knowledge-model-identifier)/(concept-identifier)"
@@ -12,51 +12,151 @@
12
12
  "href": "/contributions/concepts/(knowledge-model-identifier)/(concept-identifier)"
13
13
  },
14
14
  "concepttype": {
15
- "href": "/concepttypes/Library/KMTs/Business scenarios.bixml/ScenarioStep"
15
+ "href": "/concepttypes/Library/KMTs/Products.bixml/Calculation"
16
16
  }
17
17
  },
18
18
  "filter": {
19
19
  "entryDate": {
20
20
  "param": "entryDate",
21
21
  "name": "entryDate",
22
- "value": "2020-11-20"
22
+ "value": "2021-09-23"
23
23
  }
24
24
  },
25
- "conceptLabel": "Staandehouding",
25
+ "conceptLabel": "Duration driving ban",
26
+ "formula": "IF (NoviceDriver) (NUMBER)DurationDrivingBanNoviceDriver ELSE IF\n(ExperiencedDriver) (NUMBER)DurationDrivingBanExperiencedDriver ENDIF ENDIF",
26
27
  "taxonomyType": "default",
28
+ "sourceReferences": [
29
+ {
30
+ "label": "Duration driving ban",
31
+ "type": "DescriptionFormalSourceSubsection",
32
+ "sourceLabel": "Duration driving ban (formal source, subsections)",
33
+ "_links": {
34
+ "self": {
35
+ "href": "/content/_Models and content/Police incident handling/Content/Driving ban/Subsections/Duration driving ban.formalsource/Introduction#DurationDrivingBan"
36
+ },
37
+ "content": {
38
+ "href": "/content/_Models and content/Police incident handling/Content/Driving ban/Subsections/Duration driving ban.formalsource"
39
+ }
40
+ }
41
+ },
42
+ {
43
+ "label": "Duration driving ban",
44
+ "type": "DescriptionTextileSource",
45
+ "sourceLabel": "Duration driving ban (textile source)",
46
+ "_links": {
47
+ "self": {
48
+ "href": "/content/_Models and content/Police incident handling/Content/Driving ban/Duration driving ban.textilesource/duration"
49
+ },
50
+ "content": {
51
+ "href": "/content/_Models and content/Police incident handling/Content/Driving ban/Duration driving ban.textilesource"
52
+ }
53
+ }
54
+ }
55
+ ],
56
+ "properties": [
57
+ {
58
+ "value": "DDB",
59
+ "type": "Abbreviation"
60
+ }
61
+ ],
62
+ "labels": [
63
+ {
64
+ "type": "ResultLabel",
65
+ "value": "Duration of driving ban (in months)"
66
+ }
67
+ ],
68
+ "textFragments": [
69
+ {
70
+ "type": "Description",
71
+ "id": "DurationDrivingBan.tv852.Description",
72
+ "text": "Text fragment for duration driving ban"
73
+ }
74
+ ],
27
75
  "relations": [
28
76
  {
29
- "relationLabel": "performed by",
30
- "relationType": "performedBy",
77
+ "relationLabel": "depends on",
78
+ "relationType": "depends_on",
79
+ "relationDirection": "outgoing",
80
+ "concept": {
81
+ "_links": {
82
+ "self": {
83
+ "href": "/concepts/_Models and content/Police incident handling/Models/Sanctions/Driver.bixml/NoviceDriver"
84
+ },
85
+ "concepttype": {
86
+ "href": "/concepttypes/Library/KMTs/Products.bixml/Class"
87
+ }
88
+ },
89
+ "conceptLabel": "Novice driver",
90
+ "_id": "NoviceDriver"
91
+ }
92
+ },
93
+ {
94
+ "relationLabel": "depends on",
95
+ "relationType": "depends_on",
96
+ "relationDirection": "outgoing",
97
+ "concept": {
98
+ "_links": {
99
+ "self": {
100
+ "href": "/concepts/_Models and content/Police incident handling/Models/Sanctions/Driver.bixml/ExperiencedDriver"
101
+ },
102
+ "concepttype": {
103
+ "href": "/concepttypes/Library/KMTs/Products.bixml/Class"
104
+ }
105
+ },
106
+ "conceptLabel": "Experienced driver",
107
+ "_id": "ExperiencedDriver"
108
+ }
109
+ },
110
+ {
111
+ "relationLabel": "depends on",
112
+ "relationType": "depends_on",
113
+ "relationDirection": "outgoing",
114
+ "concept": {
115
+ "_links": {
116
+ "self": {
117
+ "href": "/concepts/_Models and content/Police incident handling/Models/Sanctions/Driving ban/Duration driving ban.bixml/DurationDrivingBanNoviceDriver"
118
+ },
119
+ "concepttype": {
120
+ "href": "/concepttypes/Library/KMTs/Products.bixml/Ground"
121
+ }
122
+ },
123
+ "conceptLabel": "Duration driving ban novice driver",
124
+ "_id": "DurationDrivingBanNoviceDriver"
125
+ }
126
+ },
127
+ {
128
+ "relationLabel": "depends on",
129
+ "relationType": "depends_on",
31
130
  "relationDirection": "outgoing",
32
131
  "concept": {
33
132
  "_links": {
34
133
  "self": {
35
- "href": "/concepts/Incident/Business design/Business scenario/Scenario incident.bixml/Agent"
134
+ "href": "/concepts/_Models and content/Police incident handling/Models/Sanctions/Driving ban/Duration driving ban.bixml/DurationDrivingBanExperiencedDriver"
36
135
  },
37
136
  "concepttype": {
38
- "href": "/concepttypes/Library/KMTs/Business scenarios.bixml/Persona"
137
+ "href": "/concepttypes/Library/KMTs/Products.bixml/Ground"
39
138
  }
40
139
  },
41
- "conceptLabel": "Agent",
42
- "_id": "Agent"
140
+ "conceptLabel": "Duration driving ban experienced driver",
141
+ "_id": "DurationDrivingBanExperiencedDriver"
43
142
  }
44
143
  },
45
144
  {
46
- "relationLabel": "consists of",
47
- "relationType": "consistsOf",
145
+ "relationLabel": "required by with condition",
146
+ "relationType": "requiresWithCondition",
147
+ "relationCondition": "DurationDrivingBan >= 0",
48
148
  "relationDirection": "incoming",
49
149
  "concept": {
50
150
  "_links": {
51
151
  "self": {
52
- "href": "/concepts/Incident/Business design/Business scenario/Scenario incident.bixml/ScenarioIncident"
152
+ "href": "/concepts/_Models and content/Police incident handling/Models/Approvals/Approved duration driving ban.bixml/ApprovedDurationDrivingBan"
53
153
  },
54
154
  "concepttype": {
55
- "href": "/concepttypes/Library/KMTs/Business scenarios.bixml/BusinessScenario"
155
+ "href": "/concepttypes/Library/KMTs/Products.bixml/Decision"
56
156
  }
57
157
  },
58
- "conceptLabel": "Scenario incident",
59
- "_id": "ScenarioIncident"
158
+ "conceptLabel": "Approved duration driving ban",
159
+ "_id": "ApprovedDurationDrivingBan"
60
160
  }
61
161
  }
62
162
  ]
@@ -0,0 +1,75 @@
1
+ {
2
+ "concepttype": {
3
+ "_links": {
4
+ "self": {
5
+ "href": "/concepttypes/Library/KMTs/Products.bixml/Calculation"
6
+ },
7
+ "api_doc": {
8
+ "href": "/api-docs/v3/concepttypes/(knowledge-model-type-identifier)/(concept-type-identifier)"
9
+ },
10
+ "contributions": {
11
+ "href": "/contributions/concepttypes/(knowledge-model-type-identifier)/(concept-type-identifier)"
12
+ }
13
+ },
14
+ "_id": "Calculation",
15
+ "label": "Calculation",
16
+ "icon": "/resource/Library/General/Icons/Products/calculation_24x24.png",
17
+ "textColor": "#000000",
18
+ "lineColor": "#000000",
19
+ "backgroundColor": "#F3A60D",
20
+ "coreTaxonomy": "false",
21
+ "textFragmentTypes": [
22
+ { "_id": "Definition", "label": "Definition" },
23
+ { "_id": "Description", "label": "Description" },
24
+ { "_id": "IconSmall", "label": "Icon-small" },
25
+ { "_id": "IconMedium", "label": "Icon-medium" },
26
+ { "_id": "IconLarge", "label": "Icon-large" },
27
+ {
28
+ "_id": "NonFunctionalRequirement",
29
+ "label": "Non functional requirement"
30
+ },
31
+ { "_id": "FunctionalRequirement", "label": "Functional requirement" },
32
+ { "_id": "Rationale", "label": "Rationale" },
33
+ { "_id": "tfNote", "label": "NL TF NOTE" }
34
+ ],
35
+ "labelTypes": [
36
+ { "_id": "QuestionLabel", "label": "Question label" },
37
+ { "_id": "ResultLabel", "label": "Result label" }
38
+ ],
39
+ "propertyTypes": [
40
+ {
41
+ "_id": "PartnerService",
42
+ "label": "Partner Service",
43
+ "type": "string",
44
+ "mandatory": "false"
45
+ },
46
+ {
47
+ "_id": "Abbreviation",
48
+ "label": "Abbreviation",
49
+ "type": "string",
50
+ "mandatory": "false"
51
+ }
52
+ ],
53
+ "sectionReferenceTypes": [
54
+ { "_id": "crDescription", "label": "Description" },
55
+ {
56
+ "_id": "DescriptionFormalSource",
57
+ "label": "Description (formal source)"
58
+ },
59
+ {
60
+ "_id": "DescriptionFormalSourceSubsection",
61
+ "label": "Description (formal source, subsection)"
62
+ },
63
+ {
64
+ "_id": "DescriptionLocalSource",
65
+ "label": "Description (local source)"
66
+ },
67
+ {
68
+ "_id": "DescriptionTextileSource",
69
+ "label": "Description (textile source)"
70
+ },
71
+ { "_id": "Reference", "label": "Reference" },
72
+ { "_id": "Satisfies", "label": "Satisfies" }
73
+ ]
74
+ }
75
+ }
@@ -1,6 +1,5 @@
1
1
  import BusinessScenarioModel from "../BusinessScenarioModel";
2
- import businessScenario from "../__mock__/business_scenario";
3
- import conceptDetail from "../__mock__/conceptdetail";
2
+ import { scenario, step } from "../__mock__/business_scenario";
4
3
  import conceptType from "../__mock__/concepttype";
5
4
 
6
5
  describe("businessScenarioModel", () => {
@@ -12,16 +11,16 @@ describe("businessScenarioModel", () => {
12
11
  });
13
12
 
14
13
  it("can retrieve child model links", () => {
15
- const initialChildModelLinks = businessScenario.getInitialChildModelLinks();
14
+ const initialChildModelLinks = scenario.getInitialChildModelLinks();
16
15
 
17
16
  expect(initialChildModelLinks).toHaveLength(13);
18
17
  });
19
18
 
20
19
  it("can set scenarioSteps", () => {
21
- businessScenario.setChildModels([conceptType, conceptDetail]);
20
+ scenario.setChildModels([conceptType, step]);
22
21
 
23
- const scenarioSteps = businessScenario.scenarioSteps;
24
- const actors = businessScenario.actors;
22
+ const scenarioSteps = scenario.scenarioSteps;
23
+ const actors = scenario.actors;
25
24
 
26
25
  expect(scenarioSteps).toHaveLength(1);
27
26
  expect(actors).toHaveLength(1);
@@ -1,10 +1,65 @@
1
1
  import ConceptDetailModel from "../ConceptDetailModel";
2
2
 
3
- describe("conceptDetailModel", () => {
4
- it("should be able to create an empty ConceptDetailModel object", () => {
5
- const conceptDetail = new ConceptDetailModel();
3
+ import { conceptDetail } from "../__mock__/conceptdetail";
6
4
 
5
+ describe("conceptDetailModel", () => {
6
+ it("should be able to create a ConceptDetailModel object", () => {
7
7
  expect(conceptDetail).toBeInstanceOf(ConceptDetailModel);
8
8
  expect(conceptDetail.type).toBe("ConceptDetail");
9
+
10
+ expect(conceptDetail.key).toBe("DurationDrivingBan");
11
+ expect(conceptDetail.conceptType.label).toBe("Calculation");
12
+
13
+ expect(conceptDetail.label).toBe("Duration driving ban");
14
+ expect(conceptDetail.taxonomyType).toBe("default");
15
+
16
+ expect(conceptDetail.formula).toBe(
17
+ "IF (NoviceDriver) (NUMBER)DurationDrivingBanNoviceDriver ELSE IF\n(ExperiencedDriver) (NUMBER)DurationDrivingBanExperiencedDriver ENDIF ENDIF"
18
+ );
19
+ expect(conceptDetail.labels).toStrictEqual([
20
+ {
21
+ _id: "QuestionLabel",
22
+ label: "Question label",
23
+ },
24
+ {
25
+ _id: "ResultLabel",
26
+ label: "Result label",
27
+ type: "ResultLabel",
28
+ value: "Duration of driving ban (in months)",
29
+ },
30
+ ]);
31
+ expect(conceptDetail.conceptProperties).toStrictEqual([
32
+ {
33
+ _id: "PartnerService",
34
+ label: "Partner Service",
35
+ mandatory: "false",
36
+ type: "string",
37
+ },
38
+ {
39
+ _id: "Abbreviation",
40
+ label: "Abbreviation",
41
+ mandatory: "false",
42
+ type: "Abbreviation",
43
+ value: "DDB",
44
+ },
45
+ ]);
46
+ expect(conceptDetail.textfragments).toStrictEqual([
47
+ {
48
+ _id: "Description",
49
+ label: "Description",
50
+ id: "DurationDrivingBan.tv852.Description",
51
+ text: "Text fragment for duration driving ban",
52
+ type: "Description",
53
+ },
54
+ { _id: "Definition", label: "Definition" },
55
+ { _id: "IconSmall", label: "Icon-small" },
56
+ { _id: "IconMedium", label: "Icon-medium" },
57
+ { _id: "IconLarge", label: "Icon-large" },
58
+ { _id: "NonFunctionalRequirement", label: "Non functional requirement" },
59
+ { _id: "FunctionalRequirement", label: "Functional requirement" },
60
+ { _id: "Rationale", label: "Rationale" },
61
+ { _id: "tfNote", label: "NL TF NOTE" },
62
+ ]);
63
+ expect(conceptDetail.entryDate).toBe("2021-09-23");
9
64
  });
10
65
  });
@@ -35,8 +35,8 @@ class ContentConfigurationResults {
35
35
  }
36
36
 
37
37
  const description = this._configuration.description;
38
- if (isPlainObject(description) && "rawText" in description) {
39
- return description.rawText;
38
+ if (isPlainObject(description) && "message" in description) {
39
+ return description.message;
40
40
  }
41
41
 
42
42
  return description;
@@ -33,14 +33,14 @@ describe("ContentConfigurationResults", () => {
33
33
  });
34
34
 
35
35
  it("can handle configuration with description object", () => {
36
- const rawText =
36
+ const message =
37
37
  "<p>The property value is ${EstimatedPropertyValue} and my personal deposit is ${MortgageDeposit}. The mortgage is a repayment mortgage for a term of ${MortgageTermInYears} years. The rate type is ${InterestRateType} for a period of ${PeriodOfInterestRate}.</p>";
38
38
 
39
39
  const contributions = {
40
40
  label: "Total cost of mortgage",
41
41
  description: {
42
42
  id: "CalculatorResults.TotalCostOfMortgage.introText",
43
- rawText,
43
+ message,
44
44
  },
45
45
  layouthint: ["render-description:TotalCostOfMortgage"],
46
46
  attributes: ["TotalCostOfMortgage"],
@@ -59,7 +59,7 @@ describe("ContentConfigurationResults", () => {
59
59
  );
60
60
 
61
61
  expect(contentConfigurationResults.label).toBe("Total cost of mortgage");
62
- expect(contentConfigurationResults.description).toBe(rawText);
62
+ expect(contentConfigurationResults.description).toBe(message);
63
63
  expect(contentConfigurationResults.attributes).toStrictEqual([
64
64
  "TotalCostOfMortgage",
65
65
  ]);
@@ -87,15 +87,15 @@ describe("ContentConfigurationResults", () => {
87
87
  });
88
88
 
89
89
  it("can handle configuration with description string", () => {
90
- const rawText =
90
+ const message =
91
91
  "<p>The property value is ${EstimatedPropertyValue} and my personal deposit is ${MortgageDeposit}. The mortgage is a repayment mortgage for a term of ${MortgageTermInYears} years. The rate type is ${InterestRateType} for a period of ${PeriodOfInterestRate}.</p>";
92
92
 
93
93
  const contentConfigurationResults = new ContentConfigurationResults({
94
94
  label: "Total cost of mortgage",
95
- description: rawText,
95
+ description: message,
96
96
  });
97
97
 
98
98
  expect(contentConfigurationResults.label).toBe("Total cost of mortgage");
99
- expect(contentConfigurationResults.description).toBe(rawText);
99
+ expect(contentConfigurationResults.description).toBe(message);
100
100
  });
101
101
  });
@@ -295,8 +295,12 @@ export default class FormObjectModel extends BaseModel {
295
295
  * Get introText of form object
296
296
  */
297
297
  get introText(): string {
298
+ if (this.data.content?.text) {
299
+ return this.data.content.text.message ?? this.data.content.text;
300
+ }
301
+
298
302
  return (
299
- this.contributions.introText?.rawText ?? this.contributions.introText
303
+ this.contributions.introText?.message ?? this.contributions.introText
300
304
  );
301
305
  }
302
306
 
@@ -19,7 +19,7 @@ const data = {
19
19
  const contributions = {
20
20
  repeatable: false,
21
21
  label: "Create person",
22
- introText: { id: "IntroTextID", rawText: "This is introtext" },
22
+ introText: { id: "IntroTextID", message: "This is introtext" },
23
23
  attributes: [
24
24
  {
25
25
  Name: {
@@ -122,7 +122,7 @@ describe("formObjectModel", () => {
122
122
  const contributions2 = {
123
123
  repeatable: false,
124
124
  label: "Create person",
125
- introText: { id: "IntroTextID", rawText: "This is new introtext" },
125
+ introText: { id: "IntroTextID", message: "This is new introtext" },
126
126
  attributes: [],
127
127
  };
128
128
 
@@ -19,7 +19,8 @@
19
19
  {
20
20
  "elementid": "UitslagBlaastestType",
21
21
  "content": {
22
- "header": { "label": "Uitslag blaastest label" },
22
+ "header": { "label": "Header label" },
23
+ "label": "Uitslag blaastest label",
23
24
  "elements": [
24
25
  {
25
26
  "contentElement": {
@@ -35,11 +35,13 @@ export default class LayoutHintCollection extends BaseCollection<string> {
35
35
  has(...hints: Array<string>): boolean {
36
36
  const hintArray = hints.length > 0 ? [...hints] : [];
37
37
 
38
- return hintArray.some(
39
- (hint) =>
40
- this.layouthint.includes(hint) ||
41
- this.layouthint.some((hint2) => hint2.startsWith(hint))
42
- );
38
+ return hintArray
39
+ .flat()
40
+ .some(
41
+ (hint) =>
42
+ this.layouthint.includes(hint) ||
43
+ this.layouthint.some((hint2) => hint2.startsWith(hint))
44
+ );
43
45
  }
44
46
 
45
47
  /**
@@ -51,8 +53,7 @@ export default class LayoutHintCollection extends BaseCollection<string> {
51
53
  */
52
54
  hasExact(...hints: Array<string>): boolean {
53
55
  const hintArray = hints.length > 0 ? [...hints] : [];
54
-
55
- return hintArray.some((hint) => this.layouthint.includes(hint));
56
+ return hintArray.flat().some((hint) => this.layouthint.includes(hint));
56
57
  }
57
58
 
58
59
  /**
@@ -133,6 +133,25 @@ export default class ListDetailModel extends DetailModel {
133
133
  this._contentConfiguration = configuration;
134
134
  }
135
135
 
136
+ /**
137
+ * Getting the introduction text configured on the case view
138
+ */
139
+ get introtext(): string {
140
+ if (this.data._text) {
141
+ return this.data._text.message ?? this.data._text;
142
+ }
143
+
144
+ if (this.contributions.text) {
145
+ return this.contributions.text.message ?? this.contributions.text;
146
+ }
147
+
148
+ if (Array.isArray(this.contributions.texts)) {
149
+ return this.contributions.texts[0].text;
150
+ }
151
+
152
+ return "";
153
+ }
154
+
136
155
  /**
137
156
  */
138
157
  setResultSection() {
@@ -98,12 +98,16 @@ export default class ListModel extends ResourceModel {
98
98
  * Getting the introduction text
99
99
  */
100
100
  get introtext(): string {
101
- if (this.contributions.texts) {
102
- const text = this.contributions.texts.find(
103
- (item) => item.type === "master"
104
- );
101
+ if (this.data.text) {
102
+ return this.data.text.message ?? this.data.text;
103
+ }
104
+
105
+ if (this.contributions.text) {
106
+ return this.contributions.text.message ?? this.contributions.text;
107
+ }
105
108
 
106
- return text ? text.text : "";
109
+ if (Array.isArray(this.contributions.texts)) {
110
+ return this.contributions.texts[0].text;
107
111
  }
108
112
 
109
113
  return "";
@@ -27,4 +27,68 @@ describe("listDetailModel", () => {
27
27
  "Highly Inappropriate Tales for Young People"
28
28
  );
29
29
  });
30
+
31
+ it("should be able to handle different kind of introtext", () => {
32
+ const listdetailOldStructure = new ListDetailModel({
33
+ key: "Book",
34
+ data: data.Book,
35
+ contributions: contributions.Book,
36
+ });
37
+
38
+ expect(listdetailOldStructure.introtext).toBe("<p>This is introtext</p>");
39
+
40
+ const listdetailFromDataPlain = new ListDetailModel({
41
+ key: "Book",
42
+ data: {
43
+ _text: "<p>This is introtext</p>",
44
+ ...data.Book,
45
+ },
46
+ contributions: contributions.Book,
47
+ });
48
+
49
+ expect(listdetailFromDataPlain.introtext).toBe("<p>This is introtext</p>");
50
+
51
+ const listdetailFromDataApplicationMessage = new ListDetailModel({
52
+ key: "Book",
53
+ data: {
54
+ ...data.Book,
55
+ _text: {
56
+ message: "<p>This is introtext</p>",
57
+ },
58
+ },
59
+ contributions: contributions.Book,
60
+ });
61
+
62
+ expect(listdetailFromDataApplicationMessage.introtext).toBe(
63
+ "<p>This is introtext</p>"
64
+ );
65
+
66
+ const listdetailFromNewContributionsRawTextMessage = new ListDetailModel({
67
+ key: "Book",
68
+ data: data.Book,
69
+ contributions: {
70
+ ...contributions.Book,
71
+ text: {
72
+ message: "<p>This is introtext</p>",
73
+ },
74
+ },
75
+ });
76
+
77
+ expect(listdetailFromNewContributionsRawTextMessage.introtext).toBe(
78
+ "<p>This is introtext</p>"
79
+ );
80
+
81
+ const listdetailFromNewContributionsSimpleMessage = new ListDetailModel({
82
+ key: "Book",
83
+ data: data.Book,
84
+ contributions: {
85
+ ...contributions.Book,
86
+ text: "<p>This is introtext</p>",
87
+ },
88
+ });
89
+
90
+ expect(listdetailFromNewContributionsSimpleMessage.introtext).toBe(
91
+ "<p>This is introtext</p>"
92
+ );
93
+ });
30
94
  });