@beinformed/ui 1.57.5 → 1.58.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/esm/hooks/useModelCatalog.js +36 -5
  3. package/esm/hooks/useModelCatalog.js.map +1 -1
  4. package/esm/models/concepts/ConceptDetailModel.js +1 -1
  5. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  6. package/esm/models/concepts/ConceptIndexModel.js +1 -1
  7. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  8. package/esm/models/content/ContentModel.js +1 -1
  9. package/esm/models/content/ContentModel.js.map +1 -1
  10. package/esm/models/content/ContentTOCModel.js +1 -1
  11. package/esm/models/content/ContentTOCModel.js.map +1 -1
  12. package/esm/redux/actions/EntryDate.js +8 -0
  13. package/esm/redux/actions/EntryDate.js.map +1 -0
  14. package/esm/redux/actions/index.js +1 -0
  15. package/esm/redux/actions/index.js.map +1 -1
  16. package/esm/redux/reducers/ModelCatalogReducer.js +29 -0
  17. package/esm/redux/reducers/ModelCatalogReducer.js.map +1 -0
  18. package/esm/redux/reducers/createReducer.js +2 -0
  19. package/esm/redux/reducers/createReducer.js.map +1 -1
  20. package/esm/redux/reducers/index.js +1 -0
  21. package/esm/redux/reducers/index.js.map +1 -1
  22. package/esm/redux/selectors/index.js +1 -0
  23. package/esm/redux/selectors/index.js.map +1 -1
  24. package/esm/redux/selectors/modelcatalog.js +8 -0
  25. package/esm/redux/selectors/modelcatalog.js.map +1 -0
  26. package/esm/redux/types.js.map +1 -1
  27. package/esm/utils/helpers/createHref.js +10 -7
  28. package/esm/utils/helpers/createHref.js.map +1 -1
  29. package/lib/hooks/__tests__/useModelCatalog.spec.js.flow +7 -6
  30. package/lib/hooks/useModelCatalog.js +38 -6
  31. package/lib/hooks/useModelCatalog.js.flow +39 -5
  32. package/lib/hooks/useModelCatalog.js.map +1 -1
  33. package/lib/models/concepts/ConceptDetailModel.js +1 -1
  34. package/lib/models/concepts/ConceptDetailModel.js.flow +1 -1
  35. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  36. package/lib/models/concepts/ConceptIndexModel.js +1 -1
  37. package/lib/models/concepts/ConceptIndexModel.js.flow +1 -1
  38. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  39. package/lib/models/content/ContentModel.js +1 -1
  40. package/lib/models/content/ContentModel.js.flow +1 -1
  41. package/lib/models/content/ContentModel.js.map +1 -1
  42. package/lib/models/content/ContentTOCModel.js +1 -1
  43. package/lib/models/content/ContentTOCModel.js.flow +1 -1
  44. package/lib/models/content/ContentTOCModel.js.map +1 -1
  45. package/lib/redux/actions/EntryDate.js +15 -0
  46. package/lib/redux/actions/EntryDate.js.flow +12 -0
  47. package/lib/redux/actions/EntryDate.js.map +1 -0
  48. package/lib/redux/actions/index.js +11 -0
  49. package/lib/redux/actions/index.js.flow +1 -0
  50. package/lib/redux/actions/index.js.map +1 -1
  51. package/lib/redux/reducers/ModelCatalogReducer.js +36 -0
  52. package/lib/redux/reducers/ModelCatalogReducer.js.flow +40 -0
  53. package/lib/redux/reducers/ModelCatalogReducer.js.map +1 -0
  54. package/lib/redux/reducers/createReducer.js +2 -0
  55. package/lib/redux/reducers/createReducer.js.flow +4 -0
  56. package/lib/redux/reducers/createReducer.js.map +1 -1
  57. package/lib/redux/reducers/index.js +8 -0
  58. package/lib/redux/reducers/index.js.flow +1 -0
  59. package/lib/redux/reducers/index.js.map +1 -1
  60. package/lib/redux/selectors/index.js +11 -0
  61. package/lib/redux/selectors/index.js.flow +1 -0
  62. package/lib/redux/selectors/index.js.map +1 -1
  63. package/lib/redux/selectors/modelcatalog.js +15 -0
  64. package/lib/redux/selectors/modelcatalog.js.flow +11 -0
  65. package/lib/redux/selectors/modelcatalog.js.map +1 -0
  66. package/lib/redux/types.js.flow +11 -0
  67. package/lib/redux/types.js.map +1 -1
  68. package/lib/utils/helpers/__tests__/createHref.spec.js.flow +13 -9
  69. package/lib/utils/helpers/createHref.js +10 -7
  70. package/lib/utils/helpers/createHref.js.flow +17 -9
  71. package/lib/utils/helpers/createHref.js.map +1 -1
  72. package/package.json +8 -8
  73. package/src/hooks/__tests__/useModelCatalog.spec.js +7 -6
  74. package/src/hooks/useModelCatalog.js +39 -5
  75. package/src/models/concepts/ConceptDetailModel.js +1 -1
  76. package/src/models/concepts/ConceptIndexModel.js +1 -1
  77. package/src/models/content/ContentModel.js +1 -1
  78. package/src/models/content/ContentTOCModel.js +1 -1
  79. package/src/redux/actions/EntryDate.js +12 -0
  80. package/src/redux/actions/index.js +1 -0
  81. package/src/redux/reducers/ModelCatalogReducer.js +40 -0
  82. package/src/redux/reducers/createReducer.js +4 -0
  83. package/src/redux/reducers/index.js +1 -0
  84. package/src/redux/selectors/index.js +1 -0
  85. package/src/redux/selectors/modelcatalog.js +11 -0
  86. package/src/redux/types.js +11 -0
  87. package/src/utils/helpers/__tests__/createHref.spec.js +13 -9
  88. package/src/utils/helpers/createHref.js +17 -9
  89. package/types/models/concepts/ConceptDetailModel.d.ts +1 -1
  90. package/types/models/concepts/ConceptIndexModel.d.ts +1 -1
  91. package/types/models/content/ContentModel.d.ts +1 -1
  92. package/types/models/content/ContentTOCModel.d.ts +1 -1
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.58.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.58.0...v1.58.1) (2024-11-20)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **modelcatalog:** no initial state entrydate on server ([fb91f5f](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/fb91f5feaa860cbf1ce284509c07229316afeff5))
11
+
12
+ ## [1.58.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.57.5...v1.58.0) (2024-11-19)
13
+
14
+
15
+ ### Features
16
+
17
+ * **modelcatalog:** keep track of the modelcatalog entrydate using a redux reducer ([aae02f0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/aae02f074d5b3f1b8378f0cc006ead2799a6f532))
18
+
5
19
  ## [1.57.5](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.57.4...v1.57.5) (2024-11-04)
6
20
 
7
21
 
@@ -1,4 +1,5 @@
1
1
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
2
+ import { useSelector, useDispatch } from "react-redux";
2
3
  import { useLocation } from "./useRouter";
3
4
  import { createHref, filterParameters } from "../utils/helpers/createHref";
4
5
  import ModelCatalogModel from "../models/modelcatalog/ModelCatalogModel";
@@ -10,6 +11,8 @@ import ContentTOCModel from "../models/content/ContentTOCModel";
10
11
  import ContentModel from "../models/content/ContentModel";
11
12
  import { useModularUIBasic } from "./useModularUIBasic";
12
13
  import { ContentTypeModel } from "../models";
14
+ import { getEntryDate } from "../redux/selectors/modelcatalog";
15
+ import { updateEntryDate } from "../redux/actions/EntryDate";
13
16
  /**
14
17
  */
