@beinformed/ui 1.49.1 → 1.49.4
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 +21 -0
- package/esm/hooks/useModelCatalog.js +18 -12
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +7 -0
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/hooks/useModelCatalog.js +18 -12
- package/lib/hooks/useModelCatalog.js.flow +27 -11
- package/lib/hooks/useModelCatalog.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/hooks/useModelCatalog.js +27 -11
- package/src/models/concepts/ConceptDetailModel.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
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.4](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.49.3...v1.49.4) (2024-07-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **modelcatalog:** make key of hook settable for multiple requests ([2595154](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/25951542d34bbc16481c8487f13a5ea9224df8aa))
|
|
11
|
+
|
|
12
|
+
## [1.49.3](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.49.2...v1.49.3) (2024-06-26)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **concept-detail:** retrieve diagram links ([d6e9fe6](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/d6e9fe6cce7e6b070ba8f9ad44017af1da96a500))
|
|
18
|
+
|
|
19
|
+
## [1.49.2](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.49.1...v1.49.2) (2024-06-26)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **concept-detail:** retrieve diagram links ([2f91f9e](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/2f91f9e6da223f4b59b0c6effae997d3463ab16a))
|
|
25
|
+
|
|
5
26
|
## [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
27
|
|
|
7
28
|
## [1.49.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.48.1...v1.49.0) (2024-06-13)
|
|
@@ -19,9 +19,10 @@ export const useModelCatalog = () => useModularUIBasic("modelcatalog", "/modelca
|
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
*/
|
|
22
|
-
export const useConceptIndex = href
|
|
22
|
+
export const useConceptIndex = function (href) {
|
|
23
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "conceptindex";
|
|
23
24
|
const url = filterParameters(href, ["entryDate", "index", "label", "type"]);
|
|
24
|
-
return useModularUIBasic(
|
|
25
|
+
return useModularUIBasic(key, url, {
|
|
25
26
|
expectedModels: ["ConceptIndex"],
|
|
26
27
|
targetModel: ConceptIndexModel
|
|
27
28
|
});
|
|
@@ -29,19 +30,21 @@ export const useConceptIndex = href => {
|
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
*/
|
|
32
|
-
export const useConceptDetail = concept
|
|
33
|
+
export const useConceptDetail = function (concept) {
|
|
34
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "conceptdetail";
|
|
33
35
|
const location = useLocation();
|
|
34
36
|
const href = createHref("concepts", concept, location, ["entryDate"]);
|
|
35
|
-
return useModularUIBasic(
|
|
37
|
+
return useModularUIBasic(key, href, {
|
|
36
38
|
expectedModels: ["ConceptDetail", "BusinessScenario"]
|
|
37
39
|
});
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
43
|
*/
|
|
42
|
-
export const useContentIndex = href
|
|
44
|
+
export const useContentIndex = function (href) {
|
|
45
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "contentindex";
|
|
43
46
|
const url = filterParameters(href, ["index", "label", "type"]);
|
|
44
|
-
return useModularUIBasic(
|
|
47
|
+
return useModularUIBasic(key, url, {
|
|
45
48
|
expectedModels: ["ContentIndex"],
|
|
46
49
|
targetModel: ContentIndexModel
|
|
47
50
|
});
|
|
@@ -49,10 +52,11 @@ export const useContentIndex = href => {
|
|
|
49
52
|
|
|
50
53
|
/**
|
|
51
54
|
*/
|
|
52
|
-
export const useContentTOC = content
|
|
55
|
+
export const useContentTOC = function (content) {
|
|
56
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "contenttoc";
|
|
53
57
|
const location = useLocation();
|
|
54
58
|
const href = createHref("content", content, location, ["entryDate"]);
|
|
55
|
-
return useModularUIBasic(
|
|
59
|
+
return useModularUIBasic(key, href, {
|
|
56
60
|
expectedModels: ["ContentTOC"],
|
|
57
61
|
targetModel: ContentTOCModel
|
|
58
62
|
});
|
|
@@ -60,9 +64,10 @@ export const useContentTOC = content => {
|
|
|
60
64
|
|
|
61
65
|
/**
|
|
62
66
|
*/
|
|
63
|
-
export const useContent = contentSection
|
|
67
|
+
export const useContent = function (contentSection) {
|
|
68
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "content";
|
|
64
69
|
const href = createHref("content", contentSection, null, ["entryDate"]);
|
|
65
|
-
return useModularUIBasic(
|
|
70
|
+
return useModularUIBasic(key, href, {
|
|
66
71
|
expectedModels: ["Content"],
|
|
67
72
|
targetModel: ContentModel
|
|
68
73
|
});
|
|
@@ -70,9 +75,10 @@ export const useContent = contentSection => {
|
|
|
70
75
|
|
|
71
76
|
/**
|
|
72
77
|
*/
|
|
73
|
-
export const useContentType = contentType
|
|
78
|
+
export const useContentType = function (contentType) {
|
|
79
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "contenttypes";
|
|
74
80
|
const href = createHref("contenttypes", contentType, null, ["entryDate"]);
|
|
75
|
-
return useModularUIBasic(
|
|
81
|
+
return useModularUIBasic(key, href, {
|
|
76
82
|
expectedModels: ["ContentType"],
|
|
77
83
|
targetModel: ContentTypeModel
|
|
78
84
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModelCatalog.js","names":["useLocation","createHref","filterParameters","ModelCatalogModel","ConceptIndexModel","ConceptDetailModel","default","BusinessScenarioModel","ContentIndexModel","ContentTOCModel","ContentModel","useModularUIBasic","ContentTypeModel","useModelCatalog","expectedModels","targetModel","useConceptIndex","href","url","useConceptDetail","concept","location","useContentIndex","useContentTOC","content","useContent","contentSection","useContentType","contentType"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport { createHref, filterParameters } from \"../utils/helpers/createHref\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\n\n/**\n */\nexport const useModelCatalog = (): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n });\n\n/**\n */\nexport const useConceptIndex = (href: string): ?ConceptIndexModel => {\n const url = filterParameters(href, [\"entryDate\", \"index\", \"label\", \"type\"]);\n return useModularUIBasic(
|
|
1
|
+
{"version":3,"file":"useModelCatalog.js","names":["useLocation","createHref","filterParameters","ModelCatalogModel","ConceptIndexModel","ConceptDetailModel","default","BusinessScenarioModel","ContentIndexModel","ContentTOCModel","ContentModel","useModularUIBasic","ContentTypeModel","useModelCatalog","expectedModels","targetModel","useConceptIndex","href","key","arguments","length","undefined","url","useConceptDetail","concept","location","useContentIndex","useContentTOC","content","useContent","contentSection","useContentType","contentType"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport { createHref, filterParameters } from \"../utils/helpers/createHref\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\n\n/**\n */\nexport const useModelCatalog = (): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n });\n\n/**\n */\nexport const useConceptIndex = (\n href: string,\n key?: string = \"conceptindex\",\n): ?ConceptIndexModel => {\n const url = filterParameters(href, [\"entryDate\", \"index\", \"label\", \"type\"]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n });\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string,\n key?: string = \"conceptdetail\",\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const location = useLocation();\n\n const href = createHref(\"concepts\", concept, location, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n });\n};\n\n/**\n */\nexport const useContentIndex = (\n href: string,\n key?: string = \"contentindex\",\n): ?ContentIndexModel => {\n const url = filterParameters(href, [\"index\", \"label\", \"type\"]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n });\n};\n\n/**\n */\nexport const useContentTOC = (\n content: string,\n key?: string = \"contenttoc\",\n): ?ContentTOCModel => {\n const location = useLocation();\n const href = createHref(\"content\", content, location, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n });\n};\n\n/**\n */\nexport const useContent = (\n contentSection: string,\n key?: string = \"content\",\n): ?ContentModel => {\n const href = createHref(\"content\", contentSection, null, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n });\n};\n\n/**\n */\nexport const useContentType = (\n contentType: string,\n key?: string = \"contenttypes\",\n): ?ContentTypeModel => {\n const href = createHref(\"contenttypes\", contentType, null, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n });\n};\n"],"mappings":"AACA,SAASA,WAAW,QAAQ,aAAa;AAEzC,SAASC,UAAU,EAAEC,gBAAgB,QAAQ,6BAA6B;AAE1E,OAAOC,iBAAiB,MAAM,0CAA0C;AACxE,OAAOC,iBAAiB,MAAM,sCAAsC;AACpE,OAAOC,kBAAkB,MAAM,uCAAuC;AACtE,SAASC,OAAO,IAAIC,qBAAqB,QAAQ,0CAA0C;AAC3F,OAAOC,iBAAiB,MAAM,qCAAqC;AACnE,OAAOC,eAAe,MAAM,mCAAmC;AAC/D,OAAOC,YAAY,MAAM,gCAAgC;AAEzD,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAAS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AAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,cAAc;EAE7B,MAAMF,IAAI,GAAGhB,UAAU,CAAC,cAAc,EAAE+B,WAAW,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,CAAC;EACzE,OAAOrB,iBAAiB,CAACO,GAAG,EAAED,IAAI,EAAE;IAClCH,cAAc,EAAE,CAAC,aAAa,CAAC;IAC/BC,WAAW,EAAEH;EACf,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -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;EAC7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H,sBAAsB,CAAC;QAAA,CACvD,CAAC;MACH;MAEA,MAAMK,kBAAkB,GAAGrD,oBAAA,CAAAmC,gBAAgB,EAAArD,IAAA,CAAhBqD,gBAAgB,EACxCc,MAAM,IAAK,IAAIA,MAAM,CAACK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACtC,CAAC;;MAED;MACA,OAAO9C,uBAAA,CAAAoC,UAAA,OAAI,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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AAA,CAAAoC,oCAAoC,EAAAjE,IAAA,CAApCiE,oCAAoC,EAAUG,sBAAsB,CAAC,EACrE;QAAA,IAAAE,UAAA;QACA;QACA,OAAO1C,uBAAA,CAAA0C,UAAA,OAAI,CAAC1F,IAAI,CAACkF,gBAAgB,EAAA9D,IAAA,CAAAsE,UAAA,EAASJ,eAAe;UAAA,IAAAK,UAAA;UAAA,OACvDC,yBAAA,CAAAD,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":[]}
|
|
@@ -26,9 +26,10 @@ const useModelCatalog = () => (0, _useModularUIBasic.useModularUIBasic)("modelca
|
|
|
26
26
|
/**
|
|
27
27
|
*/
|
|
28
28
|
exports.useModelCatalog = useModelCatalog;
|
|
29
|
-
const useConceptIndex = href
|
|
29
|
+
const useConceptIndex = function (href) {
|
|
30
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "conceptindex";
|
|
30
31
|
const url = (0, _createHref.filterParameters)(href, ["entryDate", "index", "label", "type"]);
|
|
31
|
-
return (0, _useModularUIBasic.useModularUIBasic)(
|
|
32
|
+
return (0, _useModularUIBasic.useModularUIBasic)(key, url, {
|
|
32
33
|
expectedModels: ["ConceptIndex"],
|
|
33
34
|
targetModel: _ConceptIndexModel.default
|
|
34
35
|
});
|
|
@@ -37,10 +38,11 @@ const useConceptIndex = href => {
|
|
|
37
38
|
/**
|
|
38
39
|
*/
|
|
39
40
|
exports.useConceptIndex = useConceptIndex;
|
|
40
|
-
const useConceptDetail = concept
|
|
41
|
+
const useConceptDetail = function (concept) {
|
|
42
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "conceptdetail";
|
|
41
43
|
const location = (0, _useRouter.useLocation)();
|
|
42
44
|
const href = (0, _createHref.createHref)("concepts", concept, location, ["entryDate"]);
|
|
43
|
-
return (0, _useModularUIBasic.useModularUIBasic)(
|
|
45
|
+
return (0, _useModularUIBasic.useModularUIBasic)(key, href, {
|
|
44
46
|
expectedModels: ["ConceptDetail", "BusinessScenario"]
|
|
45
47
|
});
|
|
46
48
|
};
|
|
@@ -48,9 +50,10 @@ const useConceptDetail = concept => {
|
|
|
48
50
|
/**
|
|
49
51
|
*/
|
|
50
52
|
exports.useConceptDetail = useConceptDetail;
|
|
51
|
-
const useContentIndex = href
|
|
53
|
+
const useContentIndex = function (href) {
|
|
54
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "contentindex";
|
|
52
55
|
const url = (0, _createHref.filterParameters)(href, ["index", "label", "type"]);
|
|
53
|
-
return (0, _useModularUIBasic.useModularUIBasic)(
|
|
56
|
+
return (0, _useModularUIBasic.useModularUIBasic)(key, url, {
|
|
54
57
|
expectedModels: ["ContentIndex"],
|
|
55
58
|
targetModel: _ContentIndexModel.default
|
|
56
59
|
});
|
|
@@ -59,10 +62,11 @@ const useContentIndex = href => {
|
|
|
59
62
|
/**
|
|
60
63
|
*/
|
|
61
64
|
exports.useContentIndex = useContentIndex;
|
|
62
|
-
const useContentTOC = content
|
|
65
|
+
const useContentTOC = function (content) {
|
|
66
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "contenttoc";
|
|
63
67
|
const location = (0, _useRouter.useLocation)();
|
|
64
68
|
const href = (0, _createHref.createHref)("content", content, location, ["entryDate"]);
|
|
65
|
-
return (0, _useModularUIBasic.useModularUIBasic)(
|
|
69
|
+
return (0, _useModularUIBasic.useModularUIBasic)(key, href, {
|
|
66
70
|
expectedModels: ["ContentTOC"],
|
|
67
71
|
targetModel: _ContentTOCModel.default
|
|
68
72
|
});
|
|
@@ -71,9 +75,10 @@ const useContentTOC = content => {
|
|
|
71
75
|
/**
|
|
72
76
|
*/
|
|
73
77
|
exports.useContentTOC = useContentTOC;
|
|
74
|
-
const useContent = contentSection
|
|
78
|
+
const useContent = function (contentSection) {
|
|
79
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "content";
|
|
75
80
|
const href = (0, _createHref.createHref)("content", contentSection, null, ["entryDate"]);
|
|
76
|
-
return (0, _useModularUIBasic.useModularUIBasic)(
|
|
81
|
+
return (0, _useModularUIBasic.useModularUIBasic)(key, href, {
|
|
77
82
|
expectedModels: ["Content"],
|
|
78
83
|
targetModel: _ContentModel.default
|
|
79
84
|
});
|
|
@@ -82,9 +87,10 @@ const useContent = contentSection => {
|
|
|
82
87
|
/**
|
|
83
88
|
*/
|
|
84
89
|
exports.useContent = useContent;
|
|
85
|
-
const useContentType = contentType
|
|
90
|
+
const useContentType = function (contentType) {
|
|
91
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "contenttypes";
|
|
86
92
|
const href = (0, _createHref.createHref)("contenttypes", contentType, null, ["entryDate"]);
|
|
87
|
-
return (0, _useModularUIBasic.useModularUIBasic)(
|
|
93
|
+
return (0, _useModularUIBasic.useModularUIBasic)(key, href, {
|
|
88
94
|
expectedModels: ["ContentType"],
|
|
89
95
|
targetModel: _models.ContentTypeModel
|
|
90
96
|
});
|
|
@@ -24,9 +24,12 @@ export const useModelCatalog = (): ?ModelCatalogModel =>
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
*/
|
|
27
|
-
export const useConceptIndex = (
|
|
27
|
+
export const useConceptIndex = (
|
|
28
|
+
href: string,
|
|
29
|
+
key?: string = "conceptindex",
|
|
30
|
+
): ?ConceptIndexModel => {
|
|
28
31
|
const url = filterParameters(href, ["entryDate", "index", "label", "type"]);
|
|
29
|
-
return useModularUIBasic(
|
|
32
|
+
return useModularUIBasic(key, url, {
|
|
30
33
|
expectedModels: ["ConceptIndex"],
|
|
31
34
|
targetModel: ConceptIndexModel,
|
|
32
35
|
});
|
|
@@ -36,20 +39,24 @@ export const useConceptIndex = (href: string): ?ConceptIndexModel => {
|
|
|
36
39
|
*/
|
|
37
40
|
export const useConceptDetail = (
|
|
38
41
|
concept: string,
|
|
42
|
+
key?: string = "conceptdetail",
|
|
39
43
|
): ?ConceptDetailModel | ?BusinessScenarioModel => {
|
|
40
44
|
const location = useLocation();
|
|
41
45
|
|
|
42
46
|
const href = createHref("concepts", concept, location, ["entryDate"]);
|
|
43
|
-
return useModularUIBasic(
|
|
47
|
+
return useModularUIBasic(key, href, {
|
|
44
48
|
expectedModels: ["ConceptDetail", "BusinessScenario"],
|
|
45
49
|
});
|
|
46
50
|
};
|
|
47
51
|
|
|
48
52
|
/**
|
|
49
53
|
*/
|
|
50
|
-
export const useContentIndex = (
|
|
54
|
+
export const useContentIndex = (
|
|
55
|
+
href: string,
|
|
56
|
+
key?: string = "contentindex",
|
|
57
|
+
): ?ContentIndexModel => {
|
|
51
58
|
const url = filterParameters(href, ["index", "label", "type"]);
|
|
52
|
-
return useModularUIBasic(
|
|
59
|
+
return useModularUIBasic(key, url, {
|
|
53
60
|
expectedModels: ["ContentIndex"],
|
|
54
61
|
targetModel: ContentIndexModel,
|
|
55
62
|
});
|
|
@@ -57,10 +64,13 @@ export const useContentIndex = (href: string): ?ContentIndexModel => {
|
|
|
57
64
|
|
|
58
65
|
/**
|
|
59
66
|
*/
|
|
60
|
-
export const useContentTOC = (
|
|
67
|
+
export const useContentTOC = (
|
|
68
|
+
content: string,
|
|
69
|
+
key?: string = "contenttoc",
|
|
70
|
+
): ?ContentTOCModel => {
|
|
61
71
|
const location = useLocation();
|
|
62
72
|
const href = createHref("content", content, location, ["entryDate"]);
|
|
63
|
-
return useModularUIBasic(
|
|
73
|
+
return useModularUIBasic(key, href, {
|
|
64
74
|
expectedModels: ["ContentTOC"],
|
|
65
75
|
targetModel: ContentTOCModel,
|
|
66
76
|
});
|
|
@@ -68,9 +78,12 @@ export const useContentTOC = (content: string): ?ContentTOCModel => {
|
|
|
68
78
|
|
|
69
79
|
/**
|
|
70
80
|
*/
|
|
71
|
-
export const useContent = (
|
|
81
|
+
export const useContent = (
|
|
82
|
+
contentSection: string,
|
|
83
|
+
key?: string = "content",
|
|
84
|
+
): ?ContentModel => {
|
|
72
85
|
const href = createHref("content", contentSection, null, ["entryDate"]);
|
|
73
|
-
return useModularUIBasic(
|
|
86
|
+
return useModularUIBasic(key, href, {
|
|
74
87
|
expectedModels: ["Content"],
|
|
75
88
|
targetModel: ContentModel,
|
|
76
89
|
});
|
|
@@ -78,9 +91,12 @@ export const useContent = (contentSection: string): ?ContentModel => {
|
|
|
78
91
|
|
|
79
92
|
/**
|
|
80
93
|
*/
|
|
81
|
-
export const useContentType = (
|
|
94
|
+
export const useContentType = (
|
|
95
|
+
contentType: string,
|
|
96
|
+
key?: string = "contenttypes",
|
|
97
|
+
): ?ContentTypeModel => {
|
|
82
98
|
const href = createHref("contenttypes", contentType, null, ["entryDate"]);
|
|
83
|
-
return useModularUIBasic(
|
|
99
|
+
return useModularUIBasic(key, href, {
|
|
84
100
|
expectedModels: ["ContentType"],
|
|
85
101
|
targetModel: ContentTypeModel,
|
|
86
102
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModelCatalog.js","names":["_useRouter","require","_createHref","_ModelCatalogModel","_interopRequireDefault","_ConceptIndexModel","_ConceptDetailModel","_BusinessScenarioModel","_ContentIndexModel","_ContentTOCModel","_ContentModel","_useModularUIBasic","_models","useModelCatalog","useModularUIBasic","expectedModels","targetModel","ModelCatalogModel","exports","useConceptIndex","href","url","filterParameters","ConceptIndexModel","useConceptDetail","concept","location","useLocation","createHref","useContentIndex","ContentIndexModel","useContentTOC","content","ContentTOCModel","useContent","contentSection","ContentModel","useContentType","contentType","ContentTypeModel"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport { createHref, filterParameters } from \"../utils/helpers/createHref\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\n\n/**\n */\nexport const useModelCatalog = (): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n });\n\n/**\n */\nexport const useConceptIndex = (href: string): ?ConceptIndexModel => {\n const url = filterParameters(href, [\"entryDate\", \"index\", \"label\", \"type\"]);\n return useModularUIBasic(
|
|
1
|
+
{"version":3,"file":"useModelCatalog.js","names":["_useRouter","require","_createHref","_ModelCatalogModel","_interopRequireDefault","_ConceptIndexModel","_ConceptDetailModel","_BusinessScenarioModel","_ContentIndexModel","_ContentTOCModel","_ContentModel","_useModularUIBasic","_models","useModelCatalog","useModularUIBasic","expectedModels","targetModel","ModelCatalogModel","exports","useConceptIndex","href","key","arguments","length","undefined","url","filterParameters","ConceptIndexModel","useConceptDetail","concept","location","useLocation","createHref","useContentIndex","ContentIndexModel","useContentTOC","content","ContentTOCModel","useContent","contentSection","ContentModel","useContentType","contentType","ContentTypeModel"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport { createHref, filterParameters } from \"../utils/helpers/createHref\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\n\n/**\n */\nexport const useModelCatalog = (): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n });\n\n/**\n */\nexport const useConceptIndex = (\n href: string,\n key?: string = \"conceptindex\",\n): ?ConceptIndexModel => {\n const url = filterParameters(href, [\"entryDate\", \"index\", \"label\", \"type\"]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n });\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string,\n key?: string = \"conceptdetail\",\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const location = useLocation();\n\n const href = createHref(\"concepts\", concept, location, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n });\n};\n\n/**\n */\nexport const useContentIndex = (\n href: string,\n key?: string = \"contentindex\",\n): ?ContentIndexModel => {\n const url = filterParameters(href, [\"index\", \"label\", \"type\"]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n });\n};\n\n/**\n */\nexport const useContentTOC = (\n content: string,\n key?: string = \"contenttoc\",\n): ?ContentTOCModel => {\n const location = useLocation();\n const href = createHref(\"content\", content, location, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n });\n};\n\n/**\n */\nexport const useContent = (\n contentSection: string,\n key?: string = \"content\",\n): ?ContentModel => {\n const href = createHref(\"content\", contentSection, null, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n });\n};\n\n/**\n */\nexport const useContentType = (\n contentType: string,\n key?: string = \"contenttypes\",\n): ?ContentTypeModel => {\n const href = createHref(\"contenttypes\", contentType, null, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n });\n};\n"],"mappings":";;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,mBAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,sBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,kBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,gBAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,aAAA,GAAAN,sBAAA,CAAAH,OAAA;AAEA,IAAAU,kBAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AAEA;AACA;AACO,MAAMY,eAAe,GAAGA,CAAA,KAC7B,IAAAC,oCAAiB,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BC,WAAW,EAAEwB;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AADAtB,OAAA,CAAAoB,UAAA,GAAAA,UAAA;AAEO,MAAMG,cAAc,GAAG,SAAAA,CAC5BC,WAAmB,EAEG;EAAA,IADtBrB,GAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,cAAc;EAE7B,MAAMF,IAAI,GAAG,IAAAY,sBAAU,EAAC,cAAc,EAAEU,WAAW,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,CAAC;EACzE,OAAO,IAAA5B,oCAAiB,EAACO,GAAG,EAAED,IAAI,EAAE;IAClCL,cAAc,EAAE,CAAC,aAAa,CAAC;IAC/BC,WAAW,EAAE2B;EACf,CAAC,CAAC;AACJ,CAAC;AAACzB,OAAA,CAAAuB,cAAA,GAAAA,cAAA","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,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,CAAC;IAC9D,MAAMC,wBAAw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AAA,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 ?? 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,CAA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AAC;;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
|
@@ -24,9 +24,12 @@ export const useModelCatalog = (): ?ModelCatalogModel =>
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
*/
|
|
27
|
-
export const useConceptIndex = (
|
|
27
|
+
export const useConceptIndex = (
|
|
28
|
+
href: string,
|
|
29
|
+
key?: string = "conceptindex",
|
|
30
|
+
): ?ConceptIndexModel => {
|
|
28
31
|
const url = filterParameters(href, ["entryDate", "index", "label", "type"]);
|
|
29
|
-
return useModularUIBasic(
|
|
32
|
+
return useModularUIBasic(key, url, {
|
|
30
33
|
expectedModels: ["ConceptIndex"],
|
|
31
34
|
targetModel: ConceptIndexModel,
|
|
32
35
|
});
|
|
@@ -36,20 +39,24 @@ export const useConceptIndex = (href: string): ?ConceptIndexModel => {
|
|
|
36
39
|
*/
|
|
37
40
|
export const useConceptDetail = (
|
|
38
41
|
concept: string,
|
|
42
|
+
key?: string = "conceptdetail",
|
|
39
43
|
): ?ConceptDetailModel | ?BusinessScenarioModel => {
|
|
40
44
|
const location = useLocation();
|
|
41
45
|
|
|
42
46
|
const href = createHref("concepts", concept, location, ["entryDate"]);
|
|
43
|
-
return useModularUIBasic(
|
|
47
|
+
return useModularUIBasic(key, href, {
|
|
44
48
|
expectedModels: ["ConceptDetail", "BusinessScenario"],
|
|
45
49
|
});
|
|
46
50
|
};
|
|
47
51
|
|
|
48
52
|
/**
|
|
49
53
|
*/
|
|
50
|
-
export const useContentIndex = (
|
|
54
|
+
export const useContentIndex = (
|
|
55
|
+
href: string,
|
|
56
|
+
key?: string = "contentindex",
|
|
57
|
+
): ?ContentIndexModel => {
|
|
51
58
|
const url = filterParameters(href, ["index", "label", "type"]);
|
|
52
|
-
return useModularUIBasic(
|
|
59
|
+
return useModularUIBasic(key, url, {
|
|
53
60
|
expectedModels: ["ContentIndex"],
|
|
54
61
|
targetModel: ContentIndexModel,
|
|
55
62
|
});
|
|
@@ -57,10 +64,13 @@ export const useContentIndex = (href: string): ?ContentIndexModel => {
|
|
|
57
64
|
|
|
58
65
|
/**
|
|
59
66
|
*/
|
|
60
|
-
export const useContentTOC = (
|
|
67
|
+
export const useContentTOC = (
|
|
68
|
+
content: string,
|
|
69
|
+
key?: string = "contenttoc",
|
|
70
|
+
): ?ContentTOCModel => {
|
|
61
71
|
const location = useLocation();
|
|
62
72
|
const href = createHref("content", content, location, ["entryDate"]);
|
|
63
|
-
return useModularUIBasic(
|
|
73
|
+
return useModularUIBasic(key, href, {
|
|
64
74
|
expectedModels: ["ContentTOC"],
|
|
65
75
|
targetModel: ContentTOCModel,
|
|
66
76
|
});
|
|
@@ -68,9 +78,12 @@ export const useContentTOC = (content: string): ?ContentTOCModel => {
|
|
|
68
78
|
|
|
69
79
|
/**
|
|
70
80
|
*/
|
|
71
|
-
export const useContent = (
|
|
81
|
+
export const useContent = (
|
|
82
|
+
contentSection: string,
|
|
83
|
+
key?: string = "content",
|
|
84
|
+
): ?ContentModel => {
|
|
72
85
|
const href = createHref("content", contentSection, null, ["entryDate"]);
|
|
73
|
-
return useModularUIBasic(
|
|
86
|
+
return useModularUIBasic(key, href, {
|
|
74
87
|
expectedModels: ["Content"],
|
|
75
88
|
targetModel: ContentModel,
|
|
76
89
|
});
|
|
@@ -78,9 +91,12 @@ export const useContent = (contentSection: string): ?ContentModel => {
|
|
|
78
91
|
|
|
79
92
|
/**
|
|
80
93
|
*/
|
|
81
|
-
export const useContentType = (
|
|
94
|
+
export const useContentType = (
|
|
95
|
+
contentType: string,
|
|
96
|
+
key?: string = "contenttypes",
|
|
97
|
+
): ?ContentTypeModel => {
|
|
82
98
|
const href = createHref("contenttypes", contentType, null, ["entryDate"]);
|
|
83
|
-
return useModularUIBasic(
|
|
99
|
+
return useModularUIBasic(key, href, {
|
|
84
100
|
expectedModels: ["ContentType"],
|
|
85
101
|
targetModel: ContentTypeModel,
|
|
86
102
|
});
|
|
@@ -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
|
*/
|