@beinformed/ui 1.57.0-contextpath.0 → 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 (185) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/esm/constants/Settings.js +10 -2
  3. package/esm/constants/Settings.js.map +1 -1
  4. package/esm/hooks/useModularUI.js +24 -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/models/href/Href.js +21 -4
  27. package/esm/models/href/Href.js.map +1 -1
  28. package/esm/models/list/ListItemCollection.js +1 -1
  29. package/esm/models/list/ListItemCollection.js.map +1 -1
  30. package/esm/modularui/CaptchaRequest.js +12 -3
  31. package/esm/modularui/CaptchaRequest.js.map +1 -1
  32. package/esm/modularui/ModularUIRequest.js +1 -1
  33. package/esm/modularui/ModularUIRequest.js.map +1 -1
  34. package/esm/modularui/UploadRequest.js +7 -3
  35. package/esm/modularui/UploadRequest.js.map +1 -1
  36. package/esm/redux/_modularui/ModularUIActions.js +11 -9
  37. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  38. package/esm/redux/_modularui/ModularUIMiddleware.js +4 -1
  39. package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -1
  40. package/esm/redux/_modularui/ModularUIReducer.js +2 -1
  41. package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
  42. package/esm/redux/_modularui/ModularUISelectors.js +7 -6
  43. package/esm/redux/_modularui/ModularUISelectors.js.map +1 -1
  44. package/esm/redux/_modularui/types.js.map +1 -1
  45. package/esm/redux/actions/Application.js +11 -6
  46. package/esm/redux/actions/Application.js.map +1 -1
  47. package/esm/redux/connectors/PanelRenderer.js +0 -2
  48. package/esm/redux/connectors/PanelRenderer.js.map +1 -1
  49. package/esm/utils/helpers/checkResource.js +0 -2
  50. package/esm/utils/helpers/checkResource.js.map +1 -1
  51. package/esm/utils/helpers/repositoryResource.js +6 -5
  52. package/esm/utils/helpers/repositoryResource.js.map +1 -1
  53. package/lib/constants/Settings.js +10 -2
  54. package/lib/constants/Settings.js.flow +8 -2
  55. package/lib/constants/Settings.js.map +1 -1
  56. package/lib/hooks/__tests__/UseModularUIModel.spec.js.flow +11 -4
  57. package/lib/hooks/__tests__/useAuthentication.spec.js.flow +2 -8
  58. package/lib/hooks/__tests__/useForm.spec.js.flow +14 -12
  59. package/lib/hooks/__tests__/useModelCatalog.spec.js.flow +10 -4
  60. package/lib/hooks/__tests__/useModels.spec.js.flow +3 -12
  61. package/lib/hooks/__tests__/useModularUIBasic.spec.js.flow +9 -8
  62. package/lib/hooks/useModularUI.js +23 -17
  63. package/lib/hooks/useModularUI.js.flow +31 -16
  64. package/lib/hooks/useModularUI.js.map +1 -1
  65. package/lib/hooks/useModularUIBasic.js +52 -41
  66. package/lib/hooks/useModularUIBasic.js.flow +66 -50
  67. package/lib/hooks/useModularUIBasic.js.map +1 -1
  68. package/lib/models/concepts/ConceptDetailModel.js +1 -8
  69. package/lib/models/concepts/ConceptDetailModel.js.flow +2 -7
  70. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  71. package/lib/models/concepts/ConceptIndexModel.js +1 -1
  72. package/lib/models/concepts/ConceptIndexModel.js.flow +7 -1
  73. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  74. package/lib/models/concepts/ConceptLinkModel.js +8 -9
  75. package/lib/models/concepts/ConceptLinkModel.js.flow +14 -9
  76. package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
  77. package/lib/models/concepts/ConceptTypeDetailModel.js +3 -20
  78. package/lib/models/concepts/ConceptTypeDetailModel.js.flow +3 -25
  79. package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  80. package/lib/models/concepts/SourceReferenceCollection.js +3 -1
  81. package/lib/models/concepts/SourceReferenceCollection.js.flow +8 -1
  82. package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
  83. package/lib/models/concepts/SourceReferenceModel.js +9 -3
  84. package/lib/models/concepts/SourceReferenceModel.js.flow +19 -3
  85. package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
  86. package/lib/models/concepts/__mock__/conceptindex.js.flow +15 -0
  87. package/lib/models/concepts/__tests__/ConceptIndexModel.spec.js.flow +30 -2
  88. package/lib/models/concepts/__tests__/ConceptTypeDetailModel.spec.js.flow +1 -18
  89. package/lib/models/content/ContentLinkModel.js +9 -4
  90. package/lib/models/content/ContentLinkModel.js.flow +19 -4
  91. package/lib/models/content/ContentLinkModel.js.map +1 -1
  92. package/lib/models/content/SectionModel.js +10 -6
  93. package/lib/models/content/SectionModel.js.flow +31 -5
  94. package/lib/models/content/SectionModel.js.map +1 -1
  95. package/lib/models/error/ErrorResponse.js +20 -5
  96. package/lib/models/error/ErrorResponse.js.flow +34 -5
  97. package/lib/models/error/ErrorResponse.js.map +1 -1
  98. package/lib/models/href/Href.js +21 -4
  99. package/lib/models/href/Href.js.flow +21 -4
  100. package/lib/models/href/Href.js.map +1 -1
  101. package/lib/models/href/__tests__/Href.spec.js.flow +9 -3
  102. package/lib/models/list/ListItemCollection.js +1 -1
  103. package/lib/models/list/ListItemCollection.js.flow +2 -0
  104. package/lib/models/list/ListItemCollection.js.map +1 -1
  105. package/lib/modularui/CaptchaRequest.js +11 -2
  106. package/lib/modularui/CaptchaRequest.js.flow +17 -3
  107. package/lib/modularui/CaptchaRequest.js.map +1 -1
  108. package/lib/modularui/ModularUIRequest.js +1 -1
  109. package/lib/modularui/ModularUIRequest.js.flow +3 -1
  110. package/lib/modularui/ModularUIRequest.js.map +1 -1
  111. package/lib/modularui/UploadRequest.js +6 -2
  112. package/lib/modularui/UploadRequest.js.flow +12 -2
  113. package/lib/modularui/UploadRequest.js.map +1 -1
  114. package/lib/redux/_modularui/ModularUIActions.js +11 -9
  115. package/lib/redux/_modularui/ModularUIActions.js.flow +20 -10
  116. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  117. package/lib/redux/_modularui/ModularUIMiddleware.js +3 -0
  118. package/lib/redux/_modularui/ModularUIMiddleware.js.flow +6 -3
  119. package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -1
  120. package/lib/redux/_modularui/ModularUIReducer.js +2 -1
  121. package/lib/redux/_modularui/ModularUIReducer.js.flow +1 -0
  122. package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
  123. package/lib/redux/_modularui/ModularUISelectors.js +5 -6
  124. package/lib/redux/_modularui/ModularUISelectors.js.flow +22 -10
  125. package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
  126. package/lib/redux/_modularui/__tests__/actions.spec.js.flow +1 -4
  127. package/lib/redux/_modularui/types.js.flow +1 -0
  128. package/lib/redux/_modularui/types.js.map +1 -1
  129. package/lib/redux/actions/Application.js +10 -5
  130. package/lib/redux/actions/Application.js.flow +16 -5
  131. package/lib/redux/actions/Application.js.map +1 -1
  132. package/lib/redux/actions/__tests__/Application.spec.js.flow +1 -8
  133. package/lib/redux/actions/__tests__/Authorization.spec.js.flow +0 -4
  134. package/lib/redux/connectors/PanelRenderer.js +0 -2
  135. package/lib/redux/connectors/PanelRenderer.js.flow +0 -1
  136. package/lib/redux/connectors/PanelRenderer.js.map +1 -1
  137. package/lib/utils/helpers/checkResource.js +0 -2
  138. package/lib/utils/helpers/checkResource.js.flow +0 -2
  139. package/lib/utils/helpers/checkResource.js.map +1 -1
  140. package/lib/utils/helpers/repositoryResource.js +6 -5
  141. package/lib/utils/helpers/repositoryResource.js.flow +8 -6
  142. package/lib/utils/helpers/repositoryResource.js.map +1 -1
  143. package/package.json +18 -18
  144. package/src/constants/Settings.js +8 -2
  145. package/src/hooks/__tests__/UseModularUIModel.spec.js +11 -4
  146. package/src/hooks/__tests__/useAuthentication.spec.js +2 -8
  147. package/src/hooks/__tests__/useForm.spec.js +14 -12
  148. package/src/hooks/__tests__/useModelCatalog.spec.js +10 -4
  149. package/src/hooks/__tests__/useModels.spec.js +3 -12
  150. package/src/hooks/__tests__/useModularUIBasic.spec.js +9 -8
  151. package/src/hooks/useModularUI.js +31 -16
  152. package/src/hooks/useModularUIBasic.js +66 -50
  153. package/src/models/concepts/ConceptDetailModel.js +2 -7
  154. package/src/models/concepts/ConceptIndexModel.js +7 -1
  155. package/src/models/concepts/ConceptLinkModel.js +14 -9
  156. package/src/models/concepts/ConceptTypeDetailModel.js +3 -25
  157. package/src/models/concepts/SourceReferenceCollection.js +8 -1
  158. package/src/models/concepts/SourceReferenceModel.js +19 -3
  159. package/src/models/concepts/__mock__/conceptindex.js +15 -0
  160. package/src/models/concepts/__mock__/conceptindex_contributions.json +86 -0
  161. package/src/models/concepts/__mock__/conceptindex_data.json +323 -0
  162. package/src/models/concepts/__mock__/concepttype_hierarchy.json +1 -11
  163. package/src/models/concepts/__tests__/ConceptIndexModel.spec.js +30 -2
  164. package/src/models/concepts/__tests__/ConceptTypeDetailModel.spec.js +1 -18
  165. package/src/models/content/ContentLinkModel.js +19 -4
  166. package/src/models/content/SectionModel.js +31 -5
  167. package/src/models/error/ErrorResponse.js +34 -5
  168. package/src/models/href/Href.js +21 -4
  169. package/src/models/href/__tests__/Href.spec.js +9 -3
  170. package/src/models/list/ListItemCollection.js +2 -0
  171. package/src/modularui/CaptchaRequest.js +17 -3
  172. package/src/modularui/ModularUIRequest.js +3 -1
  173. package/src/modularui/UploadRequest.js +12 -2
  174. package/src/redux/_modularui/ModularUIActions.js +20 -10
  175. package/src/redux/_modularui/ModularUIMiddleware.js +6 -3
  176. package/src/redux/_modularui/ModularUIReducer.js +1 -0
  177. package/src/redux/_modularui/ModularUISelectors.js +22 -10
  178. package/src/redux/_modularui/__tests__/actions.spec.js +1 -4
  179. package/src/redux/_modularui/types.js +1 -0
  180. package/src/redux/actions/Application.js +16 -5
  181. package/src/redux/actions/__tests__/Application.spec.js +1 -8
  182. package/src/redux/actions/__tests__/Authorization.spec.js +0 -4
  183. package/src/redux/connectors/PanelRenderer.js +0 -1
  184. package/src/utils/helpers/checkResource.js +0 -2
  185. package/src/utils/helpers/repositoryResource.js +8 -6
