@beinformed/ui 1.9.0-beta.6 → 1.9.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 (160) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/esm/constants/Settings.js +10 -8
  3. package/esm/constants/Settings.js.map +1 -1
  4. package/esm/hooks/useForm.js.map +1 -1
  5. package/esm/hooks/useNotification.js.map +1 -1
  6. package/esm/hooks/useRouter.js.map +1 -1
  7. package/esm/models/attributes/AttributeContent.js +126 -58
  8. package/esm/models/attributes/AttributeContent.js.map +1 -1
  9. package/esm/models/attributes/AttributeDataHelper.js +1 -1
  10. package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
  11. package/esm/models/attributes/AttributeModel.js +3 -3
  12. package/esm/models/attributes/AttributeModel.js.map +1 -1
  13. package/esm/models/attributes/ChoiceAttributeOptionModel.js +4 -4
  14. package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  15. package/esm/models/attributes/HelptextAttributeModel.js +17 -1
  16. package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
  17. package/esm/models/caseview/CaseViewModel.js +26 -12
  18. package/esm/models/caseview/CaseViewModel.js.map +1 -1
  19. package/esm/models/content/SectionModel.js +2 -1
  20. package/esm/models/content/SectionModel.js.map +1 -1
  21. package/esm/models/content/SubSectionModel.js +3 -1
  22. package/esm/models/content/SubSectionModel.js.map +1 -1
  23. package/esm/models/contentconfiguration/ContentConfigurationResults.js +2 -2
  24. package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  25. package/esm/models/form/FormObjectModel.js +8 -2
  26. package/esm/models/form/FormObjectModel.js.map +1 -1
  27. package/esm/models/layouthint/LayoutHintCollection.js +3 -2
  28. package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
  29. package/esm/models/list/ListDetailModel.js +25 -0
  30. package/esm/models/list/ListDetailModel.js.map +1 -1
  31. package/esm/models/list/ListModel.js +22 -16
  32. package/esm/models/list/ListModel.js.map +1 -1
  33. package/esm/models/panels/GroupingPanelModel.js +19 -17
  34. package/esm/models/panels/GroupingPanelModel.js.map +1 -1
  35. package/esm/modularui/ModularUIRequest.js +2 -1
  36. package/esm/modularui/ModularUIRequest.js.map +1 -1
  37. package/esm/utils/helpers/text.js +19 -0
  38. package/esm/utils/helpers/text.js.map +1 -0
  39. package/esm/utils/index.js +2 -1
  40. package/esm/utils/index.js.map +1 -1
  41. package/lib/constants/Settings.js +12 -1
  42. package/lib/constants/Settings.js.flow +9 -5
  43. package/lib/constants/Settings.js.map +1 -1
  44. package/lib/hooks/useForm.js.flow +10 -5
  45. package/lib/hooks/useForm.js.map +1 -1
  46. package/lib/hooks/useNotification.js.flow +5 -2
  47. package/lib/hooks/useNotification.js.map +1 -1
  48. package/lib/hooks/useRouter.js.flow +12 -5
  49. package/lib/hooks/useRouter.js.map +1 -1
  50. package/lib/models/attributes/AttributeContent.js +136 -59
  51. package/lib/models/attributes/AttributeContent.js.flow +91 -39
  52. package/lib/models/attributes/AttributeContent.js.map +1 -1
  53. package/lib/models/attributes/AttributeDataHelper.js +1 -1
  54. package/lib/models/attributes/AttributeDataHelper.js.flow +2 -1
  55. package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
  56. package/lib/models/attributes/AttributeModel.js +1 -1
  57. package/lib/models/attributes/AttributeModel.js.flow +2 -3
  58. package/lib/models/attributes/AttributeModel.js.map +1 -1
  59. package/lib/models/attributes/ChoiceAttributeOptionModel.js +3 -3
  60. package/lib/models/attributes/ChoiceAttributeOptionModel.js.flow +4 -7
  61. package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  62. package/lib/models/attributes/HelptextAttributeModel.js +17 -1
  63. package/lib/models/attributes/HelptextAttributeModel.js.flow +11 -1
  64. package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
  65. package/lib/models/attributes/__tests__/AttributeContent.spec.js.flow +10 -2
  66. package/lib/models/attributes/__tests__/AttributeDataHelper.spec.js.flow +9 -3
  67. package/lib/models/attributes/__tests__/HelptextAttributeModel.spec.js.flow +39 -1
  68. package/lib/models/caseview/CaseViewModel.js +27 -13
  69. package/lib/models/caseview/CaseViewModel.js.flow +17 -7
  70. package/lib/models/caseview/CaseViewModel.js.map +1 -1
  71. package/lib/models/caseview/__tests__/CaseViewModel.spec.js.flow +68 -184
  72. package/lib/models/concepts/__mock__/business_scenario.js.flow +14 -1
  73. package/lib/models/concepts/__mock__/conceptdetail.js.flow +15 -6
  74. package/lib/models/concepts/__tests__/BusinessScenarioModel.spec.js.flow +5 -6
  75. package/lib/models/concepts/__tests__/ConceptDetailModel.spec.js.flow +58 -3
  76. package/lib/models/content/SectionModel.js +3 -1
  77. package/lib/models/content/SectionModel.js.flow +2 -1
  78. package/lib/models/content/SectionModel.js.map +1 -1
  79. package/lib/models/content/SubSectionModel.js +4 -1
  80. package/lib/models/content/SubSectionModel.js.flow +3 -1
  81. package/lib/models/content/SubSectionModel.js.map +1 -1
  82. package/lib/models/contentconfiguration/ContentConfigurationResults.js +2 -2
  83. package/lib/models/contentconfiguration/ContentConfigurationResults.js.flow +2 -2
  84. package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  85. package/lib/models/contentconfiguration/__tests__/ContentConfigurationResults.spec.js.flow +6 -6
  86. package/lib/models/form/FormObjectModel.js +8 -2
  87. package/lib/models/form/FormObjectModel.js.flow +5 -1
  88. package/lib/models/form/FormObjectModel.js.map +1 -1
  89. package/lib/models/form/__tests__/FormObjectModel.spec.js.flow +2 -2
  90. package/lib/models/layouthint/LayoutHintCollection.js +4 -2
  91. package/lib/models/layouthint/LayoutHintCollection.js.flow +8 -7
  92. package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
  93. package/lib/models/list/ListDetailModel.js +25 -0
  94. package/lib/models/list/ListDetailModel.js.flow +19 -0
  95. package/lib/models/list/ListDetailModel.js.map +1 -1
  96. package/lib/models/list/ListModel.js +23 -16
  97. package/lib/models/list/ListModel.js.flow +9 -5
  98. package/lib/models/list/ListModel.js.map +1 -1
  99. package/lib/models/list/__tests__/ListDetailModel.spec.js.flow +64 -0
  100. package/lib/models/list/__tests__/ListModel.spec.js.flow +64 -2
  101. package/lib/models/panels/GroupingPanelModel.js +21 -18
  102. package/lib/models/panels/GroupingPanelModel.js.flow +10 -9
  103. package/lib/models/panels/GroupingPanelModel.js.map +1 -1
  104. package/lib/models/panels/__tests__/GroupingPanelModel.spec.js.flow +90 -0
  105. package/lib/models/types.js.flow +38 -11
  106. package/lib/modularui/ModularUIRequest.js +2 -1
  107. package/lib/modularui/ModularUIRequest.js.flow +1 -0
  108. package/lib/modularui/ModularUIRequest.js.map +1 -1
  109. package/lib/utils/helpers/text.js +28 -0
  110. package/lib/utils/helpers/text.js.flow +23 -0
  111. package/lib/utils/helpers/text.js.map +1 -0
  112. package/lib/utils/index.js +14 -0
  113. package/lib/utils/index.js.flow +1 -0
  114. package/lib/utils/index.js.map +1 -1
  115. package/package.json +13 -13
  116. package/src/constants/Settings.js +9 -5
  117. package/src/hooks/useForm.js +10 -5
  118. package/src/hooks/useNotification.js +5 -2
  119. package/src/hooks/useRouter.js +12 -5
  120. package/src/models/attributes/AttributeContent.js +91 -39
  121. package/src/models/attributes/AttributeDataHelper.js +2 -1
  122. package/src/models/attributes/AttributeModel.js +2 -3
  123. package/src/models/attributes/ChoiceAttributeOptionModel.js +4 -7
  124. package/src/models/attributes/HelptextAttributeModel.js +11 -1
  125. package/src/models/attributes/__tests__/AttributeContent.spec.js +10 -2
  126. package/src/models/attributes/__tests__/AttributeDataHelper.spec.js +9 -3
  127. package/src/models/attributes/__tests__/HelptextAttributeModel.spec.js +39 -1
  128. package/src/models/caseview/CaseViewModel.js +17 -7
  129. package/src/models/caseview/__tests__/CaseViewModel.spec.js +68 -184
  130. package/src/models/caseview/__tests__/caseview.json +38 -0
  131. package/src/models/caseview/__tests__/caseviewContributions.json +147 -0
  132. package/src/models/concepts/__mock__/business_scenario.js +14 -1
  133. package/src/models/concepts/__mock__/business_scenario_step.json +64 -0
  134. package/src/models/concepts/__mock__/conceptdetail.js +15 -6
  135. package/src/models/concepts/__mock__/conceptdetail_data.json +117 -17
  136. package/src/models/concepts/__mock__/concepttype_Calculation.json +75 -0
  137. package/src/models/concepts/__tests__/BusinessScenarioModel.spec.js +5 -6
  138. package/src/models/concepts/__tests__/ConceptDetailModel.spec.js +58 -3
  139. package/src/models/content/SectionModel.js +2 -1
  140. package/src/models/content/SubSectionModel.js +3 -1
  141. package/src/models/contentconfiguration/ContentConfigurationResults.js +2 -2
  142. package/src/models/contentconfiguration/__tests__/ContentConfigurationResults.spec.js +6 -6
  143. package/src/models/form/FormObjectModel.js +5 -1
  144. package/src/models/form/__tests__/FormObjectModel.spec.js +2 -2
  145. package/src/models/form/__tests__/FormWithContentData.json +1 -0
  146. package/src/models/layouthint/LayoutHintCollection.js +8 -7
  147. package/src/models/list/ListDetailModel.js +19 -0
  148. package/src/models/list/ListModel.js +9 -5
  149. package/src/models/list/__tests__/ListDetailModel.spec.js +64 -0
  150. package/src/models/list/__tests__/ListModel.spec.js +64 -2
  151. package/src/models/list/__tests__/caselist-34.contributions.json +1 -1
  152. package/src/models/list/__tests__/listContributions.json +1 -1
  153. package/src/models/panels/GroupingPanelModel.js +10 -9
  154. package/src/models/panels/__tests__/GroupingPanelModel.spec.js +90 -0
  155. package/src/models/panels/__tests__/groupingPanel.json +30 -0
  156. package/src/models/panels/__tests__/groupingPanelContributions.json +46 -0
  157. package/src/models/types.js +38 -11
  158. package/src/modularui/ModularUIRequest.js +1 -0
  159. package/src/utils/helpers/text.js +23 -0
  160. package/src/utils/index.js +1 -0
