@beinformed/ui 1.49.1 → 1.49.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/esm/models/concepts/ConceptDetailModel.js +7 -0
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js +7 -0
- package/lib/models/concepts/ConceptDetailModel.js.flow +8 -0
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/package.json +1 -1
- package/src/models/concepts/ConceptDetailModel.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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.49.3](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.49.2...v1.49.3) (2024-06-26)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **concept-detail:** retrieve diagram links ([d6e9fe6](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/d6e9fe6cce7e6b070ba8f9ad44017af1da96a500))
|
|
11
|
+
|
|
12
|
+
## [1.49.2](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.49.1...v1.49.2) (2024-06-26)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **concept-detail:** retrieve diagram links ([2f91f9e](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/2f91f9e6da223f4b59b0c6effae997d3463ab16a))
|
|
18
|
+
|
|
5
19
|
## [1.49.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.49.0...v1.49.1) (2024-06-13)
|
|
6
20
|
|
|
7
21
|
## [1.49.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.48.1...v1.49.0) (2024-06-13)
|
|
@@ -86,6 +86,13 @@ export default class ConceptDetailModel extends ResourceModel {
|
|
|
86
86
|
return href;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Available diagrams for the concept, most of the time just one
|
|
91
|
+
*/
|
|
92
|
+
get diagramLinks() {
|
|
93
|
+
return this.links.getLinksByGroup("diagram");
|
|
94
|
+
}
|
|
95
|
+
|
|
89
96
|
/**
|
|
90
97
|
* Get conceptType of concept
|
|
91
98
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptDetailModel.js","names":["ResourceModel","ConceptRelationCollection","SourceReferenceCollection","ConceptTypeDetailModel","TIMEVERSION_FILTER_NAME","ConceptDetailModel","constructor","modularuiResponse","_defineProperty","_relations","data","relations","entryDate","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","conceptTypeLink","links","getLinkByKey","relationsCollectionLinks","relationsCollection","isCacheable","setChildModels","models","errors","conceptTypeModel","_findInstanceProperty","call","model","conceptType","key","getData","selfhref","href","selflink","setParameter","removeParameter","_conceptType","label","conceptLabel","taxonomyType","formula","labels","_context","labelTypes","_mapInstanceProperty","labelType","_context2","setting","_id","getLabelElementByIds","ids","_context3","_filterInstanceProperty","_includesInstanceProperty","conceptProperties","_context4","propertyTypes","propertyType","_context5","properties","property","getConceptPropertiesByIds","_context6","textfragments","_context7","_context9","textFragments","textFragment","_context8","textFragmentConfig","textFragmentTypes","textFragmentType","notConfiguredTextFragments","some","textfragment","getTextFragmentByKeys","keys","_context10","getSourceReferenceCollection","availableLocales","arguments","length","undefined","_sourceReferences","getSourceReferencesForCurrentLanguage","LANGUAGE_POSTFIX_LENGTH","sourceReferences","_context11","_context14","availableLanguagesInSourceReferences","sourceReference","substring","currentLanguagePostfix","locale","_context12","_context13","_endsWithInstanceProperty","availableLanguages","split","value"],"sources":["../../../src/models/concepts/ConceptDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ConceptRelationCollection from \"./ConceptRelationCollection\";\nimport SourceReferenceCollection from \"./SourceReferenceCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type {\n ModularUIModel,\n labelsJSON,\n textfragmentJSON,\n propertyJSON,\n} from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type Href from \"../href/Href\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport default class ConceptDetailModel extends ResourceModel {\n _relations: ConceptRelationCollection;\n _conceptType: ?ConceptTypeDetailModel;\n _sourceReferences: SourceReferenceCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._relations = new ConceptRelationCollection(\n this.data.relations,\n this.entryDate,\n );\n }\n\n /**\n */\n get type(): string {\n return \"ConceptDetail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptDetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const conceptTypeLink = this.links.getLinkByKey(\"concepttype\");\n const relationsCollectionLinks =\n this.relationsCollection.getInitialChildModelLinks();\n\n if (conceptTypeLink) {\n conceptTypeLink.isCacheable = true;\n return [conceptTypeLink, ...relationsCollectionLinks];\n }\n\n return relationsCollectionLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models, errors);\n }\n\n /**\n * Retrieve concept detail identifier as key for this model\n */\n get key(): string {\n return this.getData(\"_id\", \"concept\");\n }\n\n /**\n * Getting the self link of this Concept\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.entryDate) {\n href.setParameter(TIMEVERSION_FILTER_NAME, this.entryDate);\n } else {\n href.removeParameter(TIMEVERSION_FILTER_NAME);\n }\n\n return href;\n }\n\n /**\n * Get conceptType of concept\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n */\n set conceptType(conceptType: ?ConceptTypeDetailModel) {\n this._conceptType = conceptType;\n }\n\n /**\n * Get concept label\n */\n get label(): string {\n return this.data.conceptLabel;\n }\n\n /**\n * Get taxonomy type\n */\n get taxonomyType(): string {\n return this.getData(\"taxonomyType\", \"default\");\n }\n\n /**\n * Get concept relations collection\n */\n get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }\n\n /**\n * Get concept formula\n */\n get formula(): string {\n return this.data.formula;\n }\n\n /**\n * Get additional labels of concept\n */\n get labels(): Array<labelsJSON> {\n return this.conceptType && this.conceptType.labelTypes\n ? this.conceptType.labelTypes.map((labelType) => {\n const setting = this.data.labels\n ? this.data.labels.find((label) => label.type === labelType._id)\n : {};\n\n return {\n ...labelType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get label elements by id\n */\n getLabelElementByIds(ids: Array<string>): Array<labelsJSON> {\n return this.labels.filter((label: labelsJSON) => ids.includes(label._id));\n }\n\n /**\n * Get concept properties\n */\n get conceptProperties(): Array<propertyJSON> {\n return this.conceptType && this.conceptType.propertyTypes\n ? this.conceptType.propertyTypes.map((propertyType) => {\n const setting = this.data.properties\n ? this.data.properties.find(\n (property) => property.type === propertyType._id,\n )\n : {};\n\n return {\n ...propertyType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get concept properties by id\n */\n getConceptPropertiesByIds(ids: Array<string>): Array<propertyJSON> {\n return this.conceptProperties.filter((property) =>\n ids.includes(property._id),\n );\n }\n\n /**\n * Get Text fragments\n */\n get textfragments(): Array<textfragmentJSON> {\n const textFragments = this.data.textFragments\n ? this.data.textFragments.map((textFragment) => {\n const textFragmentConfig =\n this.conceptType &&\n this.conceptType.textFragmentTypes.find(\n (textFragmentType) => textFragment.type === textFragmentType._id,\n );\n\n return {\n ...textFragmentConfig,\n ...textFragment,\n };\n })\n : [];\n\n const notConfiguredTextFragments =\n this.conceptType && this.conceptType.textFragmentTypes\n ? this.conceptType.textFragmentTypes.filter((textFragmentType) => {\n if (!this.data.textFragments) {\n return true;\n }\n\n return !this.data.textFragments.some(\n (textfragment) => textfragment.type === textFragmentType._id,\n );\n })\n : [];\n\n return [...textFragments, ...notConfiguredTextFragments];\n }\n\n /**\n * Get text fragments by id\n */\n getTextFragmentByKeys(keys: Array<string>): Array<textfragmentJSON> {\n return this.textfragments.filter((textfragment) =>\n keys.includes(textfragment.type),\n );\n }\n\n /**\n * Get source reference collection\n */\n getSourceReferenceCollection(\n availableLocales: Array<string> = [],\n ): SourceReferenceCollection {\n if (!this._sourceReferences) {\n this._sourceReferences = new SourceReferenceCollection(\n this.getSourceReferencesForCurrentLanguage(availableLocales),\n this.entryDate,\n );\n }\n\n return this._sourceReferences;\n }\n\n /*\n * Retrieve all sourceReferenceTypes that are valid for the current language\n * Used by sourceRef collection\n */\n /**\n */\n getSourceReferencesForCurrentLanguage(\n availableLocales: Array<string>,\n ): Array<Object> {\n const LANGUAGE_POSTFIX_LENGTH = 3;\n if (this.data.sourceReferences) {\n const availableLanguagesInSourceReferences =\n this.data.sourceReferences.map((sourceReference) =>\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n );\n\n const currentLanguagePostfix = `_${this.locale}`;\n\n if (\n availableLanguagesInSourceReferences.includes(currentLanguagePostfix)\n ) {\n // return all sourceReferences that end with language that is selected\n return this.data.sourceReferences.filter((sourceReference) =>\n sourceReference.type.endsWith(currentLanguagePostfix),\n );\n }\n\n const availableLanguages = availableLocales.map(\n (locale) => `_${locale.split(\"-\")[0]}`,\n );\n\n // return all sourceReferences that do not end with language postfix\n return this.data.sourceReferences.filter(\n (sourceReference) =>\n !availableLanguages.includes(\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n ),\n );\n }\n return [];\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ?? null;\n }\n}\n"],"mappings":";;;;;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,yBAAyB,MAAM,6BAA6B;AACnE,OAAOC,yBAAyB,MAAM,6BAA6B;AACnE,OAAOC,sBAAsB,MAAM,0BAA0B;AAE7D,SAASC,uBAAuB,QAAQ,2BAA2B;AAanE;AACA;AACA;AACA,eAAe,MAAMC,kBAAkB,SAASL,aAAa,CAAC;EAK5D;AACF;EACEM,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAEzB,IAAI,CAACC,UAAU,GAAG,IAAIR,yBAAyB,CAC7C,IAAI,CAACS,IAAI,CAACC,SAAS,EACnB,IAAI,CAACC,SACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,eAAe;EACxB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,oBAAoB;EAC7B;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACL,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACM,aAAa,CAACC,YAAY,IAC/BP,IAAI,CAACM,aAAa,CAACC,YAAY,KAAK,eAAe;EAEvD;;EAEA;AACF;EACEC,yBAAyBA,CAAA,EAAqB;IAC5C,MAAMC,eAAe,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,aAAa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,CAAClF,IAAI,CAACgF,gBAAgB,EAAA5D,IAAA,CAAA8D,UAAA,EAC9BE,eAAe,IACd,CAACrC,yBAAA,CAAA4C,kBAAkB,EAAAvE,IAAA,CAAlBuE,kBAAkB,EACjBP,eAAe,CAACjF,IAAI,CAACkF,SAAS,CAC5BD,eAAe,CAACjF,IAAI,CAACwE,MAAM,GAAGI,uBAChC,CACF,CACJ,CAAC;IACH;IACA,OAAO,EAAE;EACX;;EAEA;AACF;AACA;EACE,IAAI7E,SAASA,CAAA,EAAkB;IAC7B,OAAO4C,uBAAA,KAAI,CAAC9C,IAAI,IAAUN,uBAAuB,CAAC,EAAEmG,KAAK,IAAI,IAAI;EACnE;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ConceptDetailModel.js","names":["ResourceModel","ConceptRelationCollection","SourceReferenceCollection","ConceptTypeDetailModel","TIMEVERSION_FILTER_NAME","ConceptDetailModel","constructor","modularuiResponse","_defineProperty","_relations","data","relations","entryDate","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","conceptTypeLink","links","getLinkByKey","relationsCollectionLinks","relationsCollection","isCacheable","setChildModels","models","errors","conceptTypeModel","_findInstanceProperty","call","model","conceptType","key","getData","selfhref","href","selflink","setParameter","removeParameter","diagramLinks","getLinksByGroup","_conceptType","label","conceptLabel","taxonomyType","formula","labels","_context","labelTypes","_mapInstanceProperty","labelType","_context2","setting","_id","getLabelElementByIds","ids","_context3","_filterInstanceProperty","_includesInstanceProperty","conceptProperties","_context4","propertyTypes","propertyType","_context5","properties","property","getConceptPropertiesByIds","_context6","textfragments","_context7","_context9","textFragments","textFragment","_context8","textFragmentConfig","textFragmentTypes","textFragmentType","notConfiguredTextFragments","some","textfragment","getTextFragmentByKeys","keys","_context10","getSourceReferenceCollection","availableLocales","arguments","length","undefined","_sourceReferences","getSourceReferencesForCurrentLanguage","LANGUAGE_POSTFIX_LENGTH","sourceReferences","_context11","_context14","availableLanguagesInSourceReferences","sourceReference","substring","currentLanguagePostfix","locale","_context12","_context13","_endsWithInstanceProperty","availableLanguages","split","value"],"sources":["../../../src/models/concepts/ConceptDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ConceptRelationCollection from \"./ConceptRelationCollection\";\nimport SourceReferenceCollection from \"./SourceReferenceCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type {\n ModularUIModel,\n labelsJSON,\n textfragmentJSON,\n propertyJSON,\n} from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type Href from \"../href/Href\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport default class ConceptDetailModel extends ResourceModel {\n _relations: ConceptRelationCollection;\n _conceptType: ?ConceptTypeDetailModel;\n _sourceReferences: SourceReferenceCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._relations = new ConceptRelationCollection(\n this.data.relations,\n this.entryDate,\n );\n }\n\n /**\n */\n get type(): string {\n return \"ConceptDetail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptDetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const conceptTypeLink = this.links.getLinkByKey(\"concepttype\");\n const relationsCollectionLinks =\n this.relationsCollection.getInitialChildModelLinks();\n\n if (conceptTypeLink) {\n conceptTypeLink.isCacheable = true;\n return [conceptTypeLink, ...relationsCollectionLinks];\n }\n\n return relationsCollectionLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models, errors);\n }\n\n /**\n * Retrieve concept detail identifier as key for this model\n */\n get key(): string {\n return this.getData(\"_id\", \"concept\");\n }\n\n /**\n * Getting the self link of this Concept\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.entryDate) {\n href.setParameter(TIMEVERSION_FILTER_NAME, this.entryDate);\n } else {\n href.removeParameter(TIMEVERSION_FILTER_NAME);\n }\n\n return href;\n }\n\n /**\n * Available diagrams for the concept, most of the time just one\n */\n get diagramLinks(): LinkCollection {\n return this.links.getLinksByGroup(\"diagram\");\n }\n\n /**\n * Get conceptType of concept\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n */\n set conceptType(conceptType: ?ConceptTypeDetailModel) {\n this._conceptType = conceptType;\n }\n\n /**\n * Get concept label\n */\n get label(): string {\n return this.data.conceptLabel;\n }\n\n /**\n * Get taxonomy type\n */\n get taxonomyType(): string {\n return this.getData(\"taxonomyType\", \"default\");\n }\n\n /**\n * Get concept relations collection\n */\n get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }\n\n /**\n * Get concept formula\n */\n get formula(): string {\n return this.data.formula;\n }\n\n /**\n * Get additional labels of concept\n */\n get labels(): Array<labelsJSON> {\n return this.conceptType && this.conceptType.labelTypes\n ? this.conceptType.labelTypes.map((labelType) => {\n const setting = this.data.labels\n ? this.data.labels.find((label) => label.type === labelType._id)\n : {};\n\n return {\n ...labelType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get label elements by id\n */\n getLabelElementByIds(ids: Array<string>): Array<labelsJSON> {\n return this.labels.filter((label: labelsJSON) => ids.includes(label._id));\n }\n\n /**\n * Get concept properties\n */\n get conceptProperties(): Array<propertyJSON> {\n return this.conceptType && this.conceptType.propertyTypes\n ? this.conceptType.propertyTypes.map((propertyType) => {\n const setting = this.data.properties\n ? this.data.properties.find(\n (property) => property.type === propertyType._id,\n )\n : {};\n\n return {\n ...propertyType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get concept properties by id\n */\n getConceptPropertiesByIds(ids: Array<string>): Array<propertyJSON> {\n return this.conceptProperties.filter((property) =>\n ids.includes(property._id),\n );\n }\n\n /**\n * Get Text fragments\n */\n get textfragments(): Array<textfragmentJSON> {\n const textFragments = this.data.textFragments\n ? this.data.textFragments.map((textFragment) => {\n const textFragmentConfig =\n this.conceptType &&\n this.conceptType.textFragmentTypes.find(\n (textFragmentType) => textFragment.type === textFragmentType._id,\n );\n\n return {\n ...textFragmentConfig,\n ...textFragment,\n };\n })\n : [];\n\n const notConfiguredTextFragments =\n this.conceptType && this.conceptType.textFragmentTypes\n ? this.conceptType.textFragmentTypes.filter((textFragmentType) => {\n if (!this.data.textFragments) {\n return true;\n }\n\n return !this.data.textFragments.some(\n (textfragment) => textfragment.type === textFragmentType._id,\n );\n })\n : [];\n\n return [...textFragments, ...notConfiguredTextFragments];\n }\n\n /**\n * Get text fragments by id\n */\n getTextFragmentByKeys(keys: Array<string>): Array<textfragmentJSON> {\n return this.textfragments.filter((textfragment) =>\n keys.includes(textfragment.type),\n );\n }\n\n /**\n * Get source reference collection\n */\n getSourceReferenceCollection(\n availableLocales: Array<string> = [],\n ): SourceReferenceCollection {\n if (!this._sourceReferences) {\n this._sourceReferences = new SourceReferenceCollection(\n this.getSourceReferencesForCurrentLanguage(availableLocales),\n this.entryDate,\n );\n }\n\n return this._sourceReferences;\n }\n\n /*\n * Retrieve all sourceReferenceTypes that are valid for the current language\n * Used by sourceRef collection\n */\n /**\n */\n getSourceReferencesForCurrentLanguage(\n availableLocales: Array<string>,\n ): Array<Object> {\n const LANGUAGE_POSTFIX_LENGTH = 3;\n if (this.data.sourceReferences) {\n const availableLanguagesInSourceReferences =\n this.data.sourceReferences.map((sourceReference) =>\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n );\n\n const currentLanguagePostfix = `_${this.locale}`;\n\n if (\n availableLanguagesInSourceReferences.includes(currentLanguagePostfix)\n ) {\n // return all sourceReferences that end with language that is selected\n return this.data.sourceReferences.filter((sourceReference) =>\n sourceReference.type.endsWith(currentLanguagePostfix),\n );\n }\n\n const availableLanguages = availableLocales.map(\n (locale) => `_${locale.split(\"-\")[0]}`,\n );\n\n // return all sourceReferences that do not end with language postfix\n return this.data.sourceReferences.filter(\n (sourceReference) =>\n !availableLanguages.includes(\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n ),\n );\n }\n return [];\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ?? null;\n }\n}\n"],"mappings":";;;;;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,yBAAyB,MAAM,6BAA6B;AACnE,OAAOC,yBAAyB,MAAM,6BAA6B;AACnE,OAAOC,sBAAsB,MAAM,0BAA0B;AAE7D,SAASC,uBAAuB,QAAQ,2BAA2B;AAcnE;AACA;AACA;AACA,eAAe,MAAMC,kBAAkB,SAASL,aAAa,CAAC;EAK5D;AACF;EACEM,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAEzB,IAAI,CAACC,UAAU,GAAG,IAAIR,yBAAyB,CAC7C,IAAI,CAACS,IAAI,CAACC,SAAS,EACnB,IAAI,CAACC,SACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,eAAe;EACxB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,oBAAoB;EAC7B;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACL,IAAuB,EAAW;IACzD,O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,UAAA,GAAAL,eAAe,CAACnF,IAAI,EAAAiB,IAAA,CAAAuE,UAAA,EAAUH,sBAAsB,CAAC;QAAA,CACvD,CAAC;MACH;MAEA,MAAMK,kBAAkB,GAAGrD,oBAAA,CAAAmC,gBAAgB,EAAAvD,IAAA,CAAhBuD,gBAAgB,EACxCc,MAAM,IAAK,IAAIA,MAAM,CAACK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACtC,CAAC;;MAED;MACA,OAAO9C,uBAAA,CAAAoC,UAAA,OAAI,CAACpF,IAAI,CAACkF,gBAAgB,EAAA9D,IAAA,CAAAgE,UAAA,EAC9BE,eAAe,IACd,CAACrC,yBAAA,CAAA4C,kBAAkB,EAAAzE,IAAA,CAAlByE,kBAAkB,EACjBP,eAAe,CAACnF,IAAI,CAACoF,SAAS,CAC5BD,eAAe,CAACnF,IAAI,CAAC0E,MAAM,GAAGI,uBAChC,CACF,CACJ,CAAC;IACH;IACA,OAAO,EAAE;EACX;;EAEA;AACF;AACA;EACE,IAAI/E,SAASA,CAAA,EAAkB;IAC7B,OAAO8C,uBAAA,KAAI,CAAChD,IAAI,IAAUN,uBAAuB,CAAC,EAAEqG,KAAK,IAAI,IAAI;EACnE;AACF","ignoreList":[]}
|
|
@@ -93,6 +93,13 @@ class ConceptDetailModel extends _ResourceModel.default {
|
|
|
93
93
|
return href;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Available diagrams for the concept, most of the time just one
|
|
98
|
+
*/
|
|
99
|
+
get diagramLinks() {
|
|
100
|
+
return this.links.getLinksByGroup("diagram");
|
|
101
|
+
}
|
|
102
|
+
|
|
96
103
|
/**
|
|
97
104
|
* Get conceptType of concept
|
|
98
105
|
*/
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
import type { ModularUIResponse } from "../../modularui";
|
|
16
16
|
import type Href from "../href/Href";
|
|
17
17
|
import type LinkModel from "../links/LinkModel";
|
|
18
|
+
import type LinkCollection from "../links/LinkCollection";
|
|
18
19
|
import type ErrorResponse from "../error/ErrorResponse";
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -109,6 +110,13 @@ export default class ConceptDetailModel extends ResourceModel {
|
|
|
109
110
|
return href;
|
|
110
111
|
}
|
|
111
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Available diagrams for the concept, most of the time just one
|
|
115
|
+
*/
|
|
116
|
+
get diagramLinks(): LinkCollection {
|
|
117
|
+
return this.links.getLinksByGroup("diagram");
|
|
118
|
+
}
|
|
119
|
+
|
|
112
120
|
/**
|
|
113
121
|
* Get conceptType of concept
|
|
114
122
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptDetailModel.js","names":["_ResourceModel","_interopRequireDefault","require","_ConceptRelationCollection","_SourceReferenceCollection","_ConceptTypeDetailModel","_Constants","ConceptDetailModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","_relations","ConceptRelationCollection","data","relations","entryDate","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","conceptTypeLink","links","getLinkByKey","relationsCollectionLinks","relationsCollection","isCacheable","setChildModels","models","errors","conceptTypeModel","_find","call","model","ConceptTypeDetailModel","conceptType","key","getData","selfhref","href","selflink","setParameter","TIMEVERSION_FILTER_NAME","removeParameter","_conceptType","label","conceptLabel","taxonomyType","formula","labels","_context","labelTypes","_map","labelType","_context2","setting","_id","getLabelElementByIds","ids","_context3","_filter","_includes","conceptProperties","_context4","propertyTypes","propertyType","_context5","properties","property","getConceptPropertiesByIds","_context6","textfragments","_context7","_context9","textFragments","textFragment","_context8","textFragmentConfig","textFragmentTypes","textFragmentType","notConfiguredTextFragments","some","textfragment","getTextFragmentByKeys","keys","_context10","getSourceReferenceCollection","availableLocales","arguments","length","undefined","_sourceReferences","SourceReferenceCollection","getSourceReferencesForCurrentLanguage","LANGUAGE_POSTFIX_LENGTH","sourceReferences","_context11","_context14","availableLanguagesInSourceReferences","sourceReference","substring","currentLanguagePostfix","locale","_context12","_context13","_endsWith","availableLanguages","split","value","exports"],"sources":["../../../src/models/concepts/ConceptDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ConceptRelationCollection from \"./ConceptRelationCollection\";\nimport SourceReferenceCollection from \"./SourceReferenceCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type {\n ModularUIModel,\n labelsJSON,\n textfragmentJSON,\n propertyJSON,\n} from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type Href from \"../href/Href\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport default class ConceptDetailModel extends ResourceModel {\n _relations: ConceptRelationCollection;\n _conceptType: ?ConceptTypeDetailModel;\n _sourceReferences: SourceReferenceCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._relations = new ConceptRelationCollection(\n this.data.relations,\n this.entryDate,\n );\n }\n\n /**\n */\n get type(): string {\n return \"ConceptDetail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptDetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const conceptTypeLink = this.links.getLinkByKey(\"concepttype\");\n const relationsCollectionLinks =\n this.relationsCollection.getInitialChildModelLinks();\n\n if (conceptTypeLink) {\n conceptTypeLink.isCacheable = true;\n return [conceptTypeLink, ...relationsCollectionLinks];\n }\n\n return relationsCollectionLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models, errors);\n }\n\n /**\n * Retrieve concept detail identifier as key for this model\n */\n get key(): string {\n return this.getData(\"_id\", \"concept\");\n }\n\n /**\n * Getting the self link of this Concept\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.entryDate) {\n href.setParameter(TIMEVERSION_FILTER_NAME, this.entryDate);\n } else {\n href.removeParameter(TIMEVERSION_FILTER_NAME);\n }\n\n return href;\n }\n\n /**\n * Get conceptType of concept\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n */\n set conceptType(conceptType: ?ConceptTypeDetailModel) {\n this._conceptType = conceptType;\n }\n\n /**\n * Get concept label\n */\n get label(): string {\n return this.data.conceptLabel;\n }\n\n /**\n * Get taxonomy type\n */\n get taxonomyType(): string {\n return this.getData(\"taxonomyType\", \"default\");\n }\n\n /**\n * Get concept relations collection\n */\n get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }\n\n /**\n * Get concept formula\n */\n get formula(): string {\n return this.data.formula;\n }\n\n /**\n * Get additional labels of concept\n */\n get labels(): Array<labelsJSON> {\n return this.conceptType && this.conceptType.labelTypes\n ? this.conceptType.labelTypes.map((labelType) => {\n const setting = this.data.labels\n ? this.data.labels.find((label) => label.type === labelType._id)\n : {};\n\n return {\n ...labelType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get label elements by id\n */\n getLabelElementByIds(ids: Array<string>): Array<labelsJSON> {\n return this.labels.filter((label: labelsJSON) => ids.includes(label._id));\n }\n\n /**\n * Get concept properties\n */\n get conceptProperties(): Array<propertyJSON> {\n return this.conceptType && this.conceptType.propertyTypes\n ? this.conceptType.propertyTypes.map((propertyType) => {\n const setting = this.data.properties\n ? this.data.properties.find(\n (property) => property.type === propertyType._id,\n )\n : {};\n\n return {\n ...propertyType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get concept properties by id\n */\n getConceptPropertiesByIds(ids: Array<string>): Array<propertyJSON> {\n return this.conceptProperties.filter((property) =>\n ids.includes(property._id),\n );\n }\n\n /**\n * Get Text fragments\n */\n get textfragments(): Array<textfragmentJSON> {\n const textFragments = this.data.textFragments\n ? this.data.textFragments.map((textFragment) => {\n const textFragmentConfig =\n this.conceptType &&\n this.conceptType.textFragmentTypes.find(\n (textFragmentType) => textFragment.type === textFragmentType._id,\n );\n\n return {\n ...textFragmentConfig,\n ...textFragment,\n };\n })\n : [];\n\n const notConfiguredTextFragments =\n this.conceptType && this.conceptType.textFragmentTypes\n ? this.conceptType.textFragmentTypes.filter((textFragmentType) => {\n if (!this.data.textFragments) {\n return true;\n }\n\n return !this.data.textFragments.some(\n (textfragment) => textfragment.type === textFragmentType._id,\n );\n })\n : [];\n\n return [...textFragments, ...notConfiguredTextFragments];\n }\n\n /**\n * Get text fragments by id\n */\n getTextFragmentByKeys(keys: Array<string>): Array<textfragmentJSON> {\n return this.textfragments.filter((textfragment) =>\n keys.includes(textfragment.type),\n );\n }\n\n /**\n * Get source reference collection\n */\n getSourceReferenceCollection(\n availableLocales: Array<string> = [],\n ): SourceReferenceCollection {\n if (!this._sourceReferences) {\n this._sourceReferences = new SourceReferenceCollection(\n this.getSourceReferencesForCurrentLanguage(availableLocales),\n this.entryDate,\n );\n }\n\n return this._sourceReferences;\n }\n\n /*\n * Retrieve all sourceReferenceTypes that are valid for the current language\n * Used by sourceRef collection\n */\n /**\n */\n getSourceReferencesForCurrentLanguage(\n availableLocales: Array<string>,\n ): Array<Object> {\n const LANGUAGE_POSTFIX_LENGTH = 3;\n if (this.data.sourceReferences) {\n const availableLanguagesInSourceReferences =\n this.data.sourceReferences.map((sourceReference) =>\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n );\n\n const currentLanguagePostfix = `_${this.locale}`;\n\n if (\n availableLanguagesInSourceReferences.includes(currentLanguagePostfix)\n ) {\n // return all sourceReferences that end with language that is selected\n return this.data.sourceReferences.filter((sourceReference) =>\n sourceReference.type.endsWith(currentLanguagePostfix),\n );\n }\n\n const availableLanguages = availableLocales.map(\n (locale) => `_${locale.split(\"-\")[0]}`,\n );\n\n // return all sourceReferences that do not end with language postfix\n return this.data.sourceReferences.filter(\n (sourceReference) =>\n !availableLanguages.includes(\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n ),\n );\n }\n return [];\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ?? null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,0BAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,uBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAaA;AACA;AACA;AACe,MAAMK,kBAAkB,SAASC,sBAAa,CAAC;EAK5D;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,UAAU,GAAG,IAAIC,kCAAyB,CAC7C,IAAI,CAACC,IAAI,CAACC,SAAS,EACnB,IAAI,CAACC,SACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,eAAe;EACxB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,oBAAoB;EAC7B;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACL,IAAuB,EAAW;IACzD,OACEA,IAAI,CAAC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E,UAAA;QACA;QACA,OAAO,IAAA3C,OAAA,CAAAnD,OAAA,EAAA8F,UAAA,OAAI,CAAC3F,IAAI,CAACmF,gBAAgB,EAAA/D,IAAA,CAAAuE,UAAA,EAASJ,eAAe;UAAA,IAAAK,UAAA;UAAA,OACvD,IAAAC,SAAA,CAAAhG,OAAA,EAAA+F,UAAA,GAAAL,eAAe,CAACpF,IAAI,EAAAiB,IAAA,CAAAwE,UAAA,EAAUH,sBAAsB,CAAC;QAAA,CACvD,CAAC;MACH;MAEA,MAAMK,kBAAkB,GAAG,IAAAtD,IAAA,CAAA3C,OAAA,EAAA8E,gBAAgB,EAAAvD,IAAA,CAAhBuD,gBAAgB,EACxCe,MAAM,IAAK,IAAIA,MAAM,CAACK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACtC,CAAC;;MAED;MACA,OAAO,IAAA/C,OAAA,CAAAnD,OAAA,EAAAwF,UAAA,OAAI,CAACrF,IAAI,CAACmF,gBAAgB,EAAA/D,IAAA,CAAAiE,UAAA,EAC9BE,eAAe,IACd,CAAC,IAAAtC,SAAA,CAAApD,OAAA,EAAAiG,kBAAkB,EAAA1E,IAAA,CAAlB0E,kBAAkB,EACjBP,eAAe,CAACpF,IAAI,CAACqF,SAAS,CAC5BD,eAAe,CAACpF,IAAI,CAAC0E,MAAM,GAAGK,uBAChC,CACF,CACJ,CAAC;IACH;IACA,OAAO,EAAE;EACX;;EAEA;AACF;AACA;EACE,IAAIhF,SAASA,CAAA,EAAkB;IAC7B,OAAO,IAAA8C,OAAA,CAAAnD,OAAA,MAAI,CAACG,IAAI,IAAU8B,kCAAuB,CAAC,EAAEkE,KAAK,IAAI,IAAI;EACnE;AACF;AAACC,OAAA,CAAApG,OAAA,GAAAL,kBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ConceptDetailModel.js","names":["_ResourceModel","_interopRequireDefault","require","_ConceptRelationCollection","_SourceReferenceCollection","_ConceptTypeDetailModel","_Constants","ConceptDetailModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","_relations","ConceptRelationCollection","data","relations","entryDate","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","conceptTypeLink","links","getLinkByKey","relationsCollectionLinks","relationsCollection","isCacheable","setChildModels","models","errors","conceptTypeModel","_find","call","model","ConceptTypeDetailModel","conceptType","key","getData","selfhref","href","selflink","setParameter","TIMEVERSION_FILTER_NAME","removeParameter","diagramLinks","getLinksByGroup","_conceptType","label","conceptLabel","taxonomyType","formula","labels","_context","labelTypes","_map","labelType","_context2","setting","_id","getLabelElementByIds","ids","_context3","_filter","_includes","conceptProperties","_context4","propertyTypes","propertyType","_context5","properties","property","getConceptPropertiesByIds","_context6","textfragments","_context7","_context9","textFragments","textFragment","_context8","textFragmentConfig","textFragmentTypes","textFragmentType","notConfiguredTextFragments","some","textfragment","getTextFragmentByKeys","keys","_context10","getSourceReferenceCollection","availableLocales","arguments","length","undefined","_sourceReferences","SourceReferenceCollection","getSourceReferencesForCurrentLanguage","LANGUAGE_POSTFIX_LENGTH","sourceReferences","_context11","_context14","availableLanguagesInSourceReferences","sourceReference","substring","currentLanguagePostfix","locale","_context12","_context13","_endsWith","availableLanguages","split","value","exports"],"sources":["../../../src/models/concepts/ConceptDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ConceptRelationCollection from \"./ConceptRelationCollection\";\nimport SourceReferenceCollection from \"./SourceReferenceCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type {\n ModularUIModel,\n labelsJSON,\n textfragmentJSON,\n propertyJSON,\n} from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type Href from \"../href/Href\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport default class ConceptDetailModel extends ResourceModel {\n _relations: ConceptRelationCollection;\n _conceptType: ?ConceptTypeDetailModel;\n _sourceReferences: SourceReferenceCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._relations = new ConceptRelationCollection(\n this.data.relations,\n this.entryDate,\n );\n }\n\n /**\n */\n get type(): string {\n return \"ConceptDetail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptDetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const conceptTypeLink = this.links.getLinkByKey(\"concepttype\");\n const relationsCollectionLinks =\n this.relationsCollection.getInitialChildModelLinks();\n\n if (conceptTypeLink) {\n conceptTypeLink.isCacheable = true;\n return [conceptTypeLink, ...relationsCollectionLinks];\n }\n\n return relationsCollectionLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models, errors);\n }\n\n /**\n * Retrieve concept detail identifier as key for this model\n */\n get key(): string {\n return this.getData(\"_id\", \"concept\");\n }\n\n /**\n * Getting the self link of this Concept\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.entryDate) {\n href.setParameter(TIMEVERSION_FILTER_NAME, this.entryDate);\n } else {\n href.removeParameter(TIMEVERSION_FILTER_NAME);\n }\n\n return href;\n }\n\n /**\n * Available diagrams for the concept, most of the time just one\n */\n get diagramLinks(): LinkCollection {\n return this.links.getLinksByGroup(\"diagram\");\n }\n\n /**\n * Get conceptType of concept\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n */\n set conceptType(conceptType: ?ConceptTypeDetailModel) {\n this._conceptType = conceptType;\n }\n\n /**\n * Get concept label\n */\n get label(): string {\n return this.data.conceptLabel;\n }\n\n /**\n * Get taxonomy type\n */\n get taxonomyType(): string {\n return this.getData(\"taxonomyType\", \"default\");\n }\n\n /**\n * Get concept relations collection\n */\n get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }\n\n /**\n * Get concept formula\n */\n get formula(): string {\n return this.data.formula;\n }\n\n /**\n * Get additional labels of concept\n */\n get labels(): Array<labelsJSON> {\n return this.conceptType && this.conceptType.labelTypes\n ? this.conceptType.labelTypes.map((labelType) => {\n const setting = this.data.labels\n ? this.data.labels.find((label) => label.type === labelType._id)\n : {};\n\n return {\n ...labelType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get label elements by id\n */\n getLabelElementByIds(ids: Array<string>): Array<labelsJSON> {\n return this.labels.filter((label: labelsJSON) => ids.includes(label._id));\n }\n\n /**\n * Get concept properties\n */\n get conceptProperties(): Array<propertyJSON> {\n return this.conceptType && this.conceptType.propertyTypes\n ? this.conceptType.propertyTypes.map((propertyType) => {\n const setting = this.data.properties\n ? this.data.properties.find(\n (property) => property.type === propertyType._id,\n )\n : {};\n\n return {\n ...propertyType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get concept properties by id\n */\n getConceptPropertiesByIds(ids: Array<string>): Array<propertyJSON> {\n return this.conceptProperties.filter((property) =>\n ids.includes(property._id),\n );\n }\n\n /**\n * Get Text fragments\n */\n get textfragments(): Array<textfragmentJSON> {\n const textFragments = this.data.textFragments\n ? this.data.textFragments.map((textFragment) => {\n const textFragmentConfig =\n this.conceptType &&\n this.conceptType.textFragmentTypes.find(\n (textFragmentType) => textFragment.type === textFragmentType._id,\n );\n\n return {\n ...textFragmentConfig,\n ...textFragment,\n };\n })\n : [];\n\n const notConfiguredTextFragments =\n this.conceptType && this.conceptType.textFragmentTypes\n ? this.conceptType.textFragmentTypes.filter((textFragmentType) => {\n if (!this.data.textFragments) {\n return true;\n }\n\n return !this.data.textFragments.some(\n (textfragment) => textfragment.type === textFragmentType._id,\n );\n })\n : [];\n\n return [...textFragments, ...notConfiguredTextFragments];\n }\n\n /**\n * Get text fragments by id\n */\n getTextFragmentByKeys(keys: Array<string>): Array<textfragmentJSON> {\n return this.textfragments.filter((textfragment) =>\n keys.includes(textfragment.type),\n );\n }\n\n /**\n * Get source reference collection\n */\n getSourceReferenceCollection(\n availableLocales: Array<string> = [],\n ): SourceReferenceCollection {\n if (!this._sourceReferences) {\n this._sourceReferences = new SourceReferenceCollection(\n this.getSourceReferencesForCurrentLanguage(availableLocales),\n this.entryDate,\n );\n }\n\n return this._sourceReferences;\n }\n\n /*\n * Retrieve all sourceReferenceTypes that are valid for the current language\n * Used by sourceRef collection\n */\n /**\n */\n getSourceReferencesForCurrentLanguage(\n availableLocales: Array<string>,\n ): Array<Object> {\n const LANGUAGE_POSTFIX_LENGTH = 3;\n if (this.data.sourceReferences) {\n const availableLanguagesInSourceReferences =\n this.data.sourceReferences.map((sourceReference) =>\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n );\n\n const currentLanguagePostfix = `_${this.locale}`;\n\n if (\n availableLanguagesInSourceReferences.includes(currentLanguagePostfix)\n ) {\n // return all sourceReferences that end with language that is selected\n return this.data.sourceReferences.filter((sourceReference) =>\n sourceReference.type.endsWith(currentLanguagePostfix),\n );\n }\n\n const availableLanguages = availableLocales.map(\n (locale) => `_${locale.split(\"-\")[0]}`,\n );\n\n // return all sourceReferences that do not end with language postfix\n return this.data.sourceReferences.filter(\n (sourceReference) =>\n !availableLanguages.includes(\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n ),\n );\n }\n return [];\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ??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AAA,CACvD,CAAC;MACH;MAEA,MAAMK,kBAAkB,GAAG,IAAAtD,IAAA,CAAA7C,OAAA,EAAAgF,gBAAgB,EAAAzD,IAAA,CAAhByD,gBAAgB,EACxCe,MAAM,IAAK,IAAIA,MAAM,CAACK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACtC,CAAC;;MAED;MACA,OAAO,IAAA/C,OAAA,CAAArD,OAAA,EAAA0F,UAAA,OAAI,CAACvF,IAAI,CAACqF,gBAAgB,EAAAjE,IAAA,CAAAmE,UAAA,EAC9BE,eAAe,IACd,CAAC,IAAAtC,SAAA,CAAAtD,OAAA,EAAAmG,kBAAkB,EAAA5E,IAAA,CAAlB4E,kBAAkB,EACjBP,eAAe,CAACtF,IAAI,CAACuF,SAAS,CAC5BD,eAAe,CAACtF,IAAI,CAAC4E,MAAM,GAAGK,uBAChC,CACF,CACJ,CAAC;IACH;IACA,OAAO,EAAE;EACX;;EAEA;AACF;AACA;EACE,IAAIlF,SAASA,CAAA,EAAkB;IAC7B,OAAO,IAAAgD,OAAA,CAAArD,OAAA,MAAI,CAACG,IAAI,IAAU8B,kCAAuB,CAAC,EAAEoE,KAAK,IAAI,IAAI;EACnE;AACF;AAACC,OAAA,CAAAtG,OAAA,GAAAL,kBAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
import type { ModularUIResponse } from "../../modularui";
|
|
16
16
|
import type Href from "../href/Href";
|
|
17
17
|
import type LinkModel from "../links/LinkModel";
|
|
18
|
+
import type LinkCollection from "../links/LinkCollection";
|
|
18
19
|
import type ErrorResponse from "../error/ErrorResponse";
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -109,6 +110,13 @@ export default class ConceptDetailModel extends ResourceModel {
|
|
|
109
110
|
return href;
|
|
110
111
|
}
|
|
111
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Available diagrams for the concept, most of the time just one
|
|
115
|
+
*/
|
|
116
|
+
get diagramLinks(): LinkCollection {
|
|
117
|
+
return this.links.getLinksByGroup("diagram");
|
|
118
|
+
}
|
|
119
|
+
|
|
112
120
|
/**
|
|
113
121
|
* Get conceptType of concept
|
|
114
122
|
*/
|