@beinformed/ui 1.57.1 → 1.57.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (436) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/esm/constants/Settings.js +14 -6
  3. package/esm/constants/Settings.js.map +1 -1
  4. package/esm/hooks/useAuthentication.js +3 -3
  5. package/esm/hooks/useAuthentication.js.map +1 -1
  6. package/esm/hooks/useModelCatalog.js.map +1 -1
  7. package/esm/hooks/useModularUI.js +9 -8
  8. package/esm/hooks/useModularUI.js.map +1 -1
  9. package/esm/hooks/useModularUIBasic.js +2 -4
  10. package/esm/hooks/useModularUIBasic.js.map +1 -1
  11. package/esm/hooks/useModularUIModel.js.map +1 -1
  12. package/esm/models/actions/ActionCollection.js +2 -3
  13. package/esm/models/actions/ActionCollection.js.map +1 -1
  14. package/esm/models/actions/ActionModel.js +13 -23
  15. package/esm/models/actions/ActionModel.js.map +1 -1
  16. package/esm/models/application/ApplicationModel.js +1 -1
  17. package/esm/models/application/ApplicationModel.js.map +1 -1
  18. package/esm/models/attributes/AttributeCollection.js +6 -3
  19. package/esm/models/attributes/AttributeCollection.js.map +1 -1
  20. package/esm/models/attributes/AttributeModel.js +3 -3
  21. package/esm/models/attributes/AttributeModel.js.map +1 -1
  22. package/esm/models/attributes/AttributeSetModel.js +7 -4
  23. package/esm/models/attributes/AttributeSetModel.js.map +1 -1
  24. package/esm/models/attributes/BooleanAttributeModel.js +6 -3
  25. package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
  26. package/esm/models/attributes/ChoiceAttributeModel.js +6 -3
  27. package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
  28. package/esm/models/attributes/ChoiceAttributeOptionCollection.js +18 -14
  29. package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  30. package/esm/models/attributes/ChoiceAttributeOptionModel.js +17 -10
  31. package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  32. package/esm/models/attributes/CompositeAttributeChildCollection.js +7 -7
  33. package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  34. package/esm/models/attributes/CompositeAttributeModel.js +3 -3
  35. package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
  36. package/esm/models/attributes/DatetimeAttributeModel.js +2 -2
  37. package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
  38. package/esm/models/attributes/StringAttributeModel.js +2 -2
  39. package/esm/models/attributes/StringAttributeModel.js.map +1 -1
  40. package/esm/models/attributes/_createAttribute.js +2 -2
  41. package/esm/models/attributes/_createAttribute.js.map +1 -1
  42. package/esm/models/base/BaseModel.js +27 -1
  43. package/esm/models/base/BaseModel.js.map +1 -1
  44. package/esm/models/base/ResourceModel.js +3 -23
  45. package/esm/models/base/ResourceModel.js.map +1 -1
  46. package/esm/models/caseview/CaseViewModel.js +1 -1
  47. package/esm/models/caseview/CaseViewModel.js.map +1 -1
  48. package/esm/models/concepts/ConceptDetailModel.js +2 -2
  49. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  50. package/esm/models/concepts/ConceptIndexModel.js +2 -2
  51. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  52. package/esm/models/concepts/ConceptLinkModel.js +4 -10
  53. package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
  54. package/esm/models/concepts/ConceptRelationCollection.js +11 -4
  55. package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
  56. package/esm/models/concepts/ConceptRelationModel.js +8 -1
  57. package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
  58. package/esm/models/concepts/SourceReferenceCollection.js +2 -4
  59. package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
  60. package/esm/models/concepts/SourceReferenceModel.js +9 -10
  61. package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
  62. package/esm/models/content/ContentIndexModel.js +2 -2
  63. package/esm/models/content/ContentIndexModel.js.map +1 -1
  64. package/esm/models/content/ContentLinkModel.js +4 -11
  65. package/esm/models/content/ContentLinkModel.js.map +1 -1
  66. package/esm/models/content/ContentModel.js +2 -2
  67. package/esm/models/content/ContentModel.js.map +1 -1
  68. package/esm/models/content/ContentTOCModel.js +7 -7
  69. package/esm/models/content/ContentTOCModel.js.map +1 -1
  70. package/esm/models/content/SectionModel.js +6 -12
  71. package/esm/models/content/SectionModel.js.map +1 -1
  72. package/esm/models/detail/DetailModel.js +9 -3
  73. package/esm/models/detail/DetailModel.js.map +1 -1
  74. package/esm/models/error/ErrorResponse.js +8 -10
  75. package/esm/models/error/ErrorResponse.js.map +1 -1
  76. package/esm/models/filters/AssignmentFilterModel.js +2 -2
  77. package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
  78. package/esm/models/filters/BaseFilterModel.js +3 -3
  79. package/esm/models/filters/BaseFilterModel.js.map +1 -1
  80. package/esm/models/filters/ConceptIndexFilterModel.js +2 -3
  81. package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
  82. package/esm/models/filters/FilterCollection.js +8 -7
  83. package/esm/models/filters/FilterCollection.js.map +1 -1
  84. package/esm/models/filters/StringFilterModel.js +2 -2
  85. package/esm/models/filters/StringFilterModel.js.map +1 -1
  86. package/esm/models/form/FormModel.js +4 -4
  87. package/esm/models/form/FormModel.js.map +1 -1
  88. package/esm/models/form/FormObjectModel.js +7 -4
  89. package/esm/models/form/FormObjectModel.js.map +1 -1
  90. package/esm/models/grouping/GroupingModel.js +10 -7
  91. package/esm/models/grouping/GroupingModel.js.map +1 -1
  92. package/esm/models/href/Href.js +9 -8
  93. package/esm/models/href/Href.js.map +1 -1
  94. package/esm/models/links/LinkCollection.js +2 -3
  95. package/esm/models/links/LinkCollection.js.map +1 -1
  96. package/esm/models/links/LinkModel.js +7 -7
  97. package/esm/models/links/LinkModel.js.map +1 -1
  98. package/esm/models/list/ListDetailModel.js +1 -1
  99. package/esm/models/list/ListDetailModel.js.map +1 -1
  100. package/esm/models/list/ListItemCollection.js +1 -1
  101. package/esm/models/list/ListItemCollection.js.map +1 -1
  102. package/esm/models/list/ListItemModel.js +3 -3
  103. package/esm/models/list/ListItemModel.js.map +1 -1
  104. package/esm/models/list/ListModel.js +3 -3
  105. package/esm/models/list/ListModel.js.map +1 -1
  106. package/esm/models/lookup/LookupOptionCollection.js +5 -2
  107. package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
  108. package/esm/models/lookup/LookupOptionsModel.js +2 -2
  109. package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
  110. package/esm/models/panels/GroupingPanelModel.js +1 -1
  111. package/esm/models/panels/GroupingPanelModel.js.map +1 -1
  112. package/esm/models/tab/TabModel.js +2 -2
  113. package/esm/models/tab/TabModel.js.map +1 -1
  114. package/esm/models/taskgroup/TaskGroupModel.js +4 -5
  115. package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
  116. package/esm/models/types.js.map +1 -1
  117. package/esm/models/user/UserProfileModel.js +4 -1
  118. package/esm/models/user/UserProfileModel.js.map +1 -1
  119. package/esm/modularui/CaptchaRequest.js +3 -3
  120. package/esm/modularui/CaptchaRequest.js.map +1 -1
  121. package/esm/modularui/ModularUIRequest.js +8 -5
  122. package/esm/modularui/ModularUIRequest.js.map +1 -1
  123. package/esm/modularui/ModularUIResponse.js +12 -3
  124. package/esm/modularui/ModularUIResponse.js.map +1 -1
  125. package/esm/modularui/UploadRequest.js +3 -3
  126. package/esm/modularui/UploadRequest.js.map +1 -1
  127. package/esm/react-client/client.js +3 -3
  128. package/esm/react-client/client.js.map +1 -1
  129. package/esm/react-server/renderSSRComplete.js +2 -2
  130. package/esm/react-server/renderSSRComplete.js.map +1 -1
  131. package/esm/react-server/renderSSRMinimal.js +2 -2
  132. package/esm/react-server/renderSSRMinimal.js.map +1 -1
  133. package/esm/redux/_modularui/ModularUIActions.js +8 -2
  134. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  135. package/esm/redux/_modularui/ModularUIUtils.js +8 -11
  136. package/esm/redux/_modularui/ModularUIUtils.js.map +1 -1
  137. package/esm/utils/browser/Cookies.js +3 -3
  138. package/esm/utils/browser/Cookies.js.map +1 -1
  139. package/esm/utils/helpers/createHref.js +23 -3
  140. package/esm/utils/helpers/createHref.js.map +1 -1
  141. package/esm/utils/helpers/repositoryResource.js +2 -2
  142. package/esm/utils/helpers/repositoryResource.js.map +1 -1
  143. package/lib/constants/Settings.js +18 -8
  144. package/lib/constants/Settings.js.flow +16 -6
  145. package/lib/constants/Settings.js.map +1 -1
  146. package/lib/hooks/useAuthentication.js +2 -2
  147. package/lib/hooks/useAuthentication.js.flow +3 -3
  148. package/lib/hooks/useAuthentication.js.map +1 -1
  149. package/lib/hooks/useModelCatalog.js.flow +7 -6
  150. package/lib/hooks/useModelCatalog.js.map +1 -1
  151. package/lib/hooks/useModularUI.js +9 -8
  152. package/lib/hooks/useModularUI.js.flow +12 -9
  153. package/lib/hooks/useModularUI.js.map +1 -1
  154. package/lib/hooks/useModularUIBasic.js +2 -4
  155. package/lib/hooks/useModularUIBasic.js.flow +3 -4
  156. package/lib/hooks/useModularUIBasic.js.map +1 -1
  157. package/lib/hooks/useModularUIModel.js.flow +16 -11
  158. package/lib/hooks/useModularUIModel.js.map +1 -1
  159. package/lib/models/actions/ActionCollection.js +2 -2
  160. package/lib/models/actions/ActionCollection.js.flow +3 -8
  161. package/lib/models/actions/ActionCollection.js.map +1 -1
  162. package/lib/models/actions/ActionModel.js +12 -22
  163. package/lib/models/actions/ActionModel.js.flow +7 -24
  164. package/lib/models/actions/ActionModel.js.map +1 -1
  165. package/lib/models/application/ApplicationModel.js +1 -1
  166. package/lib/models/application/ApplicationModel.js.flow +1 -2
  167. package/lib/models/application/ApplicationModel.js.map +1 -1
  168. package/lib/models/attributes/AttributeCollection.js +6 -3
  169. package/lib/models/attributes/AttributeCollection.js.flow +12 -4
  170. package/lib/models/attributes/AttributeCollection.js.map +1 -1
  171. package/lib/models/attributes/AttributeModel.js +3 -3
  172. package/lib/models/attributes/AttributeModel.js.flow +8 -2
  173. package/lib/models/attributes/AttributeModel.js.map +1 -1
  174. package/lib/models/attributes/AttributeSetModel.js +7 -3
  175. package/lib/models/attributes/AttributeSetModel.js.flow +11 -3
  176. package/lib/models/attributes/AttributeSetModel.js.map +1 -1
  177. package/lib/models/attributes/BooleanAttributeModel.js +6 -3
  178. package/lib/models/attributes/BooleanAttributeModel.js.flow +8 -4
  179. package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
  180. package/lib/models/attributes/ChoiceAttributeModel.js +6 -3
  181. package/lib/models/attributes/ChoiceAttributeModel.js.flow +13 -4
  182. package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
  183. package/lib/models/attributes/ChoiceAttributeOptionCollection.js +18 -13
  184. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.flow +30 -28
  185. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  186. package/lib/models/attributes/ChoiceAttributeOptionModel.js +17 -10
  187. package/lib/models/attributes/ChoiceAttributeOptionModel.js.flow +30 -11
  188. package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  189. package/lib/models/attributes/CompositeAttributeChildCollection.js +7 -7
  190. package/lib/models/attributes/CompositeAttributeChildCollection.js.flow +8 -1
  191. package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  192. package/lib/models/attributes/CompositeAttributeModel.js +3 -3
  193. package/lib/models/attributes/CompositeAttributeModel.js.flow +8 -3
  194. package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
  195. package/lib/models/attributes/DatetimeAttributeModel.js +2 -2
  196. package/lib/models/attributes/DatetimeAttributeModel.js.flow +7 -2
  197. package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
  198. package/lib/models/attributes/StringAttributeModel.js +2 -2
  199. package/lib/models/attributes/StringAttributeModel.js.flow +7 -3
  200. package/lib/models/attributes/StringAttributeModel.js.map +1 -1
  201. package/lib/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js.flow +1 -1
  202. package/lib/models/attributes/_createAttribute.js +2 -2
  203. package/lib/models/attributes/_createAttribute.js.flow +3 -2
  204. package/lib/models/attributes/_createAttribute.js.map +1 -1
  205. package/lib/models/base/BaseModel.js +27 -1
  206. package/lib/models/base/BaseModel.js.flow +31 -1
  207. package/lib/models/base/BaseModel.js.map +1 -1
  208. package/lib/models/base/ResourceModel.js +3 -22
  209. package/lib/models/base/ResourceModel.js.flow +6 -23
  210. package/lib/models/base/ResourceModel.js.map +1 -1
  211. package/lib/models/base/__tests__/BaseModel.spec.js.flow +4 -0
  212. package/lib/models/caseview/CaseViewModel.js +1 -1
  213. package/lib/models/caseview/CaseViewModel.js.flow +1 -2
  214. package/lib/models/caseview/CaseViewModel.js.map +1 -1
  215. package/lib/models/concepts/ConceptDetailModel.js +2 -2
  216. package/lib/models/concepts/ConceptDetailModel.js.flow +2 -2
  217. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  218. package/lib/models/concepts/ConceptIndexModel.js +2 -2
  219. package/lib/models/concepts/ConceptIndexModel.js.flow +9 -6
  220. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  221. package/lib/models/concepts/ConceptLinkModel.js +4 -10
  222. package/lib/models/concepts/ConceptLinkModel.js.flow +15 -12
  223. package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
  224. package/lib/models/concepts/ConceptRelationCollection.js +11 -4
  225. package/lib/models/concepts/ConceptRelationCollection.js.flow +17 -3
  226. package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
  227. package/lib/models/concepts/ConceptRelationModel.js +8 -1
  228. package/lib/models/concepts/ConceptRelationModel.js.flow +18 -2
  229. package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
  230. package/lib/models/concepts/SourceReferenceCollection.js +2 -3
  231. package/lib/models/concepts/SourceReferenceCollection.js.flow +3 -8
  232. package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
  233. package/lib/models/concepts/SourceReferenceModel.js +8 -8
  234. package/lib/models/concepts/SourceReferenceModel.js.flow +10 -11
  235. package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
  236. package/lib/models/content/ContentIndexModel.js +2 -2
  237. package/lib/models/content/ContentIndexModel.js.flow +10 -5
  238. package/lib/models/content/ContentIndexModel.js.map +1 -1
  239. package/lib/models/content/ContentLinkModel.js +4 -10
  240. package/lib/models/content/ContentLinkModel.js.flow +10 -13
  241. package/lib/models/content/ContentLinkModel.js.map +1 -1
  242. package/lib/models/content/ContentModel.js +2 -2
  243. package/lib/models/content/ContentModel.js.flow +6 -1
  244. package/lib/models/content/ContentModel.js.map +1 -1
  245. package/lib/models/content/ContentTOCModel.js +7 -7
  246. package/lib/models/content/ContentTOCModel.js.flow +19 -11
  247. package/lib/models/content/ContentTOCModel.js.map +1 -1
  248. package/lib/models/content/SectionModel.js +6 -11
  249. package/lib/models/content/SectionModel.js.flow +9 -21
  250. package/lib/models/content/SectionModel.js.map +1 -1
  251. package/lib/models/detail/DetailModel.js +9 -3
  252. package/lib/models/detail/DetailModel.js.flow +3 -4
  253. package/lib/models/detail/DetailModel.js.map +1 -1
  254. package/lib/models/error/ErrorResponse.js +7 -9
  255. package/lib/models/error/ErrorResponse.js.flow +9 -20
  256. package/lib/models/error/ErrorResponse.js.map +1 -1
  257. package/lib/models/filters/AssignmentFilterModel.js +2 -2
  258. package/lib/models/filters/AssignmentFilterModel.js.flow +7 -3
  259. package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
  260. package/lib/models/filters/BaseFilterModel.js +3 -3
  261. package/lib/models/filters/BaseFilterModel.js.flow +16 -7
  262. package/lib/models/filters/BaseFilterModel.js.map +1 -1
  263. package/lib/models/filters/ConceptIndexFilterModel.js +2 -2
  264. package/lib/models/filters/ConceptIndexFilterModel.js.flow +8 -2
  265. package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
  266. package/lib/models/filters/FilterCollection.js +8 -7
  267. package/lib/models/filters/FilterCollection.js.flow +13 -7
  268. package/lib/models/filters/FilterCollection.js.map +1 -1
  269. package/lib/models/filters/StringFilterModel.js +2 -2
  270. package/lib/models/filters/StringFilterModel.js.flow +7 -3
  271. package/lib/models/filters/StringFilterModel.js.map +1 -1
  272. package/lib/models/form/FormModel.js +4 -4
  273. package/lib/models/form/FormModel.js.flow +8 -2
  274. package/lib/models/form/FormModel.js.map +1 -1
  275. package/lib/models/form/FormObjectModel.js +7 -4
  276. package/lib/models/form/FormObjectModel.js.flow +17 -4
  277. package/lib/models/form/FormObjectModel.js.map +1 -1
  278. package/lib/models/grouping/GroupingModel.js +10 -7
  279. package/lib/models/grouping/GroupingModel.js.flow +21 -5
  280. package/lib/models/grouping/GroupingModel.js.map +1 -1
  281. package/lib/models/href/Href.js +8 -7
  282. package/lib/models/href/Href.js.flow +17 -10
  283. package/lib/models/href/Href.js.map +1 -1
  284. package/lib/models/href/__tests__/Href.spec.js.flow +5 -8
  285. package/lib/models/links/LinkCollection.js +2 -3
  286. package/lib/models/links/LinkCollection.js.flow +3 -3
  287. package/lib/models/links/LinkCollection.js.map +1 -1
  288. package/lib/models/links/LinkModel.js +7 -7
  289. package/lib/models/links/LinkModel.js.flow +8 -15
  290. package/lib/models/links/LinkModel.js.map +1 -1
  291. package/lib/models/list/ListDetailModel.js +1 -1
  292. package/lib/models/list/ListDetailModel.js.flow +6 -1
  293. package/lib/models/list/ListDetailModel.js.map +1 -1
  294. package/lib/models/list/ListItemCollection.js +1 -1
  295. package/lib/models/list/ListItemCollection.js.flow +1 -2
  296. package/lib/models/list/ListItemCollection.js.map +1 -1
  297. package/lib/models/list/ListItemModel.js +3 -3
  298. package/lib/models/list/ListItemModel.js.flow +4 -4
  299. package/lib/models/list/ListItemModel.js.map +1 -1
  300. package/lib/models/list/ListModel.js +3 -3
  301. package/lib/models/list/ListModel.js.flow +12 -8
  302. package/lib/models/list/ListModel.js.map +1 -1
  303. package/lib/models/lookup/LookupOptionCollection.js +5 -1
  304. package/lib/models/lookup/LookupOptionCollection.js.flow +17 -6
  305. package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
  306. package/lib/models/lookup/LookupOptionsModel.js +2 -2
  307. package/lib/models/lookup/LookupOptionsModel.js.flow +2 -0
  308. package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
  309. package/lib/models/panels/GroupingPanelModel.js +1 -1
  310. package/lib/models/panels/GroupingPanelModel.js.flow +1 -2
  311. package/lib/models/panels/GroupingPanelModel.js.map +1 -1
  312. package/lib/models/tab/TabModel.js +2 -2
  313. package/lib/models/tab/TabModel.js.flow +2 -4
  314. package/lib/models/tab/TabModel.js.map +1 -1
  315. package/lib/models/taskgroup/TaskGroupModel.js +4 -4
  316. package/lib/models/taskgroup/TaskGroupModel.js.flow +5 -6
  317. package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
  318. package/lib/models/types.js.flow +5 -0
  319. package/lib/models/types.js.map +1 -1
  320. package/lib/models/user/UserProfileModel.js +4 -1
  321. package/lib/models/user/UserProfileModel.js.flow +1 -0
  322. package/lib/models/user/UserProfileModel.js.map +1 -1
  323. package/lib/modularui/CaptchaRequest.js +2 -2
  324. package/lib/modularui/CaptchaRequest.js.flow +7 -3
  325. package/lib/modularui/CaptchaRequest.js.map +1 -1
  326. package/lib/modularui/ModularUIRequest.js +7 -4
  327. package/lib/modularui/ModularUIRequest.js.flow +8 -5
  328. package/lib/modularui/ModularUIRequest.js.map +1 -1
  329. package/lib/modularui/ModularUIResponse.js +11 -2
  330. package/lib/modularui/ModularUIResponse.js.flow +13 -3
  331. package/lib/modularui/ModularUIResponse.js.map +1 -1
  332. package/lib/modularui/UploadRequest.js +2 -2
  333. package/lib/modularui/UploadRequest.js.flow +7 -3
  334. package/lib/modularui/UploadRequest.js.map +1 -1
  335. package/lib/react-client/client.js +2 -2
  336. package/lib/react-client/client.js.flow +7 -3
  337. package/lib/react-client/client.js.map +1 -1
  338. package/lib/react-server/renderSSRComplete.js +1 -1
  339. package/lib/react-server/renderSSRComplete.js.flow +2 -2
  340. package/lib/react-server/renderSSRComplete.js.map +1 -1
  341. package/lib/react-server/renderSSRMinimal.js +1 -1
  342. package/lib/react-server/renderSSRMinimal.js.flow +2 -2
  343. package/lib/react-server/renderSSRMinimal.js.map +1 -1
  344. package/lib/redux/_modularui/ModularUIActions.js +8 -2
  345. package/lib/redux/_modularui/ModularUIActions.js.flow +8 -7
  346. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  347. package/lib/redux/_modularui/ModularUIUtils.js +8 -11
  348. package/lib/redux/_modularui/ModularUIUtils.js.flow +13 -14
  349. package/lib/redux/_modularui/ModularUIUtils.js.map +1 -1
  350. package/lib/utils/browser/Cookies.js +2 -2
  351. package/lib/utils/browser/Cookies.js.flow +3 -3
  352. package/lib/utils/browser/Cookies.js.map +1 -1
  353. package/lib/utils/helpers/__tests__/createHref.spec.js.flow +13 -8
  354. package/lib/utils/helpers/createHref.js +23 -3
  355. package/lib/utils/helpers/createHref.js.flow +37 -8
  356. package/lib/utils/helpers/createHref.js.map +1 -1
  357. package/lib/utils/helpers/repositoryResource.js +1 -1
  358. package/lib/utils/helpers/repositoryResource.js.flow +2 -2
  359. package/lib/utils/helpers/repositoryResource.js.map +1 -1
  360. package/package.json +4 -4
  361. package/src/constants/Settings.js +16 -6
  362. package/src/hooks/useAuthentication.js +3 -3
  363. package/src/hooks/useModelCatalog.js +7 -6
  364. package/src/hooks/useModularUI.js +12 -9
  365. package/src/hooks/useModularUIBasic.js +3 -4
  366. package/src/hooks/useModularUIModel.js +16 -11
  367. package/src/models/actions/ActionCollection.js +3 -8
  368. package/src/models/actions/ActionModel.js +7 -24
  369. package/src/models/application/ApplicationModel.js +1 -2
  370. package/src/models/attributes/AttributeCollection.js +12 -4
  371. package/src/models/attributes/AttributeModel.js +8 -2
  372. package/src/models/attributes/AttributeSetModel.js +11 -3
  373. package/src/models/attributes/BooleanAttributeModel.js +8 -4
  374. package/src/models/attributes/ChoiceAttributeModel.js +13 -4
  375. package/src/models/attributes/ChoiceAttributeOptionCollection.js +30 -28
  376. package/src/models/attributes/ChoiceAttributeOptionModel.js +30 -11
  377. package/src/models/attributes/CompositeAttributeChildCollection.js +8 -1
  378. package/src/models/attributes/CompositeAttributeModel.js +8 -3
  379. package/src/models/attributes/DatetimeAttributeModel.js +7 -2
  380. package/src/models/attributes/StringAttributeModel.js +7 -3
  381. package/src/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js +1 -1
  382. package/src/models/attributes/_createAttribute.js +3 -2
  383. package/src/models/base/BaseModel.js +31 -1
  384. package/src/models/base/ResourceModel.js +6 -23
  385. package/src/models/base/__tests__/BaseModel.spec.js +4 -0
  386. package/src/models/caseview/CaseViewModel.js +1 -2
  387. package/src/models/concepts/ConceptDetailModel.js +2 -2
  388. package/src/models/concepts/ConceptIndexModel.js +9 -6
  389. package/src/models/concepts/ConceptLinkModel.js +15 -12
  390. package/src/models/concepts/ConceptRelationCollection.js +17 -3
  391. package/src/models/concepts/ConceptRelationModel.js +18 -2
  392. package/src/models/concepts/SourceReferenceCollection.js +3 -8
  393. package/src/models/concepts/SourceReferenceModel.js +10 -11
  394. package/src/models/content/ContentIndexModel.js +10 -5
  395. package/src/models/content/ContentLinkModel.js +10 -13
  396. package/src/models/content/ContentModel.js +6 -1
  397. package/src/models/content/ContentTOCModel.js +19 -11
  398. package/src/models/content/SectionModel.js +9 -21
  399. package/src/models/detail/DetailModel.js +3 -4
  400. package/src/models/error/ErrorResponse.js +9 -20
  401. package/src/models/filters/AssignmentFilterModel.js +7 -3
  402. package/src/models/filters/BaseFilterModel.js +16 -7
  403. package/src/models/filters/ConceptIndexFilterModel.js +8 -2
  404. package/src/models/filters/FilterCollection.js +13 -7
  405. package/src/models/filters/StringFilterModel.js +7 -3
  406. package/src/models/form/FormModel.js +8 -2
  407. package/src/models/form/FormObjectModel.js +17 -4
  408. package/src/models/grouping/GroupingModel.js +21 -5
  409. package/src/models/href/Href.js +17 -10
  410. package/src/models/href/__tests__/Href.spec.js +5 -8
  411. package/src/models/links/LinkCollection.js +3 -3
  412. package/src/models/links/LinkModel.js +8 -15
  413. package/src/models/list/ListDetailModel.js +6 -1
  414. package/src/models/list/ListItemCollection.js +1 -2
  415. package/src/models/list/ListItemModel.js +4 -4
  416. package/src/models/list/ListModel.js +12 -8
  417. package/src/models/lookup/LookupOptionCollection.js +17 -6
  418. package/src/models/lookup/LookupOptionsModel.js +2 -0
  419. package/src/models/panels/GroupingPanelModel.js +1 -2
  420. package/src/models/tab/TabModel.js +2 -4
  421. package/src/models/taskgroup/TaskGroupModel.js +5 -6
  422. package/src/models/types.js +5 -0
  423. package/src/models/user/UserProfileModel.js +1 -0
  424. package/src/modularui/CaptchaRequest.js +7 -3
  425. package/src/modularui/ModularUIRequest.js +8 -5
  426. package/src/modularui/ModularUIResponse.js +13 -3
  427. package/src/modularui/UploadRequest.js +7 -3
  428. package/src/react-client/client.js +7 -3
  429. package/src/react-server/renderSSRComplete.js +2 -2
  430. package/src/react-server/renderSSRMinimal.js +2 -2
  431. package/src/redux/_modularui/ModularUIActions.js +8 -7
  432. package/src/redux/_modularui/ModularUIUtils.js +13 -14
  433. package/src/utils/browser/Cookies.js +3 -3
  434. package/src/utils/helpers/__tests__/createHref.spec.js +13 -8
  435. package/src/utils/helpers/createHref.js +37 -8
  436. package/src/utils/helpers/repositoryResource.js +2 -2
