@beinformed/ui 1.57.2 → 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 (430) hide show
  1. package/CHANGELOG.md +12 -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/useModularUIBasic.js +1 -1
  8. package/esm/hooks/useModularUIBasic.js.map +1 -1
  9. package/esm/hooks/useModularUIModel.js.map +1 -1
  10. package/esm/models/actions/ActionCollection.js +2 -3
  11. package/esm/models/actions/ActionCollection.js.map +1 -1
  12. package/esm/models/actions/ActionModel.js +13 -23
  13. package/esm/models/actions/ActionModel.js.map +1 -1
  14. package/esm/models/application/ApplicationModel.js +1 -1
  15. package/esm/models/application/ApplicationModel.js.map +1 -1
  16. package/esm/models/attributes/AttributeCollection.js +6 -3
  17. package/esm/models/attributes/AttributeCollection.js.map +1 -1
  18. package/esm/models/attributes/AttributeModel.js +3 -3
  19. package/esm/models/attributes/AttributeModel.js.map +1 -1
  20. package/esm/models/attributes/AttributeSetModel.js +7 -4
  21. package/esm/models/attributes/AttributeSetModel.js.map +1 -1
  22. package/esm/models/attributes/BooleanAttributeModel.js +6 -3
  23. package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
  24. package/esm/models/attributes/ChoiceAttributeModel.js +6 -3
  25. package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
  26. package/esm/models/attributes/ChoiceAttributeOptionCollection.js +18 -14
  27. package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  28. package/esm/models/attributes/ChoiceAttributeOptionModel.js +17 -10
  29. package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  30. package/esm/models/attributes/CompositeAttributeChildCollection.js +7 -7
  31. package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  32. package/esm/models/attributes/CompositeAttributeModel.js +3 -3
  33. package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
  34. package/esm/models/attributes/DatetimeAttributeModel.js +2 -2
  35. package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
  36. package/esm/models/attributes/StringAttributeModel.js +2 -2
  37. package/esm/models/attributes/StringAttributeModel.js.map +1 -1
  38. package/esm/models/attributes/_createAttribute.js +2 -2
  39. package/esm/models/attributes/_createAttribute.js.map +1 -1
  40. package/esm/models/base/BaseModel.js +27 -1
  41. package/esm/models/base/BaseModel.js.map +1 -1
  42. package/esm/models/base/ResourceModel.js +3 -23
  43. package/esm/models/base/ResourceModel.js.map +1 -1
  44. package/esm/models/caseview/CaseViewModel.js +1 -1
  45. package/esm/models/caseview/CaseViewModel.js.map +1 -1
  46. package/esm/models/concepts/ConceptDetailModel.js +2 -2
  47. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  48. package/esm/models/concepts/ConceptIndexModel.js +2 -2
  49. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  50. package/esm/models/concepts/ConceptLinkModel.js +4 -10
  51. package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
  52. package/esm/models/concepts/ConceptRelationCollection.js +11 -4
  53. package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
  54. package/esm/models/concepts/ConceptRelationModel.js +8 -1
  55. package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
  56. package/esm/models/concepts/SourceReferenceCollection.js +2 -4
  57. package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
  58. package/esm/models/concepts/SourceReferenceModel.js +9 -10
  59. package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
  60. package/esm/models/content/ContentIndexModel.js +2 -2
  61. package/esm/models/content/ContentIndexModel.js.map +1 -1
  62. package/esm/models/content/ContentLinkModel.js +4 -11
  63. package/esm/models/content/ContentLinkModel.js.map +1 -1
  64. package/esm/models/content/ContentModel.js +2 -2
  65. package/esm/models/content/ContentModel.js.map +1 -1
  66. package/esm/models/content/ContentTOCModel.js +7 -7
  67. package/esm/models/content/ContentTOCModel.js.map +1 -1
  68. package/esm/models/content/SectionModel.js +6 -12
  69. package/esm/models/content/SectionModel.js.map +1 -1
  70. package/esm/models/detail/DetailModel.js +9 -3
  71. package/esm/models/detail/DetailModel.js.map +1 -1
  72. package/esm/models/error/ErrorResponse.js +8 -10
  73. package/esm/models/error/ErrorResponse.js.map +1 -1
  74. package/esm/models/filters/AssignmentFilterModel.js +2 -2
  75. package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
  76. package/esm/models/filters/BaseFilterModel.js +3 -3
  77. package/esm/models/filters/BaseFilterModel.js.map +1 -1
  78. package/esm/models/filters/ConceptIndexFilterModel.js +2 -3
  79. package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
  80. package/esm/models/filters/FilterCollection.js +8 -7
  81. package/esm/models/filters/FilterCollection.js.map +1 -1
  82. package/esm/models/filters/StringFilterModel.js +2 -2
  83. package/esm/models/filters/StringFilterModel.js.map +1 -1
  84. package/esm/models/form/FormModel.js +4 -4
  85. package/esm/models/form/FormModel.js.map +1 -1
  86. package/esm/models/form/FormObjectModel.js +7 -4
  87. package/esm/models/form/FormObjectModel.js.map +1 -1
  88. package/esm/models/grouping/GroupingModel.js +10 -7
  89. package/esm/models/grouping/GroupingModel.js.map +1 -1
  90. package/esm/models/href/Href.js +9 -8
  91. package/esm/models/href/Href.js.map +1 -1
  92. package/esm/models/links/LinkCollection.js +2 -3
  93. package/esm/models/links/LinkCollection.js.map +1 -1
  94. package/esm/models/links/LinkModel.js +7 -7
  95. package/esm/models/links/LinkModel.js.map +1 -1
  96. package/esm/models/list/ListDetailModel.js +1 -1
  97. package/esm/models/list/ListDetailModel.js.map +1 -1
  98. package/esm/models/list/ListItemCollection.js +1 -1
  99. package/esm/models/list/ListItemCollection.js.map +1 -1
  100. package/esm/models/list/ListItemModel.js +3 -3
  101. package/esm/models/list/ListItemModel.js.map +1 -1
  102. package/esm/models/list/ListModel.js +3 -3
  103. package/esm/models/list/ListModel.js.map +1 -1
  104. package/esm/models/lookup/LookupOptionCollection.js +5 -2
  105. package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
  106. package/esm/models/lookup/LookupOptionsModel.js +2 -2
  107. package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
  108. package/esm/models/panels/GroupingPanelModel.js +1 -1
  109. package/esm/models/panels/GroupingPanelModel.js.map +1 -1
  110. package/esm/models/tab/TabModel.js +2 -2
  111. package/esm/models/tab/TabModel.js.map +1 -1
  112. package/esm/models/taskgroup/TaskGroupModel.js +4 -5
  113. package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
  114. package/esm/models/types.js.map +1 -1
  115. package/esm/models/user/UserProfileModel.js +4 -1
  116. package/esm/models/user/UserProfileModel.js.map +1 -1
  117. package/esm/modularui/CaptchaRequest.js +3 -3
  118. package/esm/modularui/CaptchaRequest.js.map +1 -1
  119. package/esm/modularui/ModularUIRequest.js +8 -5
  120. package/esm/modularui/ModularUIRequest.js.map +1 -1
  121. package/esm/modularui/ModularUIResponse.js +12 -3
  122. package/esm/modularui/ModularUIResponse.js.map +1 -1
  123. package/esm/modularui/UploadRequest.js +3 -3
  124. package/esm/modularui/UploadRequest.js.map +1 -1
  125. package/esm/react-client/client.js +3 -3
  126. package/esm/react-client/client.js.map +1 -1
  127. package/esm/react-server/renderSSRComplete.js +2 -2
  128. package/esm/react-server/renderSSRComplete.js.map +1 -1
  129. package/esm/react-server/renderSSRMinimal.js +2 -2
  130. package/esm/react-server/renderSSRMinimal.js.map +1 -1
  131. package/esm/redux/_modularui/ModularUIActions.js +8 -2
  132. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  133. package/esm/redux/_modularui/ModularUIUtils.js +8 -11
  134. package/esm/redux/_modularui/ModularUIUtils.js.map +1 -1
  135. package/esm/utils/browser/Cookies.js +3 -3
  136. package/esm/utils/browser/Cookies.js.map +1 -1
  137. package/esm/utils/helpers/createHref.js +23 -3
  138. package/esm/utils/helpers/createHref.js.map +1 -1
  139. package/esm/utils/helpers/repositoryResource.js +2 -2
  140. package/esm/utils/helpers/repositoryResource.js.map +1 -1
  141. package/lib/constants/Settings.js +18 -8
  142. package/lib/constants/Settings.js.flow +16 -6
  143. package/lib/constants/Settings.js.map +1 -1
  144. package/lib/hooks/useAuthentication.js +2 -2
  145. package/lib/hooks/useAuthentication.js.flow +3 -3
  146. package/lib/hooks/useAuthentication.js.map +1 -1
  147. package/lib/hooks/useModelCatalog.js.flow +7 -6
  148. package/lib/hooks/useModelCatalog.js.map +1 -1
  149. package/lib/hooks/useModularUIBasic.js +1 -1
  150. package/lib/hooks/useModularUIBasic.js.flow +1 -1
  151. package/lib/hooks/useModularUIBasic.js.map +1 -1
  152. package/lib/hooks/useModularUIModel.js.flow +16 -11
  153. package/lib/hooks/useModularUIModel.js.map +1 -1
  154. package/lib/models/actions/ActionCollection.js +2 -2
  155. package/lib/models/actions/ActionCollection.js.flow +3 -8
  156. package/lib/models/actions/ActionCollection.js.map +1 -1
  157. package/lib/models/actions/ActionModel.js +12 -22
  158. package/lib/models/actions/ActionModel.js.flow +7 -24
  159. package/lib/models/actions/ActionModel.js.map +1 -1
  160. package/lib/models/application/ApplicationModel.js +1 -1
  161. package/lib/models/application/ApplicationModel.js.flow +1 -2
  162. package/lib/models/application/ApplicationModel.js.map +1 -1
  163. package/lib/models/attributes/AttributeCollection.js +6 -3
  164. package/lib/models/attributes/AttributeCollection.js.flow +12 -4
  165. package/lib/models/attributes/AttributeCollection.js.map +1 -1
  166. package/lib/models/attributes/AttributeModel.js +3 -3
  167. package/lib/models/attributes/AttributeModel.js.flow +8 -2
  168. package/lib/models/attributes/AttributeModel.js.map +1 -1
  169. package/lib/models/attributes/AttributeSetModel.js +7 -3
  170. package/lib/models/attributes/AttributeSetModel.js.flow +11 -3
  171. package/lib/models/attributes/AttributeSetModel.js.map +1 -1
  172. package/lib/models/attributes/BooleanAttributeModel.js +6 -3
  173. package/lib/models/attributes/BooleanAttributeModel.js.flow +8 -4
  174. package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
  175. package/lib/models/attributes/ChoiceAttributeModel.js +6 -3
  176. package/lib/models/attributes/ChoiceAttributeModel.js.flow +13 -4
  177. package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
  178. package/lib/models/attributes/ChoiceAttributeOptionCollection.js +18 -13
  179. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.flow +30 -28
  180. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  181. package/lib/models/attributes/ChoiceAttributeOptionModel.js +17 -10
  182. package/lib/models/attributes/ChoiceAttributeOptionModel.js.flow +30 -11
  183. package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  184. package/lib/models/attributes/CompositeAttributeChildCollection.js +7 -7
  185. package/lib/models/attributes/CompositeAttributeChildCollection.js.flow +8 -1
  186. package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  187. package/lib/models/attributes/CompositeAttributeModel.js +3 -3
  188. package/lib/models/attributes/CompositeAttributeModel.js.flow +8 -3
  189. package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
  190. package/lib/models/attributes/DatetimeAttributeModel.js +2 -2
  191. package/lib/models/attributes/DatetimeAttributeModel.js.flow +7 -2
  192. package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
  193. package/lib/models/attributes/StringAttributeModel.js +2 -2
  194. package/lib/models/attributes/StringAttributeModel.js.flow +7 -3
  195. package/lib/models/attributes/StringAttributeModel.js.map +1 -1
  196. package/lib/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js.flow +1 -1
  197. package/lib/models/attributes/_createAttribute.js +2 -2
  198. package/lib/models/attributes/_createAttribute.js.flow +3 -2
  199. package/lib/models/attributes/_createAttribute.js.map +1 -1
  200. package/lib/models/base/BaseModel.js +27 -1
  201. package/lib/models/base/BaseModel.js.flow +31 -1
  202. package/lib/models/base/BaseModel.js.map +1 -1
  203. package/lib/models/base/ResourceModel.js +3 -22
  204. package/lib/models/base/ResourceModel.js.flow +6 -23
  205. package/lib/models/base/ResourceModel.js.map +1 -1
  206. package/lib/models/base/__tests__/BaseModel.spec.js.flow +4 -0
  207. package/lib/models/caseview/CaseViewModel.js +1 -1
  208. package/lib/models/caseview/CaseViewModel.js.flow +1 -2
  209. package/lib/models/caseview/CaseViewModel.js.map +1 -1
  210. package/lib/models/concepts/ConceptDetailModel.js +2 -2
  211. package/lib/models/concepts/ConceptDetailModel.js.flow +2 -2
  212. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  213. package/lib/models/concepts/ConceptIndexModel.js +2 -2
  214. package/lib/models/concepts/ConceptIndexModel.js.flow +9 -6
  215. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  216. package/lib/models/concepts/ConceptLinkModel.js +4 -10
  217. package/lib/models/concepts/ConceptLinkModel.js.flow +15 -12
  218. package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
  219. package/lib/models/concepts/ConceptRelationCollection.js +11 -4
  220. package/lib/models/concepts/ConceptRelationCollection.js.flow +17 -3
  221. package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
  222. package/lib/models/concepts/ConceptRelationModel.js +8 -1
  223. package/lib/models/concepts/ConceptRelationModel.js.flow +18 -2
  224. package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
  225. package/lib/models/concepts/SourceReferenceCollection.js +2 -3
  226. package/lib/models/concepts/SourceReferenceCollection.js.flow +3 -8
  227. package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
  228. package/lib/models/concepts/SourceReferenceModel.js +8 -8
  229. package/lib/models/concepts/SourceReferenceModel.js.flow +10 -11
  230. package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
  231. package/lib/models/content/ContentIndexModel.js +2 -2
  232. package/lib/models/content/ContentIndexModel.js.flow +10 -5
  233. package/lib/models/content/ContentIndexModel.js.map +1 -1
  234. package/lib/models/content/ContentLinkModel.js +4 -10
  235. package/lib/models/content/ContentLinkModel.js.flow +10 -13
  236. package/lib/models/content/ContentLinkModel.js.map +1 -1
  237. package/lib/models/content/ContentModel.js +2 -2
  238. package/lib/models/content/ContentModel.js.flow +6 -1
  239. package/lib/models/content/ContentModel.js.map +1 -1
  240. package/lib/models/content/ContentTOCModel.js +7 -7
  241. package/lib/models/content/ContentTOCModel.js.flow +19 -11
  242. package/lib/models/content/ContentTOCModel.js.map +1 -1
  243. package/lib/models/content/SectionModel.js +6 -11
  244. package/lib/models/content/SectionModel.js.flow +9 -21
  245. package/lib/models/content/SectionModel.js.map +1 -1
  246. package/lib/models/detail/DetailModel.js +9 -3
  247. package/lib/models/detail/DetailModel.js.flow +3 -4
  248. package/lib/models/detail/DetailModel.js.map +1 -1
  249. package/lib/models/error/ErrorResponse.js +7 -9
  250. package/lib/models/error/ErrorResponse.js.flow +9 -20
  251. package/lib/models/error/ErrorResponse.js.map +1 -1
  252. package/lib/models/filters/AssignmentFilterModel.js +2 -2
  253. package/lib/models/filters/AssignmentFilterModel.js.flow +7 -3
  254. package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
  255. package/lib/models/filters/BaseFilterModel.js +3 -3
  256. package/lib/models/filters/BaseFilterModel.js.flow +16 -7
  257. package/lib/models/filters/BaseFilterModel.js.map +1 -1
  258. package/lib/models/filters/ConceptIndexFilterModel.js +2 -2
  259. package/lib/models/filters/ConceptIndexFilterModel.js.flow +8 -2
  260. package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
  261. package/lib/models/filters/FilterCollection.js +8 -7
  262. package/lib/models/filters/FilterCollection.js.flow +13 -7
  263. package/lib/models/filters/FilterCollection.js.map +1 -1
  264. package/lib/models/filters/StringFilterModel.js +2 -2
  265. package/lib/models/filters/StringFilterModel.js.flow +7 -3
  266. package/lib/models/filters/StringFilterModel.js.map +1 -1
  267. package/lib/models/form/FormModel.js +4 -4
  268. package/lib/models/form/FormModel.js.flow +8 -2
  269. package/lib/models/form/FormModel.js.map +1 -1
  270. package/lib/models/form/FormObjectModel.js +7 -4
  271. package/lib/models/form/FormObjectModel.js.flow +17 -4
  272. package/lib/models/form/FormObjectModel.js.map +1 -1
  273. package/lib/models/grouping/GroupingModel.js +10 -7
  274. package/lib/models/grouping/GroupingModel.js.flow +21 -5
  275. package/lib/models/grouping/GroupingModel.js.map +1 -1
  276. package/lib/models/href/Href.js +8 -7
  277. package/lib/models/href/Href.js.flow +17 -10
  278. package/lib/models/href/Href.js.map +1 -1
  279. package/lib/models/href/__tests__/Href.spec.js.flow +5 -8
  280. package/lib/models/links/LinkCollection.js +2 -3
  281. package/lib/models/links/LinkCollection.js.flow +3 -3
  282. package/lib/models/links/LinkCollection.js.map +1 -1
  283. package/lib/models/links/LinkModel.js +7 -7
  284. package/lib/models/links/LinkModel.js.flow +8 -15
  285. package/lib/models/links/LinkModel.js.map +1 -1
  286. package/lib/models/list/ListDetailModel.js +1 -1
  287. package/lib/models/list/ListDetailModel.js.flow +6 -1
  288. package/lib/models/list/ListDetailModel.js.map +1 -1
  289. package/lib/models/list/ListItemCollection.js +1 -1
  290. package/lib/models/list/ListItemCollection.js.flow +1 -2
  291. package/lib/models/list/ListItemCollection.js.map +1 -1
  292. package/lib/models/list/ListItemModel.js +3 -3
  293. package/lib/models/list/ListItemModel.js.flow +4 -4
  294. package/lib/models/list/ListItemModel.js.map +1 -1
  295. package/lib/models/list/ListModel.js +3 -3
  296. package/lib/models/list/ListModel.js.flow +12 -8
  297. package/lib/models/list/ListModel.js.map +1 -1
  298. package/lib/models/lookup/LookupOptionCollection.js +5 -1
  299. package/lib/models/lookup/LookupOptionCollection.js.flow +17 -6
  300. package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
  301. package/lib/models/lookup/LookupOptionsModel.js +2 -2
  302. package/lib/models/lookup/LookupOptionsModel.js.flow +2 -0
  303. package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
  304. package/lib/models/panels/GroupingPanelModel.js +1 -1
  305. package/lib/models/panels/GroupingPanelModel.js.flow +1 -2
  306. package/lib/models/panels/GroupingPanelModel.js.map +1 -1
  307. package/lib/models/tab/TabModel.js +2 -2
  308. package/lib/models/tab/TabModel.js.flow +2 -4
  309. package/lib/models/tab/TabModel.js.map +1 -1
  310. package/lib/models/taskgroup/TaskGroupModel.js +4 -4
  311. package/lib/models/taskgroup/TaskGroupModel.js.flow +5 -6
  312. package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
  313. package/lib/models/types.js.flow +5 -0
  314. package/lib/models/types.js.map +1 -1
  315. package/lib/models/user/UserProfileModel.js +4 -1
  316. package/lib/models/user/UserProfileModel.js.flow +1 -0
  317. package/lib/models/user/UserProfileModel.js.map +1 -1
  318. package/lib/modularui/CaptchaRequest.js +2 -2
  319. package/lib/modularui/CaptchaRequest.js.flow +7 -3
  320. package/lib/modularui/CaptchaRequest.js.map +1 -1
  321. package/lib/modularui/ModularUIRequest.js +7 -4
  322. package/lib/modularui/ModularUIRequest.js.flow +8 -5
  323. package/lib/modularui/ModularUIRequest.js.map +1 -1
  324. package/lib/modularui/ModularUIResponse.js +11 -2
  325. package/lib/modularui/ModularUIResponse.js.flow +13 -3
  326. package/lib/modularui/ModularUIResponse.js.map +1 -1
  327. package/lib/modularui/UploadRequest.js +2 -2
  328. package/lib/modularui/UploadRequest.js.flow +7 -3
  329. package/lib/modularui/UploadRequest.js.map +1 -1
  330. package/lib/react-client/client.js +2 -2
  331. package/lib/react-client/client.js.flow +7 -3
  332. package/lib/react-client/client.js.map +1 -1
  333. package/lib/react-server/renderSSRComplete.js +1 -1
  334. package/lib/react-server/renderSSRComplete.js.flow +2 -2
  335. package/lib/react-server/renderSSRComplete.js.map +1 -1
  336. package/lib/react-server/renderSSRMinimal.js +1 -1
  337. package/lib/react-server/renderSSRMinimal.js.flow +2 -2
  338. package/lib/react-server/renderSSRMinimal.js.map +1 -1
  339. package/lib/redux/_modularui/ModularUIActions.js +8 -2
  340. package/lib/redux/_modularui/ModularUIActions.js.flow +8 -7
  341. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  342. package/lib/redux/_modularui/ModularUIUtils.js +8 -11
  343. package/lib/redux/_modularui/ModularUIUtils.js.flow +13 -14
  344. package/lib/redux/_modularui/ModularUIUtils.js.map +1 -1
  345. package/lib/utils/browser/Cookies.js +2 -2
  346. package/lib/utils/browser/Cookies.js.flow +3 -3
  347. package/lib/utils/browser/Cookies.js.map +1 -1
  348. package/lib/utils/helpers/__tests__/createHref.spec.js.flow +13 -8
  349. package/lib/utils/helpers/createHref.js +23 -3
  350. package/lib/utils/helpers/createHref.js.flow +37 -8
  351. package/lib/utils/helpers/createHref.js.map +1 -1
  352. package/lib/utils/helpers/repositoryResource.js +1 -1
  353. package/lib/utils/helpers/repositoryResource.js.flow +2 -2
  354. package/lib/utils/helpers/repositoryResource.js.map +1 -1
  355. package/package.json +4 -4
  356. package/src/constants/Settings.js +16 -6
  357. package/src/hooks/useAuthentication.js +3 -3
  358. package/src/hooks/useModelCatalog.js +7 -6
  359. package/src/hooks/useModularUIBasic.js +1 -1
  360. package/src/hooks/useModularUIModel.js +16 -11
  361. package/src/models/actions/ActionCollection.js +3 -8
  362. package/src/models/actions/ActionModel.js +7 -24
  363. package/src/models/application/ApplicationModel.js +1 -2
  364. package/src/models/attributes/AttributeCollection.js +12 -4
  365. package/src/models/attributes/AttributeModel.js +8 -2
  366. package/src/models/attributes/AttributeSetModel.js +11 -3
  367. package/src/models/attributes/BooleanAttributeModel.js +8 -4
  368. package/src/models/attributes/ChoiceAttributeModel.js +13 -4
  369. package/src/models/attributes/ChoiceAttributeOptionCollection.js +30 -28
  370. package/src/models/attributes/ChoiceAttributeOptionModel.js +30 -11
  371. package/src/models/attributes/CompositeAttributeChildCollection.js +8 -1
  372. package/src/models/attributes/CompositeAttributeModel.js +8 -3
  373. package/src/models/attributes/DatetimeAttributeModel.js +7 -2
  374. package/src/models/attributes/StringAttributeModel.js +7 -3
  375. package/src/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js +1 -1
  376. package/src/models/attributes/_createAttribute.js +3 -2
  377. package/src/models/base/BaseModel.js +31 -1
  378. package/src/models/base/ResourceModel.js +6 -23
  379. package/src/models/base/__tests__/BaseModel.spec.js +4 -0
  380. package/src/models/caseview/CaseViewModel.js +1 -2
  381. package/src/models/concepts/ConceptDetailModel.js +2 -2
  382. package/src/models/concepts/ConceptIndexModel.js +9 -6
  383. package/src/models/concepts/ConceptLinkModel.js +15 -12
  384. package/src/models/concepts/ConceptRelationCollection.js +17 -3
  385. package/src/models/concepts/ConceptRelationModel.js +18 -2
  386. package/src/models/concepts/SourceReferenceCollection.js +3 -8
  387. package/src/models/concepts/SourceReferenceModel.js +10 -11
  388. package/src/models/content/ContentIndexModel.js +10 -5
  389. package/src/models/content/ContentLinkModel.js +10 -13
  390. package/src/models/content/ContentModel.js +6 -1
  391. package/src/models/content/ContentTOCModel.js +19 -11
  392. package/src/models/content/SectionModel.js +9 -21
  393. package/src/models/detail/DetailModel.js +3 -4
  394. package/src/models/error/ErrorResponse.js +9 -20
  395. package/src/models/filters/AssignmentFilterModel.js +7 -3
  396. package/src/models/filters/BaseFilterModel.js +16 -7
  397. package/src/models/filters/ConceptIndexFilterModel.js +8 -2
  398. package/src/models/filters/FilterCollection.js +13 -7
  399. package/src/models/filters/StringFilterModel.js +7 -3
  400. package/src/models/form/FormModel.js +8 -2
  401. package/src/models/form/FormObjectModel.js +17 -4
  402. package/src/models/grouping/GroupingModel.js +21 -5
  403. package/src/models/href/Href.js +17 -10
  404. package/src/models/href/__tests__/Href.spec.js +5 -8
  405. package/src/models/links/LinkCollection.js +3 -3
  406. package/src/models/links/LinkModel.js +8 -15
  407. package/src/models/list/ListDetailModel.js +6 -1
  408. package/src/models/list/ListItemCollection.js +1 -2
  409. package/src/models/list/ListItemModel.js +4 -4
  410. package/src/models/list/ListModel.js +12 -8
  411. package/src/models/lookup/LookupOptionCollection.js +17 -6
  412. package/src/models/lookup/LookupOptionsModel.js +2 -0
  413. package/src/models/panels/GroupingPanelModel.js +1 -2
  414. package/src/models/tab/TabModel.js +2 -4
  415. package/src/models/taskgroup/TaskGroupModel.js +5 -6
  416. package/src/models/types.js +5 -0
  417. package/src/models/user/UserProfileModel.js +1 -0
  418. package/src/modularui/CaptchaRequest.js +7 -3
  419. package/src/modularui/ModularUIRequest.js +8 -5
  420. package/src/modularui/ModularUIResponse.js +13 -3
  421. package/src/modularui/UploadRequest.js +7 -3
  422. package/src/react-client/client.js +7 -3
  423. package/src/react-server/renderSSRComplete.js +2 -2
  424. package/src/react-server/renderSSRMinimal.js +2 -2
  425. package/src/redux/_modularui/ModularUIActions.js +8 -7
  426. package/src/redux/_modularui/ModularUIUtils.js +13 -14
  427. package/src/utils/browser/Cookies.js +3 -3
  428. package/src/utils/helpers/__tests__/createHref.spec.js +13 -8
  429. package/src/utils/helpers/createHref.js +37 -8
  430. package/src/utils/helpers/repositoryResource.js +2 -2