15
18
  export const useModelCatalog = options => useModularUIBasic("modelcatalog", "/modelcatalog", {
@@ -23,7 +26,11 @@ export const useModelCatalog = options => useModularUIBasic("modelcatalog", "/mo
23
26
  export const useConceptIndex = function (href) {
24
27
  let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "conceptindex";
25
28
  let options = arguments.length > 2 ? arguments[2] : undefined;
26
- const url = filterParameters(href, ["entryDate", "index", "label", "modelcategory", "type"]);
29
+ const {
30
+ entryDate
31
+ } = useEntryDate();
32
+ const url = filterParameters(href, ["index", "label", "modelcategory", "type"]);
33
+ url.setParameter("entryDate", entryDate);
27
34
  return useModularUIBasic(key, url, {
28
35
  expectedModels: ["ConceptIndex"],
29
36
  targetModel: ConceptIndexModel,
@@ -36,8 +43,11 @@ export const useConceptIndex = function (href) {
36
43
  export const useConceptDetail = function (concept) {
37
44
  let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "conceptdetail";
38
45
  let options = arguments.length > 2 ? arguments[2] : undefined;
46
+ const {
47
+ entryDate
48
+ } = useEntryDate();
39
49
  const location = useLocation();
40
- const href = createHref("concepts", concept, location, ["entryDate"]);
50
+ const href = createHref("concepts", concept, entryDate, location, []);
41
51
  return useModularUIBasic(key, href, {
42
52
  expectedModels: ["ConceptDetail", "BusinessScenario"],
43
53
  ...options
@@ -62,8 +72,11 @@ export const useContentIndex = function (href) {
62
72
  export const useContentTOC = function (content) {
63
73
  let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "contenttoc";
64
74
  let options = arguments.length > 2 ? arguments[2] : undefined;
75
+ const {
76
+ entryDate
77
+ } = useEntryDate();
65
78
  const location = useLocation();
66
- const href = createHref("content", content, location, ["entryDate"]);
79
+ const href = createHref("content", content, entryDate, location, []);
67
80
  return useModularUIBasic(key, href, {
68
81
  expectedModels: ["ContentTOC"],
69
82
  targetModel: ContentTOCModel,
@@ -76,7 +89,10 @@ export const useContentTOC = function (content) {
76
89
  export const useContent = function (contentSection) {
77
90
  let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "content";
78
91
  let options = arguments.length > 2 ? arguments[2] : undefined;
79
- const href = createHref("content", contentSection, null, ["entryDate"]);
92
+ const {
93
+ entryDate
94
+ } = useEntryDate();
95
+ const href = createHref("content", contentSection, entryDate, null, []);
80
96
  return useModularUIBasic(key, href, {
81
97
  expectedModels: ["Content"],
82
98
  targetModel: ContentModel,
@@ -89,7 +105,10 @@ export const useContent = function (contentSection) {
89
105
  export const useContentType = function (contentType) {
90
106
  let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "contenttypes";
91
107
  let options = arguments.length > 2 ? arguments[2] : undefined;
92
- const href = createHref("contenttypes", contentType, null, ["entryDate"]);
108
+ const {
109
+ entryDate
110
+ } = useEntryDate();
111
+ const href = createHref("contenttypes", contentType, entryDate, null, []);
93
112
  return useModularUIBasic(key, href, {
94
113
  expectedModels: ["ContentType"],
95
114
  targetModel: ContentTypeModel,
@@ -131,4 +150,16 @@ export const useContentSearch = function (filters) {
131
150
  const href = getSearchHref("/content", filters);
132
151
  return useContentIndex(href, key, options);
133
152
  };
153
+
154
+ /**
155
+ * Retrieve and update the entrydate for the modelcatalog
156
+ */
157
+ export const useEntryDate = () => {
158
+ const dispatch = useDispatch();
159
+ const entryDate = useSelector(getEntryDate);
160
+ return {
161
+ entryDate,
162
+ setEntryDate: entryDate => dispatch(updateEntryDate(entryDate))
163
+ };
164
+ };
134
165
  //# sourceMappingURL=useModelCatalog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useModelCatalog.js","names":["useLocation","createHref","filterParameters","ModelCatalogModel","ConceptIndexModel","ConceptDetailModel","default","BusinessScenarioModel","ContentIndexModel","ContentTOCModel","ContentModel","useModularUIBasic","ContentTypeModel","useModelCatalog","options","expectedModels","targetModel","useConceptIndex","href","key","arguments","length","undefined","url","useConceptDetail","concept","location","useContentIndex","useContentTOC","content","useContent","contentSection","useContentType","contentType","getSearchHref","uri","filters","filterString","_Object$keys","filterValue","value","Array","isArray","join","replace","push","useConceptSearch","useContentSearch"],"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\nimport type Href from \"../models/href/Href\";\nimport type { UseModularUIBasicOptions } from \"./useModularUIBasic\";\nexport type SearchFilter = {\n index?: string,\n label?: string,\n type?: string | Array<string>,\n modelCategory?: string | Array<string>,\n entryDate?: string,\n};\n\n/**\n */\nexport const useModelCatalog = (\n options?: UseModularUIBasicOptions<ModelCatalogModel>,\n): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n ...options,\n });\n\n/**\n */\nexport const useConceptIndex = (\n href: string | Href,\n key?: string = \"conceptindex\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n): ?ConceptIndexModel => {\n const url = filterParameters(href, [\n \"entryDate\",\n \"index\",\n \"label\",\n \"modelcategory\",\n \"type\",\n ]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string | Href,\n key?: string = \"conceptdetail\",\n options?: UseModularUIBasicOptions<\n ConceptDetailModel | BusinessScenarioModel,\n >,\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 ...options,\n });\n};\n\n/**\n */\nexport const useContentIndex = (\n href: string | Href,\n key?: string = \"contentindex\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n): ?ContentIndexModel => {\n const url = filterParameters(href, [\"index\", \"label\", \"type\"]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContentTOC = (\n content: string | Href,\n key?: string = \"contenttoc\",\n options?: UseModularUIBasicOptions<ContentTOCModel>,\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 ...options,\n });\n};\n\n/**\n */\nexport const useContent = (\n contentSection: string | Href,\n key?: string = \"content\",\n options?: UseModularUIBasicOptions<ContentModel>,\n): ?ContentModel => {\n const href = createHref(\"content\", contentSection, null, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContentType = (\n contentType: string | Href,\n key?: string = \"contenttypes\",\n options?: UseModularUIBasicOptions<ContentTypeModel>,\n): ?ContentTypeModel => {\n const href = createHref(\"contenttypes\", contentType, null, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n ...options,\n });\n};\n\n/**\n */\nconst getSearchHref = (uri: string, filters: SearchFilter): string => {\n const filterString = [];\n\n for (const key of Object.keys(filters)) {\n const filterValue = filters[key];\n if (filterValue) {\n let value: string = Array.isArray(filterValue)\n ? filterValue.join(\",\")\n : filterValue;\n if (key === \"type\") {\n value = value.replace(\"#\", \"%23\"); // handles un-encoded #\n }\n filterString.push(`${key}=${value}`);\n }\n }\n\n return filterString.length ? `${uri}?${filterString.join(\"&\")}` : uri;\n};\n\n/**\n */\nexport const useConceptSearch = (\n filters: SearchFilter,\n key?: string = \"conceptSearch\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n): ?ConceptIndexModel => {\n const href = getSearchHref(\"/concepts\", filters);\n return useConceptIndex(href, key, options);\n};\n\n/**\n */\nexport const useContentSearch = (\n filters: SearchFilter,\n key?: string = \"contentSearch\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n): ?ContentIndexModel => {\n const href = getSearchHref(\"/content\", filters);\n return useContentIndex(href, key, options);\n};\n"],"mappings":";AACA,SAASA,WAAW,QAAQ,aAAa;AAEzC,SAASC,UAAU,EAAEC,gBAAgB,QAAQ,6BAA6B;AAE1E,OAAOC,iBAAiB,MAAM,0CAA0C;AAC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AA,IAC9BN,OAAqD,GAAAM,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAErD,MAAMJ,IAAI,GAAGgB,aAAa,CAAC,UAAU,EAAEE,OAAO,CAAC;EAC/C,OAAOT,eAAe,CAACT,IAAI,EAAEC,GAAG,EAAEL,OAAO,CAAC;AAC5C,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"useModelCatalog.js","names":["useSelector","useDispatch","useLocation","createHref","filterParameters","ModelCatalogModel","ConceptIndexModel","ConceptDetailModel","default","BusinessScenarioModel","ContentIndexModel","ContentTOCModel","ContentModel","useModularUIBasic","ContentTypeModel","getEntryDate","updateEntryDate","useModelCatalog","options","expectedModels","targetModel","useConceptIndex","href","key","arguments","length","undefined","entryDate","useEntryDate","url","setParameter","useConceptDetail","concept","location","useContentIndex","useContentTOC","content","useContent","contentSection","useContentType","contentType","getSearchHref","uri","filters","filterString","_Object$keys","filterValue","value","Array","isArray","join","replace","push","useConceptSearch","useContentSearch","dispatch","setEntryDate"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useSelector, useDispatch } from \"react-redux\";\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\nimport { getEntryDate } from \"../redux/selectors/modelcatalog\";\nimport { updateEntryDate } from \"../redux/actions/EntryDate\";\n\nimport type Href from \"../models/href/Href\";\nimport type { UseModularUIBasicOptions } from \"./useModularUIBasic\";\nimport type { UpdateEntryDateAction } from \"../redux\";\nexport type SearchFilter = {\n index?: string,\n label?: string,\n type?: string | Array<string>,\n modelCategory?: string | Array<string>,\n entryDate?: string,\n};\n\n/**\n */\nexport const useModelCatalog = (\n options?: UseModularUIBasicOptions<ModelCatalogModel>,\n): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n ...options,\n });\n\n/**\n */\nexport const useConceptIndex = (\n href: string | Href,\n key?: string = \"conceptindex\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n): ?ConceptIndexModel => {\n const { entryDate } = useEntryDate();\n const url = filterParameters(href, [\n \"index\",\n \"label\",\n \"modelcategory\",\n \"type\",\n ]);\n url.setParameter(\"entryDate\", entryDate);\n\n return useModularUIBasic(key, url, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string | Href,\n key?: string = \"conceptdetail\",\n options?: UseModularUIBasicOptions<\n ConceptDetailModel | BusinessScenarioModel,\n >,\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const { entryDate } = useEntryDate();\n const location = useLocation();\n\n const href = createHref(\"concepts\", concept, entryDate, location, []);\n\n return useModularUIBasic(key, href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n ...options,\n });\n};\n\n/**\n */\nexport const useContentIndex = (\n href: string | Href,\n key?: string = \"contentindex\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n): ?ContentIndexModel => {\n const url = filterParameters(href, [\"index\", \"label\", \"type\"]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContentTOC = (\n content: string | Href,\n key?: string = \"contenttoc\",\n options?: UseModularUIBasicOptions<ContentTOCModel>,\n): ?ContentTOCModel => {\n const { entryDate } = useEntryDate();\n const location = useLocation();\n\n const href = createHref(\"content\", content, entryDate, location, []);\n\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContent = (\n contentSection: string | Href,\n key?: string = \"content\",\n options?: UseModularUIBasicOptions<ContentModel>,\n): ?ContentModel => {\n const { entryDate } = useEntryDate();\n\n const href = createHref(\"content\", contentSection, entryDate, null, []);\n\n return useModularUIBasic(key, href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContentType = (\n contentType: string | Href,\n key?: string = \"contenttypes\",\n options?: UseModularUIBasicOptions<ContentTypeModel>,\n): ?ContentTypeModel => {\n const { entryDate } = useEntryDate();\n\n const href = createHref(\"contenttypes\", contentType, entryDate, null, []);\n\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n ...options,\n });\n};\n\n/**\n */\nconst getSearchHref = (uri: string, filters: SearchFilter): string => {\n const filterString = [];\n\n for (const key of Object.keys(filters)) {\n const filterValue = filters[key];\n if (filterValue) {\n let value: string = Array.isArray(filterValue)\n ? filterValue.join(\",\")\n : filterValue;\n if (key === \"type\") {\n value = value.replace(\"#\", \"%23\"); // handles un-encoded #\n }\n filterString.push(`${key}=${value}`);\n }\n }\n\n return filterString.length ? `${uri}?${filterString.join(\"&\")}` : uri;\n};\n\n/**\n */\nexport const useConceptSearch = (\n filters: SearchFilter,\n key?: string = \"conceptSearch\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n): ?ConceptIndexModel => {\n const href = getSearchHref(\"/concepts\", filters);\n return useConceptIndex(href, key, options);\n};\n\n/**\n */\nexport const useContentSearch = (\n filters: SearchFilter,\n key?: string = \"contentSearch\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n): ?ContentIndexModel => {\n const href = getSearchHref(\"/content\", filters);\n return useContentIndex(href, key, options);\n};\n\n/**\n * Retrieve and update the entrydate for the modelcatalog\n */\nexport const useEntryDate = (): ({\n entryDate: ISO_DATE,\n setEntryDate: (entryDate: ISO_DATE) => UpdateEntryDateAction,\n}) => {\n const dispatch = useDispatch();\n const entryDate = useSelector(getEntryDate);\n\n return {\n entryDate,\n setEntryDate: (entryDate: ISO_DATE) => dispatch(updateEntryDate(entryDate)),\n };\n};\n"],"mappings":";AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,aAAa;AACtD,SAASC,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,SAASC,gBAAgB,QAAQ,WAAW;AAE5C,SAASC,YAAY,QAAQ,iCAAiC;AAC9D,SAASC,eAAe,QAAQ,4BAA4B;AAa5D;AACA;AACA,OAAO,MAAMC,eAAe,GAC1BC,OAAqD,IAErDL,iBAAiB,CAAC,cAAc,EAAE,eAAe,EAAE;EACjDM,cAAc,EAAE,CAAC,cAAc,CAAC;EAChCC,WAAW,EAAEf,iBAAiB;EAC9B,GAAGa;AACL,CAAC,CAAC;;AAEJ;AACA;AACA,OAAO,MAAMG,eAAe,GAAG,SAAAA,CAC7BC,IAAmB,EAGI;EAAA,IAFvBC,GAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,cAAc;EAAA,IAC7BN,OAAqD,GAAAM,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SA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AAS;IACT6B,YAAY,EAAG7B,SAAmB,IAAK4B,QAAQ,CAACvC,eAAe,CAACW,SAAS,CAAC;EAC5E,CAAC;AACH,CAAC","ignoreList":[]}
@@ -257,7 +257,7 @@ export default class ConceptDetailModel extends ResourceModel {
257
257
  }
258
258
 
259
259
  /**
260
- * Retrieve entrydate
260
+ * Retrieve modelcatalog.js
261
261
  */
262
262
  get entryDate() {
263
263
  return _filterInstanceProperty(this.data)?.[TIMEVERSION_FILTER_NAME]?.value ?? null;
@@ -1 +1 @@
1
- {"version":3,"file":"ConceptDetailModel.js","names":["ResourceModel","ConceptRelationCollection","SourceReferenceCollection","ConceptTypeDetailModel","TIMEVERSION_FILTER_NAME","ConceptDetailModel","constructor","modularuiResponse","_defineProperty","_relations","data","relations","entryDate","modelOptions","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","modelCategory","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","isOfConceptType","conceptTypeId"],"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 this.modelOptions,\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 model category of the concept\n */\n get modelCategory(): string {\n return this.getData(\"modelCategory\", \"\");\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 this.modelOptions,\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\n */\n get entryDate(): string | null {\n return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ?? null;\n }\n\n /**\n * Indicates if the given concept type id or href exists in the hierarchy of concept types for this concept\n */\n isOfConceptType(conceptTypeId: string): boolean {\n return this.conceptType?.isOfConceptType(conceptTypeId) ?? false;\n }\n}\n"],"mappings":";;;;;;AACA,OAAOA,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,SAAS,EACd,IAAI,CAACC,YACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,eAA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elationCollection","SourceReferenceCollection","ConceptTypeDetailModel","TIMEVERSION_FILTER_NAME","ConceptDetailModel","constructor","modularuiResponse","_defineProperty","_relations","data","relations","entryDate","modelOptions","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","modelCategory","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","isOfConceptType","conceptTypeId"],"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 this.modelOptions,\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 model category of the concept\n */\n get modelCategory(): string {\n return this.getData(\"modelCategory\", \"\");\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 this.modelOptions,\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 modelcatalog.js\n */\n get entryDate(): string | null {\n return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ?? null;\n }\n\n /**\n * Indicates if the given concept type id or href exists in the hierarchy of concept types for this concept\n */\n isOfConceptType(conceptTypeId: string): boolean {\n return this.conceptType?.isOfConceptType(conceptTypeId) ?? false;\n }\n}\n"],"mappings":";;;;;;AACA,OAAOA,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,SAAS,EACd,IAAI,CAACC,YACP,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,CAACN,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACO,aAAa,CAACC,YAAY,IAC/BR,IAAI,CAACO,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,wBAAwB,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AAC;MACH;MAEA,MAAMK,kBAAkB,GAAGrD,oBAAA,CAAAmC,gBAAgB,EAAAxD,IAAA,CAAhBwD,gBAAgB,EACxCc,MAAM,IAAK,IAAIA,MAAM,CAACK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACtC,CAAC;;MAED;MACA,OAAO9C,uBAAA,CAAAoC,UAAA,OAAI,CAACtF,IAAI,CAACoF,gBAAgB,EAAA/D,IAAA,CAAAiE,UAAA,EAC9BE,eAAe,IACd,CAACrC,yBAAA,CAAA4C,kBAAkB,EAAA1E,IAAA,CAAlB0E,kBAAkB,EACjBP,eAAe,CAACpF,IAAI,CAACqF,SAAS,CAC5BD,eAAe,CAACpF,IAAI,CAAC2E,MAAM,GAAGI,uBAChC,CACF,CACJ,CAAC;IACH;IACA,OAAO,EAAE;EACX;;EAEA;AACF;AACA;EACE,IAAIjF,SAASA,CAAA,EAAkB;IAC7B,OAAOgD,uBAAA,KAAI,CAAClD,IAAI,IAAUN,uBAAuB,CAAC,EAAEuG,KAAK,IAAI,IAAI;EACnE;;EAEA;AACF;AACA;EACEC,eAAeA,CAACC,aAAqB,EAAW;IAC9C,OAAO,IAAI,CAAC5E,WAAW,EAAE2E,eAAe,CAACC,aAAa,CAAC,IAAI,KAAK;EAClE;AACF","ignoreList":[]}
@@ -101,7 +101,7 @@ export default class ConceptIndexModel extends ResourceModel {
101
101
  }
102
102
 
103
103
  /**
104
- * Retrieve entrydate of content toc
104
+ * Retrieve modelcatalog.js of content toc
105
105
  */
106
106
  get entryDate() {
107
107
  const timeversionFilter = this.filterCollection.getFilterByAttributeKey(TIMEVERSION_FILTER_NAME);
@@ -1 +1 @@
1
- {"version":3,"file":"ConceptIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ConceptLinkModel","TIMEVERSION_FILTER_NAME","ConceptIndexModel","constructor","modularuiResponse","_context","_defineProperty","_filterCollection","_filterInstanceProperty","data","filter","contributions","dynamicschema","modelOptions","_concepts","collection","_embedded","_mapInstanceProperty","results","call","concept","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","attribute","searchtermfilter","modelCategoryFilter","itemCollection"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) =>\n new ConceptLinkModel(\n concept.concept,\n this.entryDate,\n this.modelOptions,\n ),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" || resourceType === \"relatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n this.items.setChildModels(models, errors);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (timeversionFilter && timeversionFilter.attribute) {\n return timeversionFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get model category filter\n */\n get modelCategoryFilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"modelCategory\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uB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iB,CAACC,SAAS,EAAE;MACpD,OAAOD,iBAAiB,CAACC,SAAS,CAACT,KAAK;IAC1C;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACE,IAAIU,gBAAgBA,CAAA,EAAsB;IACxC,OAAO,IAAI,CAACf,gBAAgB,CAACY,uBAAuB,CAAC,OAAO,CAAC;EAC/D;;EAEA;AACF;AACA;EACE,IAAII,mBAAmBA,CAAA,EAAsB;IAC3C,OAAO,IAAI,CAAChB,gBAAgB,CAACY,uBAAuB,CAAC,eAAe,CAAC;EACvE;;EAEA;AACF;AACA;EACE,IAAInB,KAAKA,CAAA,EAAyC;IAChD,OAAO,IAAI,CAACd,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIc,KAAKA,CAACwB,cAAoD,EAAE;IAC9D,IAAI,CAACtC,SAAS,GAAGsC,cAAc;EACjC;AACF","ignoreList":[]}
1
+ {"version":3,"file":"ConceptIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ConceptLinkModel","TIMEVERSION_FILTER_NAME","ConceptIndexModel","constructor","modularuiResponse","_context","_defineProperty","_filterCollection","_filterInstanceProperty","data","filter","contributions","dynamicschema","modelOptions","_concepts","collection","_embedded","_mapInstanceProperty","results","call","concept","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","attribute","searchtermfilter","modelCategoryFilter","itemCollection"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) =>\n new ConceptLinkModel(\n concept.concept,\n this.entryDate,\n this.modelOptions,\n ),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" || resourceType === \"relatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n this.items.setChildModels(models, errors);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): string | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (timeversionFilter && timeversionFilter.attribute) {\n return timeversionFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get model category filter\n */\n get modelCategoryFilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"modelCategory\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAQnE;AACA;AACA;AACA,eAAe,MAAMC,iBAAiB,SAASL,aAAa,CAAC;EAI3D;AACF;EACEM,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAACE,eAAA;IAAAA,eAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIR,gBAAgB,CAAAS,uBAAA,CAC3C,IAAI,CAACC,IAAI,GACT;MACEC,MAAM,EAAAF,uBAAA,CAAE,IAAI,CAACG,aAAa,CAAO;MACjCC,aAAa,EAAE,IAAI,CAACH,IAAI,CAACG;IAC3B,CAAC,EACD,IAAI,CAACC,YACP,CAAC;IAED,IAAI,CAACC,SAAS,GAAG,IAAIhB,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oD,EAAE;IAC9D,IAAI,CAACtC,SAAS,GAAGsC,cAAc;EACjC;AACF","ignoreList":[]}
@@ -83,7 +83,7 @@ export default class ContentModel extends ResourceModel {
83
83
  }
84
84
 
85
85
  /**
86
- * Retrieve entrydate of content toc
86
+ * Retrieve modelcatalog.js of content toc
87
87
  */
88
88
  get entryDate() {
89
89
  const entryDateFilter = this.filterCollection?.getFilterByAttributeKey(TIMEVERSION_FILTER_NAME);
@@ -1 +1 @@
1
- {"version":3,"file":"ContentModel.js","names":["ModularUIResponse","ResourceModel","FilterCollection","ContentLinkModel","SubSectionModel","ContentTypeModel","TIMEVERSION_FILTER_NAME","SectionModel","ContentModel","constructor","response","_defineProperty","_section","data","entryDate","modelOptions","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","_findInstanceProperty","call","model","section","id","_id","filterCollection","_filterCollection","_filterInstanceProperty","filter","entryDateFilter","getFilterByAttributeKey","attribute","value","_contentType","label","number","body","childSectionLinks","selfContentLink","childSections","sections","subSections","relatedConceptsHrefs","hrefs","relatedConceptsHref","push","forEach","subSection","relatedConceptsLink","href","addParameter","setReferenceHash","referenceHash"],"sources":["../../../src/models/content/ContentModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport SubSectionModel from \"./SubSectionModel\";\n\nimport ContentTypeModel from \"./ContentTypeModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport SectionModel from \"./SectionModel\";\n\n/**\n * Content detail model\n */\nexport default class ContentModel extends ResourceModel {\n _section: SectionModel;\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n constructor(response: ModularUIResponse) {\n super(response);\n\n this._section = new SectionModel(\n this.data,\n this.entryDate,\n this.modelOptions,\n );\n }\n\n /**\n */\n get type(): string {\n return \"Content\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n */\n get section(): SectionModel {\n return this._section;\n }\n\n /**\n */\n get id(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection && this.data.filter?.entryDate) {\n this._filterCollection = new FilterCollection(\n {\n entryDate: this.data.filter.entryDate,\n },\n {\n filter: this.contributions.filter,\n },\n this.modelOptions,\n );\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): ISO_DATE | null {\n const entryDateFilter = this.filterCollection?.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (entryDateFilter && entryDateFilter.attribute) {\n return entryDateFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * Get conceptType of concept\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n * Set concept type\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.section.label;\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.section.number;\n }\n\n /**\n * Get content body\n */\n get body(): ?string {\n return this.section.body;\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks(): Array<ContentLinkModel> {\n return this.section.childSectionLinks;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return this.section.selfContentLink;\n }\n\n /**\n * Get tree of child sections\n */\n get childSections(): Array<SectionModel> {\n return this.section.childSections;\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: Array<SectionModel>) {\n this.section.childSections = sections || [];\n }\n\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.section.subSections;\n }\n\n /**\n */\n get relatedConceptsHrefs(): Array<Href> {\n const hrefs = [];\n if (this.relatedConceptsHref) {\n hrefs.push(this.relatedConceptsHref);\n }\n\n this.subSections.forEach((subSection) => {\n hrefs.push(...subSection.relatedConceptsHrefs);\n });\n\n return hrefs;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref(): Href | null {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n href.addParameter(\"entryDate\", this.entryDate);\n href.setReferenceHash(this.referenceHash);\n return href;\n }\n\n return null;\n }\n\n /**\n */\n get referenceHash(): number {\n return this.section.referenceHash;\n }\n}\n"],"mappings":";;;AACA,OAAOA,iBAAiB,MAAM,mCAAmC;AAEjE,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAKnE,OAAOC,YAAY,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,eAAe,MAAMC,YAAY,SAASP,aAAa,CAAC;EAKtDQ,WAAWA,CAACC,QAA2B,EAAE;IACvC,KAAK,CAACA,QAAQ,CAAC;IAACC,eAAA;IAAAA,eAAA,uBAJsB,IAAI;IAAAA,eAAA;IAM1C,IAAI,CAACC,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;AACA;EACE,IAAIA,aAAaA,CAACC,QAA6B,EAAE;IAC/C,IAAI,CAAClB,OAAO,CAACiB,aAAa,GAAGC,QAAQ,IAAI,EAAE;EAC7C;;EAEA;AACF;AACA;EACE,IAAIC,WAAWA,CAAA,EAA2B;IACxC,OAAO,IAAI,CAACnB,OAAO,CAACmB,WAAW;EACjC;;EAEA;AACF;EACE,IAAIC,oBAAoBA,CAAA,EAAgB;IACtC,MAAMC,KAAK,GAAG,EAAE;IAChB,IAAI,IAAI,CAACC,mBAAmB,EAAE;MAC5BD,KAAK,CAACE,IAAI,CAAC,IAAI,CAACD,mBAAmB,CAAC;IACtC;IAEA,IAAI,CAACH,WAAW,CAACK,OAAO,CAAEC,UAAU,IAAK;MACvCJ,KAAK,CAACE,IAAI,CAAC,GAAGE,UAAU,CAACL,oBAAoB,CAAC;IAChD,CAAC,CAAC;IAEF,OAAOC,KAAK;EACd;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmBA,CAAA,EAAgB;IACrC,MAAMI,mBAAmB,GAAG,IAAI,CAAClC,KAAK,CAACC,YAAY,CAAC,iBAAiB,CAAC;IAEtE,IAAIiC,mBAAmB,EAAE;MACvB,MAAM;QAAEC;MAAK,CAAC,GAAGD,mBAAmB;MACpCC,IAAI,CAACC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC7C,SAAS,CAAC;MAC9C4C,IAAI,CAACE,gBAAgB,CAAC,IAAI,CAACC,aAAa,CAAC;MACzC,OAAOH,IAAI;IACb;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIG,aAAaA,CAAA,EAAW;IAC1B,OAAO,IAAI,CAAC9B,OAAO,CAAC8B,aAAa;EACnC;AACF","ignoreList":[]}
1
+ {"version":3,"file":"ContentModel.js","names":["ModularUIResponse","ResourceModel","FilterCollection","ContentLinkModel","SubSectionModel","ContentTypeModel","TIMEVERSION_FILTER_NAME","SectionModel","ContentModel","constructor","response","_defineProperty","_section","data","entryDate","modelOptions","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","_findInstanceProperty","call","model","section","id","_id","filterCollection","_filterCollection","_filterInstanceProperty","filter","entryDateFilter","getFilterByAttributeKey","attribute","value","_contentType","label","number","body","childSectionLinks","selfContentLink","childSections","sections","subSections","relatedConceptsHrefs","hrefs","relatedConceptsHref","push","forEach","subSection","relatedConceptsLink","href","addParameter","setReferenceHash","referenceHash"],"sources":["../../../src/models/content/ContentModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport SubSectionModel from \"./SubSectionModel\";\n\nimport ContentTypeModel from \"./ContentTypeModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport SectionModel from \"./SectionModel\";\n\n/**\n * Content detail model\n */\nexport default class ContentModel extends ResourceModel {\n _section: SectionModel;\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n constructor(response: ModularUIResponse) {\n super(response);\n\n this._section = new SectionModel(\n this.data,\n this.entryDate,\n this.modelOptions,\n );\n }\n\n /**\n */\n get type(): string {\n return \"Content\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n */\n get section(): SectionModel {\n return this._section;\n }\n\n /**\n */\n get id(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection && this.data.filter?.entryDate) {\n this._filterCollection = new FilterCollection(\n {\n entryDate: this.data.filter.entryDate,\n },\n {\n filter: this.contributions.filter,\n },\n this.modelOptions,\n );\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): ISO_DATE | null {\n const entryDateFilter = this.filterCollection?.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (entryDateFilter && entryDateFilter.attribute) {\n return entryDateFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * Get conceptType of concept\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n * Set concept type\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.section.label;\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.section.number;\n }\n\n /**\n * Get content body\n */\n get body(): ?string {\n return this.section.body;\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks(): Array<ContentLinkModel> {\n return this.section.childSectionLinks;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return this.section.selfContentLink;\n }\n\n /**\n * Get tree of child sections\n */\n get childSections(): Array<SectionModel> {\n return this.section.childSections;\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: Array<SectionModel>) {\n this.section.childSections = sections || [];\n }\n\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.section.subSections;\n }\n\n /**\n */\n get relatedConceptsHrefs(): Array<Href> {\n const hrefs = [];\n if (this.relatedConceptsHref) {\n hrefs.push(this.relatedConceptsHref);\n }\n\n this.subSections.forEach((subSection) => {\n hrefs.push(...subSection.relatedConceptsHrefs);\n });\n\n return hrefs;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref(): Href | null {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n href.addParameter(\"entryDate\", this.entryDate);\n href.setReferenceHash(this.referenceHash);\n return href;\n }\n\n return null;\n }\n\n /**\n */\n get referenceHash(): number {\n return this.section.referenceHash;\n }\n}\n"],"mappings":";;;AACA,OAAOA,iBAAiB,MAAM,mCAAmC;AAEjE,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAKnE,OAAOC,YAAY,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,eAAe,MAAMC,YAAY,SAASP,aAAa,CAAC;EAKtDQ,WAAWA,CAACC,QAA2B,EAAE;IACvC,KAAK,CAACA,QAAQ,CAAC;IAACC,eAAA;IAAAA,eAAA,uBAJsB,IAAI;IAAAA,eAAA;IAM1C,IAAI,CAACC,QAAQ,GAAG,IAAIL,YAAY,CAC9B,IAAI,CAACM,IAAI,EACT,IAAI,CAACC,SAAS,EACd,IAAI,CAACC,YACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,SAAS;EAClB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,cAAc;EACvB;;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,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ACvCJ,KAAK,CAACE,IAAI,CAAC,GAAGE,UAAU,CAACL,oBAAoB,CAAC;IAChD,CAAC,CAAC;IAEF,OAAOC,KAAK;EACd;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmBA,CAAA,EAAgB;IACrC,MAAMI,mBAAmB,GAAG,IAAI,CAAClC,KAAK,CAACC,YAAY,CAAC,iBAAiB,CAAC;IAEtE,IAAIiC,mBAAmB,EAAE;MACvB,MAAM;QAAEC;MAAK,CAAC,GAAGD,mBAAmB;MACpCC,IAAI,CAACC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC7C,SAAS,CAAC;MAC9C4C,IAAI,CAACE,gBAAgB,CAAC,IAAI,CAACC,aAAa,CAAC;MACzC,OAAOH,IAAI;IACb;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIG,aAAaA,CAAA,EAAW;IAC1B,OAAO,IAAI,CAAC9B,OAAO,CAAC8B,aAAa;EACnC;AACF","ignoreList":[]}
@@ -145,7 +145,7 @@ export default class ContentTOCModel extends ResourceModel {
145
145
  }
146
146
 
147
147
  /**
148
- * Retrieve entrydate of content toc
148
+ * Retrieve modelcatalog.js of content toc
149
149
  */
150
150
  get entryDate() {
151
151
  const timeversionFilter = this.filterCollection.getFilterByAttributeKey(TIMEVERSION_FILTER_NAME);
@@ -1 +1 @@
1
- {"version":3,"file":"ContentTOCModel.js","names":["has","ResourceModel","FilterCollection","ContentLinkModel","ContentTypeModel","Href","TIMEVERSION_FILTER_NAME","getItems","items","entryDate","modelOptions","_mapInstanceProperty","call","item","link","section","_id","ContentTOCModel","constructor","arguments","_defineProperty","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","_findInstanceProperty","model","label","getData","selfhref","href","selflink","filterCollection","forEach","filter","params","param","value","setParameter","name","removeParameter","selfContentLink","categories","_context","category","_contentType","_filterCollection","_context2","_filterInstanceProperty","key","_Object$keys","timeversionFilter","getFilterByAttributeKey","attribute"],"sources":["../../../src/models/content/ContentTOCModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport ContentTypeModel from \"./ContentTypeModel\";\nimport Href from \"../href/Href\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModelOptions, ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Get content items recursively\n */\nconst getItems = (\n items: Array<Object>,\n entryDate: ISO_DATE | null,\n modelOptions?: ModelOptions,\n): Array<ContentLinkModel> =>\n items.map((item) => {\n const link = new ContentLinkModel(\n {\n ...item,\n section: item._id,\n },\n entryDate,\n modelOptions,\n );\n\n if (item.items) {\n link.items = getItems(item.items, entryDate, modelOptions);\n }\n\n return link;\n });\n\n/**\n * Content detail model\n */\nexport default class ContentTOCModel extends ResourceModel {\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n /**\n */\n get type(): string {\n return \"ContentTOC\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentTOCModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentTOC\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const href = new Href(this.selflink.href);\n\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n\n return href;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return new ContentLinkModel(this.data, this.entryDate, this.modelOptions);\n }\n\n /**\n * Get sub items of toc\n */\n get items(): Array<ContentLinkModel> {\n return this.data.items\n ? getItems(this.data.items, this.entryDate, this.modelOptions)\n : [];\n }\n\n /**\n * get categories of content\n */\n get categories(): Array<ContentLinkModel> {\n if (this.data.categories) {\n return this.data.categories.map(\n (category) => new ContentLinkModel(category, null, this.modelOptions),\n );\n }\n\n return [];\n }\n\n /**\n * Retrieve content type model\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter.filter((filter) => {\n const [key] = Object.keys(filter);\n return has(this.data?.filter, key);\n }),\n },\n this.modelOptions,\n );\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): ISO_DATE | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n\n return timeversionFilter?.attribute?.value ?? null;\n }\n}\n"],"mappings":";;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,cAAc;AAE/B,SAASC,uBAAuB,QAAQ,2BAA2B;AAMnE;AACA;AACA;AACA,MAAMC,QAAQ,GAAGA,CACfC,KAAoB,EAC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,QAAQ,IAAK,IAAIlD,gBAAgB,CAACkD,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC3C,YAAY,CACtE,CAAC;IACH;IAEA,OAAO,EAAE;EACX;;EAEA;AACF;AACA;EACE,IAAIuB,WAAWA,CAAA,EAA4B;IACzC,OAAO,IAAI,CAACqB,YAAY;EAC1B;;EAEA;AACF;EACE,IAAIrB,WAAWA,CAACA,WAA4B,EAAE;IAC5C,IAAI,CAACqB,YAAY,GACfrB,WAAW,YAAY7B,gBAAgB,GAAG6B,WAAW,GAAG,IAAI;EAChE;;EAEA;AACF;AACA;EACE,IAAIQ,gBAAgBA,CAAA,EAAqB;IACvC,IAAI,CAAC,IAAI,CAACc,iBAAiB,EAAE;MAAA,IAAAC,SAAA;MAC3B,IAAI,CAACD,iBAAiB,GAAG,IAAIrD,gBAAgB,CAAAuD,uBAAA,CAC3C,IAAI,CAACjC,IAAI,GACT;QACEmB,MAAM,EAAEc,uBAAA,CAAAD,SAAA,GAAAC,uBAAA,KAAI,CAAChC,aAAa,GAAAb,IAAA,CAAA4C,SAAA,EAAgBb,MAAM,IAAK;UACnD,MAAM,CAACe,GAAG,CAAC,GAAGC,YAAA,CAAYhB,MAAM,CAAC;UACjC,OAAO3C,GAAG,CAAC,IAAI,CAACwB,IAAI,EAAEmB,MAAM,EAAEe,GAAG,CAAC;QACpC,CAAC;MACH,CAAC,EACD,IAAI,CAAChD,YACP,CAAC;IACH;IAEA,OAAO,IAAI,CAAC6C,iBAAiB;EAC/B;;EAEA;AACF;AACA;EACE,IAAI9C,SAASA,CAAA,EAAoB;IAC/B,MAAMmD,iBAAiB,GAAG,IAAI,CAACnB,gBAAgB,CAACoB,uBAAuB,CACrEvD,uBACF,CAAC;IAED,OAAOsD,iBAAiB,EAAEE,SAAS,EAAEhB,KAAK,IAAI,IAAI;EACpD;AACF","ignoreList":[]}
1
+ {"version":3,"file":"ContentTOCModel.js","names":["has","ResourceModel","FilterCollection","ContentLinkModel","ContentTypeModel","Href","TIMEVERSION_FILTER_NAME","getItems","items","entryDate","modelOptions","_mapInstanceProperty","call","item","link","section","_id","ContentTOCModel","constructor","arguments","_defineProperty","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","_findInstanceProperty","model","label","getData","selfhref","href","selflink","filterCollection","forEach","filter","params","param","value","setParameter","name","removeParameter","selfContentLink","categories","_context","category","_contentType","_filterCollection","_context2","_filterInstanceProperty","key","_Object$keys","timeversionFilter","getFilterByAttributeKey","attribute"],"sources":["../../../src/models/content/ContentTOCModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport ContentTypeModel from \"./ContentTypeModel\";\nimport Href from \"../href/Href\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModelOptions, ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Get content items recursively\n */\nconst getItems = (\n items: Array<Object>,\n entryDate: ISO_DATE | null,\n modelOptions?: ModelOptions,\n): Array<ContentLinkModel> =>\n items.map((item) => {\n const link = new ContentLinkModel(\n {\n ...item,\n section: item._id,\n },\n entryDate,\n modelOptions,\n );\n\n if (item.items) {\n link.items = getItems(item.items, entryDate, modelOptions);\n }\n\n return link;\n });\n\n/**\n * Content detail model\n */\nexport default class ContentTOCModel extends ResourceModel {\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n /**\n */\n get type(): string {\n return \"ContentTOC\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentTOCModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentTOC\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const href = new Href(this.selflink.href);\n\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n\n return href;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return new ContentLinkModel(this.data, this.entryDate, this.modelOptions);\n }\n\n /**\n * Get sub items of toc\n */\n get items(): Array<ContentLinkModel> {\n return this.data.items\n ? getItems(this.data.items, this.entryDate, this.modelOptions)\n : [];\n }\n\n /**\n * get categories of content\n */\n get categories(): Array<ContentLinkModel> {\n if (this.data.categories) {\n return this.data.categories.map(\n (category) => new ContentLinkModel(category, null, this.modelOptions),\n );\n }\n\n return [];\n }\n\n /**\n * Retrieve content type model\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter.filter((filter) => {\n const [key] = Object.keys(filter);\n return has(this.data?.filter, key);\n }),\n },\n this.modelOptions,\n );\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): ISO_DATE | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n\n return timeversionFilter?.attribute?.value ?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O,IAAI,CAAC6C,iBAAiB;EAC/B;;EAEA;AACF;AACA;EACE,IAAI9C,SAASA,CAAA,EAAoB;IAC/B,MAAMmD,iBAAiB,GAAG,IAAI,CAACnB,gBAAgB,CAACoB,uBAAuB,CACrEvD,uBACF,CAAC;IAED,OAAOsD,iBAAiB,EAAEE,SAAS,EAAEhB,KAAK,IAAI,IAAI;EACpD;AACF","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Update the entry date being used in the modelcatalog
3
+ */
4
+ export const updateEntryDate = entryDate => ({
5
+ type: "UPDATE_ENTRYDATE",
6
+ payload: entryDate
7
+ });
8
+ //# sourceMappingURL=EntryDate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntryDate.js","names":["updateEntryDate","entryDate","type","payload"],"sources":["../../../src/redux/actions/EntryDate.js"],"sourcesContent":["// @flow\nimport type { UpdateEntryDateAction } from \"../types\";\n\n/**\n * Update the entry date being used in the modelcatalog\n */\nexport const updateEntryDate = (\n entryDate: ISO_DATE,\n): UpdateEntryDateAction => ({\n type: \"UPDATE_ENTRYDATE\",\n payload: entryDate,\n});\n"],"mappings":"AAGA;AACA;AACA;AACA,OAAO,MAAMA,eAAe,GAC1BC,SAAmB,KACQ;EAC3BC,IAAI,EAAE,kBAAkB;EACxBC,OAAO,EAAEF;AACX,CAAC,CAAC","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  export * from "./Application";
2
2
  export * from "./Authorization";
3
+ export * from "./EntryDate";
3
4
  export * from "./Error";
4
5
  export * from "./Form";
5
6
  export * from "./FormAttributeSet";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/redux/actions/index.js"],"sourcesContent":["// @flow\nexport * from \"./Application\";\nexport * from \"./Authorization\";\nexport * from \"./Error\";\nexport * from \"./Form\";\nexport * from \"./FormAttributeSet\";\nexport * from \"./FormAttributeSetRepeatable\";\nexport * from \"./FormAutosave\";\nexport * from \"./FormAutosubmit\";\nexport * from \"./FormValidations\";\nexport * from \"./Modals\";\nexport * from \"./Notification\";\nexport * from \"./Preferences\";\nexport * from \"./ProgressIndicator\";\nexport * from \"./SignIn\";\nexport * from \"./SignOut\";\n"],"mappings":"AACA,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,oBAAoB;AAClC,cAAc,8BAA8B;AAC5C,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,UAAU;AACxB,cAAc,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/redux/actions/index.js"],"sourcesContent":["// @flow\nexport * from \"./Application\";\nexport * from \"./Authorization\";\nexport * from \"./EntryDate\";\nexport * from \"./Error\";\nexport * from \"./Form\";\nexport * from \"./FormAttributeSet\";\nexport * from \"./FormAttributeSetRepeatable\";\nexport * from \"./FormAutosave\";\nexport * from \"./FormAutosubmit\";\nexport * from \"./FormValidations\";\nexport * from \"./Modals\";\nexport * from \"./Notification\";\nexport * from \"./Preferences\";\nexport * from \"./ProgressIndicator\";\nexport * from \"./SignIn\";\nexport * from \"./SignOut\";\n"],"mappings":"AACA,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,aAAa;AAC3B,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,oBAAoB;AAClC,cAAc,8BAA8B;AAC5C,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,UAAU;AACxB,cAAc,WAAW","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ import _URLSearchParams from "@babel/runtime-corejs3/core-js-stable/url-search-params";
2
+ import { DateUtil } from "../../utils";
3
+ import Cache from "../../utils/browser/Cache";
4
+ const initialState = {
5
+ entryDate: typeof window !== "undefined" ? new _URLSearchParams(window.location?.search).get("entryDate") || Cache.getItem("ModelCatalogEntryDate") || DateUtil.now() : null
6
+ };
7
+
8
+ /**
9
+ * Keep track of the entry date for the modelcatalog
10
+ */
11
+ const ModelCatalogReducer = function () {
12
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
13
+ let action = arguments.length > 1 ? arguments[1] : undefined;
14
+ if (!action) {
15
+ return state;
16
+ }
17
+ switch (action.type) {
18
+ case "UPDATE_ENTRYDATE":
19
+ Cache.addItem("ModelCatalogEntryDate", action.payload);
20
+ return {
21
+ ...state,
22
+ entryDate: action.payload
23
+ };
24
+ default:
25
+ return state;
26
+ }
27
+ };
28
+ export default ModelCatalogReducer;
29
+ //# sourceMappingURL=ModelCatalogReducer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelCatalogReducer.js","names":["DateUtil","Cache","initialState","entryDate","window","_URLSearchParams","location","search","get","getItem","now","ModelCatalogReducer","state","arguments","length","undefined","action","type","addItem","payload"],"sources":["../../../src/redux/reducers/ModelCatalogReducer.js"],"sourcesContent":["// @flow\nimport { DateUtil } from \"../../utils\";\nimport Cache from \"../../utils/browser/Cache\";\n\nimport type { Reducer } from \"redux\";\nimport type { ReduxAction, ModelCatalogState } from \"../types\";\n\nconst initialState: ModelCatalogState = {\n entryDate:\n typeof window !== \"undefined\"\n ? new URLSearchParams(window.location?.search).get(\"entryDate\") ||\n Cache.getItem(\"ModelCatalogEntryDate\") ||\n DateUtil.now()\n : null,\n};\n\n/**\n * Keep track of the entry date for the modelcatalog\n */\nconst ModelCatalogReducer: Reducer<ModelCatalogState, ReduxAction> = (\n state = initialState,\n action,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"UPDATE_ENTRYDATE\":\n Cache.addItem(\"ModelCatalogEntryDate\", action.payload);\n return {\n ...state,\n entryDate: action.payload,\n };\n default:\n return state;\n }\n};\n\nexport default ModelCatalogReducer;\n"],"mappings":";AACA,SAASA,QAAQ,QAAQ,aAAa;AACtC,OAAOC,KAAK,MAAM,2BAA2B;AAK7C,MAAMC,YAA+B,GAAG;EACtCC,SAAS,EACP,OAAOC,MAAM,KAAK,WAAW,GACzB,IAAAC,gBAAA,CAAoBD,MAAM,CAACE,QAAQ,EAAEC,MAAM,CAAC,CAACC,GAAG,CAAC,WAAW,CAAC,IAC7DP,KAAK,CAACQ,OAAO,CAAC,uBAAuB,CAAC,IACtCT,QAAQ,CAACU,GAAG,CAAC,CAAC,GACd;AACR,CAAC;;AAED;AACA;AACA;AACA,MAAMC,mBAA4D,GAAG,SAAAA,CAAA,EAGhE;EAAA,IAFHC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGX,YAAY;EAAA,IACpBc,MAAM,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAEN,IAAI,CAACC,MAAM,EAAE;IACX,OAAOJ,KAAK;EACd;EAEA,QAAQI,MAAM,CAACC,IAAI;IACjB,KAAK,kBAAkB;MACrBhB,KAAK,CAACiB,OAAO,CAAC,uBAAuB,EAAEF,MAAM,CAACG,OAAO,CAAC;MACtD,OAAO;QACL,GAAGP,KAAK;QACRT,SAAS,EAAEa,MAAM,CAACG;MACpB,CAAC;IACH;MACE,OAAOP,KAAK;EAChB;AACF,CAAC;AAED,eAAeD,mBAAmB","ignoreList":[]}
@@ -4,6 +4,7 @@ import { I18nReducer } from "../_i18n/I18nReducer";
4
4
  import ModalsReducer from "./ModalsReducer";
5
5
  import AuthReducer from "./AuthReducer";
6
6
  import ErrorReducer from "./ErrorReducer";
7
+ import ModelCatalogReducer from "./ModelCatalogReducer";
7
8
  import NotificationReducer from "./NotificationReducer";
8
9
  import ProgressIndicatorReducer from "./ProgressIndicatorReducer";
9
10
  import PreferencesReducer from "./PreferencesReducer";
@@ -16,6 +17,7 @@ export const createReducer = () => ({
16
17
  auth: AuthReducer,
17
18
  error: ErrorReducer,
18
19
  modals: ModalsReducer,
20
+ modelcatalog: ModelCatalogReducer,
19
21
  notification: NotificationReducer,
20
22
  progressindicator: ProgressIndicatorReducer,
21
23
  preferences: PreferencesReducer
@@ -1 +1 @@
1
- {"version":3,"file":"createReducer.js","names":["RouterReducer","ModularUIReducer","I18nReducer","ModalsReducer","AuthReducer","ErrorReducer","NotificationReducer","ProgressIndicatorReducer","PreferencesReducer","createReducer","router","modularui","i18n","auth","error","modals","notification","progressindicator","preferences"],"sources":["../../../src/redux/reducers/createReducer.js"],"sourcesContent":["// @flow\nimport { RouterReducer } from \"../_router/RouterReducer\";\nimport { ModularUIReducer } from \"../_modularui/ModularUIReducer\";\nimport { I18nReducer } from \"../_i18n/I18nReducer\";\n\nimport ModalsReducer from \"./ModalsReducer\";\nimport AuthReducer from \"./AuthReducer\";\nimport ErrorReducer from \"./ErrorReducer\";\nimport NotificationReducer from \"./NotificationReducer\";\nimport ProgressIndicatorReducer from \"./ProgressIndicatorReducer\";\nimport PreferencesReducer from \"./PreferencesReducer\";\n\nimport type { Reducer } from \"redux\";\nimport type {\n ReduxAction,\n ProgressIndicatorState,\n PreferencesState,\n NotificationState,\n ModalsState,\n ErrorState,\n AuthState,\n} from \"../types\";\nimport type { RouterState } from \"../_router/types\";\nimport type { ModularUIState } from \"../_modularui/types\";\nimport type { I18nState } from \"../_i18n/types\";\n\ntype Reducers = {\n auth: Reducer<AuthState, ReduxAction>,\n error: Reducer<ErrorState, ReduxAction>,\n i18n: Reducer<I18nState, ReduxAction>,\n modals: Reducer<ModalsState, ReduxAction>,\n modularui: Reducer<ModularUIState, ReduxAction>,\n notification: Reducer<NotificationState, ReduxAction>,\n preferences: Reducer<PreferencesState, ReduxAction>,\n progressindicator: Reducer<ProgressIndicatorState, ReduxAction>,\n router: Reducer<RouterState, ReduxAction>,\n};\n\n/**\n */\nexport const createReducer = (): Reducers => ({\n router: RouterReducer,\n modularui: ModularUIReducer,\n i18n: I18nReducer,\n auth: AuthReducer,\n error: ErrorReducer,\n modals: ModalsReducer,\n notification: NotificationReducer,\n progressindicator: ProgressIndicatorReducer,\n preferences: PreferencesReducer,\n});\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,0BAA0B;AACxD,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,WAAW,QAAQ,sBAAsB;AAElD,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,OAAOC,wBAAwB,MAAM,4BAA4B;AACjE,OAAOC,kBAAkB,MAAM,sBAAsB;AA4BrD;AACA;AACA,OAAO,MAAMC,aAAa,GAAGA,CAAA,MAAiB;EAC5CC,MAAM,EAAEV,aAAa;EACrBW,SAAS,EAAEV,gBAAgB;EAC3BW,IAAI,EAAEV,WAAW;EACjBW,IAAI,EAAET,WAAW;EACjBU,KAAK,EAAET,YAAY;EACnBU,MAAM,EAAEZ,aAAa;EACrBa,YAAY,EAAEV,mBAAmB;EACjCW,iBAAiB,EAAEV,wBAAwB;EAC3CW,WAAW,EAAEV;AACf,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"createReducer.js","names":["RouterReducer","ModularUIReducer","I18nReducer","ModalsReducer","AuthReducer","ErrorReducer","ModelCatalogReducer","NotificationReducer","ProgressIndicatorReducer","PreferencesReducer","createReducer","router","modularui","i18n","auth","error","modals","modelcatalog","notification","progressindicator","preferences"],"sources":["../../../src/redux/reducers/createReducer.js"],"sourcesContent":["// @flow\nimport { RouterReducer } from \"../_router/RouterReducer\";\nimport { ModularUIReducer } from \"../_modularui/ModularUIReducer\";\nimport { I18nReducer } from \"../_i18n/I18nReducer\";\n\nimport ModalsReducer from \"./ModalsReducer\";\nimport AuthReducer from \"./AuthReducer\";\nimport ErrorReducer from \"./ErrorReducer\";\nimport ModelCatalogReducer from \"./ModelCatalogReducer\";\nimport NotificationReducer from \"./NotificationReducer\";\nimport ProgressIndicatorReducer from \"./ProgressIndicatorReducer\";\nimport PreferencesReducer from \"./PreferencesReducer\";\n\nimport type { Reducer } from \"redux\";\nimport type {\n ReduxAction,\n ProgressIndicatorState,\n PreferencesState,\n NotificationState,\n ModalsState,\n ErrorState,\n AuthState,\n ModelCatalogState,\n} from \"../types\";\nimport type { RouterState } from \"../_router/types\";\nimport type { ModularUIState } from \"../_modularui/types\";\nimport type { I18nState } from \"../_i18n/types\";\n\ntype Reducers = {\n auth: Reducer<AuthState, ReduxAction>,\n error: Reducer<ErrorState, ReduxAction>,\n i18n: Reducer<I18nState, ReduxAction>,\n modals: Reducer<ModalsState, ReduxAction>,\n modelcatalog: Reducer<ModelCatalogState, ReduxAction>,\n modularui: Reducer<ModularUIState, ReduxAction>,\n notification: Reducer<NotificationState, ReduxAction>,\n preferences: Reducer<PreferencesState, ReduxAction>,\n progressindicator: Reducer<ProgressIndicatorState, ReduxAction>,\n router: Reducer<RouterState, ReduxAction>,\n};\n\n/**\n */\nexport const createReducer = (): Reducers => ({\n router: RouterReducer,\n modularui: ModularUIReducer,\n i18n: I18nReducer,\n auth: AuthReducer,\n error: ErrorReducer,\n modals: ModalsReducer,\n modelcatalog: ModelCatalogReducer,\n notification: NotificationReducer,\n progressindicator: ProgressIndicatorReducer,\n preferences: PreferencesReducer,\n});\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,0BAA0B;AACxD,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,WAAW,QAAQ,sBAAsB;AAElD,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,OAAOC,wBAAwB,MAAM,4BAA4B;AACjE,OAAOC,kBAAkB,MAAM,sBAAsB;AA8BrD;AACA;AACA,OAAO,MAAMC,aAAa,GAAGA,CAAA,MAAiB;EAC5CC,MAAM,EAAEX,aAAa;EACrBY,SAAS,EAAEX,gBAAgB;EAC3BY,IAAI,EAAEX,WAAW;EACjBY,IAAI,EAAEV,WAAW;EACjBW,KAAK,EAAEV,YAAY;EACnBW,MAAM,EAAEb,aAAa;EACrBc,YAAY,EAAEX,mBAAmB;EACjCY,YAAY,EAAEX,mBAAmB;EACjCY,iBAAiB,EAAEX,wBAAwB;EAC3CY,WAAW,EAAEX;AACf,CAAC,CAAC","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  export * from "./createReducer";
2
2
  export { default as AuthReducer } from "./AuthReducer";
3
+ export { default as ModelCatalogReducer } from "./ModelCatalogReducer";
3
4
  export { default as ErrorReducer } from "./ErrorReducer";
4
5
  export { default as ModalsReducer } from "./ModalsReducer";
5
6
  export { default as NotificationReducer } from "./NotificationReducer";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","AuthReducer","ErrorReducer","ModalsReducer","NotificationReducer","PreferencesReducer","ProgressIndicatorReducer"],"sources":["../../../src/redux/reducers/index.js"],"sourcesContent":["// @flow\nexport * from \"./createReducer\";\n\nexport { default as AuthReducer } from \"./AuthReducer\";\nexport { default as ErrorReducer } from \"./ErrorReducer\";\nexport { default as ModalsReducer } from \"./ModalsReducer\";\nexport { default as NotificationReducer } from \"./NotificationReducer\";\nexport { default as PreferencesReducer } from \"./PreferencesReducer\";\nexport { default as ProgressIndicatorReducer } from \"./ProgressIndicatorReducer\";\n"],"mappings":"AACA,cAAc,iBAAiB;AAE/B,SAASA,OAAO,IAAIC,WAAW,QAAQ,eAAe;AACtD,SAASD,OAAO,IAAIE,YAAY,QAAQ,gBAAgB;AACxD,SAASF,OAAO,IAAIG,aAAa,QAAQ,iBAAiB;AAC1D,SAASH,OAAO,IAAII,mBAAmB,QAAQ,uBAAuB;AACtE,SAASJ,OAAO,IAAIK,kBAAkB,QAAQ,sBAAsB;AACpE,SAASL,OAAO,IAAIM,wBAAwB,QAAQ,4BAA4B","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["default","AuthReducer","ModelCatalogReducer","ErrorReducer","ModalsReducer","NotificationReducer","PreferencesReducer","ProgressIndicatorReducer"],"sources":["../../../src/redux/reducers/index.js"],"sourcesContent":["// @flow\nexport * from \"./createReducer\";\n\nexport { default as AuthReducer } from \"./AuthReducer\";\nexport { default as ModelCatalogReducer } from \"./ModelCatalogReducer\";\nexport { default as ErrorReducer } from \"./ErrorReducer\";\nexport { default as ModalsReducer } from \"./ModalsReducer\";\nexport { default as NotificationReducer } from \"./NotificationReducer\";\nexport { default as PreferencesReducer } from \"./PreferencesReducer\";\nexport { default as ProgressIndicatorReducer } from \"./ProgressIndicatorReducer\";\n"],"mappings":"AACA,cAAc,iBAAiB;AAE/B,SAASA,OAAO,IAAIC,WAAW,QAAQ,eAAe;AACtD,SAASD,OAAO,IAAIE,mBAAmB,QAAQ,uBAAuB;AACtE,SAASF,OAAO,IAAIG,YAAY,QAAQ,gBAAgB;AACxD,SAASH,OAAO,IAAII,aAAa,QAAQ,iBAAiB;AAC1D,SAASJ,OAAO,IAAIK,mBAAmB,QAAQ,uBAAuB;AACtE,SAASL,OAAO,IAAIM,kBAAkB,QAAQ,sBAAsB;AACpE,SAASN,OAAO,IAAIO,wBAAwB,QAAQ,4BAA4B","ignoreList":[]}
@@ -1,2 +1,3 @@
1
1
  export * from "./i18n";
2
+ export * from "./modelcatalog";
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/redux/selectors/index.js"],"sourcesContent":["// @flow\nexport * from \"./i18n\";\n"],"mappings":"AACA,cAAc,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/redux/selectors/index.js"],"sourcesContent":["// @flow\nexport * from \"./i18n\";\nexport * from \"./modelcatalog\";\n"],"mappings":"AACA,cAAc,QAAQ;AACtB,cAAc,gBAAgB","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import { DateUtil } from "../../utils";
2
+ /**
3
+ * Retrieve entrydate for the model catalog
4
+ */
5
+ export const getEntryDate = state => {
6
+ return state.modelcatalog?.entryDate ?? DateUtil.now();
7
+ };
8
+ //# sourceMappingURL=modelcatalog.js.map