@beinformed/ui 1.57.0-contextpath.1 → 1.57.0

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 (159) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/esm/constants/Settings.js +10 -2
  3. package/esm/constants/Settings.js.map +1 -1
  4. package/esm/hooks/useModularUI.js +19 -18
  5. package/esm/hooks/useModularUI.js.map +1 -1
  6. package/esm/hooks/useModularUIBasic.js +52 -41
  7. package/esm/hooks/useModularUIBasic.js.map +1 -1
  8. package/esm/models/concepts/ConceptDetailModel.js +1 -8
  9. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  10. package/esm/models/concepts/ConceptIndexModel.js +1 -1
  11. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  12. package/esm/models/concepts/ConceptLinkModel.js +8 -9
  13. package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
  14. package/esm/models/concepts/ConceptTypeDetailModel.js +3 -20
  15. package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  16. package/esm/models/concepts/SourceReferenceCollection.js +3 -1
  17. package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
  18. package/esm/models/concepts/SourceReferenceModel.js +9 -3
  19. package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
  20. package/esm/models/content/ContentLinkModel.js +10 -4
  21. package/esm/models/content/ContentLinkModel.js.map +1 -1
  22. package/esm/models/content/SectionModel.js +10 -6
  23. package/esm/models/content/SectionModel.js.map +1 -1
  24. package/esm/models/error/ErrorResponse.js +20 -5
  25. package/esm/models/error/ErrorResponse.js.map +1 -1
  26. package/esm/modularui/CaptchaRequest.js +12 -3
  27. package/esm/modularui/CaptchaRequest.js.map +1 -1
  28. package/esm/modularui/ModularUIRequest.js +1 -1
  29. package/esm/modularui/ModularUIRequest.js.map +1 -1
  30. package/esm/modularui/UploadRequest.js +7 -3
  31. package/esm/modularui/UploadRequest.js.map +1 -1
  32. package/esm/redux/_modularui/ModularUIActions.js +11 -9
  33. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  34. package/esm/redux/_modularui/ModularUIMiddleware.js +4 -1
  35. package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -1
  36. package/esm/redux/_modularui/ModularUIReducer.js +2 -1
  37. package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
  38. package/esm/redux/_modularui/ModularUISelectors.js +7 -6
  39. package/esm/redux/_modularui/ModularUISelectors.js.map +1 -1
  40. package/esm/redux/_modularui/types.js.map +1 -1
  41. package/esm/redux/connectors/PanelRenderer.js +0 -2
  42. package/esm/redux/connectors/PanelRenderer.js.map +1 -1
  43. package/esm/utils/helpers/repositoryResource.js +6 -5
  44. package/esm/utils/helpers/repositoryResource.js.map +1 -1
  45. package/lib/constants/Settings.js +10 -2
  46. package/lib/constants/Settings.js.flow +8 -2
  47. package/lib/constants/Settings.js.map +1 -1
  48. package/lib/hooks/__tests__/UseModularUIModel.spec.js.flow +11 -4
  49. package/lib/hooks/__tests__/useAuthentication.spec.js.flow +2 -8
  50. package/lib/hooks/__tests__/useForm.spec.js.flow +14 -12
  51. package/lib/hooks/__tests__/useModelCatalog.spec.js.flow +10 -4
  52. package/lib/hooks/__tests__/useModels.spec.js.flow +3 -12
  53. package/lib/hooks/__tests__/useModularUIBasic.spec.js.flow +9 -8
  54. package/lib/hooks/useModularUI.js +18 -17
  55. package/lib/hooks/useModularUI.js.flow +25 -15
  56. package/lib/hooks/useModularUI.js.map +1 -1
  57. package/lib/hooks/useModularUIBasic.js +52 -41
  58. package/lib/hooks/useModularUIBasic.js.flow +66 -50
  59. package/lib/hooks/useModularUIBasic.js.map +1 -1
  60. package/lib/models/concepts/ConceptDetailModel.js +1 -8
  61. package/lib/models/concepts/ConceptDetailModel.js.flow +2 -7
  62. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  63. package/lib/models/concepts/ConceptIndexModel.js +1 -1
  64. package/lib/models/concepts/ConceptIndexModel.js.flow +7 -1
  65. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  66. package/lib/models/concepts/ConceptLinkModel.js +8 -9
  67. package/lib/models/concepts/ConceptLinkModel.js.flow +14 -9
  68. package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
  69. package/lib/models/concepts/ConceptTypeDetailModel.js +3 -20
  70. package/lib/models/concepts/ConceptTypeDetailModel.js.flow +3 -25
  71. package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  72. package/lib/models/concepts/SourceReferenceCollection.js +3 -1
  73. package/lib/models/concepts/SourceReferenceCollection.js.flow +8 -1
  74. package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
  75. package/lib/models/concepts/SourceReferenceModel.js +9 -3
  76. package/lib/models/concepts/SourceReferenceModel.js.flow +19 -3
  77. package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
  78. package/lib/models/concepts/__mock__/conceptindex.js.flow +15 -0
  79. package/lib/models/concepts/__tests__/ConceptIndexModel.spec.js.flow +30 -2
  80. package/lib/models/concepts/__tests__/ConceptTypeDetailModel.spec.js.flow +1 -18
  81. package/lib/models/content/ContentLinkModel.js +9 -4
  82. package/lib/models/content/ContentLinkModel.js.flow +19 -4
  83. package/lib/models/content/ContentLinkModel.js.map +1 -1
  84. package/lib/models/content/SectionModel.js +10 -6
  85. package/lib/models/content/SectionModel.js.flow +31 -5
  86. package/lib/models/content/SectionModel.js.map +1 -1
  87. package/lib/models/error/ErrorResponse.js +20 -5
  88. package/lib/models/error/ErrorResponse.js.flow +34 -5
  89. package/lib/models/error/ErrorResponse.js.map +1 -1
  90. package/lib/modularui/CaptchaRequest.js +11 -2
  91. package/lib/modularui/CaptchaRequest.js.flow +17 -3
  92. package/lib/modularui/CaptchaRequest.js.map +1 -1
  93. package/lib/modularui/ModularUIRequest.js +1 -1
  94. package/lib/modularui/ModularUIRequest.js.flow +3 -1
  95. package/lib/modularui/ModularUIRequest.js.map +1 -1
  96. package/lib/modularui/UploadRequest.js +6 -2
  97. package/lib/modularui/UploadRequest.js.flow +12 -2
  98. package/lib/modularui/UploadRequest.js.map +1 -1
  99. package/lib/redux/_modularui/ModularUIActions.js +11 -9
  100. package/lib/redux/_modularui/ModularUIActions.js.flow +20 -10
  101. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  102. package/lib/redux/_modularui/ModularUIMiddleware.js +3 -0
  103. package/lib/redux/_modularui/ModularUIMiddleware.js.flow +6 -3
  104. package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -1
  105. package/lib/redux/_modularui/ModularUIReducer.js +2 -1
  106. package/lib/redux/_modularui/ModularUIReducer.js.flow +1 -0
  107. package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
  108. package/lib/redux/_modularui/ModularUISelectors.js +5 -6
  109. package/lib/redux/_modularui/ModularUISelectors.js.flow +22 -10
  110. package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
  111. package/lib/redux/_modularui/__tests__/actions.spec.js.flow +1 -4
  112. package/lib/redux/_modularui/types.js.flow +1 -0
  113. package/lib/redux/_modularui/types.js.map +1 -1
  114. package/lib/redux/actions/__tests__/Application.spec.js.flow +1 -8
  115. package/lib/redux/actions/__tests__/Authorization.spec.js.flow +0 -4
  116. package/lib/redux/connectors/PanelRenderer.js +0 -2
  117. package/lib/redux/connectors/PanelRenderer.js.flow +0 -1
  118. package/lib/redux/connectors/PanelRenderer.js.map +1 -1
  119. package/lib/utils/helpers/repositoryResource.js +6 -5
  120. package/lib/utils/helpers/repositoryResource.js.flow +8 -6
  121. package/lib/utils/helpers/repositoryResource.js.map +1 -1
  122. package/package.json +18 -18
  123. package/src/constants/Settings.js +8 -2
  124. package/src/hooks/__tests__/UseModularUIModel.spec.js +11 -4
  125. package/src/hooks/__tests__/useAuthentication.spec.js +2 -8
  126. package/src/hooks/__tests__/useForm.spec.js +14 -12
  127. package/src/hooks/__tests__/useModelCatalog.spec.js +10 -4
  128. package/src/hooks/__tests__/useModels.spec.js +3 -12
  129. package/src/hooks/__tests__/useModularUIBasic.spec.js +9 -8
  130. package/src/hooks/useModularUI.js +25 -15
  131. package/src/hooks/useModularUIBasic.js +66 -50
  132. package/src/models/concepts/ConceptDetailModel.js +2 -7
  133. package/src/models/concepts/ConceptIndexModel.js +7 -1
  134. package/src/models/concepts/ConceptLinkModel.js +14 -9
  135. package/src/models/concepts/ConceptTypeDetailModel.js +3 -25
  136. package/src/models/concepts/SourceReferenceCollection.js +8 -1
  137. package/src/models/concepts/SourceReferenceModel.js +19 -3
  138. package/src/models/concepts/__mock__/conceptindex.js +15 -0
  139. package/src/models/concepts/__mock__/conceptindex_contributions.json +86 -0
  140. package/src/models/concepts/__mock__/conceptindex_data.json +323 -0
  141. package/src/models/concepts/__mock__/concepttype_hierarchy.json +1 -11
  142. package/src/models/concepts/__tests__/ConceptIndexModel.spec.js +30 -2
  143. package/src/models/concepts/__tests__/ConceptTypeDetailModel.spec.js +1 -18
  144. package/src/models/content/ContentLinkModel.js +19 -4
  145. package/src/models/content/SectionModel.js +31 -5
  146. package/src/models/error/ErrorResponse.js +34 -5
  147. package/src/modularui/CaptchaRequest.js +17 -3
  148. package/src/modularui/ModularUIRequest.js +3 -1
  149. package/src/modularui/UploadRequest.js +12 -2
  150. package/src/redux/_modularui/ModularUIActions.js +20 -10
  151. package/src/redux/_modularui/ModularUIMiddleware.js +6 -3
  152. package/src/redux/_modularui/ModularUIReducer.js +1 -0
  153. package/src/redux/_modularui/ModularUISelectors.js +22 -10
  154. package/src/redux/_modularui/__tests__/actions.spec.js +1 -4
  155. package/src/redux/_modularui/types.js +1 -0
  156. package/src/redux/actions/__tests__/Application.spec.js +1 -8
  157. package/src/redux/actions/__tests__/Authorization.spec.js +0 -4
  158. package/src/redux/connectors/PanelRenderer.js +0 -1
  159. package/src/utils/helpers/repositoryResource.js +8 -6