@@ -1,23 +1,34 @@
1
1
  // @flow
2
2
  import ResourceCollection from "../base/ResourceCollection";
3
3
  import ChoiceAttributeOptionModel from "../attributes/ChoiceAttributeOptionModel";
4
+ import { DateUtil } from "../../utils";
5
+
6
+ import type { ModelOptions } from "../types";
4
7
 
5
8
  /**
6
9
  */
7
10
  class LookupOptionCollection extends ResourceCollection<ChoiceAttributeOptionModel> {
8
11
  /**
9
12
  */
10
- static create(data: Object, contributions: Object): LookupOptionCollection {
13
+ static create(
14
+ data: Object,
15
+ contributions: Object,
16
+ modelOptions?: ModelOptions,
17
+ ): LookupOptionCollection {
11
18
  const collection = new LookupOptionCollection();
12
19
 
13
20
  if (data.options && contributions.options) {
14
21
  data.options.forEach((option) => {
15
22
  collection.add(
16
- new ChoiceAttributeOptionModel([], {
17
- ...option,
18
- optionType: this.getOptionType(option, contributions),
19
- elementsContributions: contributions.options[0].elements,
20
- }),
23
+ new ChoiceAttributeOptionModel(
24
+ [],
25
+ {
26
+ ...option,
27
+ optionType: this.getOptionType(option, contributions),
28
+ elementsContributions: contributions.options[0].elements,
29
+ },
30
+ { ...modelOptions, referenceDate: DateUtil.now() },
31
+ ),
21
32
  );
22
33
  });
23
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LookupOptionCollection.js","names":["_ResourceCollection","_interopRequireDefault","require","_ChoiceAttributeOptionModel","LookupOptionCollection","ResourceCollection","create","data","contributions","collection","options","forEach","option","add","ChoiceAttributeOptionModel","optionType","getOptionType","elementsContributions","elements","_links","download","name","_default","exports","default"],"sources":["../../../src/models/lookup/LookupOptionCollection.js"],"sourcesContent":["// @flow\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport ChoiceAttributeOptionModel from \"../attributes/ChoiceAttributeOptionModel\";\n\n/**\n */\nclass LookupOptionCollection extends ResourceCollection<ChoiceAttributeOptionModel> {\n /**\n */\n static create(data: Object, contributions: Object): LookupOptionCollection {\n const collection = new LookupOptionCollection();\n\n if (data.options && contributions.options) {\n data.options.forEach((option) => {\n collection.add(\n new ChoiceAttributeOptionModel([], {\n ...option,\n optionType: this.getOptionType(option, contributions),\n elementsContributions: contributions.options[0].elements,\n }),\n );\n });\n }\n\n return collection;\n }\n\n /**\n */\n static getOptionType(option: Object, contributions: Object): string {\n if (contributions.optionType) {\n return contributions.optionType;\n }\n if (option._links?.download?.[0].name === \"avatar\") {\n return \"user\";\n }\n return \"generic\";\n }\n}\n\nexport default LookupOptionCollection;\n"],"mappings":";;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,2BAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA,MAAME,sBAAsB,SAASC,2BAAkB,CAA6B;EAClF;AACF;EACE,OAAOC,MAAMA,CAACC,IAAY,EAAEC,aAAqB,EAA0B;IACzE,MAAMC,UAAU,GAAG,IAAIL,sBAAsB,CAAC,CAAC;IAE/C,IAAIG,IAAI,CAACG,OAAO,IAAIF,aAAa,CAACE,OAAO,EAAE;MACzCH,IAAI,CAACG,OAAO,CAACC,OAAO,CAAEC,MAAM,IAAK;QAC/BH,UAAU,CAACI,GAAG,CACZ,IAAIC,mCAA0B,CAAC,EAAE,EAAE;UACjC,GAAGF,MAAM;UACTG,UAAU,EAAE,IAAI,CAACC,aAAa,CAACJ,MAAM,EAAEJ,aAAa,CAAC;UACrDS,qBAAqB,EAAET,aAAa,CAACE,OAAO,CAAC,CAAC,CAAC,CAACQ;QAClD,CAAC,CACH,CAAC;MACH,CAAC,CAAC;IACJ;IAEA,OAAOT,UAAU;EACnB;;EAEA;AACF;EACE,OAAOO,aAAaA,CAACJ,MAAc,EAAEJ,aAAqB,EAAU;IAClE,IAAIA,aAAa,CAACO,UAAU,EAAE;MAC5B,OAAOP,aAAa,CAACO,UAAU;IACjC;IACA,IAAIH,MAAM,CAACO,MAAM,EAAEC,QAAQ,GAAG,CAAC,CAAC,CAACC,IAAI,KAAK,QAAQ,EAAE;MAClD,OAAO,MAAM;IACf;IACA,OAAO,SAAS;EAClB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcpB,sBAAsB","ignoreList":[]}
1
+ {"version":3,"file":"LookupOptionCollection.js","names":["_ResourceCollection","_interopRequireDefault","require","_ChoiceAttributeOptionModel","_utils","LookupOptionCollection","ResourceCollection","create","data","contributions","modelOptions","collection","options","forEach","option","add","ChoiceAttributeOptionModel","optionType","getOptionType","elementsContributions","elements","referenceDate","DateUtil","now","_links","download","name","_default","exports","default"],"sources":["../../../src/models/lookup/LookupOptionCollection.js"],"sourcesContent":["// @flow\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport ChoiceAttributeOptionModel from \"../attributes/ChoiceAttributeOptionModel\";\nimport { DateUtil } from \"../../utils\";\n\nimport type { ModelOptions } from \"../types\";\n\n/**\n */\nclass LookupOptionCollection extends ResourceCollection<ChoiceAttributeOptionModel> {\n /**\n */\n static create(\n data: Object,\n contributions: Object,\n modelOptions?: ModelOptions,\n ): LookupOptionCollection {\n const collection = new LookupOptionCollection();\n\n if (data.options && contributions.options) {\n data.options.forEach((option) => {\n collection.add(\n new ChoiceAttributeOptionModel(\n [],\n {\n ...option,\n optionType: this.getOptionType(option, contributions),\n elementsContributions: contributions.options[0].elements,\n },\n { ...modelOptions, referenceDate: DateUtil.now() },\n ),\n );\n });\n }\n\n return collection;\n }\n\n /**\n */\n static getOptionType(option: Object, contributions: Object): string {\n if (contributions.optionType) {\n return contributions.optionType;\n }\n if (option._links?.download?.[0].name === \"avatar\") {\n return \"user\";\n }\n return \"generic\";\n }\n}\n\nexport default LookupOptionCollection;\n"],"mappings":";;;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,2BAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAIA;AACA;AACA,MAAMG,sBAAsB,SAASC,2BAAkB,CAA6B;EAClF;AACF;EACE,OAAOC,MAAMA,CACXC,IAAY,EACZC,aAAqB,EACrBC,YAA2B,EACH;IACxB,MAAMC,UAAU,GAAG,IAAIN,sBAAsB,CAAC,CAAC;IAE/C,IAAIG,IAAI,CAACI,OAAO,IAAIH,aAAa,CAACG,OAAO,EAAE;MACzCJ,IAAI,CAACI,OAAO,CAACC,OAAO,CAAEC,MAAM,IAAK;QAC/BH,UAAU,CAACI,GAAG,CACZ,IAAIC,mCAA0B,CAC5B,EAAE,EACF;UACE,GAAGF,MAAM;UACTG,UAAU,EAAE,IAAI,CAACC,aAAa,CAACJ,MAAM,EAAEL,aAAa,CAAC;UACrDU,qBAAqB,EAAEV,aAAa,CAACG,OAAO,CAAC,CAAC,CAAC,CAACQ;QAClD,CAAC,EACD;UAAE,GAAGV,YAAY;UAAEW,aAAa,EAAEC,eAAQ,CAACC,GAAG,CAAC;QAAE,CACnD,CACF,CAAC;MACH,CAAC,CAAC;IACJ;IAEA,OAAOZ,UAAU;EACnB;;EAEA;AACF;EACE,OAAOO,aAAaA,CAACJ,MAAc,EAAEL,aAAqB,EAAU;IAClE,IAAIA,aAAa,CAACQ,UAAU,EAAE;MAC5B,OAAOR,aAAa,CAACQ,UAAU;IACjC;IACA,IAAIH,MAAM,CAACU,MAAM,EAAEC,QAAQ,GAAG,CAAC,CAAC,CAACC,IAAI,KAAK,QAAQ,EAAE;MAClD,OAAO,MAAM;IACf;IACA,OAAO,SAAS;EAClB;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcxB,sBAAsB","ignoreList":[]}
@@ -19,7 +19,7 @@ class LookupOptionsModel extends _ResourceModel.default {
19
19
  super(modularuiResponse);
20
20
  (0, _defineProperty2.default)(this, "_options", void 0);
21
21
  (0, _defineProperty2.default)(this, "_filterCollection", void 0);
22
- this._options = _LookupOptionCollection.default.create(this.data, this.contributions);
22
+ this._options = _LookupOptionCollection.default.create(this.data, this.contributions, this.modelOptions);
23
23
  this._filterCollection = this.createFilterCollection((0, _filter.default)(this.data), (0, _filter.default)(this.contributions));
24
24
  }
25
25
 
@@ -55,7 +55,7 @@ class LookupOptionsModel extends _ResourceModel.default {
55
55
  [data.name]: data
56
56
  }, {
57
57
  filter: contributions
58
- });
58
+ }, this.modelOptions);
59
59
  }