@@ -10,9 +10,17 @@ var _urlSearchParams = _interopRequireDefault(require("@babel/runtime-corejs3/co
10
10
  var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
11
11
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/keys"));
12
12
  var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/starts-with"));
13
+ var _Href = _interopRequireDefault(require("../../models/href/Href"));
13
14
  /**
14
15
  */
15
16
  const parseUrl = href => {
17
+ if (href instanceof _Href.default) {
18
+ return {
19
+ path: href.path,
20
+ querystring: href.querystring,
21
+ hash: href.hash
22
+ };
23
+ }
16
24
  let path = href;
17
25
  let hash = null;
18
26
  let querystring = null;
@@ -38,7 +46,7 @@ const parseUrl = href => {
38
46
  exports.parseUrl = parseUrl;
39
47
  const filterParameters = (href, allowedParameters) => {
40
48
  if (!Array.isArray(allowedParameters)) {
41
- return href;
49
+ return new _Href.default(href);
42
50
  }
43
51
  const url = parseUrl(href);
44
52
  let filteredUrl = url.path;
@@ -55,14 +63,20 @@ const filterParameters = (href, allowedParameters) => {
55
63
  if (url.hash) {
56
64
  filteredUrl = filteredUrl + "#" + url.hash;
57
65
  }
58
- return filteredUrl;
66
+ if (href instanceof _Href.default) {
67
+ return new _Href.default(filteredUrl, href.resourcetype, {
68
+ origin: href.origin,
69
+ contextPath: href.contextPath
70
+ });
71
+ }
72
+ return new _Href.default(filteredUrl);
59
73
  };
60
74
 
61
75
  /**
62
76
  */
63
77
  exports.filterParameters = filterParameters;
64
78
  const createHref = (context, dynamicPart, location, allowedParameters) => {
65
- let href = dynamicPart;
79
+ let href = dynamicPart.toString();
66
80
  if (!(0, _startsWith.default)(href).call(href, `/${context}/`)) {
67
81
  href = `/${context}/${href}`;
68
82
  }
@@ -72,6 +86,12 @@ const createHref = (context, dynamicPart, location, allowedParameters) => {
72
86
  const search = (0, _startsWith.default)(_context = location.search).call(_context, "?") ? location.search.substring(1) : location.search;
73
87
  href = `${href}?${search}`;
74
88
  }
89
+ if (dynamicPart instanceof _Href.default) {
90
+ return filterParameters(new _Href.default(href, dynamicPart.resourcetype, {
91
+ origin: dynamicPart.origin,
92
+ contextPath: dynamicPart.contextPath
93
+ }), allowedParameters);
94
+ }
75
95
  return filterParameters(href, allowedParameters);
76
96
  };
77
97
  exports.createHref = createHref;
@@ -1,11 +1,21 @@
1
1
  // @flow
2
+ import Href from "../../models/href/Href";
3
+
2
4
  import type { Location } from "react-router";
3
5
 
4
6
  /**
5
7
  */
6
8
  export const parseUrl = (
7
- href: string,
9
+ href: string | Href,
8
10
  ): { path: string, querystring: null | string, hash: null | string } => {
11
+ if (href instanceof Href) {
12
+ return {
13
+ path: href.path,
14
+ querystring: href.querystring,
15
+ hash: href.hash,
16
+ };
17
+ }
18
+
9
19
  let path = href;
10
20
  let hash = null;
11
21
  let querystring = null;
@@ -29,11 +39,11 @@ export const parseUrl = (
29
39
  /**
30
40
  */
31
41
  export const filterParameters = (
32
- href: string,
42
+ href: string | Href,
33
43
  allowedParameters?: Array<string>,
34
- ): string => {
44
+ ): Href => {
35
45
  if (!Array.isArray(allowedParameters)) {
36
- return href;
46
+ return new Href(href);
37
47
  }
38
48
 
39
49
  const url = parseUrl(href);
@@ -51,18 +61,27 @@ export const filterParameters = (
51
61
  if (url.hash) {
52
62
  filteredUrl = filteredUrl + "#" + url.hash;
53
63
  }
54
- return filteredUrl;
64
+
65
+ if (href instanceof Href) {
66
+ return new Href(filteredUrl, href.resourcetype, {
67
+ origin: href.origin,
68
+ contextPath: href.contextPath,
69
+ });
70
+ }
71
+
72
+ return new Href(filteredUrl);
55
73
  };
56
74
 
57
75
  /**
58
76
  */
59
77
  export const createHref = (
60
78
  context: string,
61
- dynamicPart: string,
79
+ dynamicPart: string | Href,
62
80
  location?: ?Location,
63
81
  allowedParameters?: Array<string>,
64
- ): string => {
65
- let href = dynamicPart;
82
+ ): Href => {
83
+ let href = dynamicPart.toString();
84
+
66
85
  if (!href.startsWith(`/${context}/`)) {
67
86
  href = `/${context}/${href}`;
68
87
  }
@@ -76,5 +95,15 @@ export const createHref = (
76
95
  href = `${href}?${search}`;
77
96
  }
78
97
 
98
+ if (dynamicPart instanceof Href) {
99
+ return filterParameters(
100
+ new Href(href, dynamicPart.resourcetype, {
101
+ origin: dynamicPart.origin,
102
+ contextPath: dynamicPart.contextPath,
103
+ }),
104
+ allowedParameters,
105
+ );
106
+ }
107
+
79
108
  return filterParameters(href, allowedParameters);
80
109
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createHref.js","names":["parseUrl","href","path","hash","querystring","_includes","default","call","hashSplit","split","qsSplit","exports","filterParameters","allowedParameters","Array","isArray","url","filteredUrl","searchParams","_urlSearchParams","params","_from","_keys","param","delete","toString","createHref","context","dynamicPart","location","_startsWith","replace","search","_context","substring"],"sources":["../../../src/utils/helpers/createHref.js"],"sourcesContent":["// @flow\nimport type { Location } from \"react-router\";\n\n/**\n */\nexport const parseUrl = (\n href: string,\n): { path: string, querystring: null | string, hash: null | string } => {\n let path = href;\n let hash = null;\n let querystring = null;\n if (href.includes(\"#\")) {\n const hashSplit = href.split(\"#\");\n path = hashSplit[0];\n hash = hashSplit[1];\n }\n if (href.includes(\"?\")) {\n const qsSplit = path.split(\"?\");\n path = qsSplit[0];\n querystring = qsSplit[1];\n }\n return {\n path,\n querystring,\n hash,\n };\n};\n\n/**\n */\nexport const filterParameters = (\n href: string,\n allowedParameters?: Array<string>,\n): string => {\n if (!Array.isArray(allowedParameters)) {\n return href;\n }\n\n const url = parseUrl(href);\n let filteredUrl = url.path;\n if (url.querystring) {\n const searchParams = new URLSearchParams(url.querystring);\n const params = Array.from(searchParams.keys());\n for (const param of params) {\n if (!allowedParameters.includes(param)) {\n searchParams.delete(param);\n }\n }\n filteredUrl = filteredUrl + \"?\" + searchParams.toString();\n }\n if (url.hash) {\n filteredUrl = filteredUrl + \"#\" + url.hash;\n }\n return filteredUrl;\n};\n\n/**\n */\nexport const createHref = (\n context: string,\n dynamicPart: string,\n location?: ?Location,\n allowedParameters?: Array<string>,\n): string => {\n let href = dynamicPart;\n if (!href.startsWith(`/${context}/`)) {\n href = `/${context}/${href}`;\n }\n\n href = href.replace(/\\/\\//g, \"/\");\n\n if (location?.search && !href.includes(\"?\")) {\n const search = location.search.startsWith(\"?\")\n ? location.search.substring(1)\n : location.search;\n href = `${href}?${search}`;\n }\n\n return filterParameters(href, allowedParameters);\n};\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"createHref.js","names":["_Href","_interopRequireDefault","require","parseUrl","href","Href","path","querystring","hash","_includes","default","call","hashSplit","split","qsSplit","exports","filterParameters","allowedParameters","Array","isArray","url","filteredUrl","searchParams","_urlSearchParams","params","_from","_keys","param","delete","toString","resourcetype","origin","contextPath","createHref","context","dynamicPart","location","_startsWith","replace","search","_context","substring"],"sources":["../../../src/utils/helpers/createHref.js"],"sourcesContent":["// @flow\nimport Href from \"../../models/href/Href\";\n\nimport type { Location } from \"react-router\";\n\n/**\n */\nexport const parseUrl = (\n href: string | Href,\n): { path: string, querystring: null | string, hash: null | string } => {\n if (href instanceof Href) {\n return {\n path: href.path,\n querystring: href.querystring,\n hash: href.hash,\n };\n }\n\n let path = href;\n let hash = null;\n let querystring = null;\n if (href.includes(\"#\")) {\n const hashSplit = href.split(\"#\");\n path = hashSplit[0];\n hash = hashSplit[1];\n }\n if (href.includes(\"?\")) {\n const qsSplit = path.split(\"?\");\n path = qsSplit[0];\n querystring = qsSplit[1];\n }\n return {\n path,\n querystring,\n hash,\n };\n};\n\n/**\n */\nexport const filterParameters = (\n href: string | Href,\n allowedParameters?: Array<string>,\n): Href => {\n if (!Array.isArray(allowedParameters)) {\n return new Href(href);\n }\n\n const url = parseUrl(href);\n let filteredUrl = url.path;\n if (url.querystring) {\n const searchParams = new URLSearchParams(url.querystring);\n const params = Array.from(searchParams.keys());\n for (const param of params) {\n if (!allowedParameters.includes(param)) {\n searchParams.delete(param);\n }\n }\n filteredUrl = filteredUrl + \"?\" + searchParams.toString();\n }\n if (url.hash) {\n filteredUrl = filteredUrl + \"#\" + url.hash;\n }\n\n if (href instanceof Href) {\n return new Href(filteredUrl, href.resourcetype, {\n origin: href.origin,\n contextPath: href.contextPath,\n });\n }\n\n return new Href(filteredUrl);\n};\n\n/**\n */\nexport const createHref = (\n context: string,\n dynamicPart: string | Href,\n location?: ?Location,\n allowedParameters?: Array<string>,\n): Href => {\n let href = dynamicPart.toString();\n\n if (!href.startsWith(`/${context}/`)) {\n href = `/${context}/${href}`;\n }\n\n href = href.replace(/\\/\\//g, \"/\");\n\n if (location?.search && !href.includes(\"?\")) {\n const search = location.search.startsWith(\"?\")\n ? location.search.substring(1)\n : location.search;\n href = `${href}?${search}`;\n }\n\n if (dynamicPart instanceof Href) {\n return filterParameters(\n new Href(href, dynamicPart.resourcetype, {\n origin: dynamicPart.origin,\n contextPath: dynamicPart.contextPath,\n }),\n allowedParameters,\n );\n }\n\n return filterParameters(href, allowedParameters);\n};\n"],"mappings":"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","ignoreList":[]}
@@ -12,7 +12,7 @@ var _constants = require("../../constants");
12
12
  * Only possible when serving using the UI Servlet of Be Informed
13
13
  */
14
14
  const getRepositoryResourceUrl = function (resourceUrl) {
15
- let contextPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _constants.getBasePath)();
15
+ let contextPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _constants.getBasePathServer)();
16
16
  let origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
17
17
  if ((0, _startsWith.default)(resourceUrl).call(resourceUrl, origin + contextPath)) {
18
18
  return resourceUrl;
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- import { getBasePath, RESOURCE_PATH } from "../../constants";
2
+ import { getBasePathServer, RESOURCE_PATH } from "../../constants";
3
3
 
4
4
  /**
5
5
  * Creates an url to a resource in the Be Informed repository
@@ -7,7 +7,7 @@ import { getBasePath, RESOURCE_PATH } from "../../constants";
7
7
  */
8
8
  export const getRepositoryResourceUrl = (
9
9
  resourceUrl: string,
10
- contextPath: string = getBasePath(),
10
+ contextPath: string = getBasePathServer(),
11
11
  origin: string = "",
12
12
  ): string => {
13
13
  if (resourceUrl.startsWith(origin + contextPath)) {
@@ -1 +1 @@
1
- {"version":3,"file":"repositoryResource.js","names":["_constants","require","getRepositoryResourceUrl","resourceUrl","contextPath","arguments","length","undefined","getBasePath","origin","_startsWith","default","call","RESOURCE_PATH","exports"],"sources":["../../../src/utils/helpers/repositoryResource.js"],"sourcesContent":["// @flow\nimport { getBasePath, RESOURCE_PATH } from \"../../constants\";\n\n/**\n * Creates an url to a resource in the Be Informed repository\n * Only possible when serving using the UI Servlet of Be Informed\n */\nexport const getRepositoryResourceUrl = (\n resourceUrl: string,\n contextPath: string = getBasePath(),\n origin: string = \"\",\n): string => {\n if (resourceUrl.startsWith(origin + contextPath)) {\n return resourceUrl;\n }\n\n if (resourceUrl.startsWith(RESOURCE_PATH)) {\n return `${origin}${contextPath}${resourceUrl}`;\n }\n\n return `${origin}${contextPath}${RESOURCE_PATH}${resourceUrl}`;\n};\n"],"mappings":";;;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAG,SAAAA,CACtCC,WAAmB,EAGR;EAAA,IAFXC,WAAmB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAAG,sBAAW,EAAC,CAAC;EAAA,IACnCC,MAAc,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAEnB,IAAI,IAAAK,WAAA,CAAAC,OAAA,EAAAR,WAAW,EAAAS,IAAA,CAAXT,WAAW,EAAYM,MAAM,GAAGL,WAAW,CAAC,EAAE;IAChD,OAAOD,WAAW;EACpB;EAEA,IAAI,IAAAO,WAAA,CAAAC,OAAA,EAAAR,WAAW,EAAAS,IAAA,CAAXT,WAAW,EAAYU,wBAAa,CAAC,EAAE;IACzC,OAAO,GAAGJ,MAAM,GAAGL,WAAW,GAAGD,WAAW,EAAE;EAChD;EAEA,OAAO,GAAGM,MAAM,GAAGL,WAAW,GAAGS,wBAAa,GAAGV,WAAW,EAAE;AAChE,CAAC;AAACW,OAAA,CAAAZ,wBAAA,GAAAA,wBAAA","ignoreList":[]}
1
+ {"version":3,"file":"repositoryResource.js","names":["_constants","require","getRepositoryResourceUrl","resourceUrl","contextPath","arguments","length","undefined","getBasePathServer","origin","_startsWith","default","call","RESOURCE_PATH","exports"],"sources":["../../../src/utils/helpers/repositoryResource.js"],"sourcesContent":["// @flow\nimport { getBasePathServer, RESOURCE_PATH } from \"../../constants\";\n\n/**\n * Creates an url to a resource in the Be Informed repository\n * Only possible when serving using the UI Servlet of Be Informed\n */\nexport const getRepositoryResourceUrl = (\n resourceUrl: string,\n contextPath: string = getBasePathServer(),\n origin: string = \"\",\n): string => {\n if (resourceUrl.startsWith(origin + contextPath)) {\n return resourceUrl;\n }\n\n if (resourceUrl.startsWith(RESOURCE_PATH)) {\n return `${origin}${contextPath}${resourceUrl}`;\n }\n\n return `${origin}${contextPath}${RESOURCE_PATH}${resourceUrl}`;\n};\n"],"mappings":";;;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAG,SAAAA,CACtCC,WAAmB,EAGR;EAAA,IAFXC,WAAmB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAAG,4BAAiB,EAAC,CAAC;EAAA,IACzCC,MAAc,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAEnB,IAAI,IAAAK,WAAA,CAAAC,OAAA,EAAAR,WAAW,EAAAS,IAAA,CAAXT,WAAW,EAAYM,MAAM,GAAGL,WAAW,CAAC,EAAE;IAChD,OAAOD,WAAW;EACpB;EAEA,IAAI,IAAAO,WAAA,CAAAC,OAAA,EAAAR,WAAW,EAAAS,IAAA,CAAXT,WAAW,EAAYU,wBAAa,CAAC,EAAE;IACzC,OAAO,GAAGJ,MAAM,GAAGL,WAAW,GAAGD,WAAW,EAAE;EAChD;EAEA,OAAO,GAAGM,MAAM,GAAGL,WAAW,GAAGS,wBAAa,GAAGV,WAAW,EAAE;AAChE,CAAC;AAACW,OAAA,CAAAZ,wBAAA,GAAAA,wBAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beinformed/ui",
3
- "version": "1.57.2",
3
+ "version": "1.57.3",
4
4
  "description": "Toolbox for be informed javascript layouts",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "bugs": "http://support.beinformed.com",
@@ -82,7 +82,7 @@
82
82
  "styled-components": "^5.0.0"
83
83
  },
84
84
  "dependencies": {
85
- "@babel/runtime-corejs3": "^7.25.9",
85
+ "@babel/runtime-corejs3": "^7.26.0",
86
86
  "big.js": "^6.2.2",
87
87
  "date-fns": "^4.1.0",
88
88
  "deepmerge": "^4.3.1",
@@ -99,13 +99,13 @@
99
99
  },
100
100
  "devDependencies": {
101
101
  "@babel/cli": "^7.25.9",
102
- "@babel/core": "^7.25.9",
102
+ "@babel/core": "^7.26.0",
103
103
  "@babel/eslint-parser": "^7.25.9",
104
104
  "@babel/eslint-plugin": "^7.25.9",
105
105
  "@babel/plugin-proposal-class-properties": "^7.18.6",
106
106
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
107
107
  "@babel/plugin-transform-runtime": "^7.25.9",
108
- "@babel/preset-env": "^7.25.9",
108
+ "@babel/preset-env": "^7.26.0",
109
109
  "@babel/preset-flow": "^7.25.9",
110
110
  "@babel/preset-react": "^7.25.9",
111
111
  "@commitlint/cli": "^19.5.0",
@@ -161,19 +161,29 @@ export const cacheContributions = (): boolean =>
161
161
  getSetting("CACHE_CONTRIBUTIONS", true);
162
162
 
163
163
  /**
164
- * Base path
165
- * This uses contextPath set from property from server
166
- * When requesting a remote server with CORS enabled, add the origin, for example:
167
- * export const BEINFORMED_PATH = 'http://192.168.128.61:8080/BeInformed';
164
+ * The context path is retrieved on the server using the context path property as set in the runtime properties
165
+ * This can be manually override by setting the UI setting 'CONTEXT_PATH'
168
166
  */
169
167
  export const getBasePath = (): string =>
170
168
  getSetting("CONTEXT_PATH", "/BeInformed");
171
169
 
170
+ /**
171
+ * The context path to modular ui rest services
172
+ */
173
+ export const getBasePathModularUI = (): string =>
174
+ getSetting("CONTEXT_PATH_SERVER", getBasePath());
175
+
176
+ /**
177
+ * Used to link the css and js files in the server templates
178
+ */
179
+ export const getBasePathServer = (): string =>
180
+ getSetting("CONTEXT_PATH_SERVER", getBasePath());
181
+
172
182
  /**
173
183
  * Path to upload service
174
184
  */
175
185
  export const getUploadPath = (
176
- contextPath: string = getBasePath(),
186
+ contextPath: string = getBasePathModularUI(),
177
187
  origin: string = "",
178
188
  ): string => `${origin}${contextPath}${UPLOAD_PATH}`;
179
189
 
@@ -181,7 +191,7 @@ export const getUploadPath = (
181
191
  * Path to captcha service
182
192
  */
183
193
  export const getCaptchaPath = (
184
- contextPath: string = getBasePath(),
194
+ contextPath: string = getBasePathModularUI(),
185
195
  origin: string = "",
186
196
  ): string => `${origin}${contextPath}${CAPTCHA_PATH}`;
187
197
 
@@ -7,7 +7,7 @@ import { login, logout, resetAuthErrors } from "../redux/actions";
7
7
  import Cache from "../utils/browser/Cache";
8
8
  import {
9
9
  DEFAULT_AUTHENTICATION_TYPE,
10
- getBasePath,
10
+ getBasePathServer,
11
11
  logoutPath,
12
12
  } from "../constants";
13
13
 
@@ -62,7 +62,7 @@ export const useLogin = (): LoginHook => {
62
62
  if (!isAuthenticated) {
63
63
  Cache.setItem("isRedirectLogin", true);
64
64
  window.location.assign(
65
- `${getBasePath()}${authenticationType.redirectUri ?? ""}`,
65
+ `${getBasePathServer()}${authenticationType.redirectUri ?? ""}`,
66
66
  );
67
67
  }
68
68
  },
@@ -76,7 +76,7 @@ export const useLogout = (): LogoutHook => {
76
76
  const application = useSelector(getApplication);
77
77
 
78
78
  const LOGOUT_PATH = logoutPath();
79
- const BASE_PATH = getBasePath();
79
+ const BASE_PATH = getBasePathServer();
80
80
 
81
81
  const isAuthenticated = application?.isLoggedIn ?? false;
82
82
  return {
@@ -14,6 +14,7 @@ import ContentModel from "../models/content/ContentModel";
14
14
  import { useModularUIBasic } from "./useModularUIBasic";
15
15
  import { ContentTypeModel } from "../models";
16
16
 
17
+ import type Href from "../models/href/Href";
17
18
  import type { UseModularUIBasicOptions } from "./useModularUIBasic";
18
19
  export type SearchFilter = {
19
20
  index?: string,
@@ -37,7 +38,7 @@ export const useModelCatalog = (
37
38
  /**
38
39
  */
39
40
  export const useConceptIndex = (
40
- href: string,
41
+ href: string | Href,
41
42
  key?: string = "conceptindex",
42
43
  options?: UseModularUIBasicOptions<ConceptIndexModel>,
43
44
  ): ?ConceptIndexModel => {
@@ -58,7 +59,7 @@ export const useConceptIndex = (
58
59
  /**
59
60
  */
60
61
  export const useConceptDetail = (
61
- concept: string,
62
+ concept: string | Href,
62
63
  key?: string = "conceptdetail",
63
64
  options?: UseModularUIBasicOptions<
64
65
  ConceptDetailModel | BusinessScenarioModel,
@@ -76,7 +77,7 @@ export const useConceptDetail = (
76
77
  /**
77
78
  */
78
79
  export const useContentIndex = (
79
- href: string,
80
+ href: string | Href,
80
81
  key?: string = "contentindex",
81
82
  options?: UseModularUIBasicOptions<ContentIndexModel>,
82
83
  ): ?ContentIndexModel => {
@@ -91,7 +92,7 @@ export const useContentIndex = (
91
92
  /**
92
93
  */
93
94
  export const useContentTOC = (
94
- content: string,
95
+ content: string | Href,
95
96
  key?: string = "contenttoc",
96
97
  options?: UseModularUIBasicOptions<ContentTOCModel>,
97
98
  ): ?ContentTOCModel => {
@@ -107,7 +108,7 @@ export const useContentTOC = (
107
108
  /**
108
109
  */
109
110
  export const useContent = (
110
- contentSection: string,
111
+ contentSection: string | Href,
111
112
  key?: string = "content",
112
113
  options?: UseModularUIBasicOptions<ContentModel>,
113
114
  ): ?ContentModel => {
@@ -122,7 +123,7 @@ export const useContent = (
122
123
  /**
123
124
  */
124
125
  export const useContentType = (
125
- contentType: string,
126
+ contentType: string | Href,
126
127
  key?: string = "contenttypes",
127
128
  options?: UseModularUIBasicOptions<ContentTypeModel>,
128
129
  ): ?ContentTypeModel => {
@@ -85,7 +85,7 @@ export const useModularUIBasic = <T: ModularUIModel>(
85
85
  [options, memoizedHref, location],
86
86
  );
87
87
 
88
- const modularUI = useModularUI(key, memoizedHref, useModularUIOptions);
88
+ const modularUI = useModularUI(key, href, useModularUIOptions);
89
89
  const expectedModels = useMemo(
90
90
  () => options.expectedModels ?? [],
91
91
  [options.expectedModels],
@@ -11,6 +11,8 @@ import UserProfileModel from "../models/user/UserProfileModel";
11
11
 
12
12
  import { useModularUIBasic } from "./useModularUIBasic";
13
13
 
14
+ import type Href from "../models/href/Href";
15
+
14
16
  type HookOptions = {
15
17
  origin?: string,
16
18
  contextPath?: string,
@@ -31,7 +33,10 @@ export const useApplication = (
31
33
  /**
32
34
  * Load a tab by href
33
35
  */
34
- export const useTab = (href: string, options?: HookOptions): TabModel | null =>
36
+ export const useTab = (
37
+ href: string | Href,
38
+ options?: HookOptions,
39
+ ): TabModel | null =>
35
40
  useModularUIBasic("tab", href, {
36
41
  expectedModels: ["Tab"],
37
42
  targetModel: TabModel,
@@ -42,7 +47,7 @@ export const useTab = (href: string, options?: HookOptions): TabModel | null =>
42
47
  * Load caseview by href
43
48
  */
44
49
  export const useCaseView = (
45
- href: string,
50
+ href: string | Href,
46
51
  options?: HookOptions,
47
52
  ): CaseViewModel | null =>
48
53
  useModularUIBasic("caseview", href, {
@@ -54,7 +59,7 @@ export const useCaseView = (
54
59
  /**
55
60
  */
56
61
  export const usePanel = (
57
- href: string,
62
+ href: string | Href,
58
63
  options?: HookOptions,
59
64
  ): ListModel | GroupingPanelModel | DetailModel | null =>
60
65
  useModularUIBasic("panel", href, {
@@ -65,7 +70,7 @@ export const usePanel = (
65
70
  /**
66
71
  */
67
72
  export const useList = (
68
- href: string,
73
+ href: string | Href,
69
74
  options?: HookOptions,
70
75
  ): ListModel | null =>
71
76
  useModularUIBasic("list", href, {
@@ -77,7 +82,7 @@ export const useList = (
77
82
  /**
78
83
  */
79
84
  export const useListOrDetail = (
80
- href: string,
85
+ href: string | Href,
81
86
  options?: HookOptions,
82
87
  ): ListModel | DetailModel | null =>
83
88
  useModularUIBasic("list", href, {
@@ -89,7 +94,7 @@ export const useListOrDetail = (
89
94
  /**
90
95
  */
91
96
  export const useListDetail = (
92
- href: string,
97
+ href: string | Href,
93
98
  options?: HookOptions,
94
99
  ): ListDetailModel | null =>
95
100
  useModularUIBasic("listdetail", href, {
@@ -102,7 +107,7 @@ export const useListDetail = (
102
107
  /**
103
108
  */
104
109
  export const useGroupingPanel = (
105
- href: string,
110
+ href: string | Href,
106
111
  options?: HookOptions,
107
112
  ): GroupingPanelModel | null =>
108
113
  useModularUIBasic("groupingpanel", href, {
@@ -114,7 +119,7 @@ export const useGroupingPanel = (
114
119
  /**
115
120
  */
116
121
  export const useDetailPanel = (
117
- href: string,
122
+ href: string | Href,
118
123
  options?: HookOptions,
119
124
  ): DetailModel | null =>
120
125
  useModularUIBasic("detailpanel", href, {
@@ -126,7 +131,7 @@ export const useDetailPanel = (
126
131
  /**
127
132
  */
128
133
  export const useQuicksearch = (
129
- href: string,
134
+ href: string | Href,
130
135
  options?: HookOptions,
131
136
  ): CaseSearchModel | null =>
132
137
  useModularUIBasic("quicksearch", href, {
@@ -138,7 +143,7 @@ export const useQuicksearch = (
138
143
  /**
139
144
  */
140
145
  export const useSearch = (
141
- href: string,
146
+ href: string | Href,
142
147
  options?: HookOptions,
143
148
  ): CaseSearchModel | null =>
144
149
  useModularUIBasic("search", href, {
@@ -150,7 +155,7 @@ export const useSearch = (
150
155
  /**
151
156
  */
152
157
  export const useUserProfile = (
153
- href: string,
158
+ href: string | Href,
154
159
  options?: HookOptions,
155
160
  ): UserProfileModel | null =>
156
161
  useModularUIBasic("userprofile", href, {
@@ -1,6 +1,7 @@
1
1
  // @flow
2
2
  import BaseCollection from "../base/BaseCollection";
3
3
  import ActionModel from "./ActionModel";
4
+ import type { ModelOptions } from "../types";
4
5
 
5
6
  /**
6
7
  * Collection of actions
@@ -9,8 +10,7 @@ export default class ActionCollection extends BaseCollection<ActionModel> {
9
10
  constructor(
10
11
  actions?: Object,
11
12
  actionsContributions?: Object,
12
- origin?: string,
13
- contextPath?: string,
13
+ modelOptions?: ModelOptions,
14
14
  ) {
15
15
  super();
16
16
 
@@ -28,12 +28,7 @@ export default class ActionCollection extends BaseCollection<ActionModel> {
28
28
 
29
29
  if (actionContribution) {
30
30
  actionModels.push(
31
- new ActionModel(
32
- actionData,
33
- actionContribution,
34
- origin,
35
- contextPath,
36
- ),
31
+ new ActionModel(actionData, actionContribution, modelOptions),
37
32
  );
38
33
  }
39
34
  }
@@ -7,14 +7,13 @@ import BaseModel from "../base/BaseModel";
7
7
  import Href from "../href/Href";
8
8
 
9
9
  import {
10
- getBasePath,
11
10
  HTTP_METHODS,
12
11
  CREATE_ACTION,
13
12
  UPDATE_ACTION,
14
13
  DELETE_ACTION,
15
14
  } from "../../constants";
16
15
 
17
- import type { AttributeType } from "../types";
16
+ import type { AttributeType, ModelOptions } from "../types";
18
17
 
19
18
  /**
20
19
  * Defines an Action. For instance an action on the tab 'books', which leads to a form
@@ -23,23 +22,19 @@ export default class ActionModel extends BaseModel {
23
22
  _fieldCollection: AttributeCollection;
24
23
  _href: Href;
25
24
  _icon: string;
26
- _origin: ?string;
27
- _contextPath: ?string;
28
25
 
29
26
  constructor(
30
27
  data: Object,
31
28
  contributions: Object,
32
- origin?: string,
33
- contextPath?: string,
29
+ modelOptions?: ModelOptions,
34
30
  ) {
35
- super(data, contributions);
31
+ super(data, contributions, modelOptions);
36
32
 
37
33
  this._fieldCollection = new AttributeCollection(
38
34
  this.data.fields,
39
35
  this.contributions.fields,
36
+ { ...modelOptions, isReadonly: false },
40
37
  );
41
- this._origin = origin;
42
- this._contextPath = contextPath;
43
38
  }
44
39
 
45
40
  /**
@@ -54,7 +49,7 @@ export default class ActionModel extends BaseModel {
54
49
  ): ActionModel {
55
50
  const data = { name, href };
56
51
  const contributions = { name, label: label ?? name, type };
57
- return new ActionModel(data, contributions, origin, contextPath);
52
+ return new ActionModel(data, contributions, { origin, contextPath });
58
53
  }
59
54
 
60
55
  /**
@@ -63,18 +58,6 @@ export default class ActionModel extends BaseModel {
63
58
  return this.data.href == null;
64
59
  }
65
60
 
66
- /**
67
- */
68
- get origin(): string {
69
- return this._origin ?? "";
70
- }
71
-
72
- /**
73
- */
74
- get contextPath(): string {
75
- return this._contextPath ?? getBasePath();
76
- }
77
-
78
61
  /**
79
62
  * retrieve href of action
80
63
  */
@@ -84,8 +67,7 @@ export default class ActionModel extends BaseModel {
84
67
  new Href(
85
68
  `${this.data.href}?${this.querystring}`,
86
69
  "Form",
87
- this.origin,
88
- this.contextPath,
70
+ this.modelOptions,
89
71
  )
90
72
  );
91
73
  }
@@ -204,6 +186,7 @@ export default class ActionModel extends BaseModel {
204
186
  return new ProcessStatusSettingsModel(
205
187
  this.getData("processStatus", {}),
206
188
  this.getContribution("processTask", {}),
189
+ this.modelOptions,
207
190
  );
208
191
  }
209
192
 
@@ -106,8 +106,7 @@ export default class ApplicationModel extends ResourceModel {
106
106
  "modelcatalog",
107
107
  "/modelcatalog",
108
108
  "Model catalog",
109
- this.origin,
110
- this.contextPath,
109
+ this.modelOptions,
111
110
  );
112
111
  }
113
112
 
@@ -11,7 +11,12 @@ import ContentConfiguration from "../contentconfiguration/ContentConfiguration";
11
11
 
12
12
  import { ConfigurationException } from "../../exceptions";
13
13
 
14
- import type { AttributeType, FormErrorAnchor } from "../types";
14
+ import type { AttributeType, FormErrorAnchor, ModelOptions } from "../types";
15
+
16
+ type AttributeCollectionOptions = {
17
+ ...ModelOptions,
18
+ isReadonly: boolean,
19
+ };
15
20
 
16
21
  /**
17
22
  * Collection of attributes
@@ -20,7 +25,7 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
20
25
  constructor(
21
26
  data: Object | Array<Object> = {},
22
27
  contributions: Array<Object> = [],
23
- isReadonly: boolean = false,
28
+ modelOptions?: AttributeCollectionOptions,
24
29
  ) {
25
30
  super();
26
31
 
@@ -28,11 +33,14 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
28
33
  contributions.forEach((contribution) => {
29
34
  const [key] = Object.keys(contribution);
30
35
 
31
- const attribute = createAttribute(key, data, contribution[key]);
36
+ const attribute = createAttribute(key, data, contribution[key], {
37
+ origin: modelOptions?.origin,
38
+ contextPath: modelOptions?.contextPath,
39
+ });
32
40
 
33
41
  if (attribute !== null) {
34
42
  // when readonly is not explicitly set in the contributions, follow argument
35
- if (isReadonly && !has(contribution[key], "readonly")) {
43
+ if (modelOptions?.isReadonly && !has(contribution[key], "readonly")) {
36
44
  attribute.readonly = true;
37
45
  }
38
46