@@ -32,7 +32,13 @@ export default class ConceptIndexModel extends ResourceModel {
32
32
  this._concepts = new ResourceCollection();
33
33
  this._concepts.collection = this.data._embedded
34
34
  ? this.data._embedded.results.map(
35
- (concept) => new ConceptLinkModel(concept.concept, this.entryDate),
35
+ (concept) =>
36
+ new ConceptLinkModel(
37
+ concept.concept,
38
+ this.entryDate,
39
+ this.origin,
40
+ this.contextPath,
41
+ ),
36
42
  )
37
43
  : [];
38
44
  }
@@ -7,6 +7,7 @@ import { TIMEVERSION_FILTER_NAME } from "../../constants/Constants";
7
7
 
8
8
  import type { IModelWithChildModels, ModularUIModel } from "../types";
9
9
  import type Href from "../href/Href";
10
+ import { getBasePath } from "../../constants";
10
11
  /**
11
12
  * Link to a concept
12
13
  */
@@ -17,14 +18,23 @@ export default class ConceptLinkModel
17
18
  _links: ?LinkCollection;
18
19
  _entryDate: ?ISO_DATE;
19
20
  _conceptType: ?ConceptTypeDetailModel;
21
+ _origin: string = "";
22
+ _contextPath: string = getBasePath();
20
23
 