60
60
  return new _FilterCollection.default();
61
61
  }
@@ -19,6 +19,7 @@ export default class LookupOptionsModel extends ResourceModel {
19
19
  this._options = LookupOptionCollection.create(
20
20
  this.data,
21
21
  this.contributions,
22
+ this.modelOptions,
22
23
  );
23
24
 
24
25
  this._filterCollection = this.createFilterCollection(
@@ -64,6 +65,7 @@ export default class LookupOptionsModel extends ResourceModel {
64
65
  return new FilterCollection(
65
66
  { [data.name]: data },
66
67
  { filter: contributions },
68
+ this.modelOptions,
67
69
  );
68
70
  }
69
71
 
@@ -1 +1 @@
1
- {"version":3,"file":"LookupOptionsModel.js","names":["_ResourceModel","_interopRequireDefault","require","_LookupOptionCollection","_FilterCollection","LookupOptionsModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","_options","LookupOptionCollection","create","data","contributions","_filterCollection","createFilterCollection","_filter","type","modelName","isApplicableModel","resourcetype","options","FilterCollection","name","filter","filterCollection","exports"],"sources":["../../../src/models/lookup/LookupOptionsModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LookupOptionCollection from \"../lookup/LookupOptionCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n */\nexport default class LookupOptionsModel extends ResourceModel {\n _options: LookupOptionCollection;\n _filterCollection: ?FilterCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._options = LookupOptionCollection.create(\n this.data,\n this.contributions,\n );\n\n this._filterCollection = this.createFilterCollection(\n this.data.filter,\n this.contributions.filter,\n );\n }\n\n /**\n */\n get type(): string {\n return \"LookupOptions\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"LookupOptionsModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"lookupOptions\"\n );\n }\n\n /**\n */\n get options(): LookupOptionCollection {\n return this._options;\n }\n\n /**\n */\n createFilterCollection(\n data: Object,\n contributions: Object,\n ): FilterCollection {\n if (data && contributions) {\n return new FilterCollection(\n { [data.name]: data },\n { filter: contributions },\n );\n }\n\n return new FilterCollection();\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): ?FilterCollection {\n return this._filterCollection;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBA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F;AAACY,OAAA,CAAAlB,OAAA,GAAAL,kBAAA","ignoreList":[]}
1
+ {"version":3,"file":"LookupOptionsModel.js","names":["_ResourceModel","_interopRequireDefault","require","_LookupOptionCollection","_FilterCollection","LookupOptionsModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","_options","LookupOptionCollection","create","data","contributions","modelOptions","_filterCollection","createFilterCollection","_filter","type","modelName","isApplicableModel","resourcetype","options","FilterCollection","name","filter","filterCollection","exports"],"sources":["../../../src/models/lookup/LookupOptionsModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LookupOptionCollection from \"../lookup/LookupOptionCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n */\nexport default class LookupOptionsModel extends ResourceModel {\n _options: LookupOptionCollection;\n _filterCollection: ?FilterCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._options = LookupOptionCollection.create(\n this.data,\n this.contributions,\n this.modelOptions,\n );\n\n this._filterCollection = this.createFilterCollection(\n this.data.filter,\n this.contributions.filter,\n );\n }\n\n /**\n */\n get type(): string {\n return \"LookupOptions\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"LookupOptionsModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"lookupOptions\"\n );\n }\n\n /**\n */\n get options(): LookupOptionCollection {\n return this._options;\n }\n\n /**\n */\n createFilterCollection(\n data: Object,\n contributions: Object,\n ): FilterCollection {\n if (data && contributions) {\n return new FilterCollection(\n { [data.name]: data },\n { filter: contributions },\n this.modelOptions,\n );\n }\n\n return new FilterCollection();\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): ?FilterCollection {\n return this._filterCollection;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA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IS,yBAAgB,CAAC,CAAC;EAC/B;;EAEA;AACF;AACA;EACE,IAAIG,gBAAgBA,CAAA,EAAsB;IACxC,OAAO,IAAI,CAACX,iBAAiB;EAC/B;AACF;AAACY,OAAA,CAAAnB,OAAA,GAAAL,kBAAA","ignoreList":[]}
@@ -107,7 +107,7 @@ class GroupingPanelModel extends _ResourceModel.default {
107
107
  const allTaskgroupsContributions = this.getContribution("taskgroups", []);
108
108
  this.taskGroupCollection = (0, _map.default)(_context2 = (0, _filter.default)(allTaskgroupsData).call(allTaskgroupsData, taskgroup => allTaskgroupsContributions.some(taskgroupContribution => taskgroupContribution.name === taskgroup.name))).call(_context2, taskgroup => {
109
109
  const taskgroupContributions = (0, _find.default)(allTaskgroupsContributions).call(allTaskgroupsContributions, taskgroupContribution => taskgroupContribution.name === taskgroup.name);
110
- return _TaskGroupModel.default.create(taskgroup.name, taskgroup, taskgroupContributions, this.origin, this.contextPath);
110
+ return _TaskGroupModel.default.create(taskgroup.name, taskgroup, taskgroupContributions, this.modelOptions);
111
111
  });
112
112
  }
113
113
 
@@ -129,8 +129,7 @@ export default class GroupingPanelModel extends ResourceModel {
129
129
  taskgroup.name,
130
130
  taskgroup,
131
131
  taskgroupContributions,
132
- this.origin,
133
- this.contextPath,
132
+ this.modelOptions,
134
133
  );
135
134
  });
136
135
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingPanelModel.js","names":["_ResourceModel","_interopRequireDefault","require","_TaskGroupCollection","_TaskGroupModel","GroupingPanelModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","createTaskGroupCollection","type","modelName","isApplicableModel","data","_context","contributions","resourcetype","_includes","call","label","getInitialChildModelLinks","links","getLinksByGroup","all","panelLinks","setChildModels","models","taskGroups","i","length","TaskGroupModel","push","taskGroupCollection","add","hasIntroText","introtext","_content","text","message","Array","isArray","texts","_context2","allTaskgroupsData","getData","allTaskgroupsContributions","getContribution","_map","_filter","taskgroup","some","taskgroupContribution","name","taskgroupContributions","_find","create","origin","contextPath","taskgroups","_taskGroupCollection","TaskGroupCollection","hasTaskGroups","hasItems","hasTasks","exports"],"sources":["../../../src/models/panels/GroupingPanelModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\n\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Panel that groups other panels\n */\nexport default class GroupingPanelModel extends ResourceModel {\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n * Constructs GroupingPanel\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n }\n\n /**\n */\n get type(): string {\n return \"GroupingPanel\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"GroupingPanelModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n [\"GroupingPanel\", \"CaseTabGroupingPanel\", \"TabGroupingPanel\"].includes(\n data.contributions.resourcetype,\n )\n );\n }\n\n /**\n * Getting the label of the panel\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\").all;\n }\n\n /**\n */\n get panelLinks(): LinkCollection {\n return this.links.getLinksByGroup(\"panel\");\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n * Check if an introtext exists for this caseview\n */\n hasIntroText(): boolean {\n return this.introtext !== \"\";\n }\n\n /**\n * Getting the introduction text configured on the grouping panel\n */\n get introtext(): string {\n if (this.data._content) {\n return this.data._content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n */\n createTaskGroupCollection() {\n const allTaskgroupsData = this.getData(\"taskgroups\", []);\n const allTaskgroupsContributions = this.getContribution(\"taskgroups\", []);\n\n this.taskGroupCollection = allTaskgroupsData\n .filter((taskgroup) =>\n allTaskgroupsContributions.some(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n ),\n )\n .map((taskgroup) => {\n const taskgroupContributions = allTaskgroupsContributions.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n );\n\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions,\n this.origin,\n this.contextPath,\n );\n });\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection.hasItems;\n }\n\n /**\n * Has tasks\n */\n hasTasks(): boolean {\n return this.taskGroupCollection.hasTasks();\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AAOA;AACA;AACA;AACe,MAAMG,kBAAkB,SAASC,sBAAa,CAAC;EAG5D;AACF;AACA;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC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ACG,IAC7C,CAAC;MAED,OAAOtB,uBAAc,CAACyB,MAAM,CAC1BN,SAAS,CAACG,IAAI,EACdH,SAAS,EACTI,sBAAsB,EACtB,IAAI,CAACG,MAAM,EACX,IAAI,CAACC,WACP,CAAC;IACH,CAAC,CAAC;EACN;;EAEA;AACF;AACA;EACE,IAAIzB,mBAAmBA,CAAC0B,UAAiC,EAAE;IACzD,IAAI,CAACC,oBAAoB,GAAG,IAAIC,4BAAmB,CAACF,UAAU,CAAC;EACjE;;EAEA;AACF;AACA;EACE,IAAI1B,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAAC2B,oBAAoB;EAClC;;EAEA;AACF;AACA;EACEE,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAAC7B,mBAAmB,IAAI,IAAI,CAACA,mBAAmB,CAAC8B,QAAQ;EACtE;;EAEA;AACF;AACA;EACEC,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI,CAAC/B,mBAAmB,CAAC+B,QAAQ,CAAC,CAAC;EAC5C;AACF;AAACC,OAAA,CAAAxD,OAAA,GAAAL,kBAAA","ignoreList":[]}
1
+ {"version":3,"file":"GroupingPanelModel.js","names":["_ResourceModel","_interopRequireDefault","require","_TaskGroupCollection","_TaskGroupModel","GroupingPanelModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","createTaskGroupCollection","type","modelName","isApplicableModel","data","_context","contributions","resourcetype","_includes","call","label","getInitialChildModelLinks","links","getLinksByGroup","all","panelLinks","setChildModels","models","taskGroups","i","length","TaskGroupModel","push","taskGroupCollection","add","hasIntroText","introtext","_content","text","message","Array","isArray","texts","_context2","allTaskgroupsData","getData","allTaskgroupsContributions","getContribution","_map","_filter","taskgroup","some","taskgroupContribution","name","taskgroupContributions","_find","create","modelOptions","taskgroups","_taskGroupCollection","TaskGroupCollection","hasTaskGroups","hasItems","hasTasks","exports"],"sources":["../../../src/models/panels/GroupingPanelModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\n\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Panel that groups other panels\n */\nexport default class GroupingPanelModel extends ResourceModel {\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n * Constructs GroupingPanel\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n }\n\n /**\n */\n get type(): string {\n return \"GroupingPanel\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"GroupingPanelModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n [\"GroupingPanel\", \"CaseTabGroupingPanel\", \"TabGroupingPanel\"].includes(\n data.contributions.resourcetype,\n )\n );\n }\n\n /**\n * Getting the label of the panel\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\").all;\n }\n\n /**\n */\n get panelLinks(): LinkCollection {\n return this.links.getLinksByGroup(\"panel\");\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n * Check if an introtext exists for this caseview\n */\n hasIntroText(): boolean {\n return this.introtext !== \"\";\n }\n\n /**\n * Getting the introduction text configured on the grouping panel\n */\n get introtext(): string {\n if (this.data._content) {\n return this.data._content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n */\n createTaskGroupCollection() {\n const allTaskgroupsData = this.getData(\"taskgroups\", []);\n const allTaskgroupsContributions = this.getContribution(\"taskgroups\", []);\n\n this.taskGroupCollection = allTaskgroupsData\n .filter((taskgroup) =>\n allTaskgroupsContributions.some(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n ),\n )\n .map((taskgroup) => {\n const taskgroupContributions = allTaskgroupsContributions.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n );\n\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions,\n this.modelOptions,\n );\n });\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection.hasItems;\n }\n\n /**\n * Has tasks\n */\n hasTasks(): boolean {\n return this.taskGroupCollection.hasTasks();\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AAOA;AACA;AACA;AACe,MAAMG,kBAAkB,SAASC,sBAAa,CAAC;EAG5D;AACF;AACA;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,yBAAyB,CAAC,CAAC;EAClC;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,eAAe;EACxB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OA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C;EACN;;EAEA;AACF;AACA;EACE,IAAIxB,mBAAmBA,CAACyB,UAAiC,EAAE;IACzD,IAAI,CAACC,oBAAoB,GAAG,IAAIC,4BAAmB,CAACF,UAAU,CAAC;EACjE;;EAEA;AACF;AACA;EACE,IAAIzB,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAAC0B,oBAAoB;EAClC;;EAEA;AACF;AACA;EACEE,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAAC5B,mBAAmB,IAAI,IAAI,CAACA,mBAAmB,CAAC6B,QAAQ;EACtE;;EAEA;AACF;AACA;EACEC,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI,CAAC9B,mBAAmB,CAAC8B,QAAQ,CAAC,CAAC;EAC5C;AACF;AAACC,OAAA,CAAAvD,OAAA,GAAAL,kBAAA","ignoreList":[]}
@@ -25,7 +25,7 @@ class TabModel extends _ResourceModel.default {
25
25
  (0, _defineProperty2.default)(this, "_actionCollection", void 0);
26
26
  (0, _defineProperty2.default)(this, "_taskGroupCollection", void 0);
27
27
  this.createTaskGroupCollection();
28
- this._actionCollection = new _ActionCollection.default(this.data.actions, this.contributions.actions, this.origin, this.contextPath);
28
+ this._actionCollection = new _ActionCollection.default(this.data.actions, this.contributions.actions, this.modelOptions);
29
29
  }
30
30
 
31
31
  /**
@@ -79,7 +79,7 @@ class TabModel extends _ResourceModel.default {
79
79
  var _context5;
80
80
  const taskgroupContributions = (0, _find.default)(_context5 = this.contributions.taskgroups).call(_context5, taskgroupContribution => taskgroupContribution.name === taskgroup.name);
81
81
  if (taskgroupContributions) {
82
- return _TaskGroupModel.default.create(taskgroup.name, taskgroup, taskgroupContributions, this.origin, this.contextPath);
82
+ return _TaskGroupModel.default.create(taskgroup.name, taskgroup, taskgroupContributions, this.modelOptions);
83
83
  }
84
84
  return null;
85
85
  })).call(_context3, taskgroup => taskgroup != null) : [];
@@ -26,8 +26,7 @@ export default class TabModel extends ResourceModel {
26
26
  this._actionCollection = new ActionCollection(
27
27
  this.data.actions,
28
28
  this.contributions.actions,
29
- this.origin,
30
- this.contextPath,
29
+ this.modelOptions,
31
30
  );
32
31
  }
33
32
 
@@ -95,8 +94,7 @@ export default class TabModel extends ResourceModel {
95
94
  taskgroup.name,
96
95
  taskgroup,
97
96
  taskgroupContributions,
98
- this.origin,
99
- this.contextPath,
97
+ this.modelOptions,
100
98
  );
101
99
  }
102
100
 
@@ -1 +1 @@
1
- {"version":3,"file":"TabModel.js","names":["_TaskGroupCollection","_interopRequireDefault","require","_ResourceModel","_TaskGroupModel","_ActionCollection","TabModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","createTaskGroupCollection","_actionCollection","ActionCollection","data","actions","contributions","origin","contextPath","type","modelName","isApplicableModel","_context","_context2","resourcetype","_endsWith","call","getInitialChildModelLinks","links","getLinksByGroup","all","setChildModels","models","taskGroups","i","length","TaskGroupModel","push","taskGroupCollection","add","searchLink","first","_context3","_context4","taskgroups","_filter","_map","taskgroup","_context5","taskgroupContributions","_find","taskgroupContribution","name","create","_taskGroupCollection","TaskGroupCollection","label","getContribution","components","actionCollection","hasComponents","size","hasTaskGroups","hasItems","hasActions","exports"],"sources":["../../../src/models/tab/TabModel.js"],"sourcesContent":["// @flow\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Describes a TabModel\n */\nexport default class TabModel extends ResourceModel {\n _actionCollection: ActionCollection;\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n this.origin,\n this.contextPath,\n );\n }\n\n /**\n */\n get type(): string {\n return \"Tab\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TabModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n (data.contributions.resourcetype.endsWith(\"Tab\") ||\n data.contributions.resourcetype.endsWith(\"KnowledgeBank\"))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\", \"actions\").all;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n */\n get searchLink(): ?LinkModel {\n return this.links.getLinksByGroup(\"search\").first;\n }\n\n /**\n */\n createTaskGroupCollection() {\n this.taskGroupCollection = this.data.taskgroups\n ? this.data.taskgroups\n .map((taskgroup) => {\n const taskgroupContributions = this.contributions.taskgroups.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n );\n\n if (taskgroupContributions) {\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions,\n this.origin,\n this.contextPath,\n );\n }\n\n return null;\n })\n .filter((taskgroup) => taskgroup != null)\n : [];\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the label of the tab\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the component links on the tab\n */\n get components(): LinkCollection {\n return this.links.getLinksByGroup(\"component\", \"search\");\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Has component links\n */\n hasComponents(): boolean {\n return this.components.size > 0;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection?.hasItems;\n }\n\n /**\n */\n hasActions(): boolean {\n return this.actionCollection && this.actionCollection.hasItems;\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAOA;AACA;AACA;AACe,MAAMI,QAAQ,SAASC,sBAAa,CAAC;EAIlD;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,yBAAyB,CAAC,CAAC;IAEhC,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAACC,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,EAC1B,IAAI,CAACE,MAAM,EACX,IAAI,CAACC,WACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,KAAK;EACd;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,UAAU;EACnB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACP,IAAuB,EAAW;IAAA,IAAAQ,QAAA,EAAAC,SAAA;IACzD,OACET,IAAI,CAACE,aAAa,CAACQ,YAAY,KAC9B,IAAAC,SAAA,CAAAf,OAAA,EAAAY,QAAA,GAAAR,IAAI,CAACE,aAAa,CAACQ,YAAY,EAAAE,IAAA,CAAAJ,QAAA,EAAU,KAAK,C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AACL,gBAAgB,IAAI,IAAI,CAACA,gBAAgB,CAACI,QAAQ;EAChE;AACF;AAACE,OAAA,CAAAvD,OAAA,GAAAL,QAAA","ignoreList":[]}
1
+ {"version":3,"file":"TabModel.js","names":["_TaskGroupCollection","_interopRequireDefault","require","_ResourceModel","_TaskGroupModel","_ActionCollection","TabModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","createTaskGroupCollection","_actionCollection","ActionCollection","data","actions","contributions","modelOptions","type","modelName","isApplicableModel","_context","_context2","resourcetype","_endsWith","call","getInitialChildModelLinks","links","getLinksByGroup","all","setChildModels","models","taskGroups","i","length","TaskGroupModel","push","taskGroupCollection","add","searchLink","first","_context3","_context4","taskgroups","_filter","_map","taskgroup","_context5","taskgroupContributions","_find","taskgroupContribution","name","create","_taskGroupCollection","TaskGroupCollection","label","getContribution","components","actionCollection","hasComponents","size","hasTaskGroups","hasItems","hasActions","exports"],"sources":["../../../src/models/tab/TabModel.js"],"sourcesContent":["// @flow\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Describes a TabModel\n */\nexport default class TabModel extends ResourceModel {\n _actionCollection: ActionCollection;\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n this.modelOptions,\n );\n }\n\n /**\n */\n get type(): string {\n return \"Tab\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TabModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n (data.contributions.resourcetype.endsWith(\"Tab\") ||\n data.contributions.resourcetype.endsWith(\"KnowledgeBank\"))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\", \"actions\").all;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n */\n get searchLink(): ?LinkModel {\n return this.links.getLinksByGroup(\"search\").first;\n }\n\n /**\n */\n createTaskGroupCollection() {\n this.taskGroupCollection = this.data.taskgroups\n ? this.data.taskgroups\n .map((taskgroup) => {\n const taskgroupContributions = this.contributions.taskgroups.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n );\n\n if (taskgroupContributions) {\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions,\n this.modelOptions,\n );\n }\n\n return null;\n })\n .filter((taskgroup) => taskgroup != null)\n : [];\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the label of the tab\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the component links on the tab\n */\n get components(): LinkCollection {\n return this.links.getLinksByGroup(\"component\", \"search\");\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Has component links\n */\n hasComponents(): boolean {\n return this.components.size > 0;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection?.hasItems;\n }\n\n /**\n */\n hasActions(): bo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AsB,EACtB,IAAI,CAAC/B,YACP,CAAC;MACH;MAEA,OAAO,IAAI;IACb,CAAC,CAAC,EAAAQ,IAAA,CAAAgB,SAAA,EACOK,SAAS,IAAKA,SAAS,IAAI,IAAI,CAAC,GAC3C,EAAE;EACR;;EAEA;AACF;AACA;EACE,IAAIT,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAACgB,oBAAoB;EAClC;;EAEA;AACF;AACA;EACE,IAAIhB,mBAAmBA,CAACM,UAAiC,EAAE;IACzD,IAAI,CAACU,oBAAoB,GAAG,IAAIC,4BAAmB,CAACX,UAAU,CAAC;EACjE;;EAEA;AACF;AACA;EACE,IAAIY,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIC,UAAUA,CAAA,EAAmB;IAC/B,OAAO,IAAI,CAAC9B,KAAK,CAACC,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC;EAC1D;;EAEA;AACF;EACE,IAAI8B,gBAAgBA,CAAA,EAAqB;IACvC,OAAO,IAAI,CAAC9C,iBAAiB;EAC/B;;EAEA;AACF;AACA;EACE+C,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACF,UAAU,CAACG,IAAI,GAAG,CAAC;EACjC;;EAEA;AACF;AACA;EACEC,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACxB,mBAAmB,IAAI,IAAI,CAACA,mBAAmB,EAAEyB,QAAQ;EACvE;;EAEA;AACF;EACEC,UAAUA,CAAA,EAAY;IACpB,OAAO,IAAI,CAACL,gBAAgB,IAAI,IAAI,CAACA,gBAAgB,CAACI,QAAQ;EAChE;AACF;AAACE,OAAA,CAAAtD,OAAA,GAAAL,QAAA","ignoreList":[]}
@@ -19,20 +19,20 @@ class TaskGroupModel extends _ResourceModel.default {
19
19
  super(modularuiResponse);
20
20
  (0, _defineProperty2.default)(this, "_key", void 0);
21
21
  (0, _defineProperty2.default)(this, "_actionCollection", void 0);
22
- this._actionCollection = new _ActionCollection.default(this.data.actions, this.contributions.actions, this.origin, this.contextPath);
22
+ this._actionCollection = new _ActionCollection.default(this.data.actions, this.contributions.actions, this.modelOptions);
23
23
  const selfHref = this.links.getLinkByKey("self") ? this.selflink.href.href : null;
24
24
  this._key = selfHref ? selfHref.substring(selfHref.lastIndexOf("/") + 1) : this.data.name;
25
25
  }
26
26
 
27
27
  /**
28
28
  */
29
- static create(key, data, contributions, origin, contextPath) {
29
+ static create(key, data, contributions, modelOptions) {
30
30
  const taskgroup = new _ModularUIResponse.default();
31
31
  taskgroup.key = key;
32
32
  taskgroup.data = data;
33
33
  taskgroup.contributions = contributions;
34
- taskgroup.origin = origin;
35
- taskgroup.contextPath = contextPath;
34
+ taskgroup.origin = modelOptions?.origin;
35
+ taskgroup.contextPath = modelOptions?.contextPath;
36
36
  return new TaskGroupModel(taskgroup);
37
37
  }
38
38
 
@@ -3,6 +3,7 @@ import ActionCollection from "../actions/ActionCollection";
3
3
  import ResourceModel from "../base/ResourceModel";
4
4
 
5
5
  import ModularUIResponse from "../../modularui/ModularUIResponse";
6
+ import type { ModelOptions } from "../types";
6
7
 
7
8
  /**
8
9
  * TaskGroupModel
@@ -19,8 +20,7 @@ export default class TaskGroupModel extends ResourceModel {
19
20
  this._actionCollection = new ActionCollection(
20
21
  this.data.actions,
21
22
  this.contributions.actions,
22
- this.origin,
23
- this.contextPath,
23
+ this.modelOptions,
24
24
  );
25
25
 
26
26
  const selfHref = this.links.getLinkByKey("self")
@@ -38,15 +38,14 @@ export default class TaskGroupModel extends ResourceModel {
38
38
  key: string,
39
39
  data: Object,
40
40
  contributions: Object,
41
- origin?: string,
42
- contextPath?: string,
41
+ modelOptions?: ModelOptions,
43
42
  ): TaskGroupModel {
44
43
  const taskgroup = new ModularUIResponse();
45
44
  taskgroup.key = key;
46
45
  taskgroup.data = data;
47
46
  taskgroup.contributions = contributions;
48
- taskgroup.origin = origin;
49
- taskgroup.contextPath = contextPath;
47
+ taskgroup.origin = modelOptions?.origin;
48
+ taskgroup.contextPath = modelOptions?.contextPath;
50
49
 
51
50
  return new TaskGroupModel(taskgroup);
52
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TaskGroupModel.js","names":["_ActionCollection","_interopRequireDefault","require","_ResourceModel","_ModularUIResponse","TaskGroupModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","_actionCollection","ActionCollection","data","actions","contributions","origin","contextPath","selfHref","links","getLinkByKey","selflink","href","_key","substring","lastIndexOf","name","create","key","taskgroup","ModularUIResponse","type","modelName","isApplicableModel","resourcetype","label","actionCollection","hasTasks","length","exports"],"sources":["../../../src/models/taskgroup/TaskGroupModel.js"],"sourcesContent":["// @flow\nimport ActionCollection from \"../actions/ActionCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\n/**\n * TaskGroupModel\n */\nexport default class TaskGroupModel extends ResourceModel {\n _key: string;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n this.origin,\n this.contextPath,\n );\n\n const selfHref = this.links.getLinkByKey(\"self\")\n ? this.selflink.href.href\n : null;\n\n this._key = selfHref\n ? selfHref.substring(selfHref.lastIndexOf(\"/\") + 1)\n : this.data.name;\n }\n\n /**\n */\n static create(\n key: string,\n data: Object,\n contributions: Object,\n origin?: string,\n contextPath?: string,\n ): TaskGroupModel {\n const taskgroup = new ModularUIResponse();\n taskgroup.key = key;\n taskgroup.data = data;\n taskgroup.contributions = contributions;\n taskgroup.origin = origin;\n taskgroup.contextPath = contextPath;\n\n return new TaskGroupModel(taskgroup);\n }\n\n /**\n */\n get type(): string {\n return \"TaskGroup\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TaskGroupModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"TaskGroup\"\n );\n }\n\n /**\n * Get the key of the TaskGroup\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get the label of the TaskGroup\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Retrieve actions of taskgroup\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Indicates if taskgroup has tasks\n * @returns {boolean}\n */\n hasTasks(): boolean {\n return this.actionCollection.length > 0;\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACe,MAAMG,cAAc,SAASC,sBAAa,CAAC;EAIxD;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAACC,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,EAC1B,IAAI,CAACE,MAAM,EACX,IAAI,CAACC,WACP,CAAC;IAED,MAAMC,QAAQ,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,MAAM,CAAC,GAC5C,IAAI,CAACC,QAAQ,CAACC,IAAI,CAACA,IAAI,GACvB,IAAI;IAER,IAAI,CAACC,IAAI,GAAGL,QAAQ,GAChBA,QAAQ,CAACM,SAAS,CAACN,QAAQ,CAACO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GACjD,IAAI,CAACZ,IAAI,CAACa,IAAI;EACpB;;EAEA;AACF;EACE,OAAOC,MAAMA,CACXC,GAAW,EACXf,IAAY,EACZE,aAAqB,EACrBC,MAAe,EACfC,WAAoB,EACJ;IAChB,MAAMY,SAAS,GAAG,IAAIC,0BAAiB,CAAC,CAAC;IACzCD,SAAS,CAACD,GAAG,GAAGA,GAAG;IACnBC,SAAS,CAAChB,IAAI,GAAGA,IAAI;IACrBgB,SAAS,CAACd,aAAa,GAAGA,aAAa;IACvCc,SAAS,CAACb,MAAM,GAAGA,MAAM;IACzBa,SAAS,CAACZ,WAAW,GAAGA,WAAW;IAEnC,OAAO,IAAIZ,cAAc,CAACwB,SAAS,CAAC;EACtC;;EAEA;AACF;EACE,IAAIE,IAAIA,CAAA,EAAW;IACjB,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,gBAAgB;EACzB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACpB,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACE,aAAa,CAACmB,YAAY,IAC/BrB,IAAI,CAACE,aAAa,CAACmB,YAAY,KAAK,WAAW;EAEnD;;EAEA;AACF;AACA;EACE,IAAIN,GAAGA,CAAA,EAAW;IAChB,OAAO,IAAI,CAACL,IAAI;EAClB;;EAEA;AACF;AACA;EACE,IAAIY,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACpB,aAAa,CAACoB,KAAK;EACjC;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgBA,CAAA,EAAqB;IACvC,OAAO,IAAI,CAACzB,iBAAiB;EAC/B;;EAEA;AACF;AACA;AACA;EACE0B,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACD,gBAAgB,CAACE,MAAM,GAAG,CAAC;EACzC;AACF;AAACC,OAAA,CAAA7B,OAAA,GAAAL,cAAA","ignoreList":[]}
1
+ {"version":3,"file":"TaskGroupModel.js","names":["_ActionCollection","_interopRequireDefault","require","_ResourceModel","_ModularUIResponse","TaskGroupModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","_actionCollection","ActionCollection","data","actions","contributions","modelOptions","selfHref","links","getLinkByKey","selflink","href","_key","substring","lastIndexOf","name","create","key","taskgroup","ModularUIResponse","origin","contextPath","type","modelName","isApplicableModel","resourcetype","label","actionCollection","hasTasks","length","exports"],"sources":["../../../src/models/taskgroup/TaskGroupModel.js"],"sourcesContent":["// @flow\nimport ActionCollection from \"../actions/ActionCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\nimport type { ModelOptions } from \"../types\";\n\n/**\n * TaskGroupModel\n */\nexport default class TaskGroupModel extends ResourceModel {\n _key: string;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n this.modelOptions,\n );\n\n const selfHref = this.links.getLinkByKey(\"self\")\n ? this.selflink.href.href\n : null;\n\n this._key = selfHref\n ? selfHref.substring(selfHref.lastIndexOf(\"/\") + 1)\n : this.data.name;\n }\n\n /**\n */\n static create(\n key: string,\n data: Object,\n contributions: Object,\n modelOptions?: ModelOptions,\n ): TaskGroupModel {\n const taskgroup = new ModularUIResponse();\n taskgroup.key = key;\n taskgroup.data = data;\n taskgroup.contributions = contributions;\n taskgroup.origin = modelOptions?.origin;\n taskgroup.contextPath = modelOptions?.contextPath;\n\n return new TaskGroupModel(taskgroup);\n }\n\n /**\n */\n get type(): string {\n return \"TaskGroup\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TaskGroupModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"TaskGroup\"\n );\n }\n\n /**\n * Get the key of the TaskGroup\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get the label of the TaskGroup\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Retrieve actions of taskgroup\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Indicates if taskgroup has tasks\n * @returns {boolean}\n */\n hasTasks(): boolean {\n return this.actionCollection.length > 0;\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAGA;AACA;AACA;AACe,MAAMG,cAAc,SAASC,sBAAa,CAAC;EAIxD;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAACC,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,EAC1B,IAAI,CAACE,YACP,CAAC;IAED,MAAMC,QAAQ,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,MAAM,CAAC,GAC5C,IAAI,CAACC,QAAQ,CAACC,IAAI,CAACA,IAAI,GACvB,IAAI;IAER,IAAI,CAACC,IAAI,GAAGL,QAAQ,GAChBA,QAAQ,CAACM,SAAS,CAACN,QAAQ,CAACO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GACjD,IAAI,CAACX,IAAI,CAACY,IAAI;EACpB;;EAEA;AACF;EACE,OAAOC,MAAMA,CACXC,GAAW,EACXd,IAAY,EACZE,aAAqB,EACrBC,YAA2B,EACX;IAChB,MAAMY,SAAS,GAAG,IAAIC,0BAAiB,CAAC,CAAC;IACzCD,SAAS,CAACD,GAAG,GAAGA,GAAG;IACnBC,SAAS,CAACf,IAAI,GAAGA,IAAI;IACrBe,SAAS,CAACb,aAAa,GAAGA,aAAa;IACvCa,SAAS,CAACE,MAAM,GAAGd,YAAY,EAAEc,MAAM;IACvCF,SAAS,CAACG,WAAW,GAAGf,YAAY,EAAEe,WAAW;IAEjD,OAAO,IAAI1B,cAAc,CAACuB,SAAS,CAAC;EACtC;;EAEA;AACF;EACE,IAAII,IAAIA,CAAA,EAAW;IACjB,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,gBAAgB;EACzB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACrB,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACE,aAAa,CAACoB,YAAY,IAC/BtB,IAAI,CAACE,aAAa,CAACoB,YAAY,KAAK,WAAW;EAEnD;;EAEA;AACF;AACA;EACE,IAAIR,GAAGA,CAAA,EAAW;IAChB,OAAO,IAAI,CAACL,IAAI;EAClB;;EAEA;AACF;AACA;EACE,IAAIc,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACrB,aAAa,CAACqB,KAAK;EACjC;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgBA,CAAA,EAAqB;IACvC,OAAO,IAAI,CAAC1B,iBAAiB;EAC/B;;EAEA;AACF;AACA;AACA;EACE2B,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACD,gBAAgB,CAACE,MAAM,GAAG,CAAC;EACzC;AACF;AAACC,OAAA,CAAA9B,OAAA,GAAAL,cAAA","ignoreList":[]}
@@ -261,3 +261,8 @@ export type ContentData = {
261
261
  label?: string,
262
262
  elements: Array<PropertyElement | TextFragmentElement | ContentElement>,
263
263
  };
264
+
265
+ export type ModelOptions = {
266
+ origin?: ?string,
267
+ contextPath?: ?string,
268
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\nimport type ErrorResponse from \"./error/ErrorResponse\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(\n models: Array<ModularUIModel>,\n errors: Array<ErrorResponse>,\n ): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped,\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\nimport type ErrorResponse from \"./error/ErrorResponse\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(\n models: Array<ModularUIModel>,\n errors: Array<ErrorResponse>,\n ): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped,\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n\nexport type ModelOptions = {\n origin?: ?string,\n contextPath?: ?string,\n};\n"],"mappings":"","ignoreList":[]}
@@ -26,7 +26,10 @@ class UserProfileModel extends _UserModel.default {
26
26
  const [key] = (0, _keys.default)(contribution);
27
27
  return key !== "sessiondata" && (0, _objects.has)(this.data, key);
28
28
  }) : [];
29
- this._attributeCollection = new _AttributeCollection.default(this.data, attributeContributions);
29
+ this._attributeCollection = new _AttributeCollection.default(this.data, attributeContributions, {
30
+ ...this.modelOptions,
31
+ isReadonly: true
32
+ });
30
33
  }
31
34
 
32
35
  /**
@@ -29,6 +29,7 @@ export default class UserProfileModel extends UserModel {
29
29
  this._attributeCollection = new AttributeCollection(
30
30
  this.data,
31
31
  attributeContributions,
32
+ { ...this.modelOptions, isReadonly: true },
32
33
  );
33
34
  }
34
35
 
@@ -1 +1 @@
1
- {"version":3,"file":"UserProfileModel.js","names":["_objects","require","_AttributeCollection","_interopRequireDefault","_UserModel","UserProfileModel","UserModel","constructor","modularuiResponse","_context","_defineProperty2","default","attributeContributions","contributions","attributes","_filter","call","contribution","key","_keys","has","data","_attributeCollection","AttributeCollection","type","attributeCollection","modelName","exports"],"sources":["../../../src/models/user/UserProfileModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport AttributeCollection from \"../attributes/AttributeCollection\";\n\nimport UserModel from \"./UserModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserProfileModel extends UserModel {\n _attributeCollection: AttributeCollection;\n\n /**\n * constructor\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return key !== \"sessiondata\" && has(this.data, key);\n })\n : [];\n\n this._attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n );\n }\n\n /**\n */\n get type(): string {\n return \"UserProfile\";\n }\n\n /**\n * returns all the attributes from the attribute collection\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserProfileModel\";\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAIA;AACA;AACA;AACe,MAAMI,gBAAgB,SAASC,kBAAS,CAAC;EAGtD;AACF;AACA;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAAC,IAAAE,gBAAA,CAAAC,OAAA;IAEzB,MAAMC,sBAAsB,GAAG,IAAI,CAACC,aAAa,CAACC,UAAU,GACxD,IAAAC,OAAA,CAAAJ,OAAA,EAAAF,QAAA,OAAI,CAACI,aAAa,CAACC,UAAU,EAAAE,IAAA,CAAAP,QAAA,EAASQ,YAAY,IAAK;MACrD,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAC,KAAA,CAAAR,OAAA,EAAYM,YAAY,CAAC;MACvC,OAAOC,GAAG,KAAK,aAAa,IAAI,IAAAE,YAAG,EAAC,IAAI,CAACC,IAAI,EAAEH,GAAG,CAAC;IACrD,CAAC,CAAC,GACF,EAAE;IAEN,IAAI,CAACI,oBAAoB,GAAG,IAAIC,4BAAmB,CACjD,IAAI,CAACF,IAAI,EACTT,sBACF,CAAC;EACH;;EAEA;AACF;EACE,IAAIY,IAAIA,CAAA,EAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAACH,oBAAoB;EAClC;;EAEA;AACF;EACE,WAAWI,SAASA,CAAA,EAAW;IAC7B,OAAO,kBAAkB;EAC3B;AACF;AAACC,OAAA,CAAAhB,OAAA,GAAAN,gBAAA","ignoreList":[]}
1
+ {"version":3,"file":"UserProfileModel.js","names":["_objects","require","_AttributeCollection","_interopRequireDefault","_UserModel","UserProfileModel","UserModel","constructor","modularuiResponse","_context","_defineProperty2","default","attributeContributions","contributions","attributes","_filter","call","contribution","key","_keys","has","data","_attributeCollection","AttributeCollection","modelOptions","isReadonly","type","attributeCollection","modelName","exports"],"sources":["../../../src/models/user/UserProfileModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport AttributeCollection from \"../attributes/AttributeCollection\";\n\nimport UserModel from \"./UserModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserProfileModel extends UserModel {\n _attributeCollection: AttributeCollection;\n\n /**\n * constructor\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return key !== \"sessiondata\" && has(this.data, key);\n })\n : [];\n\n this._attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n { ...this.modelOptions, isReadonly: true },\n );\n }\n\n /**\n */\n get type(): string {\n return \"UserProfile\";\n }\n\n /**\n * returns all the attributes from the attribute collection\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserProfileModel\";\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAIA;AACA;AACA;AACe,MAAMI,gBAAgB,SAASC,kBAAS,CAAC;EAGtD;AACF;AACA;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAAC,IAAAE,gBAAA,CAAAC,OAAA;IAEzB,MAAMC,sBAAsB,GAAG,IAAI,CAACC,aAAa,CAACC,UAAU,GACxD,IAAAC,OAAA,CAAAJ,OAAA,EAAAF,QAAA,OAAI,CAACI,aAAa,CAACC,UAAU,EAAAE,IAAA,CAAAP,QAAA,EAASQ,YAAY,IAAK;MACrD,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAC,KAAA,CAAAR,OAAA,EAAYM,YAAY,CAAC;MACvC,OAAOC,GAAG,KAAK,aAAa,IAAI,IAAAE,YAAG,EAAC,IAAI,CAACC,IAAI,EAAEH,GAAG,CAAC;IACrD,CAAC,CAAC,GACF,EAAE;IAEN,IAAI,CAACI,oBAAoB,GAAG,IAAIC,4BAAmB,CACjD,IAAI,CAACF,IAAI,EACTT,sBAAsB,EACtB;MAAE,GAAG,IAAI,CAACY,YAAY;MAAEC,UAAU,EAAE;IAAK,CAC3C,CAAC;EACH;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAACL,oBAAoB;EAClC;;EAEA;AACF;EACE,WAAWM,SAASA,CAAA,EAAW;IAC7B,OAAO,kBAAkB;EAC3B;AACF;AAACC,OAAA,CAAAlB,OAAA,GAAAN,gBAAA","ignoreList":[]}
@@ -15,13 +15,13 @@ class CaptchaRequest {
15
15
  (0, _defineProperty2.default)(this, "_tokenId", void 0);
16
16
  (0, _defineProperty2.default)(this, "_image", void 0);
17
17
  (0, _defineProperty2.default)(this, "_origin", "");
18
- (0, _defineProperty2.default)(this, "_contextPath", (0, _constants.getBasePath)());
18
+ (0, _defineProperty2.default)(this, "_contextPath", (0, _constants.getBasePathModularUI)());
19
19
  }
20
20
  /**
21
21
  */
22
22
  CaptchaRequest(options) {
23
23
  this._origin = options?.origin || "";
24
- this._contextPath = options?.contextPath || (0, _constants.getBasePath)();
24
+ this._contextPath = options?.contextPath || (0, _constants.getBasePathModularUI)();
25
25
  }
26
26
 
27
27
  /**
@@ -1,6 +1,10 @@
1
1
  // @flow
2
2
  import xhr from "../utils/fetch/xhr";
3
- import { getBasePath, getCaptchaPath, HTTP_METHODS } from "../constants";
3
+ import {
4
+ getBasePathModularUI,
5
+ getCaptchaPath,
6
+ HTTP_METHODS,
7
+ } from "../constants";
4
8
 
5
9
  type CaptchaInitialResponse = {
6
10
  tokenId: string,
@@ -36,13 +40,13 @@ class CaptchaRequest {
36
40
  _tokenId: string;
37
41
  _image: string;
38
42
  _origin: string = "";
39
- _contextPath: string = getBasePath();
43
+ _contextPath: string = getBasePathModularUI();
40
44
 
41
45
  /**
42
46
  */
43
47
  CaptchaRequest(options?: CaptchaRequestOptions) {
44
48
  this._origin = options?.origin || "";
45
- this._contextPath = options?.contextPath || getBasePath();
49
+ this._contextPath = options?.contextPath || getBasePathModularUI();
46
50
  }
47
51
 
48
52
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CaptchaRequest.js","names":["_xhr","_interopRequireDefault","require","_constants","CaptchaRequest","constructor","_defineProperty2","default","getBasePath","options","_origin","origin","_contextPath","contextPath","captchaResponse","response","_tokenId","tokenId","_image","image","valid","error","init","xhr","url","getCaptchaPath","then","send","answer","method","HTTP_METHODS","POST","data","catch","refresh","_default","exports"],"sources":["../../src/modularui/CaptchaRequest.js"],"sourcesContent":["// @flow\nimport xhr from \"../utils/fetch/xhr\";\nimport { getBasePath, getCaptchaPath, HTTP_METHODS } from \"../constants\";\n\ntype CaptchaInitialResponse = {\n tokenId: string,\n image: string,\n};\n\ntype CaptchaValidResponse = {\n valid: boolean,\n};\n\ntype CaptchaInvalidResponse = {\n tokenId: string,\n image: string,\n valid: boolean,\n error: { id: string },\n};\n\ntype CaptchaResponse = {\n tokenId: string,\n image: string,\n valid: boolean,\n error: { id: string } | null,\n};\n\ntype CaptchaRequestOptions = {\n origin?: string,\n contextPath?: string,\n};\n\n/**\n */\nclass CaptchaRequest {\n _tokenId: string;\n _image: string;\n _origin: string = \"\";\n _contextPath: string = getBasePath();\n\n /**\n */\n CaptchaRequest(options?: CaptchaRequestOptions) {\n this._origin = options?.origin || \"\";\n this._contextPath = options?.contextPath || getBasePath();\n }\n\n /**\n */\n captchaResponse(\n response:\n | CaptchaInitialResponse\n | CaptchaValidResponse\n | CaptchaInvalidResponse,\n ): CaptchaResponse {\n this._tokenId = response.tokenId ?? this._tokenId;\n this._image = response.image ?? this._image;\n\n return {\n tokenId: this._tokenId,\n image: this._image,\n valid: response.valid ?? false,\n error: response.error ?? null,\n };\n }\n\n /**\n * Initiate the captcha request\n */\n init(): Promise<CaptchaResponse> {\n return xhr({\n url: getCaptchaPath(this._contextPath, this._origin),\n }).then((response) => this.captchaResponse(response));\n }\n\n /**\n * Answer the captcha\n */\n send(answer?: string): Promise<CaptchaResponse> {\n return xhr({\n url: getCaptchaPath(this._contextPath, this._origin),\n method: HTTP_METHODS.POST,\n data: {\n tokenId: this._tokenId ?? \"\",\n answer: answer ?? \"\",\n },\n })\n .then((response) => this.captchaResponse(response))\n .catch((error) => this.captchaResponse(error.response));\n }\n\n /**\n * Reset the captcha and receive a new token and image\n */\n refresh(): Promise<CaptchaResponse> {\n return this.init();\n }\n}\n\nexport default CaptchaRequest;\n"],"mappings":";;;;;;;;AACA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AA8BA;AACA;AACA,MAAME,cAAc,CAAC;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA,mBAGD,EAAE;IAAA,IAAAD,gBAAA,CAAAC,OAAA,wBACG,IAAAC,sBAAW,EAAC,CAAC;EAAA;EAEpC;AACF;EACEJ,cAAcA,CAACK,OAA+B,EAAE;IAC9C,IAAI,CAACC,OAAO,GAAGD,OAAO,EAAEE,MAAM,IAAI,EAAE;IACpC,IAAI,CAACC,YAAY,GAAGH,OAAO,EAAEI,WAAW,IAAI,IAAAL,sBAAW,EAAC,CAAC;EAC3D;;EAEA;AACF;EACEM,eAAeA,CACbC,QAG0B,EACT;IACjB,IAAI,CAACC,QAAQ,GAAGD,QAAQ,CAACE,OAAO,IAAI,IAAI,CAACD,QAAQ;IACjD,IAAI,CAACE,MAAM,GAAGH,QAAQ,CAACI,KAAK,IAAI,IAAI,CAACD,MAAM;IAE3C,OAAO;MACLD,OAAO,EAAE,IAAI,CAACD,QAAQ;MACtBG,KAAK,EAAE,IAAI,CAACD,MAAM;MAClBE,KAAK,EAAEL,QAAQ,CAACK,KAAK,IAAI,KAAK;MAC9BC,KAAK,EAAEN,QAAQ,CAACM,KAAK,IAAI;IAC3B,CAAC;EACH;;EAEA;AACF;AACA;EACEC,IAAIA,CAAA,EAA6B;IAC/B,OAAO,IAAAC,YAAG,EAAC;MACTC,GAAG,EAAE,IAAAC,yBAAc,EAAC,IAAI,CAACb,YAAY,EAAE,IAAI,CAACF,OAAO;IACrD,CAAC,CAAC,CAACgB,IAAI,CAAEX,QAAQ,IAAK,IAAI,CAACD,eAAe,CAACC,QAAQ,CAAC,CAAC;EACvD;;EAEA;AACF;AACA;EACEY,IAAIA,CAACC,MAAe,EAA4B;IAC9C,OAAO,IAAAL,YAAG,EAAC;MACTC,GAAG,EAAE,IAAAC,yBAAc,EAAC,IAAI,CAACb,YAAY,EAAE,IAAI,CAACF,OAAO,CAAC;MACpDmB,MAAM,EAAEC,uBAAY,CAACC,IAAI;MACzBC,IAAI,EAAE;QACJf,OAAO,EAAE,IAAI,CAACD,QAAQ,IAAI,EAAE;QAC5BY,MAAM,EAAEA,MAAM,IAAI;MACpB;IACF,CAAC,CAAC,CACCF,IAAI,CAAEX,QAAQ,IAAK,IAAI,CAACD,eAAe,CAACC,QAAQ,CAAC,CAAC,CAClDkB,KAAK,CAAEZ,KAAK,IAAK,IAAI,CAACP,eAAe,CAACO,KAAK,CAACN,QAAQ,CAAC,CAAC;EAC3D;;EAEA;AACF;AACA;EACEmB,OAAOA,CAAA,EAA6B;IAClC,OAAO,IAAI,CAACZ,IAAI,CAAC,CAAC;EACpB;AACF;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAA7B,OAAA,GAEcH,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"CaptchaRequest.js","names":["_xhr","_interopRequireDefault","require","_constants","CaptchaRequest","constructor","_defineProperty2","default","getBasePathModularUI","options","_origin","origin","_contextPath","contextPath","captchaResponse","response","_tokenId","tokenId","_image","image","valid","error","init","xhr","url","getCaptchaPath","then","send","answer","method","HTTP_METHODS","POST","data","catch","refresh","_default","exports"],"sources":["../../src/modularui/CaptchaRequest.js"],"sourcesContent":["// @flow\nimport xhr from \"../utils/fetch/xhr\";\nimport {\n getBasePathModularUI,\n getCaptchaPath,\n HTTP_METHODS,\n} from \"../constants\";\n\ntype CaptchaInitialResponse = {\n tokenId: string,\n image: string,\n};\n\ntype CaptchaValidResponse = {\n valid: boolean,\n};\n\ntype CaptchaInvalidResponse = {\n tokenId: string,\n image: string,\n valid: boolean,\n error: { id: string },\n};\n\ntype CaptchaResponse = {\n tokenId: string,\n image: string,\n valid: boolean,\n error: { id: string } | null,\n};\n\ntype CaptchaRequestOptions = {\n origin?: string,\n contextPath?: string,\n};\n\n/**\n */\nclass CaptchaRequest {\n _tokenId: string;\n _image: string;\n _origin: string = \"\";\n _contextPath: string = getBasePathModularUI();\n\n /**\n */\n CaptchaRequest(options?: CaptchaRequestOptions) {\n this._origin = options?.origin || \"\";\n this._contextPath = options?.contextPath || getBasePathModularUI();\n }\n\n /**\n */\n captchaResponse(\n response:\n | CaptchaInitialResponse\n | CaptchaValidResponse\n | CaptchaInvalidResponse,\n ): CaptchaResponse {\n this._tokenId = response.tokenId ?? this._tokenId;\n this._image = response.image ?? this._image;\n\n return {\n tokenId: this._tokenId,\n image: this._image,\n valid: response.valid ?? false,\n error: response.error ?? null,\n };\n }\n\n /**\n * Initiate the captcha request\n */\n init(): Promise<CaptchaResponse> {\n return xhr({\n url: getCaptchaPath(this._contextPath, this._origin),\n }).then((response) => this.captchaResponse(response));\n }\n\n /**\n * Answer the captcha\n */\n send(answer?: string): Promise<CaptchaResponse> {\n return xhr({\n url: getCaptchaPath(this._contextPath, this._origin),\n method: HTTP_METHODS.POST,\n data: {\n tokenId: this._tokenId ?? \"\",\n answer: answer ?? \"\",\n },\n })\n .then((response) => this.captchaResponse(response))\n .catch((error) => this.captchaResponse(error.response));\n }\n\n /**\n * Reset the captcha and receive a new token and image\n */\n refresh(): Promise<CaptchaResponse> {\n return this.init();\n }\n}\n\nexport default CaptchaRequest;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EAA4B;IAC9C,OAAO,IAAAL,YAAG,EAAC;MACTC,GAAG,EAAE,IAAAC,yBAAc,EAAC,IAAI,CAACb,YAAY,EAAE,IAAI,CAACF,OAAO,CAAC;MACpDmB,MAAM,EAAEC,uBAAY,CAACC,IAAI;MACzBC,IAAI,EAAE;QACJf,OAAO,EAAE,IAAI,CAACD,QAAQ,IAAI,EAAE;QAC5BY,MAAM,EAAEA,MAAM,IAAI;MACpB;IACF,CAAC,CAAC,CACCF,IAAI,CAAEX,QAAQ,IAAK,IAAI,CAACD,eAAe,CAACC,QAAQ,CAAC,CAAC,CAClDkB,KAAK,CAAEZ,KAAK,IAAK,IAAI,CAACP,eAAe,CAACO,KAAK,CAACN,QAAQ,CAAC,CAAC;EAC3D;;EAEA;AACF;AACA;EACEmB,OAAOA,CAAA,EAA6B;IAClC,OAAO,IAAI,CAACZ,IAAI,CAAC,CAAC;EACpB;AACF;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAA7B,OAAA,GAEcH,cAAc","ignoreList":[]}
@@ -46,7 +46,7 @@ class ModularUIRequest {
46
46
  (0, _defineProperty2.default)(this, "_method", _Constants.HTTP_METHODS.GET);
47
47
  (0, _defineProperty2.default)(this, "_progressEvent", void 0);
48
48
  (0, _defineProperty2.default)(this, "_origin", "");
49
- (0, _defineProperty2.default)(this, "_contextPath", (0, _Settings.getBasePath)());
49
+ (0, _defineProperty2.default)(this, "_contextPath", (0, _Settings.getBasePathModularUI)());
50
50
  if (!href) {
51
51
  throw new _exceptions.IllegalArgumentException("You must pass a href to the resource that is requested");
52
52
  }
@@ -100,8 +100,8 @@ class ModularUIRequest {
100
100
  /**
101
101
  */
102
102
  set contextPath(contextPath) {
103
- this._contextPath = contextPath ?? (0, _Settings.getBasePath)();
104
- this._response.contextPath = contextPath ?? (0, _Settings.getBasePath)();
103
+ this._contextPath = contextPath ?? (0, _Settings.getBasePathModularUI)();
104
+ this._response.contextPath = contextPath ?? (0, _Settings.getBasePathModularUI)();
105
105
  }
106
106
 
107
107
  /**
@@ -597,7 +597,10 @@ class ModularUIRequest {
597
597
  // eslint-disable-next-line no-console
598
598
  console.debug("Unexpected error when retrieving child model:", reason);
599
599
  }
600
- errorChildModels.push(new _ErrorResponse.default(reason, "", this.origin, this.contextPath));
600
+ errorChildModels.push(new _ErrorResponse.default(reason, "", {
601
+ origin: this.origin,
602
+ contextPath: this.contextPath
603
+ }));
601
604
  } else {
602
605
  resolvedChildModels.push(childModel.value);
603
606
  }
@@ -5,7 +5,7 @@ import { HTTP_METHODS, TIMEVERSION_FILTER_NAME } from "../constants/Constants";
5
5
 
6
6
  import { HIDE_WHEN_EMPTY } from "../constants/LayoutHints";
7
7
 
8
- import { getBasePath, getSetting } from "../constants/Settings";
8
+ import { getBasePathModularUI, getSetting } from "../constants/Settings";
9
9
 
10
10
  import Href from "../models/href/Href";
11
11
 
@@ -47,7 +47,7 @@ class ModularUIRequest {
47
47
  _progressEvent: ProgressEventHandler;
48
48
 
49
49
  _origin: string = "";
50
- _contextPath: string = getBasePath();
50
+ _contextPath: string = getBasePathModularUI();
51
51
 
52
52
  /**
53
53
  */
@@ -117,8 +117,8 @@ class ModularUIRequest {
117
117
  /**
118
118
  */
119
119
  set contextPath(contextPath: ?string) {
120
- this._contextPath = contextPath ?? getBasePath();
121
- this._response.contextPath = contextPath ?? getBasePath();
120
+ this._contextPath = contextPath ?? getBasePathModularUI();
121
+ this._response.contextPath = contextPath ?? getBasePathModularUI();
122
122
  }
123
123
 
124
124
  /**
@@ -725,7 +725,10 @@ class ModularUIRequest {
725
725
  );
726
726
  }
727
727
  errorChildModels.push(
728
- new ErrorResponse(reason, "", this.origin, this.contextPath),
728
+ new ErrorResponse(reason, "", {
729
+ origin: this.origin,
730
+ contextPath: this.contextPath,
731
+ }),
729
732
  );
730
733
  } else {
731
734
  resolvedChildModels.push(childModel.value);