@@ -0,0 +1,147 @@
1
+ {
2
+ "label": "Book",
3
+ "resourcetype": "CaseView",
4
+ "texts": [
5
+ {
6
+ "type": "master",
7
+ "text": "<p>This is introtext</p>"
8
+ }
9
+ ],
10
+ "_links": {
11
+ "panel": [
12
+ {
13
+ "name": "Creator",
14
+ "label": "Creator",
15
+ "resourcetype": "CaseRelationListPanel"
16
+ },
17
+ {
18
+ "name": "Editions",
19
+ "label": "Editions",
20
+ "resourcetype": "RecordListPanel"
21
+ },
22
+ {
23
+ "name": "Activities",
24
+ "label": "Activities",
25
+ "resourcetype": "GroupingPanel"
26
+ }
27
+ ],
28
+ "taskgroup": [
29
+ {
30
+ "name": "Tasks",
31
+ "label": "Tasks",
32
+ "resourcetype": "TaskGroup"
33
+ }
34
+ ]
35
+ },
36
+ "metadata": {
37
+ "_id": {
38
+ "label": "Id",
39
+ "type": "integer"
40
+ }
41
+ },
42
+ "attributes": [
43
+ {
44
+ "CaseName": {
45
+ "label": "Case name",
46
+ "type": "string",
47
+ "layouthint": ["title"]
48
+ }
49
+ },
50
+ {
51
+ "CaseType": {
52
+ "label": "Case type",
53
+ "type": "string",
54
+ "layouthint": ["type"]
55
+ }
56
+ },
57
+ {
58
+ "Owner": {
59
+ "label": "Case owner",
60
+ "type": "string",
61
+ "layouthint": ["owner"]
62
+ }
63
+ },
64
+ {
65
+ "State": {
66
+ "label": "State",
67
+ "type": "string",
68
+ "layouthint": ["state"],
69
+ "options": [
70
+ {
71
+ "code": "Registered",
72
+ "label": "Registered"
73
+ }
74
+ ]
75
+ }
76
+ },
77
+ {
78
+ "Format": {
79
+ "label": "Format",
80
+ "type": "string",
81
+ "multiplechoice": false,
82
+ "layouthint": ["combobox"],
83
+ "options": [
84
+ {
85
+ "code": "Hardcover",
86
+ "label": "Hardcover"
87
+ },
88
+ {
89
+ "code": "Paperback",
90
+ "label": "Paperback"
91
+ },
92
+ {
93
+ "code": "Ebook",
94
+ "label": "Ebook"
95
+ },
96
+ {
97
+ "code": "Audio",
98
+ "label": "Audio book"
99
+ }
100
+ ]
101
+ }
102
+ },
103
+ {
104
+ "ISBN10": {
105
+ "label": "ISBN10",
106
+ "type": "string",
107
+ "displaysize": 50
108
+ }
109
+ },
110
+ {
111
+ "ISBN13": {
112
+ "label": "ISBN13",
113
+ "type": "string",
114
+ "displaysize": 50
115
+ }
116
+ },
117
+ {
118
+ "Language": {
119
+ "label": "Language",
120
+ "type": "string",
121
+ "multiplechoice": false,
122
+ "layouthint": ["radiobutton"],
123
+ "options": [
124
+ {
125
+ "code": "EN",
126
+ "label": "English"
127
+ },
128
+ {
129
+ "code": "DU",
130
+ "label": "Dutch"
131
+ }
132
+ ]
133
+ }
134
+ },
135
+ {
136
+ "NumberOfPages": {
137
+ "label": "Number of pages",
138
+ "type": "number",
139
+ "format": "0",
140
+ "groupingSeparator": ".",
141
+ "decimalSeparator": ",",
142
+ "minimum": 1,
143
+ "maximum": 1000
144
+ }
145
+ }
146
+ ]
147
+ }
@@ -1,13 +1,26 @@
1
1
  import BusinessScenarioModel from "../BusinessScenarioModel";