@@ -1 +1 @@
1
- {"version":3,"file":"ConceptLinkModel.js","names":["_BaseModel","_interopRequireDefault","require","_LinkModel","_LinkCollection","_ConceptTypeDetailModel","_Constants","ConceptLinkModel","BaseModel","constructor","data","entryDate","arguments","length","undefined","_defineProperty2","default","_entryDate","getInitialChildModelLinks","conceptTypeLink","isCacheable","setChildModels","models","href","conceptTypeModel","_find","call","model","selfhref","equalsWithParameters","type","conceptType","_conceptType","ConceptTypeDetailModel","key","_id","label","getData","links","_links","LinkCollection","Array","isArray","selflink","getLinkByKey","Error","addParameter","TIMEVERSION_FILTER_NAME","concepttypeHref","taxonomyType","asLinkModel","link","LinkModel","create","isOfConceptType","conceptTypeId","hasMetamodelIdInConceptTypeHierarchy","metamodelId","hasMetamodelIdInHierarchy","exports"],"sources":["../../../src/models/concepts/ConceptLinkModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport LinkCollection from \"../links/LinkCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { IModelWithChildModels, ModularUIModel } from \"../types\";\nimport type Href from \"../href/Href\";\n/**\n * Link to a concept\n */\nexport default class ConceptLinkModel\n extends BaseModel\n implements IModelWithChildModels\n{\n _links: ?LinkCollection;\n _entryDate: ?ISO_DATE;\n _conceptType: ?ConceptTypeDetailModel;\n\n /**\n * Construct ConceptLinkModel\n */\n constructor(data: Object, entryDate: ?ISO_DATE = null) {\n super(data, {});\n\n this._entryDate = entryDate;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (this.conceptTypeLink) {\n this.conceptTypeLink.isCacheable = true;\n return [this.conceptTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n if (this.conceptTypeLink) {\n const href = this.conceptTypeLink.href;\n const conceptTypeModel = models.find((model) =>\n model.selfhref.equalsWithParameters(href),\n );\n\n if (conceptTypeModel?.type === \"ConceptTypeDetail\") {\n this.conceptType = conceptTypeModel;\n }\n }\n }\n\n /**\n * Retrieve concept type\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n * Set concept type\n */\n set conceptType(conceptType: ?ModularUIModel) {\n this._conceptType =\n conceptType instanceof ConceptTypeDetailModel ? conceptType : null;\n }\n\n /**\n * Retrieve key\n */\n get key(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve label\n */\n get label(): string {\n const label = this.getData(\"label\");\n\n if (label) {\n return label;\n }\n\n return this.getData(\"conceptLabel\", \"\");\n }\n\n /**\n * Getting the links of the resource\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n Array.isArray(this.data._links)\n ? this.data._links[0]\n : this.data._links,\n );\n }\n\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new Error(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Self href of concept\n */\n get selfhref(): Href {\n if (this._entryDate !== null) {\n return this.selflink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this._entryDate,\n );\n }\n\n return this.selflink.href;\n }\n\n /**\n */\n get conceptTypeLink(): LinkModel | null {\n return this.links.getLinkByKey(\"concepttype\");\n }\n\n /**\n * Concept type href of concept\n */\n get concepttypeHref(): Href | null {\n return this.conceptTypeLink?.href ?? null;\n }\n\n /**\n */\n get taxonomyType(): string {\n return \"default\";\n }\n\n /**\n */\n asLinkModel(): LinkModel {\n // TODO SBO: origin and contextpath\n const link = LinkModel.create(this.key, this.selfhref.href, this.label);\n link.href = this.selfhref;\n\n return link;\n }\n\n /**\n * Indicates if the given concept type id or href exists in the hierarchy of concept types for this concept\n */\n isOfConceptType(conceptTypeId: string): boolean {\n return this.conceptType?.isOfConceptType(conceptTypeId) ?? false;\n }\n\n /**\n * Indicates if the given metamodel functional identifier exists in the hierarchy of concept types for this concept\n */\n hasMetamodelIdInConceptTypeHierarchy(metamodelId: string): boolean {\n return this.conceptType?.hasMetamodelIdInHierarchy(metamodelId) ?? false;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,uBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAIA;AACA;AACA;AACe,MAAMK,gBAAgB,SAC3BC,kBAAS,CAEnB;EAKE;AACF;AACA;EACEC,WAAWA,CAACC,IAAY,EAA+B;IAAA,IAA7B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Y,CAAC,aAAa,CAAC;EAC/C;;EAEA;AACF;AACA;EACE,IAAII,eAAeA,CAAA,EAAgB;IACjC,OAAO,IAAI,CAAC7B,eAAe,EAAEI,IAAI,IAAI,IAAI;EAC3C;;EAEA;AACF;EACE,IAAI0B,YAAYA,CAAA,EAAW;IACzB,OAAO,SAAS;EAClB;;EAEA;AACF;EACEC,WAAWA,CAAA,EAAc;IACvB;IACA,MAAMC,IAAI,GAAGC,kBAAS,CAACC,MAAM,CAAC,IAAI,CAACnB,GAAG,EAAE,IAAI,CAACN,QAAQ,CAACL,IAAI,EAAE,IAAI,CAACa,KAAK,CAAC;IACvEe,IAAI,CAAC5B,IAAI,GAAG,IAAI,CAACK,QAAQ;IAEzB,OAAOuB,IAAI;EACb;;EAEA;AACF;AACA;EACEG,eAAeA,CAACC,aAAqB,EAAW;IAC9C,OAAO,IAAI,CAACxB,WAAW,EAAEuB,eAAe,CAACC,aAAa,CAAC,IAAI,KAAK;EAClE;;EAEA;AACF;AACA;EACEC,oCAAoCA,CAACC,WAAmB,EAAW;IACjE,OAAO,IAAI,CAAC1B,WAAW,EAAE2B,yBAAyB,CAACD,WAAW,CAAC,IAAI,KAAK;EAC1E;AACF;AAACE,OAAA,CAAA3C,OAAA,GAAAT,gBAAA","ignoreList":[]}
1
+ {"version":3,"file":"ConceptLinkModel.js","names":["_BaseModel","_interopRequireDefault","require","_LinkModel","_LinkCollection","_ConceptTypeDetailModel","_Constants","_constants","ConceptLinkModel","BaseModel","constructor","data","entryDate","arguments","length","undefined","origin","contextPath","_defineProperty2","default","getBasePath","_entryDate","_origin","_contextPath","getInitialChildModelLinks","conceptTypeLink","isCacheable","setChildModels","models","href","conceptTypeModel","_find","call","model","selfhref","equalsWithParameters","type","conceptType","_conceptType","ConceptTypeDetailModel","key","_id","label","getData","links","_links","LinkCollection","Array","isArray","selflink","getLinkByKey","Error","addParameter","TIMEVERSION_FILTER_NAME","concepttypeHref","taxonomyType","asLinkModel","link","LinkModel","create","isOfConceptType","conceptTypeId","exports"],"sources":["../../../src/models/concepts/ConceptLinkModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport LinkCollection from \"../links/LinkCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { IModelWithChildModels, ModularUIModel } from \"../types\";\nimport type Href from \"../href/Href\";\nimport { getBasePath } from \"../../constants\";\n/**\n * Link to a concept\n */\nexport default class ConceptLinkModel\n extends BaseModel\n implements IModelWithChildModels\n{\n _links: ?LinkCollection;\n _entryDate: ?ISO_DATE;\n _conceptType: ?ConceptTypeDetailModel;\n _origin: string = \"\";\n _contextPath: string = getBasePath();\n\n /**\n * Construct ConceptLinkModel\n */\n constructor(\n data: Object,\n entryDate: ?ISO_DATE = null,\n origin?: string,\n contextPath?: string,\n ) {\n super(data, {});\n\n this._entryDate = entryDate;\n this._origin = origin || \"\";\n this._contextPath = contextPath || getBasePath();\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (this.conceptTypeLink) {\n this.conceptTypeLink.isCacheable = true;\n return [this.conceptTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n if (this.conceptTypeLink) {\n const href = this.conceptTypeLink.href;\n const conceptTypeModel = models.find((model) =>\n model.selfhref.equalsWithParameters(href),\n );\n\n if (conceptTypeModel?.type === \"ConceptTypeDetail\") {\n this.conceptType = conceptTypeModel;\n }\n }\n }\n\n /**\n * Retrieve concept type\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n * Set concept type\n */\n set conceptType(conceptType: ?ModularUIModel) {\n this._conceptType =\n conceptType instanceof ConceptTypeDetailModel ? conceptType : null;\n }\n\n /**\n * Retrieve key\n */\n get key(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve label\n */\n get label(): string {\n const label = this.getData(\"label\");\n\n if (label) {\n return label;\n }\n\n return this.getData(\"conceptLabel\", \"\");\n }\n\n /**\n * Getting the links of the resource\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n Array.isArray(this.data._links)\n ? this.data._links[0]\n : this.data._links,\n null,\n this._contextPath,\n this._origin,\n );\n }\n\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new Error(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Self href of concept\n */\n get selfhref(): Href {\n if (this._entryDate !== null) {\n return this.selflink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this._entryDate,\n );\n }\n\n return this.selflink.href;\n }\n\n /**\n */\n get conceptTypeLink(): LinkModel | null {\n return this.links.getLinkByKey(\"concepttype\");\n }\n\n /**\n * Concept type href of concept\n */\n get concepttypeHref(): Href | null {\n return this.conceptTypeLink?.href ?? null;\n }\n\n /**\n */\n get taxonomyType(): string {\n return \"default\";\n }\n\n /**\n */\n asLinkModel(): LinkModel {\n const link = LinkModel.create(this.key, this.selfhref.href, this.label);\n link.href = this.selfhref;\n\n return link;\n }\n\n /**\n * Indicates if the given concept type id or href exists in the hierarchy of concept types for this concept\n */\n isOfConceptType(conceptTypeId: string): boolean {\n return this.conceptType?.isOfConceptType(conceptTypeId) ?? false;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,uBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAIA,IAAAK,UAAA,GAAAL,OAAA;AACA;AACA;AACA;AACe,MAAMM,gBAAgB,SAC3BC,kBA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exports.default = void 0;
8
- var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/starts-with"));
9
8
  var _ResourceModel = _interopRequireDefault(require("../base/ResourceModel"));
10
9
  /**
11
10
  * Model for concept details, available through modelcatalog
@@ -15,8 +14,8 @@ class ConceptTypeDetailModel extends _ResourceModel.default {
15
14
  * 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>
16
15
  * For example BEI_CaseManagement#Case
17
16
  */
18
- get name() {
19
- return this.getData("name", "");
17
+ get kmtId() {
18
+ return this.getData("kmtId", "");
20
19
  }
21
20
 
22
21
  /**
@@ -119,26 +118,10 @@ class ConceptTypeDetailModel extends _ResourceModel.default {
119
118
  return this.getData("sectionReferenceTypes", []);
120
119
  }
121
120
 
122
- /**
123
- */
124
- get conceptTypeHierarchy() {
125
- return this.links.getLinksByGroup("conceptTypeHierarchy");
126
- }
127
-
128
121
  /**
129
122
  */
130
123
  isOfConceptType(conceptTypeId) {
131
- return this.conceptTypeHierarchy?.hasLinkByKey(conceptTypeId) || this.conceptTypeHierarchy?.hasLinkByHref(conceptTypeId) || this.selfhref.equals(conceptTypeId);
132
- }
133
-
134
- /**
135
- * Indicates if the given metamodel functional identifier exists in the hierarchy of concept types
136
- */
137
- hasMetamodelIdInHierarchy(metamodelId) {
138
- return this.conceptTypeHierarchy?.all.some(link => {
139
- var _context;
140
- return (0, _startsWith.default)(_context = link.key).call(_context, metamodelId + "#");
141
- }) || false;
124
+ return this.selfhref.equals(conceptTypeId);
142
125
  }
143
126
  }
144
127
  var _default = exports.default = ConceptTypeDetailModel;
@@ -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
 
@@ -1 +1 @@
1
- {"version":3,"file":"ConceptTypeDetailModel.js","names":["_ResourceModel","_interopRequireDefault","require","ConceptTypeDetailModel","ResourceModel","name","getData","type","modelName","isApplicableModel","data","contributions","resourcetype","key","_id","label","modelCategory","isCoreTaxonomy","icon","textColor","backgroundColor","borderColor","labelTypes","propertyTypes","textFragmentTypes","sectionReferenceTypes","conceptTypeHierarchy","links","getLinksByGroup","isOfConceptType","conceptTypeId","hasLinkByKey","hasLinkByHref","selfhref","equals","hasMetamodelIdInHierarchy","metamodelId","all","some","link","_context","_startsWith","default","call","_default","exports"],"sources":["../../../src/models/concepts/ConceptTypeDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type ModularUIResponse from \"../../modularui/ModularUIResponse\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nclass ConceptTypeDetailModel extends ResourceModel {\n /**\n * 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>\n * For example BEI_CaseManagement#Case\n */\n get name(): string {\n return this.getData(\"name\", \"\");\n }\n\n /**\n */\n get type(): string {\n return \"ConceptTypeDetail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptTypeDetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptTypeDetail\"\n );\n }\n\n /**\n */\n get key(): string {\n return this.data._id;\n }\n\n /**\n * Get concept type label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Get model category of the concept type\n */\n get modelCategory(): string {\n return this.getData(\"modelCategory\", \"\");\n }\n\n /**\n */\n get isCoreTaxonomy(): boolean {\n return this.getData(\"coreTaxonomy\", \"false\") === \"true\";\n }\n\n /**\n * Get concept type icon\n */\n get icon(): string {\n return this.getData(\"icon\", \"\");\n }\n\n /**\n * Get concept type text color\n */\n get textColor(): string {\n return this.getData(\"textColor\", \"#000\");\n }\n\n /**\n * Get concept type background color\n */\n get backgroundColor(): string {\n return this.getData(\"backgroundColor\", \"#fff\");\n }\n\n /**\n * Get concept line color\n */\n get borderColor(): string {\n return this.getData(\"lineColor\", \"#000\");\n }\n\n /**\n * Get label types\n */\n get labelTypes(): ?Array<Object> {\n return this.data.labelTypes;\n }\n\n /**\n * Get propertyTypes\n */\n get propertyTypes(): Array<Object> {\n return this.getData(\"propertyTypes\", []);\n }\n\n /**\n * Get textFragmentTypes\n */\n get textFragmentTypes(): Array<Object> {\n return this.getData(\"textFragmentTypes\", []);\n }\n\n /**\n * Get sectionReferenceTypes\n */\n get sectionReferenceTypes(): Array<Object> {\n return this.getData(\"sectionReferenceTypes\", []);\n }\n\n /**\n */\n get conceptTypeHierarchy(): LinkCollection {\n return this.links.getLinksByGroup(\"conceptTypeHierarchy\");\n }\n\n /**\n */\n isOfConceptType(conceptTypeId: string): boolean {\n return (\n this.conceptTypeHierarchy?.hasLinkByKey(conceptTypeId) ||\n this.conceptTypeHierarchy?.hasLinkByHref(conceptTypeId) ||\n this.selfhref.equals(conceptTypeId)\n );\n }\n\n /**\n * Indicates if the given metamodel functional identifier exists in the hierarchy of concept types\n */\n hasMetamodelIdInHierarchy(metamodelId: string): boolean {\n return (\n this.conceptTypeHierarchy?.all.some((link) =>\n link.key.startsWith(metamodelId + \"#\"),\n ) || false\n );\n }\n}\n\nexport default ConceptTypeDetailModel;\n"],"mappings":";;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA;AACA;AACA;AACA,MAAMC,sBAAsB,SAASC,sBAAa,CAAC;EACjD;AACF;AACA;AACA;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;EACjC;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,mBAAmB;EAC5B;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,wBAAwB;EACjC;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,mBAAmB;EAE3D;;EAEA;AACF;EACE,IAAIC,GAAGA,CAAA,EAAW;IAChB,OAAO,IAAI,CAACH,IAAI,CAACI,GAAG;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACT,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;EAClC;;EAEA;AACF;AACA;EACE,IAAIU,aAAaA,CAAA,EAAW;IAC1B,OAAO,IAAI,CAAC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,eAAeA,CAACC,aAAqB,EAAW;IAC9C,OACE,IAAI,CAACJ,oBAAoB,EAAEK,YAAY,CAACD,aAAa,CAAC,IACtD,IAAI,CAACJ,oBAAoB,EAAEM,aAAa,CAACF,aAAa,CAAC,IACvD,IAAI,CAACG,QAAQ,CAACC,MAAM,CAACJ,aAAa,CAAC;EAEvC;;EAEA;AACF;AACA;EACEK,yBAAyBA,CAACC,WAAmB,EAAW;IACtD,OACE,IAAI,CAACV,oBAAoB,EAAEW,GAAG,CAACC,IAAI,CAAEC,IAAI;MAAA,IAAAC,QAAA;MAAA,OACvC,IAAAC,WAAA,CAAAC,OAAA,EAAAF,QAAA,GAAAD,IAAI,CAAC1B,GAAG,EAAA8B,IAAA,CAAAH,QAAA,EAAYJ,WAAW,GAAG,GAAG,CAAC;IAAA,CACxC,CAAC,IAAI,KAAK;EAEd;AACF;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEcvC,sBAAsB","ignoreList":[]}
1
+ {"version":3,"file":"ConceptTypeDetailModel.js","names":["_ResourceModel","_interopRequireDefault","require","ConceptTypeDetailModel","ResourceModel","kmtId","getData","type","modelName","isApplicableModel","data","contributions","resourcetype","key","_id","label","modelCategory","isCoreTaxonomy","icon","textColor","backgroundColor","borderColor","labelTypes","propertyTypes","textFragmentTypes","sectionReferenceTypes","isOfConceptType","conceptTypeId","selfhref","equals","_default","exports","default"],"sources":["../../../src/models/concepts/ConceptTypeDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nclass ConceptTypeDetailModel extends ResourceModel {\n /**\n * 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>\n * For example BEI_CaseManagement#Case\n */\n get kmtId(): string {\n return this.getData(\"kmtId\", \"\");\n }\n\n /**\n */\n get type(): string {\n return \"ConceptTypeDetail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptTypeDetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptTypeDetail\"\n );\n }\n\n /**\n */\n get key(): string {\n return this.data._id;\n }\n\n /**\n * Get concept type label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Get model category of the concept type\n */\n get modelCategory(): string {\n return this.getData(\"modelCategory\", \"\");\n }\n\n /**\n */\n get isCoreTaxonomy(): boolean {\n return this.getData(\"coreTaxonomy\", \"false\") === \"true\";\n }\n\n /**\n * Get concept type icon\n */\n get icon(): string {\n return this.getData(\"icon\", \"\");\n }\n\n /**\n * Get concept type text color\n */\n get textColor(): string {\n return this.getData(\"textColor\", \"#000\");\n }\n\n /**\n * Get concept type background color\n */\n get backgroundColor(): string {\n return this.getData(\"backgroundColor\", \"#fff\");\n }\n\n /**\n * Get concept line color\n */\n get borderColor(): string {\n return this.getData(\"lineColor\", \"#000\");\n }\n\n /**\n * Get label types\n */\n get labelTypes(): ?Array<Object> {\n return this.data.labelTypes;\n }\n\n /**\n * Get propertyTypes\n */\n get propertyTypes(): Array<Object> {\n return this.getData(\"propertyTypes\", []);\n }\n\n /**\n * Get textFragmentTypes\n */\n get textFragmentTypes(): Array<Object> {\n return this.getData(\"textFragmentTypes\", []);\n }\n\n /**\n * Get sectionReferenceTypes\n */\n get sectionReferenceTypes(): Array<Object> {\n return this.getData(\"sectionReferenceTypes\", []);\n }\n\n /**\n */\n isOfConceptType(conceptTypeId: string): boolean {\n return this.selfhref.equals(conceptTypeId);\n }\n}\n\nexport default ConceptTypeDetailModel;\n"],"mappings":";;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA;AACA;AACA;AACA,MAAMC,sBAAsB,SAASC,sBAAa,CAAC;EACjD;AACF;AACA;AACA;EACE,IAAIC,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CA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AAM,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIgB,UAAUA,CAAA,EAAmB;IAC/B,OAAO,IAAI,CAACZ,IAAI,CAACY,UAAU;EAC7B;;EAEA;AACF;AACA;EACE,IAAIC,aAAaA,CAAA,EAAkB;IACjC,OAAO,IAAI,CAACjB,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIkB,iBAAiBA,CAAA,EAAkB;IACrC,OAAO,IAAI,CAAClB,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;EAC9C;;EAEA;AACF;AACA;EACE,IAAImB,qBAAqBA,CAAA,EAAkB;IACzC,OAAO,IAAI,CAACnB,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC;EAClD;;EAEA;AACF;EACEoB,eAAeA,CAACC,aAAqB,EAAW;IAC9C,OAAO,IAAI,CAACC,QAAQ,CAACC,MAAM,CAACF,aAAa,CAAC;EAC5C;AACF;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc7B,sBAAsB","ignoreList":[]}
@@ -19,8 +19,10 @@ class SourceReferenceCollection extends _BaseCollection.default {
19
19
  constructor() {
20
20
  let sourceReferences = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
21
21
  let entryDate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
22
+ let origin = arguments.length > 2 ? arguments[2] : undefined;
23
+ let contextPath = arguments.length > 3 ? arguments[3] : undefined;
22
24
  super();
23
- this.collection = sourceReferences ? (0, _map.default)(sourceReferences).call(sourceReferences, sourceReference => new _SourceReferenceModel.default(sourceReference, entryDate)) : [];
25
+ this.collection = sourceReferences ? (0, _map.default)(sourceReferences).call(sourceReferences, sourceReference => new _SourceReferenceModel.default(sourceReference, entryDate, origin, contextPath)) : [];
24
26
  }
25
27
 
26
28
  /**
@@ -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
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SourceReferenceCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_SourceReferenceModel","SourceReferenceCollection","BaseCollection","constructor","sourceReferences","arguments","length","undefined","entryDate","collection","_map","default","call","sourceReference","SourceReferenceModel","byTypes","types","_context","_filter","sourceRef","_includes","type","exports"],"sources":["../../../src/models/concepts/SourceReferenceCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\nimport SourceReferenceModel from \"./SourceReferenceModel\";\n\n/**\n * Source reference collection\n */\nexport default class SourceReferenceCollection extends BaseCollection<SourceReferenceModel> {\n /**\n */\n constructor(\n sourceReferences: Array<Object> = [],\n entryDate: ?ISO_DATE = null,\n ) {\n super();\n\n this.collection = sourceReferences\n ? sourceReferences.map(\n (sourceReference) =>\n new SourceReferenceModel(sourceReference, entryDate),\n )\n : [];\n }\n\n /**\n */\n byTypes(types: string): Array<SourceReferenceModel> {\n return this.filter((sourceRef) => types.includes(sourceRef.type));\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACe,MAAME,yBAAyB,SAASC,uBAAc,CAAuB;EAC1F;AACF;EACEC,WAAWA,CAAA,EAGT;IAAA,IAFAC,gBAA+B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IAAA,IACpCG,SAAoB,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAE3B,KAAK,CAAC,CAAC;IAEP,IAAI,CAACI,UAAU,GAAGL,gBAAgB,GAC9B,IAAAM,IAAA,CAAAC,OAAA,EAAAP,gBAAgB,EAAAQ,IAAA,CAAhBR,gBAAgB,EACbS,eAAe,IACd,IAAIC,6BAAoB,CAACD,eAAe,EAAEL,SAAS,CACvD,CAAC,GACD,EAAE;EACR;;EAEA;AACF;EACEO,OAAOA,CAACC,KAAa,EAA+B;IAAA,IAAAC,QAAA;IAClD,OAAO,IAAAC,OAAA,CAAAP,OAAA,EAAAM,QAAA,OAAI,EAAAL,IAAA,CAAAK,QAAA,EAASE,SAAS,IAAK,IAAAC,SAAA,CAAAT,OAAA,EAAAK,KAAK,EAAAJ,IAAA,CAALI,KAAK,EAAUG,SAAS,CAACE,IAAI,CAAC,CAAC;EACnE;AACF;AAACC,OAAA,CAAAX,OAAA,GAAAV,yBAAA","ignoreList":[]}
1
+ {"version":3,"file":"SourceReferenceCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_SourceReferenceModel","SourceReferenceCollection","BaseCollection","constructor","sourceReferences","arguments","length","undefined","entryDate","origin","contextPath","collection","_map","default","call","sourceReference","SourceReferenceModel","byTypes","types","_context","_filter","sourceRef","_includes","type","exports"],"sources":["../../../src/models/concepts/SourceReferenceCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\nimport SourceReferenceModel from \"./SourceReferenceModel\";\n\n/**\n * Source reference collection\n */\nexport default class SourceReferenceCollection extends BaseCollection<SourceReferenceModel> {\n /**\n */\n constructor(\n sourceReferences: Array<Object> = [],\n entryDate: ?ISO_DATE = null,\n origin?: string,\n contextPath?: string,\n ) {\n super();\n\n this.collection = sourceReferences\n ? sourceReferences.map(\n (sourceReference) =>\n new SourceReferenceModel(\n sourceReference,\n entryDate,\n origin,\n contextPath,\n ),\n )\n : [];\n }\n\n /**\n */\n byTypes(types: string): Array<SourceReferenceModel> {\n return this.filter((sourceRef) => types.includes(sourceRef.type));\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACe,MAAME,yBAAyB,SAASC,uBAAc,CAAuB;EAC1F;AACF;EACEC,WAAWA,CAAA,EAKT;IAAA,IAJAC,gBAA+B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IAAA,IACpCG,SAAoB,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAC3BI,MAAe,GAAAJ,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAAA,IACfG,WAAoB,GAAAL,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAEpB,KAAK,CAAC,CAAC;IAEP,IAAI,CAACI,UAAU,GAAGP,gBAAgB,GAC9B,IAAAQ,IAAA,CAAAC,OAAA,EAAAT,gBAAgB,EAAAU,IAAA,CAAhBV,gBAAgB,EACbW,eAAe,IACd,IAAIC,6BAAoB,CACtBD,eAAe,EACfP,SAAS,EACTC,MAAM,EACNC,WACF,CACJ,CAAC,GACD,EAAE;EACR;;EAEA;AACF;EACEO,OAAOA,CAACC,KAAa,EAA+B;IAAA,IAAAC,QAAA;IAClD,OAAO,IAAAC,OAAA,CAAAP,OAAA,EAAAM,QAAA,OAAI,EAAAL,IAAA,CAAAK,QAAA,EAASE,SAAS,IAAK,IAAAC,SAAA,CAAAT,OAAA,EAAAK,KAAK,EAAAJ,IAAA,CAALI,KAAK,EAAUG,SAAS,CAACE,IAAI,CAAC,CAAC;EACnE;AACF;AAACC,OAAA,CAAAX,OAAA,GAAAZ,yBAAA","ignoreList":[]}
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/he
9
9
  var _createHash = require("../../utils/helpers/createHash");
10
10
  var _ContentLinkModel = _interopRequireDefault(require("../content/ContentLinkModel"));
11
11
  var _Href = _interopRequireDefault(require("../href/Href"));
12
+ var _constants = require("../../constants");
12
13
  /**
13
14
  */
14
15
  class SourceReferenceModel {
@@ -16,10 +17,16 @@ class SourceReferenceModel {
16
17
  */
17
18
  constructor(sourceReference) {
18
19
  let entryDate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
20
+ let origin = arguments.length > 2 ? arguments[2] : undefined;
21
+ let contextPath = arguments.length > 3 ? arguments[3] : undefined;
19
22
  (0, _defineProperty2.default)(this, "_sourceReference", void 0);
20
23
  (0, _defineProperty2.default)(this, "_entryDate", void 0);
24
+ (0, _defineProperty2.default)(this, "_origin", "");
25
+ (0, _defineProperty2.default)(this, "_contextPath", (0, _constants.getBasePath)());
21
26
  this._sourceReference = sourceReference;
22
27
  this._entryDate = entryDate;
28
+ this._origin = origin || "";
29
+ this._contextPath = contextPath || (0, _constants.getBasePath)();
23
30
  }
24
31
 
25
32
  /**
@@ -29,14 +36,13 @@ class SourceReferenceModel {
29
36
  return new _ContentLinkModel.default({
30
37
  ...this._sourceReference,
31
38
  section
32
- }, this._entryDate);
39
+ }, this._entryDate, this._origin, this._contextPath);
33
40
  }
34
41
 
35
42
  /**
36
43
  */
37
44
  get selfhref() {
38
- // TODO SBO: origin and context
39
- return new _Href.default(this._sourceReference._links.self.href, "SourceReference");
45
+ return new _Href.default(this._sourceReference._links.self.href, "SourceReference", this._origin, this._contextPath);
40
46
  }
41
47
 
42
48
  /**
@@ -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
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SourceReferenceModel.js","names":["_createHash","require","_ContentLinkModel","_interopRequireDefault","_Href","SourceReferenceModel","constructor","sourceReference","entryDate","arguments","length","undefined","_defineProperty2","default","_sourceReference","_entryDate","link","section","_links","self","href","replace","content","ContentLinkModel","selfhref","Href","type","label","sourceLabel","referenceHash","createHashFromHref","_default","exports"],"sources":["../../../src/models/concepts/SourceReferenceModel.js"],"sourcesContent":["// @flow\nimport { createHashFromHref } from \"../../utils/helpers/createHash\";\n\nimport ContentLinkModel from \"../content/ContentLinkModel\";\nimport Href from \"../href/Href\";\n\n/**\n */\nclass SourceReferenceModel {\n _sourceReference: Object;\n _entryDate: ?ISO_DATE;\n\n /**\n */\n constructor(sourceReference: Object, entryDate: ?ISO_DATE = null) {\n this._sourceReference = sourceReference;\n this._entryDate = entryDate;\n }\n\n /**\n */\n get link(): ContentLinkModel {\n const section = this._sourceReference._links.self.href.replace(\n `${this._sourceReference._links.content.href}/`,\n \"\",\n );\n\n return new ContentLinkModel(\n {\n ...this._sourceReference,\n section,\n },\n this._entryDate,\n );\n }\n\n /**\n */\n get selfhref(): Href {\n // TODO SBO: origin and context\n return new Href(this._sourceReference._links.self.href, \"SourceReference\");\n }\n\n /**\n */\n get type(): string {\n return this._sourceReference.type;\n }\n\n /**\n */\n get label(): string {\n return this._sourceReference.label;\n }\n\n /**\n */\n get sourceLabel(): string {\n return this._sourceReference.sourceLabel;\n }\n\n /**\n */\n get referenceHash(): number {\n return createHashFromHref(this.selfhref);\n }\n}\n\nexport default SourceReferenceModel;\n"],"mappings":";;;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA;AACA;AACA,MAAMI,oBAAoB,CAAC;EAIzB;AACF;EACEC,WAAWA,CAACC,eAAuB,EAA+B;IAAA,IAA7BC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAAAG,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAC9D,IAAI,CAACC,gBAAgB,GAAGP,eAAe;IACvC,IAAI,CAACQ,UAAU,GAAGP,SAAS;EAC7B;;EAEA;AACF;EACE,IAAIQ,IAAIA,CAAA,EAAqB;IAC3B,MAAMC,OAAO,GAAG,IAAI,CAACH,gBAAgB,CAACI,MAAM,CAACC,IAAI,CAACC,IAAI,CAACC,OAAO,CAC5D,GAAG,IAAI,CAACP,gBAAgB,CAACI,MAAM,CAACI,OAAO,CAACF,IAAI,GAAG,EAC/C,EACF,CAAC;IAED,OAAO,IAAIG,yBAAgB,CACzB;MACE,GAAG,IAAI,CAACT,gBAAgB;MACxBG;IACF,CAAC,EACD,IAAI,CAACF,UACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIS,QAAQA,CAAA,EAAS;IACnB;IACA,OAAO,IAAIC,aAAI,CAAC,IAAI,CAACX,gBAAgB,CAACI,MAAM,CAACC,IAAI,CAACC,IAAI,EAAE,iBAAiB,CAAC;EAC5E;;EAEA;AACF;EACE,IAAIM,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACZ,gBAAgB,CAACY,IAAI;EACnC;;EAEA;AACF;EACE,IAAIC,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACb,gBAAgB,CAACa,KAAK;EACpC;;EAEA;AACF;EACE,IAAIC,WAAWA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACd,gBAAgB,CAACc,WAAW;EAC1C;;EAEA;AACF;EACE,IAAIC,aAAaA,CAAA,EAAW;IAC1B,OAAO,IAAAC,8BAAkB,EAAC,IAAI,CAACN,QAAQ,CAAC;EAC1C;AACF;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAnB,OAAA,GAEcR,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"SourceReferenceModel.js","names":["_createHash","require","_ContentLinkModel","_interopRequireDefault","_Href","_constants","SourceReferenceModel","constructor","sourceReference","entryDate","arguments","length","undefined","origin","contextPath","_defineProperty2","default","getBasePath","_sourceReference","_entryDate","_origin","_contextPath","link","section","_links","self","href","replace","content","ContentLinkModel","selfhref","Href","type","label","sourceLabel","referenceHash","createHashFromHref","_default","exports"],"sources":["../../../src/models/concepts/SourceReferenceModel.js"],"sourcesContent":["// @flow\nimport { createHashFromHref } from \"../../utils/helpers/createHash\";\n\nimport ContentLinkModel from \"../content/ContentLinkModel\";\nimport Href from \"../href/Href\";\nimport { getBasePath } from \"../../constants\";\n\n/**\n */\nclass SourceReferenceModel {\n _sourceReference: Object;\n _entryDate: ?ISO_DATE;\n _origin: string = \"\";\n _contextPath: string = getBasePath();\n\n /**\n */\n constructor(\n sourceReference: Object,\n entryDate: ?ISO_DATE = null,\n origin?: string,\n contextPath?: string,\n ) {\n this._sourceReference = sourceReference;\n this._entryDate = entryDate;\n this._origin = origin || \"\";\n this._contextPath = contextPath || getBasePath();\n }\n\n /**\n */\n get link(): ContentLinkModel {\n const section = this._sourceReference._links.self.href.replace(\n `${this._sourceReference._links.content.href}/`,\n \"\",\n );\n\n return new ContentLinkModel(\n {\n ...this._sourceReference,\n section,\n },\n this._entryDate,\n this._origin,\n this._contextPath,\n );\n }\n\n /**\n */\n get selfhref(): Href {\n return new Href(\n this._sourceReference._links.self.href,\n \"SourceReference\",\n this._origin,\n this._contextPath,\n );\n }\n\n /**\n */\n get type(): string {\n return this._sourceReference.type;\n }\n\n /**\n */\n get label(): string {\n return this._sourceReference.label;\n }\n\n /**\n */\n get sourceLabel(): string {\n return this._sourceReference.sourceLabel;\n }\n\n /**\n */\n get referenceHash(): number {\n return createHashFromHref(this.selfhref);\n }\n}\n\nexport default SourceReferenceModel;\n"],"mappings":";;;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAEA;AACA;AACA,MAAMK,oBAAoB,CAAC;EAMzB;AACF;EACEC,WAAWA,CACTC,eAAuB,EAIvB;IAAA,IAHAC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAC3BG,MAAe,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAAA,IACfE,WAAoB,GAAAJ,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAAA,IAAAG,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA,mBATJ,EAAE;IAAA,IAAAD,gBAAA,CAAAC,OAAA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C;AACF;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAtB,OAAA,GAEcV,oBAAoB","ignoreList":[]}
@@ -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 };
@@ -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
  });
@@ -19,30 +19,13 @@ describe("conceptTypeDetailModel", () => {
19
19
  expect(conceptTypeDetail.backgroundColor).toBe("#FFFF3C");
20
20
  expect(conceptTypeDetail.borderColor).toBe("#000000");
21
21
 
22
- expect(conceptTypeDetail.conceptTypeHierarchy.length).toBe(2);
23
22
  expect(
24
23
  conceptTypeDetail.isOfConceptType(
25
- "Adviceandrequestbusinessscenarios#ScenarioStep_Advice",
24
+ "/concepttypes/bundle-com.beinformed.fs.demo.metamodels/Advice%20and%20request%20business%20scenarios.bixml/ScenarioStep_Advice",
26
25
  ),
27
26
  ).toBe(true);
28
- expect(
29
- conceptTypeDetail.isOfConceptType("BusinessScenarios#ScenarioStep"),
30
- ).toBe(true);
31
27
  expect(conceptTypeDetail.isOfConceptType("BEI_CaseManagement#Case")).toBe(
32
28
  false,
33
29
  );
34
-
35
- expect(
36
- conceptTypeDetail.isOfConceptType(
37
- "/concepttypes/bundle-com.beinformed.fs.demo.metamodels/Business%20scenarios.bixml/ScenarioStep",
38
- ),
39
- ).toBe(true);
40
-
41
- expect(
42
- conceptTypeDetail.hasMetamodelIdInHierarchy("BusinessScenarios"),
43
- ).toBe(true);
44
- expect(
45
- conceptTypeDetail.hasMetamodelIdInHierarchy("BEI_CaseManagement"),
46
- ).toBe(false);
47
30
  });
48
31
  });
@@ -13,6 +13,7 @@ var _LinkModel = _interopRequireDefault(require("../links/LinkModel"));
13
13
  var _ContentTypeModel = _interopRequireDefault(require("./ContentTypeModel"));
14
14
  var _Constants = require("../../constants/Constants");
15
15
  var _LinkCollection = _interopRequireDefault(require("../links/LinkCollection"));
16
+ var _constants = require("../../constants");
16
17
  /**
17
18
  * Link to a concept
18
19
  */
@@ -21,12 +22,18 @@ class ContentLinkModel extends _BaseModel.default {
21
22
  */
22
23
  constructor(data) {
23
24
  let entryDate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
25
+ let origin = arguments.length > 2 ? arguments[2] : undefined;
26
+ let contextPath = arguments.length > 3 ? arguments[3] : undefined;
24
27
  super(data, {});
25
28
  (0, _defineProperty2.default)(this, "_links", void 0);
26
29
  (0, _defineProperty2.default)(this, "_entryDate", void 0);
27
30
  (0, _defineProperty2.default)(this, "_contentType", null);
28
31
  (0, _defineProperty2.default)(this, "_items", void 0);
32
+ (0, _defineProperty2.default)(this, "_origin", "");
33
+ (0, _defineProperty2.default)(this, "_contextPath", (0, _constants.getBasePath)());
29
34
  this._entryDate = entryDate;
35
+ this._origin = origin || "";
36
+ this._contextPath = contextPath || (0, _constants.getBasePath)();
30
37
  }
31
38
 
32
39
  /**
@@ -97,9 +104,8 @@ class ContentLinkModel extends _BaseModel.default {
97
104
  /**
98
105
  */
99
106
  createEncodedHref() {
100
- // TODO SBO: origin and context
101
107
  const startURI = "/content/";
102
- const selfHref = new _Href.default(this.data._links.self.href);
108
+ const selfHref = new _Href.default(this.data._links.self.href, this._origin, this._contextPath);
103
109
  const href = selfHref.path;
104
110
  const section = this.data.section;
105
111
  const sourceId = section ? href.substring(startURI.length, href.lastIndexOf("/")) : href.substring(startURI.length);
@@ -128,8 +134,7 @@ class ContentLinkModel extends _BaseModel.default {
128
134
  */
129
135
  get links() {
130
136
  if (!this._links) {
131
- // TODO SBO: origin and context
132
- this._links = new _LinkCollection.default(Array.isArray(this.data._links) ? this.data._links[0] : this.data._links);
137
+ this._links = new _LinkCollection.default(Array.isArray(this.data._links) ? this.data._links[0] : this.data._links, null, this._origin, this._contextPath);
133
138
  }
134
139
  return this._links;
135
140
  }
@@ -8,6 +8,7 @@ import { TIMEVERSION_FILTER_NAME } from "../../constants/Constants";
8
8
  import LinkCollection from "../links/LinkCollection";
9
9
 
10
10
  import type { ModularUIModel, IModelWithChildModels } from "../types";
11
+ import { getBasePath } from "../../constants";
11
12
 
12
13
  /**
13
14
  * Link to a concept
@@ -20,13 +21,22 @@ export default class ContentLinkModel
20
21
  _entryDate: ?ISO_DATE;
21
22
  _contentType: ContentTypeModel | null = null;
22
23
  _items: Array<ContentLinkModel>;
24
+ _origin: string = "";
25
+ _contextPath: string = getBasePath();
23
26
 
24
27
  /**
25
28
  */
26
- constructor(data: Object, entryDate: ?ISO_DATE = null) {
29
+ constructor(
30
+ data: Object,
31
+ entryDate: ?ISO_DATE = null,
32
+ origin?: string,
33
+ contextPath?: string,
34
+ ) {
27
35
  super(data, {});
28
36
 
29
37
  this._entryDate = entryDate;
38
+ this._origin = origin || "";
39
+ this._contextPath = contextPath || getBasePath();
30
40
  }
31
41
 
32
42
  /**
@@ -102,9 +112,12 @@ export default class ContentLinkModel
102
112
  /**
103
113
  */
104
114
  createEncodedHref(): Href {
105
- // TODO SBO: origin and context
106
115
  const startURI = "/content/";
107
- const selfHref = new Href(this.data._links.self.href);
116
+ const selfHref = new Href(
117
+ this.data._links.self.href,
118
+ this._origin,
119
+ this._contextPath,
120
+ );
108
121
  const href = selfHref.path;
109
122
 
110
123
  const section = this.data.section;
@@ -140,11 +153,13 @@ export default class ContentLinkModel
140
153
  */
141
154
  get links(): LinkCollection {
142
155
  if (!this._links) {
143
- // TODO SBO: origin and context
144
156
  this._links = new LinkCollection(
145
157
  Array.isArray(this.data._links)
146
158
  ? this.data._links[0]
147
159
  : this.data._links,
160
+ null,
161
+ this._origin,
162
+ this._contextPath,
148
163
  );
149
164
  }
150
165
 
@@ -1 +1 @@
1
- {"version":3,"file":"ContentLinkModel.js","names":["_BaseModel","_interopRequireDefault","require","_Href","_LinkModel","_ContentTypeModel","_Constants","_LinkCollection","ContentLinkModel","BaseModel","constructor","data","entryDate","arguments","length","undefined","_defineProperty2","default","_entryDate","getInitialChildModelLinks","contentTypeLink","isCacheable","setChildModels","models","href","contentTypeModel","_find","call","model","selfhref","equalsWithParameters","type","contentType","_contentType","ContentTypeModel","key","getData","label","sourceLabel","createEncodedHref","startURI","selfHref","Href","_links","self","path","section","sourceId","substring","lastIndexOf","encodeURIComponent","encodedHref","addParameter","TIMEVERSION_FILTER_NAME","links","LinkCollection","Array","isArray","selflink","getLinkByKey","Error","subSectionID","hash","contentTypeHref","items","_items","exports"],"sources":["../../../src/models/content/ContentLinkModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport Href from \"../href/Href\";\nimport LinkModel from \"../links/LinkModel\";\nimport ContentTypeModel from \"./ContentTypeModel\";\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport LinkCollection from \"../links/LinkCollection\";\n\nimport type { ModularUIModel, IModelWithChildModels } from \"../types\";\n\n/**\n * Link to a concept\n */\nexport default class ContentLinkModel\n extends BaseModel\n implements IModelWithChildModels\n{\n _links: ?LinkCollection;\n _entryDate: ?ISO_DATE;\n _contentType: ContentTypeModel | null = null;\n _items: Array<ContentLinkModel>;\n\n /**\n */\n constructor(data: Object, entryDate: ?ISO_DATE = null) {\n super(data, {});\n\n this._entryDate = entryDate;\n }\n\n /**\n */\n // $FlowFixMe[method-unbinding]\n getInitialChildModelLinks(): Array<LinkModel> {\n if (this.contentTypeLink) {\n this.contentTypeLink.isCacheable = true;\n return [this.contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n // $FlowFixMe[method-unbinding]\n setChildModels(models: Array<ModularUIModel>) {\n if (this.contentTypeLink) {\n const href = this.contentTypeLink.href;\n const contentTypeModel = models.find((model) =>\n model.selfhref.equalsWithParameters(href),\n );\n\n if (contentTypeModel?.type === \"ContentType\") {\n this.contentType = contentTypeModel;\n }\n }\n }\n\n /**\n * Retrieve content type\n */\n get contentType(): ?ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n * Set concept type\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n */\n set entryDate(entryDate: ISO_DATE) {\n this._entryDate = entryDate;\n }\n\n /**\n * Retrieve key\n */\n get key(): string {\n return this.getData(\"_id\", \"\");\n }\n\n /**\n * Retrieve label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Retrieve the label of the source a link to a section belongs to\n */\n get sourceLabel(): string | null {\n return this.getData(\"sourceLabel\");\n }\n\n /**\n */\n createEncodedHref(): Href {\n // TODO SBO: origin and context\n const startURI = \"/content/\";\n const selfHref = new Href(this.data._links.self.href);\n const href = selfHref.path;\n\n const section = this.data.section;\n const sourceId = section\n ? href.substring(startURI.length, href.lastIndexOf(\"/\"))\n : href.substring(startURI.length);\n\n if (section) {\n selfHref.path = `${startURI}${encodeURIComponent(sourceId)}/${encodeURIComponent(section)}`;\n } else {\n selfHref.path = `${startURI}${encodeURIComponent(sourceId)}`;\n }\n\n return selfHref;\n }\n\n /**\n * Encode the content-identifier of the path to the content resource.\n * This makes it a single uri part, which can be used on routes to make nested routes\n */\n get encodedHref(): Href {\n const href = this.createEncodedHref();\n\n if (this._entryDate !== null) {\n return href.addParameter(TIMEVERSION_FILTER_NAME, this._entryDate);\n }\n\n return href;\n }\n\n /**\n * Getting the links of the resource\n */\n get links(): LinkCollection {\n if (!this._links) {\n // TODO SBO: origin and context\n this._links = new LinkCollection(\n Array.isArray(this.data._links)\n ? this.data._links[0]\n : this.data._links,\n );\n }\n\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new Error(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Self href of concept\n */\n get selfhref(): Href {\n if (this._entryDate !== null) {\n return this.selflink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this._entryDate,\n );\n }\n\n return this.selflink.href;\n }\n\n /**\n */\n get subSectionID(): string {\n return this.selfhref.hash;\n }\n\n /**\n */\n get contentTypeLink(): LinkModel | null {\n return this.links.getLinkByKey(\"contenttype\");\n }\n\n /**\n * Concept type href of concept\n */\n get contentTypeHref(): Href | null {\n if (this.contentTypeLink) {\n return this.contentTypeLink.href;\n }\n\n return null;\n }\n\n /**\n * Children of link model in TOC\n */\n set items(items: Array<ContentLinkModel>) {\n this._items = items;\n }\n\n /**\n */\n get items(): Array<ContentLinkModel> {\n return this._items;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAEA,IAAAK,eAAA,GAAAN,sBAAA,CAAAC,OAAA;AAIA;AACA;AACA;AACe,MAAMM,gBAAgB,SAC3BC,kBAAS,CAEnB;EAME;AACF;EACEC,WAAWA,CAACC,IAAY,EAA+B;IAAA,IAA7BC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IACnD,KAAK,CAACF,IAAI,EAAE,CAAC,CAAC,CAAC;IAAC,IAAAK,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA,wBANsB,IAAI;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAQ1C,IAAI,CAACC,UAAU,GAAGN,SAAS;EAC7B;;EAEA;AACF;EACE;EACAO,yBAAyBA,CAAA,EAAqB;IAC5C,IAAI,IAAI,CAACC,eAAe,EAAE;MACxB,IAAI,CAACA,eAAe,CAACC,WAAW,GAAG,IAAI;MACvC,OAAO,CAAC,IAAI,CAACD,eAAe,CAAC;IAC/B;IAEA,OAAO,EAAE;E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ContentLinkModel.js","names":["_BaseModel","_interopRequireDefault","require","_Href","_LinkModel","_ContentTypeModel","_Constants","_LinkCollection","_constants","ContentLinkModel","BaseModel","constructor","data","entryDate","arguments","length","undefined","origin","contextPath","_defineProperty2","default","getBasePath","_entryDate","_origin","_contextPath","getInitialChildModelLinks","contentTypeLink","isCacheable","setChildModels","models","href","contentTypeModel","_find","call","model","selfhref","equalsWithParameters","type","contentType","_contentType","ContentTypeModel","key","getData","label","sourceLabel","createEncodedHref","startURI","selfHref","Href","_links","self","path","section","sourceId","substring","lastIndexOf","encodeURIComponent","encodedHref","addParameter","TIMEVERSION_FILTER_NAME","links","LinkCollection","Array","isArray","selflink","getLinkByKey","Error","subSectionID","hash","contentTypeHref","items","_items","exports"],"sources":["../../../src/models/content/ContentLinkModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport Href from \"../href/Href\";\nimport LinkModel from \"../links/LinkModel\";\nimport ContentTypeModel from \"./ContentTypeModel\";\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport LinkCollection from \"../links/LinkCollection\";\n\nimport type { ModularUIModel, IModelWithChildModels } from \"../types\";\nimport { getBasePath } from \"../../constants\";\n\n/**\n * Link to a concept\n */\nexport default class ContentLinkModel\n extends BaseModel\n implements IModelWithChildModels\n{\n _links: ?LinkCollection;\n _entryDate: ?ISO_DATE;\n _contentType: ContentTypeModel | null = null;\n _items: Array<ContentLinkModel>;\n _origin: string = \"\";\n _contextPath: string = getBasePath();\n\n /**\n */\n constructor(\n data: Object,\n entryDate: ?ISO_DATE = null,\n origin?: string,\n contextPath?: string,\n ) {\n super(data, {});\n\n this._entryDate = entryDate;\n this._origin = origin || \"\";\n this._contextPath = contextPath || getBasePath();\n }\n\n /**\n */\n // $FlowFixMe[method-unbinding]\n getInitialChildModelLinks(): Array<LinkModel> {\n if (this.contentTypeLink) {\n this.contentTypeLink.isCacheable = true;\n return [this.contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n // $FlowFixMe[method-unbinding]\n setChildModels(models: Array<ModularUIModel>) {\n if (this.contentTypeLink) {\n const href = this.contentTypeLink.href;\n const contentTypeModel = models.find((model) =>\n model.selfhref.equalsWithParameters(href),\n );\n\n if (contentTypeModel?.type === \"ContentType\") {\n this.contentType = contentTypeModel;\n }\n }\n }\n\n /**\n * Retrieve content type\n */\n get contentType(): ?ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n * Set concept type\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n */\n set entryDate(entryDate: ISO_DATE) {\n this._entryDate = entryDate;\n }\n\n /**\n * Retrieve key\n */\n get key(): string {\n return this.getData(\"_id\", \"\");\n }\n\n /**\n * Retrieve label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Retrieve the label of the source a link to a section belongs to\n */\n get sourceLabel(): string | null {\n return this.getData(\"sourceLabel\");\n }\n\n /**\n */\n createEncodedHref(): Href {\n const startURI = \"/content/\";\n const selfHref = new Href(\n this.data._links.self.href,\n this._origin,\n this._contextPath,\n );\n const href = selfHref.path;\n\n const section = this.data.section;\n const sourceId = section\n ? href.substring(startURI.length, href.lastIndexOf(\"/\"))\n : href.substring(startURI.length);\n\n if (section) {\n selfHref.path = `${startURI}${encodeURIComponent(sourceId)}/${encodeURIComponent(section)}`;\n } else {\n selfHref.path = `${startURI}${encodeURIComponent(sourceId)}`;\n }\n\n return selfHref;\n }\n\n /**\n * Encode the content-identifier of the path to the content resource.\n * This makes it a single uri part, which can be used on routes to make nested routes\n */\n get encodedHref(): Href {\n const href = this.createEncodedHref();\n\n if (this._entryDate !== null) {\n return href.addParameter(TIMEVERSION_FILTER_NAME, this._entryDate);\n }\n\n return href;\n }\n\n /**\n * Getting the links of the resource\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n Array.isArray(this.data._links)\n ? this.data._links[0]\n : this.data._links,\n null,\n this._origin,\n this._contextPath,\n );\n }\n\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new Error(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Self href of concept\n */\n get selfhref(): Href {\n if (this._entryDate !== null) {\n return this.selflink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this._entryDate,\n );\n }\n\n return this.selflink.href;\n }\n\n /**\n */\n get subSectionID(): string {\n return this.selfhref.hash;\n }\n\n /**\n */\n get contentTypeLink(): LinkModel | null {\n return this.links.getLinkByKey(\"contenttype\");\n }\n\n /**\n * Concept type href of concept\n */\n get contentTypeHref(): Href | null {\n if (this.contentTypeLink) {\n return this.contentTypeLink.href;\n }\n\n return null;\n }\n\n /**\n * Children of link model in TOC\n */\n set items(items: Array<ContentLinkModel>) {\n this._items = items;\n }\n\n /**\n */\n get items(): Array<ContentLinkModel> {\n return this._items;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAEA,IAAAK,eAAA,GAAAN,sBAAA,CAAAC,OAAA;AAGA,IAAAM,UAAA,GAAAN,OAAA;AAEA;AACA;AACA;AACe,MAAMO,gBAAgB,SAC3BC,kBAAS,CAEnB;EAQE;AACF;EACEC,WAAWA,CACTC,IAAY,EAIZ;IAAA,IAHAC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAC3BG,MAAe,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAA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