21
24
  /**
22
25
  * Construct ConceptLinkModel
23
26
  */
24
- constructor(data: Object, entryDate: ?ISO_DATE = null) {
27
+ constructor(
28
+ data: Object,
29
+ entryDate: ?ISO_DATE = null,
30
+ origin?: string,
31
+ contextPath?: string,
32
+ ) {
25
33
  super(data, {});
26
34
 
27
35
  this._entryDate = entryDate;
36
+ this._origin = origin || "";
37
+ this._contextPath = contextPath || getBasePath();
28
38
  }
29
39
 
30
40
  /**
@@ -97,6 +107,9 @@ export default class ConceptLinkModel
97
107
  Array.isArray(this.data._links)
98
108
  ? this.data._links[0]
99
109
  : this.data._links,
110
+ null,
111
+ this._contextPath,
112
+ this._origin,
100
113
  );
101
114
  }
102
115
 
@@ -156,7 +169,6 @@ export default class ConceptLinkModel
156
169
  /**
157
170
  */
158
171
  asLinkModel(): LinkModel {
159
- // TODO SBO: origin and contextpath
160
172
  const link = LinkModel.create(this.key, this.selfhref.href, this.label);
161
173
  link.href = this.selfhref;
162
174
 
@@ -169,11 +181,4 @@ export default class ConceptLinkModel
169
181
  isOfConceptType(conceptTypeId: string): boolean {
170
182
  return this.conceptType?.isOfConceptType(conceptTypeId) ?? false;
171
183
  }
172
-
173
- /**
174
- * Indicates if the given metamodel functional identifier exists in the hierarchy of concept types for this concept
175
- */
176
- hasMetamodelIdInConceptTypeHierarchy(metamodelId: string): boolean {
177
- return this.conceptType?.hasMetamodelIdInHierarchy(metamodelId) ?? false;
178
- }
179
184
  }
@@ -2,7 +2,6 @@
2
2
  import ResourceModel from "../base/ResourceModel";
3
3
 
4
4
  import type ModularUIResponse from "../../modularui/ModularUIResponse";
5
- import type LinkCollection from "../links/LinkCollection";
6
5
 
7
6
  /**
8
7
  * Model for concept details, available through modelcatalog
@@ -12,8 +11,8 @@ class ConceptTypeDetailModel extends ResourceModel {
12
11
  * The name of the concept type consists of the functional id of the kmt and the functional id of the concept type separated by a #.<br>
13
12
  * For example BEI_CaseManagement#Case
14
13
  */
15
- get name(): string {
16
- return this.getData("name", "");
14
+ get kmtId(): string {
15
+ return this.getData("kmtId", "");
17
16
  }
18
17
 
19
18
  /**
@@ -119,31 +118,10 @@ class ConceptTypeDetailModel extends ResourceModel {
119
118
  return this.getData("sectionReferenceTypes", []);
120
119
  }
121
120
 
122
- /**
123
- */
124
- get conceptTypeHierarchy(): LinkCollection {
125
- return this.links.getLinksByGroup("conceptTypeHierarchy");
126
- }
127
-
128
121
  /**
129
122
  */
130
123
  isOfConceptType(conceptTypeId: string): boolean {
131
- return (
132
- this.conceptTypeHierarchy?.hasLinkByKey(conceptTypeId) ||
133
- this.conceptTypeHierarchy?.hasLinkByHref(conceptTypeId) ||
134
- this.selfhref.equals(conceptTypeId)
135
- );
136
- }
137
-
138
- /**
139
- * Indicates if the given metamodel functional identifier exists in the hierarchy of concept types
140
- */
141
- hasMetamodelIdInHierarchy(metamodelId: string): boolean {
142
- return (
143
- this.conceptTypeHierarchy?.all.some((link) =>
144
- link.key.startsWith(metamodelId + "#"),
145
- ) || false
146
- );
124
+ return this.selfhref.equals(conceptTypeId);
147
125
  }
148
126
  }
149
127
 
@@ -11,13 +11,20 @@ export default class SourceReferenceCollection extends BaseCollection<SourceRefe
11
11
  constructor(
12
12
  sourceReferences: Array<Object> = [],
13
13
  entryDate: ?ISO_DATE = null,
14
+ origin?: string,
15
+ contextPath?: string,
14
16
  ) {
15
17
  super();
16
18
 
17
19
  this.collection = sourceReferences
18
20
  ? sourceReferences.map(
19
21
  (sourceReference) =>
20
- new SourceReferenceModel(sourceReference, entryDate),
22
+ new SourceReferenceModel(
23
+ sourceReference,
24
+ entryDate,
25
+ origin,
26
+ contextPath,
27
+ ),
21
28
  )
22
29
  : [];
23
30
  }
@@ -3,18 +3,28 @@ import { createHashFromHref } from "../../utils/helpers/createHash";
3
3
 
4
4
  import ContentLinkModel from "../content/ContentLinkModel";
5
5
  import Href from "../href/Href";
6
+ import { getBasePath } from "../../constants";
6
7
 
7
8
  /**
8
9
  */
9
10
  class SourceReferenceModel {
10
11
  _sourceReference: Object;
11
12
  _entryDate: ?ISO_DATE;
13
+ _origin: string = "";
14
+ _contextPath: string = getBasePath();
12
15
 
13
16
  /**
14
17
  */
15
- constructor(sourceReference: Object, entryDate: ?ISO_DATE = null) {
18
+ constructor(
19
+ sourceReference: Object,
20
+ entryDate: ?ISO_DATE = null,
21
+ origin?: string,
22
+ contextPath?: string,
23
+ ) {
16
24
  this._sourceReference = sourceReference;
17
25
  this._entryDate = entryDate;
26
+ this._origin = origin || "";
27
+ this._contextPath = contextPath || getBasePath();
18
28
  }
19
29
 
20
30
  /**
@@ -31,14 +41,20 @@ class SourceReferenceModel {
31
41
  section,
32
42
  },
33
43
  this._entryDate,
44
+ this._origin,
45
+ this._contextPath,
34
46
  );
35
47
  }
36
48
 
37
49
  /**
38
50
  */
39
51
  get selfhref(): Href {
40
- // TODO SBO: origin and context
41
- return new Href(this._sourceReference._links.self.href, "SourceReference");
52
+ return new Href(
53
+ this._sourceReference._links.self.href,
54
+ "SourceReference",
55
+ this._origin,
56
+ this._contextPath,
57
+ );
42
58
  }
43
59
 
44
60
  /**
@@ -0,0 +1,15 @@
1
+ import ConceptIndexModel from "../ConceptIndexModel";
2
+ import ModularUIResponse from "../../../modularui/ModularUIResponse";
3
+
4
+ import data from "./conceptindex_data.json";
5
+ import contributions from "./conceptindex_contributions.json";
6
+
7
+ const conceptIndexResponse = ModularUIResponse.create({
8
+ key: "ConceptSearch",
9
+ data,
10
+ contributions,
11
+ });
12
+
13
+ const conceptIndex = new ConceptIndexModel(conceptIndexResponse);
14
+
15
+ export { conceptIndex };
@@ -0,0 +1,86 @@
1
+ {
2
+ "ConceptSearch": {
3
+ "label": "Concept search",
4
+ "resourcetype": "ConceptSearch",
5
+ "filter": [
6
+ {
7
+ "index": {
8
+ "type": "choicefilter",
9
+ "label": "Index",
10
+ "layouthint": ["combobox"],
11
+ "multiplechoice": false,
12
+ "optionMode": "dynamic"
13
+ }
14
+ },
15
+ {
16
+ "label": {
17
+ "type": "stringfilter",
18
+ "label": "Label",
19
+ "multiplechoice": false
20
+ }
21
+ },
22
+ {
23
+ "type": {
24
+ "type": "choicefilter",
25
+ "label": "Type",
26
+ "layouthint": ["checkbox"],
27
+ "multiplechoice": true,
28
+ "optionMode": "lookup"
29
+ }
30
+ },
31
+ {
32
+ "modelCategory": {
33
+ "type": "choicefilter",
34
+ "label": "Model category",
35
+ "layouthint": ["checkbox"],
36
+ "multiplechoice": true,
37
+ "optionMode": "static",
38
+ "options": [
39
+ {
40
+ "key": "BusinessDesign",
41
+ "label": "Business design"
42
+ },
43
+ {
44
+ "key": "FLINT",
45
+ "label": "FLINT"
46
+ },
47
+ {
48
+ "key": "Requirements",
49
+ "label": "Requirements"
50
+ },
51
+ {
52
+ "key": "Scenarios",
53
+ "label": "Scenarios"
54
+ }
55
+ ]
56
+ }
57
+ },
58
+ {
59
+ "entryDate": {
60
+ "type": "datefilter",
61
+ "label": "Entry date",
62
+ "format": "dd-MM-yyyy",
63
+ "formatlabel": "dd-mm-yyyy",
64
+ "operator": "greater-than-or-equal"
65
+ }
66
+ }
67
+ ],
68
+ "results": {
69
+ "concept": {
70
+ "metadata": {
71
+ "_id": {
72
+ "type": "string"
73
+ }
74
+ },
75
+ "attributes": [
76
+ {
77
+ "label": {
78
+ "type": "string",
79
+ "label": "concept label"
80
+ }
81
+ }
82
+ ]
83
+ }
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,323 @@
1
+ {
2
+ "concepts": {
3
+ "_links": {
4
+ "self": {
5
+ "href": "/concepts"
6
+ },
7
+ "api_doc": {
8
+ "href": "/api-docs/v3/concepts"
9
+ },
10
+ "contributions": {
11
+ "href": "/contributions/concepts"
12
+ }
13
+ },
14
+ "dynamicschema": {
15
+ "index": [
16
+ {
17
+ "code": "0",
18
+ "label": "0-9"
19
+ },
20
+ {
21
+ "code": "A",
22
+ "label": "A"
23
+ },
24
+ {
25
+ "code": "B",
26
+ "label": "B"
27
+ },
28
+ {
29
+ "code": "C",
30
+ "label": "C"
31
+ },
32
+ {
33
+ "code": "D",
34
+ "label": "D"
35
+ },
36
+ {
37
+ "code": "E",
38
+ "label": "E"
39
+ },
40
+ {
41
+ "code": "F",
42
+ "label": "F"
43
+ },
44
+ {
45
+ "code": "G",
46
+ "label": "G"
47
+ },
48
+ {
49
+ "code": "H",
50
+ "label": "H"
51
+ },
52
+ {
53
+ "code": "I",
54
+ "label": "I"
55
+ },
56
+ {
57
+ "code": "J",
58
+ "label": "J"
59
+ },
60
+ {
61
+ "code": "K",
62
+ "label": "K"
63
+ },
64
+ {
65
+ "code": "L",
66
+ "label": "L"
67
+ },
68
+ {
69
+ "code": "M",
70
+ "label": "M"
71
+ },
72
+ {
73
+ "code": "N",
74
+ "label": "N"
75
+ },
76
+ {
77
+ "code": "O",
78
+ "label": "O"
79
+ },
80
+ {
81
+ "code": "P",
82
+ "label": "P"
83
+ },
84
+ {
85
+ "code": "Q",
86
+ "label": "Q"
87
+ },
88
+ {
89
+ "code": "R",
90
+ "label": "R"
91
+ },
92
+ {
93
+ "code": "S",
94
+ "label": "S"
95
+ },
96
+ {
97
+ "code": "T",
98
+ "label": "T"
99
+ },
100
+ {
101
+ "code": "U",
102
+ "label": "U"
103
+ },
104
+ {
105
+ "code": "V",
106
+ "label": "V"
107
+ },
108
+ {
109
+ "code": "W",
110
+ "label": "W"
111
+ }
112
+ ],
113
+ "type": null
114
+ },
115
+ "filter": {
116
+ "index": {
117
+ "param": "index",
118
+ "name": "index",
119
+ "options": [
120
+ {
121
+ "key": "0"
122
+ },
123
+ {
124
+ "key": "A"
125
+ },
126
+ {
127
+ "key": "B"
128
+ },
129
+ {
130
+ "key": "C"
131
+ },
132
+ {
133
+ "key": "D"
134
+ },
135
+ {
136
+ "key": "E"
137
+ },
138
+ {
139
+ "key": "F"
140
+ },
141
+ {
142
+ "key": "G"
143
+ },
144
+ {
145
+ "key": "H"
146
+ },
147
+ {
148
+ "key": "I"
149
+ },
150
+ {
151
+ "key": "J"
152
+ },
153
+ {
154
+ "key": "K"
155
+ },
156
+ {
157
+ "key": "L"
158
+ },
159
+ {
160
+ "key": "M"
161
+ },
162
+ {
163
+ "key": "N"
164
+ },
165
+ {
166
+ "key": "O"
167
+ },
168
+ {
169
+ "key": "P"
170
+ },
171
+ {
172
+ "key": "Q"
173
+ },
174
+ {
175
+ "key": "R"
176
+ },
177
+ {
178
+ "key": "S"
179
+ },
180
+ {
181
+ "key": "T"
182
+ },
183
+ {
184
+ "key": "U"
185
+ },
186
+ {
187
+ "key": "V"
188
+ },
189
+ {
190
+ "key": "W"
191
+ }
192
+ ]
193
+ },
194
+ "label": {
195
+ "param": "label",
196
+ "name": "label"
197
+ },
198
+ "type": {
199
+ "param": "type",
200
+ "name": "type",
201
+ "_links": {
202
+ "lookupOptions": {
203
+ "href": "/lookupOptions?lookupToken=4bcc52d9-3f60-4f8a-b745-0814b7aca09f",
204
+ "filter": {
205
+ "name": "labelFilter"
206
+ }
207
+ }
208
+ }
209
+ },
210
+ "entryDate": {
211
+ "param": "entryDate",
212
+ "name": "entryDate",
213
+ "value": "2024-10-21"
214
+ },
215
+ "modelCategory": {
216
+ "param": "modelCategory",
217
+ "name": "modelCategory"
218
+ }
219
+ },
220
+ "_embedded": {
221
+ "results": [
222
+ {
223
+ "concept": {
224
+ "_id": "CaptureComplianceArtifactsInCustomerCase",
225
+ "label": "Capture compliance artifacts in customer case",
226
+ "_links": {
227
+ "self": {
228
+ "href": "/concepts/bundle-com.beinformed.models.FSDemoBusinessDesign/High%20level%20requirements/Architectural%20significant%20requirements.beimodel.json/CaptureComplianceArtifactsInCustomerCase"
229
+ },
230
+ "concepttype": {
231
+ "href": "/concepttypes/bundle-com.beinformed.fs.demo.metamodels/High%20level%20requirements.bixml/ArchitecturalSignificantRequirement"
232
+ }
233
+ }
234
+ }
235
+ },
236
+ {
237
+ "concept": {
238
+ "_id": "ConformApplicationPatterns",
239
+ "label": "Conform application patterns",
240
+ "_links": {
241
+ "self": {
242
+ "href": "/concepts/bundle-com.beinformed.models.FSDemoBusinessDesign/High%20level%20requirements/Architectural%20significant%20requirements.beimodel.json/ConformApplicationPatterns"
243
+ },
244
+ "concepttype": {
245
+ "href": "/concepttypes/bundle-com.beinformed.fs.demo.metamodels/High%20level%20requirements.bixml/ArchitecturalSignificantRequirement"
246
+ }
247
+ }
248
+ }
249
+ },
250
+ {
251
+ "concept": {
252
+ "_id": "ConformDesignPatterns",
253
+ "label": "Conform design patterns",
254
+ "_links": {
255
+ "self": {
256
+ "href": "/concepts/bundle-com.beinformed.models.FSDemoBusinessDesign/High%20level%20requirements/Architectural%20significant%20requirements.beimodel.json/ConformDesignPatterns"
257
+ },
258
+ "concepttype": {
259
+ "href": "/concepttypes/bundle-com.beinformed.fs.demo.metamodels/High%20level%20requirements.bixml/ArchitecturalSignificantRequirement"
260
+ }
261
+ }
262
+ }
263
+ },
264
+ {
265
+ "concept": {
266
+ "_id": "DesignShouldSupportTheCompleteProcess",
267
+ "label": "Design should support the complete process",
268
+ "_links": {
269
+ "self": {
270
+ "href": "/concepts/bundle-com.beinformed.models.FSDemoBusinessDesign/High%20level%20requirements/Architectural%20significant%20requirements.beimodel.json/DesignShouldSupportTheCompleteProcess"
271
+ },
272
+ "concepttype": {
273
+ "href": "/concepttypes/bundle-com.beinformed.fs.demo.metamodels/High%20level%20requirements.bixml/ArchitecturalSignificantRequirement"
274
+ }
275
+ }
276
+ }
277
+ },
278
+ {
279
+ "concept": {
280
+ "_id": "MaintainACustomerProfile",
281
+ "label": "Maintain a customer profile",
282
+ "_links": {
283
+ "self": {
284
+ "href": "/concepts/bundle-com.beinformed.models.FSDemoBusinessDesign/High%20level%20requirements/Architectural%20significant%20requirements.beimodel.json/MaintainACustomerProfile"
285
+ },
286
+ "concepttype": {
287
+ "href": "/concepttypes/bundle-com.beinformed.fs.demo.metamodels/High%20level%20requirements.bixml/ArchitecturalSignificantRequirement"
288
+ }
289
+ }
290
+ }
291
+ },
292
+ {
293
+ "concept": {
294
+ "_id": "RepositoryReflectsOwnershipResponsiblityAndLifecycleParameters",
295
+ "label": "Repository reflects ownership, responsiblity and lifecycle parameters",
296
+ "_links": {
297
+ "self": {
298
+ "href": "/concepts/bundle-com.beinformed.models.FSDemoBusinessDesign/High%20level%20requirements/Architectural%20significant%20requirements.beimodel.json/RepositoryReflectsOwnershipResponsiblityAndLifecycleParameters"
299
+ },
300
+ "concepttype": {
301
+ "href": "/concepttypes/bundle-com.beinformed.fs.demo.metamodels/High%20level%20requirements.bixml/ArchitecturalSignificantRequirement"
302
+ }
303
+ }
304
+ }
305
+ },
306
+ {
307
+ "concept": {
308
+ "_id": "SeparateFrontAndBackOfficeProcesses",
309
+ "label": "Separate front and back office processes",
310
+ "_links": {
311
+ "self": {
312
+ "href": "/concepts/bundle-com.beinformed.models.FSDemoBusinessDesign/High%20level%20requirements/Architectural%20significant%20requirements.beimodel.json/SeparateFrontAndBackOfficeProcesses"
313
+ },
314
+ "concepttype": {
315
+ "href": "/concepttypes/bundle-com.beinformed.fs.demo.metamodels/High%20level%20requirements.bixml/ArchitecturalSignificantRequirement"
316
+ }
317
+ }
318
+ }
319
+ }
320
+ ]
321
+ }
322
+ }
323
+ }
@@ -9,17 +9,7 @@
9
9
  },
10
10
  "contributions": {
11
11
  "href": "/contributions/concepttypes/(knowledge-model-type-identifier)/(concept-type-identifier)"
12
- },
13
- "conceptTypeHierarchy": [
14
- {
15
- "href": "/concepttypes/bundle-com.beinformed.fs.demo.metamodels/Advice%20and%20request%20business%20scenarios.bixml/ScenarioStep_Advice",
16
- "name": "Adviceandrequestbusinessscenarios#ScenarioStep_Advice"
17
- },
18
- {
19
- "href": "/concepttypes/bundle-com.beinformed.fs.demo.metamodels/Business%20scenarios.bixml/ScenarioStep",
20
- "name": "BusinessScenarios#ScenarioStep"
21
- }
22
- ]
12
+ }
23
13
  },
24
14
  "_id": "ScenarioStep_Advice",
25
15
  "label": "Advice scenario step",
@@ -1,10 +1,38 @@
1
1
  import ConceptIndexModel from "../ConceptIndexModel";
2
2
 
3
+ import { conceptIndex } from "../__mock__/conceptindex";
4
+
3
5
  describe("conceptIndexModel", () => {
4
6
  it("should be able to create an empty ConceptIndexModel object", () => {
5
- const conceptIndex = new ConceptIndexModel();
7
+ const emptyConceptIndex = new ConceptIndexModel();
8
+
9
+ expect(emptyConceptIndex).toBeInstanceOf(ConceptIndexModel);
10
+ expect(emptyConceptIndex.type).toBe("ConceptIndex");
11
+ });
6
12
 
13
+ it("should be able to create a ConceptIndexModel from concept search resposne", () => {
7
14
  expect(conceptIndex).toBeInstanceOf(ConceptIndexModel);
8
- expect(conceptIndex.type).toBe("ConceptIndex");
15
+
16
+ expect(conceptIndex.label).toBe("Concept search");
17
+ expect(conceptIndex.selfhref.toString()).toBe(
18
+ "/concepts?entryDate=2024-10-21",
19
+ );
20
+
21
+ expect(conceptIndex.indexfilter.label).toBe("Index");
22
+ expect(conceptIndex.searchtermfilter.label).toBe("Label");
23
+ expect(conceptIndex.modelCategoryFilter.label).toBe("Model category");
24
+
25
+ expect(conceptIndex.items.size).toBe(7);
26
+
27
+ const firstItem = conceptIndex.items.first;
28
+ expect(firstItem.label).toBe(
29
+ "Capture compliance artifacts in customer case",
30
+ );
31
+ expect(firstItem.selfhref.toString()).toBe(
32
+ "/concepts/bundle-com.beinformed.models.FSDemoBusinessDesign/High%20level%20requirements/Architectural%20significant%20requirements.beimodel.json/CaptureComplianceArtifactsInCustomerCase?entryDate=2024-10-21",
33
+ );
34
+ expect(firstItem.conceptTypeLink.href.toString()).toBe(
35
+ "/concepttypes/bundle-com.beinformed.fs.demo.metamodels/High%20level%20requirements.bixml/ArchitecturalSignificantRequirement",
36
+ );
9
37
  });
10
38
  });