2
2
  import ModularUIResponse from "../../../modularui/ModularUIResponse";
3
+ import ConceptDetailModel from "../ConceptDetailModel";
3
4
 
4
5
  import data from "./business_scenario_data.json";
5
6
  import contributions from "./conceptdetail_contributions.json";
6
7
 
8
+ import stepData from "./business_scenario_step.json";
9
+ import conceptType from "./concepttype";
10
+
7
11
  const response = ModularUIResponse.create({
8
12
  key: "business_scenario",
9
13
  data,
10
14
  contributions,
11
15
  });
16
+ const scenario = new BusinessScenarioModel(response);
17
+
18
+ const stepResponse = ModularUIResponse.create({
19
+ key: "business_scenario_step",
20
+ data: stepData,
21
+ contributions,
22
+ });
23
+ const step = new ConceptDetailModel(stepResponse);
24
+ step.conceptType = conceptType;
12
25
 
13
- export default new BusinessScenarioModel(response);
26
+ export { scenario, step };
@@ -0,0 +1,64 @@
1
+ {
2
+ "concept": {
3
+ "_id": "StaandehoudingScSt",
4
+ "_links": {
5
+ "self": {
6
+ "href": "/concepts/Incident/Business design/Business scenario/Scenario incident.bixml/StaandehoudingScSt"
7
+ },
8
+ "api_doc": {
9
+ "href": "/api-docs/v3/concepts/(knowledge-model-identifier)/(concept-identifier)"
10
+ },
11
+ "contributions": {
12
+ "href": "/contributions/concepts/(knowledge-model-identifier)/(concept-identifier)"
13
+ },
14
+ "concepttype": {
15
+ "href": "/concepttypes/Library/KMTs/Business scenarios.bixml/ScenarioStep"
16
+ }
17
+ },
18
+ "filter": {
19
+ "entryDate": {
20
+ "param": "entryDate",
21
+ "name": "entryDate",
22
+ "value": "2020-11-20"
23
+ }
24
+ },
25
+ "conceptLabel": "Staandehouding",
26
+ "taxonomyType": "default",
27
+ "relations": [
28
+ {
29
+ "relationLabel": "performed by",
30
+ "relationType": "performedBy",
31
+ "relationDirection": "outgoing",
32
+ "concept": {
33
+ "_links": {
34
+ "self": {
35
+ "href": "/concepts/Incident/Business design/Business scenario/Scenario incident.bixml/Agent"
36
+ },
37
+ "concepttype": {
38
+ "href": "/concepttypes/Library/KMTs/Business scenarios.bixml/Persona"
39
+ }
40
+ },
41
+ "conceptLabel": "Agent",
42
+ "_id": "Agent"
43
+ }
44
+ },
45
+ {
46
+ "relationLabel": "consists of",
47
+ "relationType": "consistsOf",
48
+ "relationDirection": "incoming",
49
+ "concept": {
50
+ "_links": {
51
+ "self": {
52
+ "href": "/concepts/Incident/Business design/Business scenario/Scenario incident.bixml/ScenarioIncident"
53
+ },
54
+ "concepttype": {
55
+ "href": "/concepttypes/Library/KMTs/Business scenarios.bixml/BusinessScenario"
56
+ }
57
+ },
58
+ "conceptLabel": "Scenario incident",
59
+ "_id": "ScenarioIncident"
60
+ }
61
+ }
62
+ ]
63
+ }
64
+ }
@@ -1,18 +1,27 @@
1
1
  import ConceptDetailModel from "../ConceptDetailModel";
