@beinformed/ui 1.61.1 → 1.62.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.
- package/CHANGELOG.md +9 -0
- package/esm/models/attributes/__tests__/AttributeContent.spec.js.flow +1 -1
- package/esm/models/concepts/ConceptIndexModel.js +1 -1
- package/esm/models/concepts/ConceptIndexModel.js.flow +3 -1
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/concepts/ConceptLinkModel.d.ts +15 -0
- package/esm/models/concepts/ConceptLinkModel.js +14 -0
- package/esm/models/concepts/ConceptLinkModel.js.flow +21 -0
- package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
- package/esm/models/concepts/SourceReferenceModel.d.ts +9 -0
- package/esm/models/concepts/SourceReferenceModel.js +14 -0
- package/esm/models/concepts/SourceReferenceModel.js.flow +15 -1
- package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
- package/esm/models/concepts/__mock__/related_concepts.js.flow +12 -0
- package/esm/models/concepts/__tests__/RelatedConcepts.spec.js.flow +60 -0
- package/esm/models/concepts/__tests__/SourceReferenceModel.spec.js.flow +58 -0
- package/esm/models/content/ContentLinkModel.d.ts +8 -0
- package/esm/models/content/ContentLinkModel.js +20 -0
- package/esm/models/content/ContentLinkModel.js.flow +22 -0
- package/esm/models/content/ContentLinkModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.d.ts +3 -0
- package/esm/models/content/ContentTOCModel.js +6 -0
- package/esm/models/content/ContentTOCModel.js.flow +6 -0
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/content/__tests__/ContentIndexModel.spec.js.flow +3 -0
- package/esm/models/content/__tests__/ContentModel.spec.js.flow +5 -5
- package/esm/models/content/__tests__/Formalsource.spec.js.flow +4 -0
- package/esm/models/types.d.ts +6 -0
- package/esm/models/types.js.flow +7 -0
- package/esm/models/types.js.map +1 -1
- package/esm/utils/helpers/__tests__/createHash.spec.js.flow +5 -5
- package/esm/utils/helpers/createHash.d.ts +2 -1
- package/esm/utils/helpers/createHash.js +10 -9
- package/esm/utils/helpers/createHash.js.flow +10 -10
- package/esm/utils/helpers/createHash.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js +1 -1
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.d.ts +15 -0
- package/lib/models/concepts/ConceptLinkModel.js +14 -0
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.d.ts +9 -0
- package/lib/models/concepts/SourceReferenceModel.js +14 -0
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.d.ts +8 -0
- package/lib/models/content/ContentLinkModel.js +20 -0
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.d.ts +3 -0
- package/lib/models/content/ContentTOCModel.js +6 -0
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/types.d.ts +6 -0
- package/lib/models/types.js.map +1 -1
- package/lib/utils/helpers/createHash.d.ts +2 -1
- package/lib/utils/helpers/createHash.js +11 -9
- package/lib/utils/helpers/createHash.js.map +1 -1
- package/package.json +3 -1
- package/src/models/attributes/__tests__/AttributeContent.spec.js +1 -1
- package/src/models/concepts/ConceptIndexModel.js +3 -1
- package/src/models/concepts/ConceptLinkModel.js +21 -0
- package/src/models/concepts/SourceReferenceModel.js +15 -1
- package/src/models/concepts/__mock__/related_concepts.js +12 -0
- package/src/models/concepts/__mock__/related_concepts_contributions.json +41 -0
- package/src/models/concepts/__mock__/related_concepts_data.json +2292 -0
- package/src/models/concepts/__tests__/RelatedConcepts.spec.js +60 -0
- package/src/models/concepts/__tests__/SourceReferenceModel.spec.js +58 -0
- package/src/models/content/ContentLinkModel.js +22 -0
- package/src/models/content/ContentTOCModel.js +6 -0
- package/src/models/content/__tests__/ContentIndexModel.spec.js +3 -0
- package/src/models/content/__tests__/ContentModel.spec.js +5 -5
- package/src/models/content/__tests__/Formalsource.spec.js +4 -0
- package/src/models/content/__tests__/content-index.json +1 -0
- package/src/models/content/__tests__/formalsource-complete.json +1 -0
- package/src/models/types.js +7 -0
- package/src/utils/helpers/__tests__/createHash.spec.js +5 -5
- package/src/utils/helpers/createHash.js +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.62.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.61.1...v1.62.0) (2025-06-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **abbreviation:** add source abbreviations to content ([88a9351](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/88a935180dc76da862b34dd0381b03790245c501))
|
|
11
|
+
* **fragment:** add fragments to source references ([4f107a4](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/4f107a48a97a7b070b55732accc37639feaeba3a))
|
|
12
|
+
* **related-concepts:** handle fragments on source references ([76a4519](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/76a45197190ff4dacff129e9aa1737589d05e832))
|
|
13
|
+
|
|
5
14
|
## [1.61.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.61.0...v1.61.1) (2025-06-02)
|
|
6
15
|
|
|
7
16
|
|
|
@@ -205,7 +205,7 @@ describe("AttributeContent", () => {
|
|
|
205
205
|
|
|
206
206
|
expect(firstSection.childSections).toHaveLength(2);
|
|
207
207
|
expect(firstSection.subSections).toHaveLength(2);
|
|
208
|
-
expect(firstSection.referenceHash).toBe(
|
|
208
|
+
expect(firstSection.referenceHash).toBe(4345174491453);
|
|
209
209
|
});
|
|
210
210
|
|
|
211
211
|
it("can handle referredSections", () => {
|
|
@@ -44,7 +44,7 @@ export default class ConceptIndexModel extends ResourceModel {
|
|
|
44
44
|
*/
|
|
45
45
|
static isApplicableModel(data) {
|
|
46
46
|
const resourceType = data.contributions?.resourcetype;
|
|
47
|
-
return resourceType === "ConceptSearch" || resourceType === "relatedConcepts";
|
|
47
|
+
return resourceType === "ConceptSearch" || resourceType === "relatedConcepts" || resourceType === "RelatedConcepts";
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
|
@@ -67,7 +67,9 @@ export default class ConceptIndexModel extends ResourceModel {
|
|
|
67
67
|
static isApplicableModel(data: ModularUIResponse): boolean {
|
|
68
68
|
const resourceType = data.contributions?.resourcetype;
|
|
69
69
|
return (
|
|
70
|
-
resourceType === "ConceptSearch" ||
|
|
70
|
+
resourceType === "ConceptSearch" ||
|
|
71
|
+
resourceType === "relatedConcepts" ||
|
|
72
|
+
resourceType === "RelatedConcepts"
|
|
71
73
|
);
|
|
72
74
|
}
|
|
73
75
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ConceptLinkModel","TIMEVERSION_FILTER_NAME","ConceptIndexModel","constructor","modularuiResponse","_context","_defineProperty","_filterCollection","_filterInstanceProperty","data","filter","contributions","dynamicschema","modelOptions","_concepts","collection","_embedded","_mapInstanceProperty","results","call","concept","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","attribute","searchtermfilter","modelCategoryFilter","itemCollection"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) =>\n new ConceptLinkModel(\n concept.concept,\n this.entryDate,\n this.modelOptions,\n ),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\"
|
|
1
|
+
{"version":3,"file":"ConceptIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ConceptLinkModel","TIMEVERSION_FILTER_NAME","ConceptIndexModel","constructor","modularuiResponse","_context","_defineProperty","_filterCollection","_filterInstanceProperty","data","filter","contributions","dynamicschema","modelOptions","_concepts","collection","_embedded","_mapInstanceProperty","results","call","concept","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","attribute","searchtermfilter","modelCategoryFilter","itemCollection"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) =>\n new ConceptLinkModel(\n concept.concept,\n this.entryDate,\n this.modelOptions,\n ),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" ||\n resourceType === \"relatedConcepts\" ||\n resourceType === \"RelatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n this.items.setChildModels(models, errors);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): string | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (timeversionFilter && timeversionFilter.attribute) {\n return timeversionFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get model category filter\n */\n get modelCategoryFilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"modelCategory\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAQnE;AACA;AACA;AACA,eAAe,MAAMC,iBAAiB,SAASL,aAAa,CAAC;EAI3D;AACF;EACEM,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,i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A,EAAsB;IACxC,OAAO,IAAI,CAACf,gBAAgB,CAACY,uBAAuB,CAAC,OAAO,CAAC;EAC/D;;EAEA;AACF;AACA;EACE,IAAII,mBAAmBA,CAAA,EAAsB;IAC3C,OAAO,IAAI,CAAChB,gBAAgB,CAACY,uBAAuB,CAAC,eAAe,CAAC;EACvE;;EAEA;AACF;AACA;EACE,IAAInB,KAAKA,CAAA,EAAyC;IAChD,OAAO,IAAI,CAACd,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIc,KAAKA,CAACwB,cAAoD,EAAE;IAC9D,IAAI,CAACtC,SAAS,GAAGsC,cAAc;EACjC;AACF","ignoreList":[]}
|
|
@@ -60,6 +60,14 @@ export default class ConceptLinkModel extends BaseModel {
|
|
|
60
60
|
* Indicates if the given concept type id or href exists in the hierarchy of concept types for this concept
|
|
61
61
|
*/
|
|
62
62
|
isOfConceptType(conceptTypeId: string): boolean;
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
get modelCategory(): string;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
get fragment(): SectionFragment;
|
|
63
71
|
}
|
|
64
72
|
import BaseModel from "../base/BaseModel";
|
|
65
73
|
import LinkCollection from "../links/LinkCollection";
|
|
@@ -67,4 +75,11 @@ import ConceptTypeDetailModel from "./ConceptTypeDetailModel";
|
|
|
67
75
|
import LinkModel from "../links/LinkModel";
|
|
68
76
|
import { ModularUIModel } from "../types";
|
|
69
77
|
import Href from "../href/Href";
|
|
78
|
+
type SectionFragment = {
|
|
79
|
+
sectionId: string;
|
|
80
|
+
text: string;
|
|
81
|
+
startOffset: number;
|
|
82
|
+
endOffset: number;
|
|
83
|
+
};
|
|
70
84
|
import { ModelOptions } from "../types";
|
|
85
|
+
export {};
|
|
@@ -140,5 +140,19 @@ export default class ConceptLinkModel extends BaseModel {
|
|
|
140
140
|
isOfConceptType(conceptTypeId) {
|
|
141
141
|
return this.conceptType?.isOfConceptType(conceptTypeId) ?? false;
|
|
142
142
|
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
*
|
|
146
|
+
*/
|
|
147
|
+
get modelCategory() {
|
|
148
|
+
return this.getData("modelCategory");
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
*/
|
|
154
|
+
get fragment() {
|
|
155
|
+
return this.getData("sectionFragment");
|
|
156
|
+
}
|
|
143
157
|
}
|
|
144
158
|
//# sourceMappingURL=ConceptLinkModel.js.map
|
|
@@ -12,6 +12,13 @@ import type {
|
|
|
12
12
|
} from "../types";
|
|
13
13
|
import type Href from "../href/Href";
|
|
14
14
|
|
|
15
|
+
type SectionFragment = {
|
|
16
|
+
sectionId: string,
|
|
17
|
+
text: string,
|
|
18
|
+
startOffset: number,
|
|
19
|
+
endOffset: number,
|
|
20
|
+
};
|
|
21
|
+
|
|
15
22
|
/**
|
|
16
23
|
* Link to a concept
|
|
17
24
|
*/
|
|
@@ -184,4 +191,18 @@ export default class ConceptLinkModel
|
|
|
184
191
|
isOfConceptType(conceptTypeId: string): boolean {
|
|
185
192
|
return this.conceptType?.isOfConceptType(conceptTypeId) ?? false;
|
|
186
193
|
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
*
|
|
197
|
+
*/
|
|
198
|
+
get modelCategory(): string {
|
|
199
|
+
return this.getData("modelCategory");
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
*
|
|
204
|
+
*/
|
|
205
|
+
get fragment(): SectionFragment {
|
|
206
|
+
return this.getData("sectionFragment");
|
|
207
|
+
}
|
|
187
208
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptLinkModel.js","names":["BaseModel","LinkModel","LinkCollection","ConceptTypeDetailModel","TIMEVERSION_FILTER_NAME","ConceptLinkModel","constructor","data","entryDate","arguments","length","undefined","modelOptions","_defineProperty","_entryDate","getInitialChildModelLinks","conceptTypeLink","isCacheable","setChildModels","models","href","conceptTypeModel","_findInstanceProperty","call","model","selfhref","equalsWithParameters","type","conceptType","_conceptType","key","_id","label","getData","links","_links","Array","isArray","selflink","getLinkByKey","Error","addParameter","concepttypeHref","taxonomyType","asLinkModel","link","create","isOfConceptType","conceptTypeId"],"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 {\n IModelWithChildModels,\n ModelOptions,\n ModularUIModel,\n} from \"../types\";\nimport type Href from \"../href/Href\";\n\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(\n data: Object,\n entryDate: ?ISO_DATE = null,\n modelOptions?: ModelOptions,\n ) {\n super(data, {}, modelOptions);\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 null,\n this.modelOptions,\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(\n this.key,\n this.selfhref.href,\n this.label,\n this.modelOptions,\n );\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,OAAOA,SAAS,MAAM,mBAAmB;AACzC,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,SAASC,uBAAuB,QAAQ,2BAA2B;
|
|
1
|
+
{"version":3,"file":"ConceptLinkModel.js","names":["BaseModel","LinkModel","LinkCollection","ConceptTypeDetailModel","TIMEVERSION_FILTER_NAME","ConceptLinkModel","constructor","data","entryDate","arguments","length","undefined","modelOptions","_defineProperty","_entryDate","getInitialChildModelLinks","conceptTypeLink","isCacheable","setChildModels","models","href","conceptTypeModel","_findInstanceProperty","call","model","selfhref","equalsWithParameters","type","conceptType","_conceptType","key","_id","label","getData","links","_links","Array","isArray","selflink","getLinkByKey","Error","addParameter","concepttypeHref","taxonomyType","asLinkModel","link","create","isOfConceptType","conceptTypeId","modelCategory","fragment"],"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 {\n IModelWithChildModels,\n ModelOptions,\n ModularUIModel,\n} from \"../types\";\nimport type Href from \"../href/Href\";\n\ntype SectionFragment = {\n sectionId: string,\n text: string,\n startOffset: number,\n endOffset: number,\n};\n\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(\n data: Object,\n entryDate: ?ISO_DATE = null,\n modelOptions?: ModelOptions,\n ) {\n super(data, {}, modelOptions);\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 null,\n this.modelOptions,\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(\n this.key,\n this.selfhref.href,\n this.label,\n this.modelOptions,\n );\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 *\n */\n get modelCategory(): string {\n return this.getData(\"modelCategory\");\n }\n\n /**\n *\n */\n get fragment(): SectionFragment {\n return this.getData(\"sectionFragment\");\n }\n}\n"],"mappings":";;AACA,OAAOA,SAAS,MAAM,mBAAmB;AACzC,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,SAASC,uBAAuB,QAAQ,2BAA2B;AAgBnE;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAC3BL,SAAS,CAEnB;EAKE;AACF;AACA;EACEM,WAAWA,CACTC,IAAY,EAGZ;IAAA,IAFAC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAC3BG,YAA2B,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAE3B,KAAK,CAACJ,IAAI,EAAE,CAAC,CAAC,EAAEK,YAAY,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAE9B,IAAI,CAACC,UAAU,GAAGN,SAAS;EAC7B;;EAEA;AACF;EACEO,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;EACX;;EAEA;AACF;EACEE,cAAcA,CAACC,MAA6B,EAAE;IAC5C,IAAI,IAAI,CAACH,eAAe,EAAE;MACxB,MAAMI,IAAI,GAAG,IAAI,CAACJ,eAAe,CAACI,IAAI;MACtC,MAAMC,gBAAgB,GAAGC,qBAAA,CAAAH,MAAM,EAAAI,IAAA,CAANJ,MAAM,EAAOK,KAAK,IACzCA,KAAK,CAACC,QAAQ,CAACC,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AC;EACtC;;EAEA;AACF;AACA;EACE,IAAIiB,QAAQA,CAAA,EAAoB;IAC9B,OAAO,IAAI,CAACjB,OAAO,CAAC,iBAAiB,CAAC;EACxC;AACF","ignoreList":[]}
|
|
@@ -23,10 +23,19 @@ declare class SourceReferenceModel {
|
|
|
23
23
|
/**
|
|
24
24
|
*/
|
|
25
25
|
get sourceLabel(): string;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
get sourceAbbreviation(): string;
|
|
26
30
|
/**
|
|
27
31
|
*/
|
|
28
32
|
get referenceHash(): number;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
get fragment(): SectionFragment | void;
|
|
29
37
|
}
|
|
30
38
|
import { ModelOptions } from "../types";
|
|
31
39
|
import ContentLinkModel from "../content/ContentLinkModel";
|
|
32
40
|
import Href from "../href/Href";
|
|
41
|
+
import { SectionFragment } from "../types";
|
|
@@ -56,11 +56,25 @@ class SourceReferenceModel {
|
|
|
56
56
|
return this._sourceReference.sourceLabel;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
get sourceAbbreviation() {
|
|
63
|
+
return this._sourceReference.sourceAbbreviation;
|
|
64
|
+
}
|
|
65
|
+
|
|
59
66
|
/**
|
|
60
67
|
*/
|
|
61
68
|
get referenceHash() {
|
|
62
69
|
return createHashFromHref(this.selfhref);
|
|
63
70
|
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
get fragment() {
|
|
76
|
+
return this._sourceReference.sectionFragment;
|
|
77
|
+
}
|
|
64
78
|
}
|
|
65
79
|
export default SourceReferenceModel;
|
|
66
80
|
//# sourceMappingURL=SourceReferenceModel.js.map
|
|
@@ -4,7 +4,7 @@ import { createHashFromHref } from "../../utils/helpers/createHash";
|
|
|
4
4
|
import ContentLinkModel from "../content/ContentLinkModel";
|
|
5
5
|
import Href from "../href/Href";
|
|
6
6
|
import { getBasePathModularUI } from "../../constants";
|
|
7
|
-
import type { ModelOptions } from "../types";
|
|
7
|
+
import type { ModelOptions, SectionFragment } from "../types";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
*/
|
|
@@ -74,11 +74,25 @@ class SourceReferenceModel {
|
|
|
74
74
|
return this._sourceReference.sourceLabel;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
get sourceAbbreviation(): string {
|
|
81
|
+
return this._sourceReference.sourceAbbreviation;
|
|
82
|
+
}
|
|
83
|
+
|
|
77
84
|
/**
|
|
78
85
|
*/
|
|
79
86
|
get referenceHash(): number {
|
|
80
87
|
return createHashFromHref(this.selfhref);
|
|
81
88
|
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
get fragment(): SectionFragment | void {
|
|
94
|
+
return this._sourceReference.sectionFragment;
|
|
95
|
+
}
|
|
82
96
|
}
|
|
83
97
|
|
|
84
98
|
export default SourceReferenceModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceReferenceModel.js","names":["createHashFromHref","ContentLinkModel","Href","getBasePathModularUI","SourceReferenceModel","constructor","sourceReference","entryDate","arguments","length","undefined","modelOptions","_defineProperty","_sourceReference","_entryDate","_modelOptions","origin","contextPath","link","section","_links","self","href","replace","content","selfhref","type","label","sourceLabel","referenceHash"],"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 { getBasePathModularUI } from \"../../constants\";\nimport type { ModelOptions } from \"../types\";\n\n/**\n */\nclass SourceReferenceModel {\n _sourceReference: Object;\n _entryDate: ?ISO_DATE;\n _modelOptions: ModelOptions;\n\n /**\n */\n constructor(\n sourceReference: Object,\n entryDate: ?ISO_DATE = null,\n modelOptions?: ModelOptions,\n ) {\n this._sourceReference = sourceReference;\n this._entryDate = entryDate;\n this._modelOptions = modelOptions || {\n origin: \"\",\n contextPath: getBasePathModularUI(),\n };\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._modelOptions,\n );\n }\n\n /**\n */\n get selfhref(): Href {\n return new Href(\n this._sourceReference._links.self.href,\n \"SourceReference\",\n this._modelOptions,\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,SAASA,kBAAkB,QAAQ,gCAAgC;AAEnE,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,IAAI,MAAM,cAAc;AAC/B,SAASC,oBAAoB,QAAQ,iBAAiB;AAGtD;AACA;AACA,MAAMC,oBAAoB,CAAC;EAKzB;AACF;EACEC,WAAWA,CACTC,eAAuB,EAGvB;IAAA,IAFAC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAC3BG,YAA2B,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAAAE,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAE3B,IAAI,CAACC,gBAAgB,GAAGP,eAAe;IACvC,IAAI,CAACQ,UAAU,GAAGP,SAAS;IAC3B,IAAI,CAACQ,aAAa,GAAGJ,YAAY,IAAI;MACnCK,MAAM,EAAE,EAAE;MACVC,WAAW,EAAEd,oBAAoB,CAAC;IACpC,CAAC;EACH;;EAEA;AACF;EACE,IAAIe,IAAIA,CAAA,EAAqB;IAC3B,MAAMC,OAAO,GAAG,IAAI,CAACN,gBAAgB,CAACO,MAAM,CAACC,IAAI,CAACC,IAAI,CAACC,OAAO,CAC5D,GAAG,IAAI,CAACV,gBAAgB,CAACO,MAAM,CAACI,OAAO,CAACF,IAAI,GAAG,EAC/C,EACF,CAAC;IAED,OAAO,IAAIrB,gBAAgB,CACzB;MACE,GAAG,IAAI,CAACY,gBAAgB;MACxBM;IACF,CAAC,EACD,IAAI,CAACL,UAAU,EACf,IAAI,CAACC,aACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIU,QAAQA,CAAA,EAAS;IACnB,OAAO,IAAIvB,IAAI,CACb,IAAI,CAACW,gBAAgB,CAACO,MAAM,CAACC,IAAI,CAACC,IAAI,EACtC,iBAAiB,EACjB,IAAI,CAACP,aACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIW,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACb,gBAAgB,CAACa,IAAI;EACnC;;EAEA;AACF;EACE,IAAIC,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACd,gBAAgB,CAACc,KAAK;EACpC;;EAEA;AACF;EACE,IAAIC,WAAWA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACf,gBAAgB,CAACe,WAAW;EAC1C;;EAEA;AACF;EACE,IAAIC,aAAaA,CAAA,EAAW;IAC1B,
|
|
1
|
+
{"version":3,"file":"SourceReferenceModel.js","names":["createHashFromHref","ContentLinkModel","Href","getBasePathModularUI","SourceReferenceModel","constructor","sourceReference","entryDate","arguments","length","undefined","modelOptions","_defineProperty","_sourceReference","_entryDate","_modelOptions","origin","contextPath","link","section","_links","self","href","replace","content","selfhref","type","label","sourceLabel","sourceAbbreviation","referenceHash","fragment","sectionFragment"],"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 { getBasePathModularUI } from \"../../constants\";\nimport type { ModelOptions, SectionFragment } from \"../types\";\n\n/**\n */\nclass SourceReferenceModel {\n _sourceReference: Object;\n _entryDate: ?ISO_DATE;\n _modelOptions: ModelOptions;\n\n /**\n */\n constructor(\n sourceReference: Object,\n entryDate: ?ISO_DATE = null,\n modelOptions?: ModelOptions,\n ) {\n this._sourceReference = sourceReference;\n this._entryDate = entryDate;\n this._modelOptions = modelOptions || {\n origin: \"\",\n contextPath: getBasePathModularUI(),\n };\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._modelOptions,\n );\n }\n\n /**\n */\n get selfhref(): Href {\n return new Href(\n this._sourceReference._links.self.href,\n \"SourceReference\",\n this._modelOptions,\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 */\n get sourceAbbreviation(): string {\n return this._sourceReference.sourceAbbreviation;\n }\n\n /**\n */\n get referenceHash(): number {\n return createHashFromHref(this.selfhref);\n }\n\n /**\n *\n */\n get fragment(): SectionFragment | void {\n return this._sourceReference.sectionFragment;\n }\n}\n\nexport default SourceReferenceModel;\n"],"mappings":";AACA,SAASA,kBAAkB,QAAQ,gCAAgC;AAEnE,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,IAAI,MAAM,cAAc;AAC/B,SAASC,oBAAoB,QAAQ,iBAAiB;AAGtD;AACA;AACA,MAAMC,oBAAoB,CAAC;EAKzB;AACF;EACEC,WAAWA,CACTC,eAAuB,EAGvB;IAAA,IA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;EAC1C;;EAEA;AACF;AACA;EACE,IAAIC,kBAAkBA,CAAA,EAAW;IAC/B,OAAO,IAAI,CAAChB,gBAAgB,CAACgB,kBAAkB;EACjD;;EAEA;AACF;EACE,IAAIC,aAAaA,CAAA,EAAW;IAC1B,OAAO9B,kBAAkB,CAAC,IAAI,CAACyB,QAAQ,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIM,QAAQA,CAAA,EAA2B;IACrC,OAAO,IAAI,CAAClB,gBAAgB,CAACmB,eAAe;EAC9C;AACF;AAEA,eAAe5B,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ModularUIResponse from "../../../modularui/ModularUIResponse";
|
|
2
|
+
import data from "./related_concepts_data.json";
|
|
3
|
+
import contributions from "./related_concepts_contributions.json";
|
|
4
|
+
import ConceptIndexModel from "../ConceptIndexModel";
|
|
5
|
+
|
|
6
|
+
const response = ModularUIResponse.create({
|
|
7
|
+
key: "concept",
|
|
8
|
+
data,
|
|
9
|
+
contributions,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const relatedConcepts = new ConceptIndexModel(response);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { relatedConcepts } from "../__mock__/related_concepts";
|
|
2
|
+
import ConceptIndexModel from "../ConceptIndexModel";
|
|
3
|
+
|
|
4
|
+
describe("Related concepts", () => {
|
|
5
|
+
it("Should be able to create a relatedConceptsModel from RelatedConcepts json", () => {
|
|
6
|
+
expect(relatedConcepts).toBeInstanceOf(ConceptIndexModel);
|
|
7
|
+
|
|
8
|
+
expect(relatedConcepts.label).toBe("Related concepts of content");
|
|
9
|
+
|
|
10
|
+
expect(relatedConcepts.label).toBe("Related concepts of content");
|
|
11
|
+
expect(relatedConcepts.selfhref.toString()).toBe(
|
|
12
|
+
"/content/bundle-com.beinformed.source.Highlevelrequirements/ResearchGrant/High%20level%20requirements.formalsource/relatedConcepts?entryDate=2025-06-03",
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
expect(relatedConcepts.entryDate).toBe("2025-06-03");
|
|
16
|
+
expect(relatedConcepts.modelCategoryFilter.label).toBe("Model category");
|
|
17
|
+
|
|
18
|
+
expect(relatedConcepts.items.size).toBe(116);
|
|
19
|
+
|
|
20
|
+
const firstItem = relatedConcepts.items.first;
|
|
21
|
+
expect(firstItem.key).toBe(
|
|
22
|
+
"SystemMustSendAutomatedNotificationsForStatusChanges",
|
|
23
|
+
);
|
|
24
|
+
expect(firstItem.label).toBe(
|
|
25
|
+
"System must send automated notifications for status changes.",
|
|
26
|
+
);
|
|
27
|
+
expect(firstItem.modelCategory).toBe("Requirements");
|
|
28
|
+
expect(firstItem.selfhref.toString()).toBe(
|
|
29
|
+
"/concepts/bundle-com.beinformed.frames.ResearchGrantRequirements/frames.beimodel.json/SystemMustSendAutomatedNotificationsForStatusChanges?entryDate=2025-06-03",
|
|
30
|
+
);
|
|
31
|
+
expect(firstItem.conceptTypeLink.href.toString()).toBe(
|
|
32
|
+
"/concepttypes/bundle-com.beinformed.research.grant.metamodels/High%20level%20requirements.bixml/ArchitecturalSignificantRequirement",
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
expect(firstItem.fragment.sectionId).toBe(
|
|
36
|
+
"AutomatedNotifications_Requirement",
|
|
37
|
+
);
|
|
38
|
+
expect(firstItem.fragment.text).toBeUndefined();
|
|
39
|
+
|
|
40
|
+
const secondItem = relatedConcepts.items.get(1);
|
|
41
|
+
|
|
42
|
+
expect(secondItem.key).toBe(
|
|
43
|
+
"n74UsersHaveMaximumFlexibilityWithinPolicyConstraints",
|
|
44
|
+
);
|
|
45
|
+
expect(secondItem.label).toBe(
|
|
46
|
+
"Users have maximum flexibility within policy constraints",
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
expect(secondItem.modelCategory).toBe("Requirements");
|
|
50
|
+
|
|
51
|
+
expect(secondItem.fragment.sectionId).toBe(
|
|
52
|
+
"MaximumFlexibilityWithinPolicyConstraints",
|
|
53
|
+
);
|
|
54
|
+
expect(secondItem.fragment.text).toBe(
|
|
55
|
+
"<p>Users have maximum flexibility within policy constraints</p>",
|
|
56
|
+
);
|
|
57
|
+
expect(secondItem.fragment.startOffset).toBe(0);
|
|
58
|
+
expect(secondItem.fragment.endOffset).toBe(56);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -1,9 +1,67 @@
|
|
|
1
1
|
import SourceReferenceModel from "../SourceReferenceModel";
|
|
2
2
|
|
|
3
|
+
const data = {
|
|
4
|
+
label: "Requirement: Implement scoring systems based on predefined cr...",
|
|
5
|
+
type: "Reference",
|
|
6
|
+
sourceLabel: "High level requirements",
|
|
7
|
+
sourceAbbreviation: "HLR-01",
|
|
8
|
+
_links: {
|
|
9
|
+
self: {
|
|
10
|
+
href: "/content/bundle-com.beinformed.source.Highlevelrequirements/ResearchGrant/High%20level%20requirements.formalsource/ScoringAndEvaluationCriteria#ScoringAndEvaluationCriteria_Requirement",
|
|
11
|
+
},
|
|
12
|
+
content: {
|
|
13
|
+
href: "/content/bundle-com.beinformed.source.Highlevelrequirements/ResearchGrant/High%20level%20requirements.formalsource",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
sectionFragment: {
|
|
17
|
+
text: "Implement scoring systems based on predefined criteria.",
|
|
18
|
+
startOffset: 12,
|
|
19
|
+
endOffset: 68,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
3
23
|
describe("sourceReferenceModel", () => {
|
|
4
24
|
it("should be able to create an empty SourceReferenceModel object", () => {
|
|
5
25
|
const sourceReference = new SourceReferenceModel();
|
|
6
26
|
|
|
7
27
|
expect(sourceReference).toBeInstanceOf(SourceReferenceModel);
|
|
8
28
|
});
|
|
29
|
+
|
|
30
|
+
it("can handle source reference data", () => {
|
|
31
|
+
const sourceReference = new SourceReferenceModel(data);
|
|
32
|
+
|
|
33
|
+
expect(sourceReference.label).toBe(
|
|
34
|
+
"Requirement: Implement scoring systems based on predefined cr...",
|
|
35
|
+
);
|
|
36
|
+
expect(sourceReference.sourceLabel).toBe("High level requirements");
|
|
37
|
+
expect(sourceReference.type).toBe("Reference");
|
|
38
|
+
expect(sourceReference.sourceAbbreviation).toBe("HLR-01");
|
|
39
|
+
expect(sourceReference.referenceHash).toBe(6767520005362);
|
|
40
|
+
expect(sourceReference.fragment.text).toBe(
|
|
41
|
+
"Implement scoring systems based on predefined criteria.",
|
|
42
|
+
);
|
|
43
|
+
expect(sourceReference.fragment.startOffset).toBe(12);
|
|
44
|
+
expect(sourceReference.fragment.endOffset).toBe(68);
|
|
45
|
+
|
|
46
|
+
expect(sourceReference.link.label).toBe(
|
|
47
|
+
"Requirement: Implement scoring systems based on predefined cr...",
|
|
48
|
+
);
|
|
49
|
+
expect(sourceReference.link.sourceLabel).toBe("High level requirements");
|
|
50
|
+
expect(sourceReference.link.abbreviation).toBe("HLR-01");
|
|
51
|
+
expect(sourceReference.link.selfhref.path).toBe(
|
|
52
|
+
"/content/bundle-com.beinformed.source.Highlevelrequirements/ResearchGrant/High%20level%20requirements.formalsource/ScoringAndEvaluationCriteria",
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
expect(sourceReference.link.fragment.text).toBe(
|
|
56
|
+
"Implement scoring systems based on predefined criteria.",
|
|
57
|
+
);
|
|
58
|
+
expect(sourceReference.link.fragment.startOffset).toBe(12);
|
|
59
|
+
expect(sourceReference.link.fragment.endOffset).toBe(68);
|
|
60
|
+
|
|
61
|
+
expect(sourceReference.link.selfhref.state.fragment.text).toBe(
|
|
62
|
+
"Implement scoring systems based on predefined criteria.",
|
|
63
|
+
);
|
|
64
|
+
expect(sourceReference.link.selfhref.state.fragment.startOffset).toBe(12);
|
|
65
|
+
expect(sourceReference.link.selfhref.state.fragment.endOffset).toBe(68);
|
|
66
|
+
});
|
|
9
67
|
});
|
|
@@ -38,6 +38,10 @@ export default class ContentLinkModel extends BaseModel {
|
|
|
38
38
|
* Retrieve the label of the source a link to a section belongs to
|
|
39
39
|
*/
|
|
40
40
|
get sourceLabel(): string | null;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
get abbreviation(): string | null;
|
|
41
45
|
/**
|
|
42
46
|
*/
|
|
43
47
|
createEncodedHref(): Href;
|
|
@@ -68,6 +72,9 @@ export default class ContentLinkModel extends BaseModel {
|
|
|
68
72
|
* Concept type href of concept
|
|
69
73
|
*/
|
|
70
74
|
get contentTypeHref(): Href | null;
|
|
75
|
+
/**
|
|
76
|
+
*/
|
|
77
|
+
get fragment(): SectionFragment | void;
|
|
71
78
|
/**
|
|
72
79
|
* Children of link model in TOC
|
|
73
80
|
*/
|
|
@@ -82,4 +89,5 @@ import ContentTypeModel from "./ContentTypeModel";
|
|
|
82
89
|
import LinkModel from "../links/LinkModel";
|
|
83
90
|
import { ModularUIModel } from "../types";
|
|
84
91
|
import Href from "../href/Href";
|
|
92
|
+
import { SectionFragment } from "../types";
|
|
85
93
|
import { ModelOptions } from "../types";
|
|
@@ -88,6 +88,13 @@ export default class ContentLinkModel extends BaseModel {
|
|
|
88
88
|
return this.getData("sourceLabel");
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
*/
|
|
94
|
+
get abbreviation() {
|
|
95
|
+
return this.getData("abbreviation") || this.getData("sourceAbbreviation");
|
|
96
|
+
}
|
|
97
|
+
|
|
91
98
|
/**
|
|
92
99
|
*/
|
|
93
100
|
createEncodedHref() {
|
|
@@ -134,6 +141,13 @@ export default class ContentLinkModel extends BaseModel {
|
|
|
134
141
|
if (selflink === null) {
|
|
135
142
|
throw new Error(`Could not find self link for ${this.key === null ? "unknown" : this.key}`);
|
|
136
143
|
}
|
|
144
|
+
if (!selflink.href.state) {
|
|
145
|
+
selflink.href.state = {
|
|
146
|
+
fragment: this.fragment
|
|
147
|
+
};
|
|
148
|
+
} else {
|
|
149
|
+
selflink.href.state.fragment = this.fragment;
|
|
150
|
+
}
|
|
137
151
|
return selflink;
|
|
138
152
|
}
|
|
139
153
|
|
|
@@ -169,6 +183,12 @@ export default class ContentLinkModel extends BaseModel {
|
|
|
169
183
|
return null;
|
|
170
184
|
}
|
|
171
185
|
|
|
186
|
+
/**
|
|
187
|
+
*/
|
|
188
|
+
get fragment() {
|
|
189
|
+
return this.data.sectionFragment;
|
|
190
|
+
}
|
|
191
|
+
|
|
172
192
|
/**
|
|
173
193
|
* Children of link model in TOC
|
|
174
194
|
*/
|
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
ModularUIModel,
|
|
12
12
|
IModelWithChildModels,
|
|
13
13
|
ModelOptions,
|
|
14
|
+
SectionFragment,
|
|
14
15
|
} from "../types";
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -107,6 +108,13 @@ export default class ContentLinkModel
|
|
|
107
108
|
return this.getData("sourceLabel");
|
|
108
109
|
}
|
|
109
110
|
|
|
111
|
+
/**
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
get abbreviation(): string | null {
|
|
115
|
+
return this.getData("abbreviation") || this.getData("sourceAbbreviation");
|
|
116
|
+
}
|
|
117
|
+
|
|
110
118
|
/**
|
|
111
119
|
*/
|
|
112
120
|
createEncodedHref(): Href {
|
|
@@ -177,6 +185,14 @@ export default class ContentLinkModel
|
|
|
177
185
|
);
|
|
178
186
|
}
|
|
179
187
|
|
|
188
|
+
if (!selflink.href.state) {
|
|
189
|
+
selflink.href.state = {
|
|
190
|
+
fragment: this.fragment,
|
|
191
|
+
};
|
|
192
|
+
} else {
|
|
193
|
+
selflink.href.state.fragment = this.fragment;
|
|
194
|
+
}
|
|
195
|
+
|
|
180
196
|
return selflink;
|
|
181
197
|
}
|
|
182
198
|
|
|
@@ -217,6 +233,12 @@ export default class ContentLinkModel
|
|
|
217
233
|
return null;
|
|
218
234
|
}
|
|
219
235
|
|
|
236
|
+
/**
|
|
237
|
+
*/
|
|
238
|
+
get fragment(): SectionFragment | void {
|
|
239
|
+
return this.data.sectionFragment;
|
|
240
|
+
}
|
|
241
|
+
|
|
220
242
|
/**
|
|
221
243
|
* Children of link model in TOC
|
|
222
244
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLinkModel.js","names":["BaseModel","Href","LinkModel","ContentTypeModel","TIMEVERSION_FILTER_NAME","LinkCollection","ContentLinkModel","constructor","data","entryDate","arguments","length","undefined","modelOptions","_defineProperty","_entryDate","getInitialChildModelLinks","contentTypeLink","isCacheable","setChildModels","models","href","contentTypeModel","_findInstanceProperty","call","model","selfhref","equalsWithParameters","type","contentType","_contentType","key","getData","label","sourceLabel","createEncodedHref","startURI","selfHref","_links","self","path","section","sourceId","substring","lastIndexOf","encodeURIComponent","encodedHref","addParameter","links","Array","isArray","selflink","getLinkByKey","Error","subSectionID","hash","contentTypeHref","items","_items"],"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 {\n ModularUIModel,\n IModelWithChildModels,\n ModelOptions,\n} 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(\n data: Object,\n entryDate: ?ISO_DATE = null,\n modelOptions?: ModelOptions,\n ) {\n super(data, {}, modelOptions);\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 const startURI = \"/content/\";\n const selfHref = new Href(\n this.data._links.self.href,\n \"\",\n this.modelOptions,\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.modelOptions,\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,OAAOA,SAAS,MAAM,mBAAmB;AACzC,OAAOC,IAAI,MAAM,cAAc;AAC/B,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAEnE,OAAOC,cAAc,MAAM,yBAAyB;AAQpD;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAC3BN,SAAS,CAEnB;EAME;AACF;EACEO,WAAWA,CACTC,IAAY,EAGZ;IAAA,IAFAC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IAAA,IAC3BG,YAA2B,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;IAE3B,KAAK,CAACJ,IAAI,EAAE,CAAC,CAAC,EAAEK,YAAY,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA,uBAVQ,IAAI;IAAA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,IAAI,CAACA,eAAe,CAACI,IAAI;IAClC;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACE,IAAIoC,KAAKA,CAACA,KAA8B,EAAE;IACxC,IAAI,CAACC,MAAM,GAAGD,KAAK;EACrB;;EAEA;AACF;EACE,IAAIA,KAAKA,CAAA,EAA4B;IACnC,OAAO,IAAI,CAACC,MAAM;EACpB;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ContentLinkModel.js","names":["BaseModel","Href","LinkModel","ContentTypeModel","TIMEVERSION_FILTER_NAME","LinkCollection","ContentLinkModel","constructor","data","entryDate","arguments","length","undefined","modelOptions","_defineProperty","_entryDate","getInitialChildModelLinks","contentTypeLink","isCacheable","setChildModels","models","href","contentTypeModel","_findInstanceProperty","call","model","selfhref","equalsWithParameters","type","contentType","_contentType","key","getData","label","sourceLabel","abbreviation","createEncodedHref","startURI","selfHref","_links","self","path","section","sourceId","substring","lastIndexOf","encodeURIComponent","encodedHref","addParameter","links","Array","isArray","selflink","getLinkByKey","Error","state","fragment","subSectionID","hash","contentTypeHref","sectionFragment","items","_items"],"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 {\n ModularUIModel,\n IModelWithChildModels,\n ModelOptions,\n SectionFragment,\n} 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(\n data: Object,\n entryDate: ?ISO_DATE = null,\n modelOptions?: ModelOptions,\n ) {\n super(data, {}, modelOptions);\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 */\n get abbreviation(): string | null {\n return this.getData(\"abbreviation\") || this.getData(\"sourceAbbreviation\");\n }\n\n /**\n */\n createEncodedHref(): Href {\n const startURI = \"/content/\";\n const selfHref = new Href(\n this.data._links.self.href,\n \"\",\n this.modelOptions,\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.modelOptions,\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 if (!selflink.href.state) {\n selflink.href.state = {\n fragment: this.fragment,\n };\n } else {\n selflink.href.state.fragment = this.fragment;\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 */\n get fragment(): SectionFragment | void {\n return this.data.sectionFragment;\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,OAAOA,SAAS,MAAM,mBAAmB;AACzC,OAAOC,IAAI,MAAM,cAAc;AAC/B,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAEnE,OAAOC,cAAc,MAAM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