@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.
- package/CHANGELOG.md +48 -0
- package/esm/hooks/useForm.js.map +1 -1
- package/esm/hooks/useNotification.js.map +1 -1
- package/esm/hooks/useRouter.js.map +1 -1
- package/esm/models/attributes/AttributeContent.js +49 -20
- package/esm/models/attributes/AttributeContent.js.map +1 -1
- package/esm/models/attributes/AttributeDataHelper.js +1 -1
- package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
- package/esm/models/attributes/HelptextAttributeModel.js +3 -1
- package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/esm/models/caseview/CaseViewModel.js +26 -12
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationResults.js +2 -2
- package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +8 -2
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/layouthint/LayoutHintCollection.js +3 -2
- package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/esm/models/list/ListDetailModel.js +25 -0
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/list/ListModel.js +22 -16
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/panels/GroupingPanelModel.js +19 -17
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +2 -1
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/redux/actions/FormAutosave.js +2 -1
- package/esm/redux/actions/FormAutosave.js.map +1 -1
- package/esm/redux/actions/FormValidations.js +2 -1
- package/esm/redux/actions/FormValidations.js.map +1 -1
- package/lib/hooks/useForm.js.flow +10 -5
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useNotification.js.flow +5 -2
- package/lib/hooks/useNotification.js.map +1 -1
- package/lib/hooks/useRouter.js.flow +12 -5
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js +51 -20
- package/lib/models/attributes/AttributeContent.js.flow +38 -13
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js +1 -1
- package/lib/models/attributes/AttributeDataHelper.js.flow +2 -1
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/HelptextAttributeModel.js +3 -1
- package/lib/models/attributes/HelptextAttributeModel.js.flow +1 -1
- package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/lib/models/attributes/__tests__/AttributeContent.spec.js.flow +4 -2
- package/lib/models/attributes/__tests__/AttributeDataHelper.spec.js.flow +9 -3
- package/lib/models/attributes/__tests__/HelptextAttributeModel.spec.js.flow +1 -1
- package/lib/models/caseview/CaseViewModel.js +27 -13
- package/lib/models/caseview/CaseViewModel.js.flow +17 -7
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/caseview/__tests__/CaseViewModel.spec.js.flow +68 -184
- package/lib/models/concepts/__mock__/business_scenario.js.flow +14 -1
- package/lib/models/concepts/__mock__/conceptdetail.js.flow +15 -6
- package/lib/models/concepts/__tests__/BusinessScenarioModel.spec.js.flow +5 -6
- package/lib/models/concepts/__tests__/ConceptDetailModel.spec.js.flow +58 -3
- package/lib/models/contentconfiguration/ContentConfigurationResults.js +2 -2
- package/lib/models/contentconfiguration/ContentConfigurationResults.js.flow +2 -2
- package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/lib/models/contentconfiguration/__tests__/ContentConfigurationResults.spec.js.flow +6 -6
- package/lib/models/form/FormObjectModel.js +8 -2
- package/lib/models/form/FormObjectModel.js.flow +5 -1
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/form/__tests__/FormObjectModel.spec.js.flow +2 -2
- package/lib/models/layouthint/LayoutHintCollection.js +4 -2
- package/lib/models/layouthint/LayoutHintCollection.js.flow +8 -7
- package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/lib/models/list/ListDetailModel.js +25 -0
- package/lib/models/list/ListDetailModel.js.flow +19 -0
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListModel.js +23 -16
- package/lib/models/list/ListModel.js.flow +9 -5
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/list/__tests__/ListDetailModel.spec.js.flow +64 -0
- package/lib/models/list/__tests__/ListModel.spec.js.flow +64 -2
- package/lib/models/panels/GroupingPanelModel.js +21 -18
- package/lib/models/panels/GroupingPanelModel.js.flow +10 -9
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/panels/__tests__/GroupingPanelModel.spec.js.flow +90 -0
- package/lib/models/types.js.flow +24 -6
- package/lib/modularui/ModularUIRequest.js +2 -1
- package/lib/modularui/ModularUIRequest.js.flow +1 -0
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js +2 -1
- package/lib/redux/actions/FormAutosave.js.flow +1 -0
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormValidations.js +2 -1
- package/lib/redux/actions/FormValidations.js.flow +1 -0
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/package.json +15 -15
- package/src/hooks/useForm.js +10 -5
- package/src/hooks/useNotification.js +5 -2
- package/src/hooks/useRouter.js +12 -5
- package/src/models/attributes/AttributeContent.js +38 -13
- package/src/models/attributes/AttributeDataHelper.js +2 -1
- package/src/models/attributes/HelptextAttributeModel.js +1 -1
- package/src/models/attributes/__tests__/AttributeContent.spec.js +4 -2
- package/src/models/attributes/__tests__/AttributeDataHelper.spec.js +9 -3
- package/src/models/attributes/__tests__/HelptextAttributeModel.spec.js +1 -1
- package/src/models/caseview/CaseViewModel.js +17 -7
- package/src/models/caseview/__tests__/CaseViewModel.spec.js +68 -184
- package/src/models/caseview/__tests__/caseview.json +38 -0
- package/src/models/caseview/__tests__/caseviewContributions.json +147 -0
- package/src/models/concepts/__mock__/business_scenario.js +14 -1
- package/src/models/concepts/__mock__/business_scenario_step.json +64 -0
- package/src/models/concepts/__mock__/conceptdetail.js +15 -6
- package/src/models/concepts/__mock__/conceptdetail_data.json +117 -17
- package/src/models/concepts/__mock__/concepttype_Calculation.json +75 -0
- package/src/models/concepts/__tests__/BusinessScenarioModel.spec.js +5 -6
- package/src/models/concepts/__tests__/ConceptDetailModel.spec.js +58 -3
- package/src/models/contentconfiguration/ContentConfigurationResults.js +2 -2
- package/src/models/contentconfiguration/__tests__/ContentConfigurationResults.spec.js +6 -6
- package/src/models/form/FormObjectModel.js +5 -1
- package/src/models/form/__tests__/FormObjectModel.spec.js +2 -2
- package/src/models/form/__tests__/FormWithContentData.json +2 -1
- package/src/models/layouthint/LayoutHintCollection.js +8 -7
- package/src/models/list/ListDetailModel.js +19 -0
- package/src/models/list/ListModel.js +9 -5
- package/src/models/list/__tests__/ListDetailModel.spec.js +64 -0
- package/src/models/list/__tests__/ListModel.spec.js +64 -2
- package/src/models/list/__tests__/caselist-34.contributions.json +1 -1
- package/src/models/list/__tests__/listContributions.json +1 -1
- package/src/models/panels/GroupingPanelModel.js +10 -9
- package/src/models/panels/__tests__/GroupingPanelModel.spec.js +90 -0
- package/src/models/panels/__tests__/groupingPanel.json +30 -0
- package/src/models/panels/__tests__/groupingPanelContributions.json +46 -0
- package/src/models/types.js +24 -6
- package/src/modularui/ModularUIRequest.js +1 -0
- package/src/redux/actions/FormAutosave.js +1 -0
- package/src/redux/actions/FormValidations.js +1 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"concept": {
|
|
3
|
-
"_id": "
|
|
3
|
+
"_id": "DurationDrivingBan",
|
|
4
4
|
"_links": {
|
|
5
5
|
"self": {
|
|
6
|
-
"href": "/concepts/
|
|
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/
|
|
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": "
|
|
22
|
+
"value": "2021-09-23"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
"conceptLabel": "
|
|
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": "
|
|
30
|
-
"relationType": "
|
|
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/
|
|
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/
|
|
137
|
+
"href": "/concepttypes/Library/KMTs/Products.bixml/Ground"
|
|
39
138
|
}
|
|
40
139
|
},
|
|
41
|
-
"conceptLabel": "
|
|
42
|
-
"_id": "
|
|
140
|
+
"conceptLabel": "Duration driving ban experienced driver",
|
|
141
|
+
"_id": "DurationDrivingBanExperiencedDriver"
|
|
43
142
|
}
|
|
44
143
|
},
|
|
45
144
|
{
|
|
46
|
-
"relationLabel": "
|
|
47
|
-
"relationType": "
|
|
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/
|
|
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/
|
|
155
|
+
"href": "/concepttypes/Library/KMTs/Products.bixml/Decision"
|
|
56
156
|
}
|
|
57
157
|
},
|
|
58
|
-
"conceptLabel": "
|
|
59
|
-
"_id": "
|
|
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
|
|
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 =
|
|
14
|
+
const initialChildModelLinks = scenario.getInitialChildModelLinks();
|
|
16
15
|
|
|
17
16
|
expect(initialChildModelLinks).toHaveLength(13);
|
|
18
17
|
});
|
|
19
18
|
|
|
20
19
|
it("can set scenarioSteps", () => {
|
|
21
|
-
|
|
20
|
+
scenario.setChildModels([conceptType, step]);
|
|
22
21
|
|
|
23
|
-
const scenarioSteps =
|
|
24
|
-
const 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
|
-
|
|
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) && "
|
|
39
|
-
return description.
|
|
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
|
|
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
|
-
|
|
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(
|
|
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
|
|
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:
|
|
95
|
+
description: message,
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
expect(contentConfigurationResults.label).toBe("Total cost of mortgage");
|
|
99
|
-
expect(contentConfigurationResults.description).toBe(
|
|
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?.
|
|
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",
|
|
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",
|
|
125
|
+
introText: { id: "IntroTextID", message: "This is new introtext" },
|
|
126
126
|
attributes: [],
|
|
127
127
|
};
|
|
128
128
|
|
|
@@ -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
|
|
39
|
-
(
|
|
40
|
-
|
|
41
|
-
|
|
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.
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
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
|
});
|