2
+ import ConceptTypeDetailModel from "../ConceptTypeDetailModel";
2
3
  import ModularUIResponse from "../../../modularui/ModularUIResponse";
3
4
 
4
5
  import data from "./conceptdetail_data.json";
5
6
  import contributions from "./conceptdetail_contributions.json";
7
+ import conceptTypeData from "./concepttype_Calculation.json";
8
+ import conceptTypeContributions from "./concepttype_contributions.json";
6
9
 
7
- import conceptType from "./concepttype";
8
-
9
- const response = ModularUIResponse.create({
10
- key: "conceptdetail",
10
+ const conceptResponse = ModularUIResponse.create({
11
+ key: "concept",
11
12
  data,
12
13
  contributions,
13
14
  });
14
15
 
15
- const conceptDetail = new ConceptDetailModel(response);
16
+ const conceptTypeResponse = ModularUIResponse.create({
17
+ key: "concepttype",
18
+ data: conceptTypeData,
19
+ contributions: conceptTypeContributions,
20
+ });
21
+
22
+ const conceptType = new ConceptTypeDetailModel(conceptTypeResponse);
23
+
24
+ const conceptDetail = new ConceptDetailModel(conceptResponse);
16
25
  conceptDetail.conceptType = conceptType;
17
26
 
18
- export default conceptDetail;
27
+ export { conceptDetail };
@@ -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
  });
@@ -7,6 +7,7 @@ import { createHashFromHref } from "../../utils/helpers/createHash";
7
7
  import LinkModel from "../links/LinkModel";
8
8
 
9
9
  import type Href from "../href/Href";
10
+ import { retrieveText } from "../../utils";
10
11
 
11
12
  class SectionModel extends BaseModel {
12
13
  _entryDate: ISO_DATE | null;
@@ -88,7 +89,7 @@ class SectionModel extends BaseModel {
88
89
  * Get content body
89
90
  */
90
91
  get body(): ?string {
91
- return this.data.body;
92
+ return retrieveText(this.data.body);
92
93
  }
93
94
 
94
95
  /**
@@ -5,6 +5,7 @@ import BaseModel from "../base/BaseModel";
5
5
  import LinkCollection from "../links/LinkCollection";
6
6
  import Href from "../href/Href";
7
7
  import LinkModel from "../links/LinkModel";
8
+ import { retrieveText } from "../../utils";
8
9
 
9
10
  /**
10
11
  * Link to a concept
@@ -41,7 +42,8 @@ export default class SubSectionModel extends BaseModel {
41
42
  * Retrieve html body
42
43
  */
43
44
  get body(): string {
44
- return this.getData("body", "");
45
+ const body = this.getData("body", "");
46
+ return retrieveText(body);
45
47
  }
46
48
 
47
49
  /**
@@ -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;