@beinformed/ui 1.25.1 → 1.25.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/esm/constants/Constants.js +5 -0
  3. package/esm/constants/Constants.js.map +1 -1
  4. package/esm/hooks/useAuthentication.js +5 -5
  5. package/esm/hooks/useAuthentication.js.map +1 -1
  6. package/esm/hooks/useModularUI.js.map +1 -1
  7. package/esm/hooks/useModularUIBasic.js +3 -0
  8. package/esm/hooks/useModularUIBasic.js.map +1 -1
  9. package/esm/hooks/useModularUIModel.js +7 -0
  10. package/esm/hooks/useModularUIModel.js.map +1 -1
  11. package/esm/hooks/useModularUIRequest.js +5 -7
  12. package/esm/hooks/useModularUIRequest.js.map +1 -1
  13. package/esm/models/application/ApplicationModel.js +9 -1
  14. package/esm/models/application/ApplicationModel.js.map +1 -1
  15. package/esm/models/base/BaseModel.js +11 -2
  16. package/esm/models/base/BaseModel.js.map +1 -1
  17. package/esm/models/base/ResourceModel.js +8 -1
  18. package/esm/models/base/ResourceModel.js.map +1 -1
  19. package/esm/models/caseview/CaseViewModel.js +6 -0
  20. package/esm/models/caseview/CaseViewModel.js.map +1 -1
  21. package/esm/models/concepts/BusinessScenarioModel.js +6 -0
  22. package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
  23. package/esm/models/concepts/ConceptDetailModel.js +6 -0
  24. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  25. package/esm/models/concepts/ConceptIndexModel.js +6 -0
  26. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  27. package/esm/models/concepts/ConceptTypeDetailModel.js +6 -0
  28. package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  29. package/esm/models/content/ContentIndexModel.js +6 -0
  30. package/esm/models/content/ContentIndexModel.js.map +1 -1
  31. package/esm/models/content/ContentModel.js +6 -0
  32. package/esm/models/content/ContentModel.js.map +1 -1
  33. package/esm/models/content/ContentTOCModel.js +6 -0
  34. package/esm/models/content/ContentTOCModel.js.map +1 -1
  35. package/esm/models/content/ContentTypeModel.js +6 -0
  36. package/esm/models/content/ContentTypeModel.js.map +1 -1
  37. package/esm/models/detail/DetailModel.js +6 -0
  38. package/esm/models/detail/DetailModel.js.map +1 -1
  39. package/esm/models/form/FormModel.js +6 -0
  40. package/esm/models/form/FormModel.js.map +1 -1
  41. package/esm/models/form/FormObjectModel.js +45 -16
  42. package/esm/models/form/FormObjectModel.js.map +1 -1
  43. package/esm/models/list/ListDetailModel.js +6 -0
  44. package/esm/models/list/ListDetailModel.js.map +1 -1
  45. package/esm/models/list/ListModel.js +6 -0
  46. package/esm/models/list/ListModel.js.map +1 -1
  47. package/esm/models/lookup/LookupOptionsModel.js +6 -0
  48. package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
  49. package/esm/models/modelcatalog/ModelCatalogModel.js +6 -0
  50. package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
  51. package/esm/models/panels/GroupingPanelModel.js +6 -0
  52. package/esm/models/panels/GroupingPanelModel.js.map +1 -1
  53. package/esm/models/resolveModel.js +4 -4
  54. package/esm/models/resolveModel.js.map +1 -1
  55. package/esm/models/search/CaseSearchModel.js +6 -0
  56. package/esm/models/search/CaseSearchModel.js.map +1 -1
  57. package/esm/models/tab/TabModel.js +6 -0
  58. package/esm/models/tab/TabModel.js.map +1 -1
  59. package/esm/models/taskgroup/TaskGroupModel.js +6 -0
  60. package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
  61. package/esm/models/types.js.map +1 -1
  62. package/esm/models/user/UserModel.js +6 -0
  63. package/esm/models/user/UserModel.js.map +1 -1
  64. package/esm/models/user/UserProfileModel.js +6 -0
  65. package/esm/models/user/UserProfileModel.js.map +1 -1
  66. package/esm/models/user/UserServicesModel.js +6 -0
  67. package/esm/models/user/UserServicesModel.js.map +1 -1
  68. package/esm/modularui/ModularUIRequest.js +38 -11
  69. package/esm/modularui/ModularUIRequest.js.map +1 -1
  70. package/esm/modularui/types.js +2 -0
  71. package/esm/modularui/types.js.map +1 -0
  72. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  73. package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -1
  74. package/esm/redux/_modularui/types.js.map +1 -1
  75. package/esm/redux/_modularui/withModularUI.js.map +1 -1
  76. package/esm/utils/fetch/types.js.map +1 -1
  77. package/lib/constants/Constants.js +7 -1
  78. package/lib/constants/Constants.js.flow +6 -0
  79. package/lib/constants/Constants.js.map +1 -1
  80. package/lib/hooks/__tests__/UseModularUIModel.spec.js.flow +1 -1
  81. package/lib/hooks/__tests__/useModelCatalog.spec.js.flow +1 -1
  82. package/lib/hooks/__tests__/useModularUIBasic.spec.js.flow +2 -2
  83. package/lib/hooks/useAuthentication.js +4 -4
  84. package/lib/hooks/useAuthentication.js.flow +17 -5
  85. package/lib/hooks/useAuthentication.js.map +1 -1
  86. package/lib/hooks/useModularUI.js.flow +2 -2
  87. package/lib/hooks/useModularUI.js.map +1 -1
  88. package/lib/hooks/useModularUIBasic.js +3 -0
  89. package/lib/hooks/useModularUIBasic.js.flow +6 -3
  90. package/lib/hooks/useModularUIBasic.js.map +1 -1
  91. package/lib/hooks/useModularUIModel.js +9 -1
  92. package/lib/hooks/useModularUIModel.js.flow +18 -10
  93. package/lib/hooks/useModularUIModel.js.map +1 -1
  94. package/lib/hooks/useModularUIRequest.js +5 -7
  95. package/lib/hooks/useModularUIRequest.js.flow +12 -11
  96. package/lib/hooks/useModularUIRequest.js.map +1 -1
  97. package/lib/models/application/ApplicationModel.js +8 -1
  98. package/lib/models/application/ApplicationModel.js.flow +10 -1
  99. package/lib/models/application/ApplicationModel.js.map +1 -1
  100. package/lib/models/base/BaseModel.js +11 -2
  101. package/lib/models/base/BaseModel.js.flow +12 -3
  102. package/lib/models/base/BaseModel.js.map +1 -1
  103. package/lib/models/base/ResourceModel.js +8 -1
  104. package/lib/models/base/ResourceModel.js.flow +8 -1
  105. package/lib/models/base/ResourceModel.js.map +1 -1
  106. package/lib/models/caseview/CaseViewModel.js +6 -0
  107. package/lib/models/caseview/CaseViewModel.js.flow +6 -0
  108. package/lib/models/caseview/CaseViewModel.js.map +1 -1
  109. package/lib/models/concepts/BusinessScenarioModel.js +6 -0
  110. package/lib/models/concepts/BusinessScenarioModel.js.flow +6 -0
  111. package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
  112. package/lib/models/concepts/ConceptDetailModel.js +6 -0
  113. package/lib/models/concepts/ConceptDetailModel.js.flow +6 -0
  114. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  115. package/lib/models/concepts/ConceptIndexModel.js +6 -0
  116. package/lib/models/concepts/ConceptIndexModel.js.flow +6 -0
  117. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  118. package/lib/models/concepts/ConceptTypeDetailModel.js +6 -0
  119. package/lib/models/concepts/ConceptTypeDetailModel.js.flow +6 -0
  120. package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  121. package/lib/models/content/ContentIndexModel.js +6 -0
  122. package/lib/models/content/ContentIndexModel.js.flow +6 -0
  123. package/lib/models/content/ContentIndexModel.js.map +1 -1
  124. package/lib/models/content/ContentModel.js +6 -0
  125. package/lib/models/content/ContentModel.js.flow +6 -0
  126. package/lib/models/content/ContentModel.js.map +1 -1
  127. package/lib/models/content/ContentTOCModel.js +6 -0
  128. package/lib/models/content/ContentTOCModel.js.flow +6 -0
  129. package/lib/models/content/ContentTOCModel.js.map +1 -1
  130. package/lib/models/content/ContentTypeModel.js +6 -0
  131. package/lib/models/content/ContentTypeModel.js.flow +6 -0
  132. package/lib/models/content/ContentTypeModel.js.map +1 -1
  133. package/lib/models/detail/DetailModel.js +6 -0
  134. package/lib/models/detail/DetailModel.js.flow +6 -0
  135. package/lib/models/detail/DetailModel.js.map +1 -1
  136. package/lib/models/form/FormModel.js +6 -0
  137. package/lib/models/form/FormModel.js.flow +6 -0
  138. package/lib/models/form/FormModel.js.map +1 -1
  139. package/lib/models/form/FormObjectModel.js +45 -16
  140. package/lib/models/form/FormObjectModel.js.flow +71 -24
  141. package/lib/models/form/FormObjectModel.js.map +1 -1
  142. package/lib/models/form/__tests__/FormModel.repeating.spec.js.flow +4 -0
  143. package/lib/models/list/ListDetailModel.js +6 -0
  144. package/lib/models/list/ListDetailModel.js.flow +6 -0
  145. package/lib/models/list/ListDetailModel.js.map +1 -1
  146. package/lib/models/list/ListModel.js +6 -0
  147. package/lib/models/list/ListModel.js.flow +6 -0
  148. package/lib/models/list/ListModel.js.map +1 -1
  149. package/lib/models/lookup/LookupOptionsModel.js +6 -0
  150. package/lib/models/lookup/LookupOptionsModel.js.flow +6 -0
  151. package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
  152. package/lib/models/modelcatalog/ModelCatalogModel.js +6 -0
  153. package/lib/models/modelcatalog/ModelCatalogModel.js.flow +6 -0
  154. package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
  155. package/lib/models/panels/GroupingPanelModel.js +6 -0
  156. package/lib/models/panels/GroupingPanelModel.js.flow +6 -0
  157. package/lib/models/panels/GroupingPanelModel.js.map +1 -1
  158. package/lib/models/resolveModel.js +4 -3
  159. package/lib/models/resolveModel.js.flow +6 -4
  160. package/lib/models/resolveModel.js.map +1 -1
  161. package/lib/models/search/CaseSearchModel.js +6 -0
  162. package/lib/models/search/CaseSearchModel.js.flow +6 -0
  163. package/lib/models/search/CaseSearchModel.js.map +1 -1
  164. package/lib/models/tab/TabModel.js +6 -0
  165. package/lib/models/tab/TabModel.js.flow +6 -0
  166. package/lib/models/tab/TabModel.js.map +1 -1
  167. package/lib/models/taskgroup/TaskGroupModel.js +6 -0
  168. package/lib/models/taskgroup/TaskGroupModel.js.flow +6 -0
  169. package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
  170. package/lib/models/types.js.flow +1 -1
  171. package/lib/models/types.js.map +1 -1
  172. package/lib/models/user/UserModel.js +6 -0
  173. package/lib/models/user/UserModel.js.flow +6 -0
  174. package/lib/models/user/UserModel.js.map +1 -1
  175. package/lib/models/user/UserProfileModel.js +6 -0
  176. package/lib/models/user/UserProfileModel.js.flow +6 -0
  177. package/lib/models/user/UserProfileModel.js.map +1 -1
  178. package/lib/models/user/UserServicesModel.js +6 -0
  179. package/lib/models/user/UserServicesModel.js.flow +6 -0
  180. package/lib/models/user/UserServicesModel.js.map +1 -1
  181. package/lib/modularui/ModularUIRequest.js +38 -11
  182. package/lib/modularui/ModularUIRequest.js.flow +65 -17
  183. package/lib/modularui/ModularUIRequest.js.map +1 -1
  184. package/lib/modularui/__tests__/ModularUIRequest.spec.js.flow +4 -9
  185. package/lib/modularui/types.js +2 -0
  186. package/lib/modularui/types.js.flow +4 -0
  187. package/lib/modularui/types.js.map +1 -0
  188. package/lib/redux/_modularui/ModularUIActions.js.flow +4 -4
  189. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  190. package/lib/redux/_modularui/ModularUIMiddleware.js.flow +3 -2
  191. package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -1
  192. package/lib/redux/_modularui/types.js.flow +4 -3
  193. package/lib/redux/_modularui/types.js.map +1 -1
  194. package/lib/redux/_modularui/withModularUI.js.flow +2 -2
  195. package/lib/redux/_modularui/withModularUI.js.map +1 -1
  196. package/lib/utils/fetch/types.js.flow +12 -4
  197. package/lib/utils/fetch/types.js.map +1 -1
  198. package/package.json +7 -7
  199. package/src/constants/Constants.js +6 -0
  200. package/src/hooks/__tests__/UseModularUIModel.spec.js +1 -1
  201. package/src/hooks/__tests__/useModelCatalog.spec.js +1 -1
  202. package/src/hooks/__tests__/useModularUIBasic.spec.js +2 -2
  203. package/src/hooks/useAuthentication.js +17 -5
  204. package/src/hooks/useModularUI.js +2 -2
  205. package/src/hooks/useModularUIBasic.js +6 -3
  206. package/src/hooks/useModularUIModel.js +18 -10
  207. package/src/hooks/useModularUIRequest.js +12 -11
  208. package/src/models/application/ApplicationModel.js +10 -1
  209. package/src/models/base/BaseModel.js +12 -3
  210. package/src/models/base/ResourceModel.js +8 -1
  211. package/src/models/caseview/CaseViewModel.js +6 -0
  212. package/src/models/concepts/BusinessScenarioModel.js +6 -0
  213. package/src/models/concepts/ConceptDetailModel.js +6 -0
  214. package/src/models/concepts/ConceptIndexModel.js +6 -0
  215. package/src/models/concepts/ConceptTypeDetailModel.js +6 -0
  216. package/src/models/content/ContentIndexModel.js +6 -0
  217. package/src/models/content/ContentModel.js +6 -0
  218. package/src/models/content/ContentTOCModel.js +6 -0
  219. package/src/models/content/ContentTypeModel.js +6 -0
  220. package/src/models/detail/DetailModel.js +6 -0
  221. package/src/models/form/FormModel.js +6 -0
  222. package/src/models/form/FormObjectModel.js +71 -24
  223. package/src/models/form/__tests__/FormModel.repeating.spec.js +4 -0
  224. package/src/models/list/ListDetailModel.js +6 -0
  225. package/src/models/list/ListModel.js +6 -0
  226. package/src/models/lookup/LookupOptionsModel.js +6 -0
  227. package/src/models/modelcatalog/ModelCatalogModel.js +6 -0
  228. package/src/models/panels/GroupingPanelModel.js +6 -0
  229. package/src/models/resolveModel.js +6 -4
  230. package/src/models/search/CaseSearchModel.js +6 -0
  231. package/src/models/tab/TabModel.js +6 -0
  232. package/src/models/taskgroup/TaskGroupModel.js +6 -0
  233. package/src/models/types.js +1 -1
  234. package/src/models/user/UserModel.js +6 -0
  235. package/src/models/user/UserProfileModel.js +6 -0
  236. package/src/models/user/UserServicesModel.js +6 -0
  237. package/src/modularui/ModularUIRequest.js +65 -17
  238. package/src/modularui/__tests__/ModularUIRequest.spec.js +4 -9
  239. package/src/modularui/types.js +4 -0
  240. package/src/redux/_modularui/ModularUIActions.js +4 -4
  241. package/src/redux/_modularui/ModularUIMiddleware.js +3 -2
  242. package/src/redux/_modularui/types.js +4 -3
  243. package/src/redux/_modularui/withModularUI.js +2 -2
  244. package/src/utils/fetch/types.js +12 -4
  245. package/types/constants/Constants.d.ts +5 -0
  246. package/types/models/base/BaseModel.d.ts +12 -3
  247. package/types/models/base/ResourceModel.d.ts +5 -1
  248. package/types/models/form/FormObjectModel.d.ts +28 -0
  249. package/types/models/resolveModel.d.ts +1 -1
  250. package/types/models/types.d.ts +1 -1
  251. package/types/modularui/ModularUIRequest.d.ts +15 -7
  252. package/types/modularui/types.d.ts +2 -0
  253. package/types/redux/_modularui/types.d.ts +2 -2
  254. package/types/utils/fetch/types.d.ts +8 -5
@@ -51,6 +51,12 @@ export default class TaskGroupModel extends ResourceModel {
51
51
  return "TaskGroup";
52
52
  }
53
53
 
54
+ /**
55
+ */
56
+ static get modelName(): string {
57
+ return "TaskGroupModel";
58
+ }
59
+
54
60
  /**
55
61
  */
56
62
  static isApplicableModel(data: ModularUIResponse): boolean {
@@ -1 +1 @@
1
- {"version":3,"file":"TaskGroupModel.js","names":["TaskGroupModel","ResourceModel","constructor","modularuiResponse","_actionCollection","ActionCollection","data","actions","contributions","selfHref","links","getLinkByKey","selflink","href","_key","substring","lastIndexOf","name","create","key","taskgroup","ModularUIResponse","type","isApplicableModel","resourcetype","label","actionCollection"],"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 );\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 ): TaskGroupModel {\n const taskgroup = new ModularUIResponse();\n taskgroup.key = key;\n taskgroup.data = data;\n taskgroup.contributions = contributions;\n\n return new TaskGroupModel(taskgroup);\n }\n\n /**\n */\n get type(): string {\n return \"TaskGroup\";\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"],"mappings":";;;;;;;;AACA;AACA;AAEA;AAEA;AACA;AACA;AACe,MAAMA,cAAc,SAASC,sBAAa,CAAC;EAIxD;AACF;EACEC,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAACC,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,CAC3B;IAED,MAAME,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,CAACV,IAAI,CAACW,IAAI;EACpB;;EAEA;AACF;EACE,OAAOC,MAAM,CACXC,GAAW,EACXb,IAAY,EACZE,aAAqB,EACL;IAChB,MAAMY,SAAS,GAAG,IAAIC,0BAAiB,EAAE;IACzCD,SAAS,CAACD,GAAG,GAAGA,GAAG;IACnBC,SAAS,CAACd,IAAI,GAAGA,IAAI;IACrBc,SAAS,CAACZ,aAAa,GAAGA,aAAa;IAEvC,OAAO,IAAIR,cAAc,CAACoB,SAAS,CAAC;EACtC;;EAEA;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACjB,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACE,aAAa,CAACgB,YAAY,IAC/BlB,IAAI,CAACE,aAAa,CAACgB,YAAY,KAAK,WAAW;EAEnD;;EAEA;AACF;AACA;EACE,IAAIL,GAAG,GAAW;IAChB,OAAO,IAAI,CAACL,IAAI;EAClB;;EAEA;AACF;AACA;EACE,IAAIW,KAAK,GAAW;IAClB,OAAO,IAAI,CAACjB,aAAa,CAACiB,KAAK;EACjC;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgB,GAAqB;IACvC,OAAO,IAAI,CAACtB,iBAAiB;EAC/B;AACF;AAAC"}
1
+ {"version":3,"file":"TaskGroupModel.js","names":["TaskGroupModel","ResourceModel","constructor","modularuiResponse","_actionCollection","ActionCollection","data","actions","contributions","selfHref","links","getLinkByKey","selflink","href","_key","substring","lastIndexOf","name","create","key","taskgroup","ModularUIResponse","type","modelName","isApplicableModel","resourcetype","label","actionCollection"],"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 );\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 ): TaskGroupModel {\n const taskgroup = new ModularUIResponse();\n taskgroup.key = key;\n taskgroup.data = data;\n taskgroup.contributions = contributions;\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"],"mappings":";;;;;;;;AACA;AACA;AAEA;AAEA;AACA;AACA;AACe,MAAMA,cAAc,SAASC,sBAAa,CAAC;EAIxD;AACF;EACEC,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAACC,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,CAC3B;IAED,MAAME,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,CAACV,IAAI,CAACW,IAAI;EACpB;;EAEA;AACF;EACE,OAAOC,MAAM,CACXC,GAAW,EACXb,IAAY,EACZE,aAAqB,EACL;IAChB,MAAMY,SAAS,GAAG,IAAIC,0BAAiB,EAAE;IACzCD,SAAS,CAACD,GAAG,GAAGA,GAAG;IACnBC,SAAS,CAACd,IAAI,GAAGA,IAAI;IACrBc,SAAS,CAACZ,aAAa,GAAGA,aAAa;IAEvC,OAAO,IAAIR,cAAc,CAACoB,SAAS,CAAC;EACtC;;EAEA;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,gBAAgB;EACzB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAAClB,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACE,aAAa,CAACiB,YAAY,IAC/BnB,IAAI,CAACE,aAAa,CAACiB,YAAY,KAAK,WAAW;EAEnD;;EAEA;AACF;AACA;EACE,IAAIN,GAAG,GAAW;IAChB,OAAO,IAAI,CAACL,IAAI;EAClB;;EAEA;AACF;AACA;EACE,IAAIY,KAAK,GAAW;IAClB,OAAO,IAAI,CAAClB,aAAa,CAACkB,KAAK;EACjC;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgB,GAAqB;IACvC,OAAO,IAAI,CAACvB,iBAAiB;EAC/B;AACF;AAAC"}
@@ -157,7 +157,7 @@ export interface IModelWithChildModels {
157
157
  export type AuthenticationType = {
158
158
  name: string,
159
159
  authentication: string,
160
- redirectUri: string,
160
+ redirectUri?: string,
161
161
  isPrimary: boolean,
162
162
  };
163
163
 
@@ -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\";\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(models: Array<ModularUIModel>): 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":""}
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\";\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(models: Array<ModularUIModel>): 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":""}
@@ -16,6 +16,12 @@ class UserModel extends _ResourceModel.default {
16
16
  return "User";
17
17
  }
18
18
 
19
+ /**
20
+ */
21
+ static get modelName() {
22
+ return "UserModel";
23
+ }
24
+
19
25
  /**
20
26
  */
21
27
  static isApplicableModel(data) {
@@ -13,6 +13,12 @@ export default class UserModel extends ResourceModel {
13
13
  return "User";
14
14
  }
15
15
 
16
+ /**
17
+ */
18
+ static get modelName(): string {
19
+ return "UserModel";
20
+ }
21
+
16
22
  /**
17
23
  */
18
24
  static isApplicableModel(data: ModularUIResponse): boolean {
@@ -1 +1 @@
1
- {"version":3,"file":"UserModel.js","names":["UserModel","ResourceModel","type","isApplicableModel","data","contributions","resourcetype","username","Username","fullname","Fullname","label"],"sources":["../../../src/models/user/UserModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"User\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"userdata\"\n );\n }\n\n /**\n * Retrieve username of user\n */\n get username(): string {\n return this.data.Username || \"Guest\";\n }\n\n /**\n * retrieve the fullname of the user\n */\n get fullname(): string {\n return this.data.Fullname || \"Guest\";\n }\n\n /**\n */\n get label(): string {\n return this.contributions.label;\n }\n}\n"],"mappings":";;;;;;;AACA;AAIA;AACA;AACA;AACe,MAAMA,SAAS,SAASC,sBAAa,CAAC;EACnD;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,MAAM;EACf;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,UAAU;EAElD;;EAEA;AACF;AACA;EACE,IAAIC,QAAQ,GAAW;IACrB,OAAO,IAAI,CAACH,IAAI,CAACI,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;AACA;EACE,IAAIC,QAAQ,GAAW;IACrB,OAAO,IAAI,CAACL,IAAI,CAACM,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACN,aAAa,CAACM,KAAK;EACjC;AACF;AAAC"}
1
+ {"version":3,"file":"UserModel.js","names":["UserModel","ResourceModel","type","modelName","isApplicableModel","data","contributions","resourcetype","username","Username","fullname","Fullname","label"],"sources":["../../../src/models/user/UserModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"User\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"userdata\"\n );\n }\n\n /**\n * Retrieve username of user\n */\n get username(): string {\n return this.data.Username || \"Guest\";\n }\n\n /**\n * retrieve the fullname of the user\n */\n get fullname(): string {\n return this.data.Fullname || \"Guest\";\n }\n\n /**\n */\n get label(): string {\n return this.contributions.label;\n }\n}\n"],"mappings":";;;;;;;AACA;AAIA;AACA;AACA;AACe,MAAMA,SAAS,SAASC,sBAAa,CAAC;EACnD;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,MAAM;EACf;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,UAAU;EAElD;;EAEA;AACF;AACA;EACE,IAAIC,QAAQ,GAAW;IACrB,OAAO,IAAI,CAACH,IAAI,CAACI,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;AACA;EACE,IAAIC,QAAQ,GAAW;IACrB,OAAO,IAAI,CAACL,IAAI,CAACM,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACN,aAAa,CAACM,KAAK;EACjC;AACF;AAAC"}
@@ -41,6 +41,12 @@ class UserProfileModel extends _UserModel.default {
41
41
  get attributeCollection() {
42
42
  return this._attributeCollection;
43
43
  }
44
+
45
+ /**
46
+ */
47
+ static get modelName() {
48
+ return "UserProfileModel";
49
+ }
44
50
  }
45
51
  exports.default = UserProfileModel;
46
52
  //# sourceMappingURL=UserProfileModel.js.map
@@ -44,4 +44,10 @@ export default class UserProfileModel extends UserModel {
44
44
  get attributeCollection(): AttributeCollection {
45
45
  return this._attributeCollection;
46
46
  }
47
+
48
+ /**
49
+ */
50
+ static get modelName(): string {
51
+ return "UserProfileModel";
52
+ }
47
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UserProfileModel.js","names":["UserProfileModel","UserModel","constructor","modularuiResponse","attributeContributions","contributions","attributes","contribution","key","has","data","_attributeCollection","AttributeCollection","type","attributeCollection"],"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"],"mappings":";;;;;;;;;;AACA;AAEA;AAEA;AAIA;AACA;AACA;AACe,MAAMA,gBAAgB,SAASC,kBAAS,CAAC;EAGtD;AACF;AACA;EACEC,WAAW,CAACC,iBAAoC,EAAE;IAAA;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAEzB,MAAMC,sBAAsB,GAAG,IAAI,CAACC,aAAa,CAACC,UAAU,GACxD,oCAAI,CAACD,aAAa,CAACC,UAAU,iBAASC,YAAY,IAAK;MACrD,MAAM,CAACC,GAAG,CAAC,GAAG,mBAAYD,YAAY,CAAC;MACvC,OAAOC,GAAG,KAAK,aAAa,IAAI,IAAAC,YAAG,EAAC,IAAI,CAACC,IAAI,EAAEF,GAAG,CAAC;IACrD,CAAC,CAAC,GACF,EAAE;IAEN,IAAI,CAACG,oBAAoB,GAAG,IAAIC,4BAAmB,CACjD,IAAI,CAACF,IAAI,EACTN,sBAAsB,CACvB;EACH;;EAEA;AACF;EACE,IAAIS,IAAI,GAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmB,GAAwB;IAC7C,OAAO,IAAI,CAACH,oBAAoB;EAClC;AACF;AAAC"}
1
+ {"version":3,"file":"UserProfileModel.js","names":["UserProfileModel","UserModel","constructor","modularuiResponse","attributeContributions","contributions","attributes","contribution","key","has","data","_attributeCollection","AttributeCollection","type","attributeCollection","modelName"],"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;AAEA;AAEA;AAIA;AACA;AACA;AACe,MAAMA,gBAAgB,SAASC,kBAAS,CAAC;EAGtD;AACF;AACA;EACEC,WAAW,CAACC,iBAAoC,EAAE;IAAA;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAEzB,MAAMC,sBAAsB,GAAG,IAAI,CAACC,aAAa,CAACC,UAAU,GACxD,oCAAI,CAACD,aAAa,CAACC,UAAU,iBAASC,YAAY,IAAK;MACrD,MAAM,CAACC,GAAG,CAAC,GAAG,mBAAYD,YAAY,CAAC;MACvC,OAAOC,GAAG,KAAK,aAAa,IAAI,IAAAC,YAAG,EAAC,IAAI,CAACC,IAAI,EAAEF,GAAG,CAAC;IACrD,CAAC,CAAC,GACF,EAAE;IAEN,IAAI,CAACG,oBAAoB,GAAG,IAAIC,4BAAmB,CACjD,IAAI,CAACF,IAAI,EACTN,sBAAsB,CACvB;EACH;;EAEA;AACF;EACE,IAAIS,IAAI,GAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmB,GAAwB;IAC7C,OAAO,IAAI,CAACH,oBAAoB;EAClC;;EAEA;AACF;EACE,WAAWI,SAAS,GAAW;IAC7B,OAAO,kBAAkB;EAC3B;AACF;AAAC"}
@@ -23,6 +23,12 @@ class UserServicesModel extends _ResourceModel.default {
23
23
  return "UserServices";
24
24
  }
25
25
 
26
+ /**
27
+ */
28
+ static get modelName() {
29
+ return "UserServicesModel";
30
+ }
31
+
26
32
  /**
27
33
  */
28
34
  static isApplicableModel(data) {
@@ -19,6 +19,12 @@ class UserServicesModel extends ResourceModel {
19
19
  return "UserServices";
20
20
  }
21
21
 
22
+ /**
23
+ */
24
+ static get modelName(): string {
25
+ return "UserServicesModel";
26
+ }
27
+
22
28
  /**
23
29
  */
24
30
  static isApplicableModel(data: ModularUIResponse): boolean {
@@ -1 +1 @@
1
- {"version":3,"file":"UserServicesModel.js","names":["UserServicesModel","ResourceModel","type","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userData","userLink","setChildModels","models","user","model","links","getLinkByKey","_user","UserModel","label","getContribution","changePassword","changePasswordLink","href","isLoggedIn","hasUser","UNSECURE_LINK_COUNT","length"],"sources":["../../../src/models/user/UserServicesModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport UserModel from \"../user/UserModel\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\n\n/**\n * UserServicesModel model\n */\nclass UserServicesModel extends ResourceModel {\n _user: ?UserModel;\n\n /**\n */\n get type(): string {\n return \"UserServices\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"user_services\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userData = this.userLink;\n return userData ? [userData] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.user = models.find((model) => model.type === \"User\");\n }\n\n /**\n */\n get userLink(): LinkModel | null {\n return this.links.getLinkByKey(\"Userdata\");\n }\n\n /**\n * return the user model for the current user\n */\n get user(): UserModel | null {\n return this._user || null;\n }\n\n /**\n * Set user data\n */\n set user(model: ?ModularUIModel) {\n this._user = model instanceof UserModel ? model : null;\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n */\n get changePassword(): Href | null {\n const changePasswordLink = this.links.getLinkByKey(\"ChangePassword\");\n\n if (changePasswordLink) {\n return changePasswordLink.href;\n }\n\n return null;\n }\n\n // when more than three unsecure links are present (always present: self, contributions and api-docs),\n // the userservice is permitted and thus we have an indication the user is probably\n // logged in\n /**\n */\n get isLoggedIn(): boolean {\n const hasUser = this.user instanceof UserModel;\n\n const UNSECURE_LINK_COUNT = 3;\n return this.links.length > UNSECURE_LINK_COUNT || hasUser;\n }\n}\n\nexport default UserServicesModel;\n"],"mappings":";;;;;;;;;AACA;AACA;AAOA;AACA;AACA;AACA,MAAMA,iBAAiB,SAASC,sBAAa,CAAC;EAAA;IAAA;IAAA;EAAA;EAG5C;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,cAAc;EACvB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,eAAe;EAEvD;;EAEA;AACF;EACEC,yBAAyB,GAAqB;IAC5C,MAAMC,QAAQ,GAAG,IAAI,CAACC,QAAQ;IAC9B,OAAOD,QAAQ,GAAG,CAACA,QAAQ,CAAC,GAAG,EAAE;EACnC;;EAEA;AACF;EACEE,cAAc,CAACC,MAA6B,EAAE;IAC5C,IAAI,CAACC,IAAI,GAAG,mBAAAD,MAAM,OAANA,MAAM,EAAOE,KAAK,IAAKA,KAAK,CAACX,IAAI,KAAK,MAAM,CAAC;EAC3D;;EAEA;AACF;EACE,IAAIO,QAAQ,GAAqB;IAC/B,OAAO,IAAI,CAACK,KAAK,CAACC,YAAY,CAAC,UAAU,CAAC;EAC5C;;EAEA;AACF;AACA;EACE,IAAIH,IAAI,GAAqB;IAC3B,OAAO,IAAI,CAACI,KAAK,IAAI,IAAI;EAC3B;;EAEA;AACF;AACA;EACE,IAAIJ,IAAI,CAACC,KAAsB,EAAE;IAC/B,IAAI,CAACG,KAAK,GAAGH,KAAK,YAAYI,kBAAS,GAAGJ,KAAK,GAAG,IAAI;EACxD;;EAEA;AACF;AACA;EACE,IAAIK,KAAK,GAAW;IAClB,OAAO,IAAI,CAACC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;EACE,IAAIC,cAAc,GAAgB;IAChC,MAAMC,kBAAkB,GAAG,IAAI,CAACP,KAAK,CAACC,YAAY,CAAC,gBAAgB,CAAC;IAEpE,IAAIM,kBAAkB,EAAE;MACtB,OAAOA,kBAAkB,CAACC,IAAI;IAChC;IAEA,OAAO,IAAI;EACb;;EAEA;EACA;EACA;EACA;AACF;EACE,IAAIC,UAAU,GAAY;IACxB,MAAMC,OAAO,GAAG,IAAI,CAACZ,IAAI,YAAYK,kBAAS;IAE9C,MAAMQ,mBAAmB,GAAG,CAAC;IAC7B,OAAO,IAAI,CAACX,KAAK,CAACY,MAAM,GAAGD,mBAAmB,IAAID,OAAO;EAC3D;AACF;AAAC,eAEcxB,iBAAiB;AAAA"}
1
+ {"version":3,"file":"UserServicesModel.js","names":["UserServicesModel","ResourceModel","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userData","userLink","setChildModels","models","user","model","links","getLinkByKey","_user","UserModel","label","getContribution","changePassword","changePasswordLink","href","isLoggedIn","hasUser","UNSECURE_LINK_COUNT","length"],"sources":["../../../src/models/user/UserServicesModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport UserModel from \"../user/UserModel\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\n\n/**\n * UserServicesModel model\n */\nclass UserServicesModel extends ResourceModel {\n _user: ?UserModel;\n\n /**\n */\n get type(): string {\n return \"UserServices\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserServicesModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"user_services\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userData = this.userLink;\n return userData ? [userData] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.user = models.find((model) => model.type === \"User\");\n }\n\n /**\n */\n get userLink(): LinkModel | null {\n return this.links.getLinkByKey(\"Userdata\");\n }\n\n /**\n * return the user model for the current user\n */\n get user(): UserModel | null {\n return this._user || null;\n }\n\n /**\n * Set user data\n */\n set user(model: ?ModularUIModel) {\n this._user = model instanceof UserModel ? model : null;\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n */\n get changePassword(): Href | null {\n const changePasswordLink = this.links.getLinkByKey(\"ChangePassword\");\n\n if (changePasswordLink) {\n return changePasswordLink.href;\n }\n\n return null;\n }\n\n // when more than three unsecure links are present (always present: self, contributions and api-docs),\n // the userservice is permitted and thus we have an indication the user is probably\n // logged in\n /**\n */\n get isLoggedIn(): boolean {\n const hasUser = this.user instanceof UserModel;\n\n const UNSECURE_LINK_COUNT = 3;\n return this.links.length > UNSECURE_LINK_COUNT || hasUser;\n }\n}\n\nexport default UserServicesModel;\n"],"mappings":";;;;;;;;;AACA;AACA;AAOA;AACA;AACA;AACA,MAAMA,iBAAiB,SAASC,sBAAa,CAAC;EAAA;IAAA;IAAA;EAAA;EAG5C;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,cAAc;EACvB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,mBAAmB;EAC5B;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,eAAe;EAEvD;;EAEA;AACF;EACEC,yBAAyB,GAAqB;IAC5C,MAAMC,QAAQ,GAAG,IAAI,CAACC,QAAQ;IAC9B,OAAOD,QAAQ,GAAG,CAACA,QAAQ,CAAC,GAAG,EAAE;EACnC;;EAEA;AACF;EACEE,cAAc,CAACC,MAA6B,EAAE;IAC5C,IAAI,CAACC,IAAI,GAAG,mBAAAD,MAAM,OAANA,MAAM,EAAOE,KAAK,IAAKA,KAAK,CAACZ,IAAI,KAAK,MAAM,CAAC;EAC3D;;EAEA;AACF;EACE,IAAIQ,QAAQ,GAAqB;IAC/B,OAAO,IAAI,CAACK,KAAK,CAACC,YAAY,CAAC,UAAU,CAAC;EAC5C;;EAEA;AACF;AACA;EACE,IAAIH,IAAI,GAAqB;IAC3B,OAAO,IAAI,CAACI,KAAK,IAAI,IAAI;EAC3B;;EAEA;AACF;AACA;EACE,IAAIJ,IAAI,CAACC,KAAsB,EAAE;IAC/B,IAAI,CAACG,KAAK,GAAGH,KAAK,YAAYI,kBAAS,GAAGJ,KAAK,GAAG,IAAI;EACxD;;EAEA;AACF;AACA;EACE,IAAIK,KAAK,GAAW;IAClB,OAAO,IAAI,CAACC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;EACE,IAAIC,cAAc,GAAgB;IAChC,MAAMC,kBAAkB,GAAG,IAAI,CAACP,KAAK,CAACC,YAAY,CAAC,gBAAgB,CAAC;IAEpE,IAAIM,kBAAkB,EAAE;MACtB,OAAOA,kBAAkB,CAACC,IAAI;IAChC;IAEA,OAAO,IAAI;EACb;;EAEA;EACA;EACA;EACA;AACF;EACE,IAAIC,UAAU,GAAY;IACxB,MAAMC,OAAO,GAAG,IAAI,CAACZ,IAAI,YAAYK,kBAAS;IAE9C,MAAMQ,mBAAmB,GAAG,CAAC;IAC7B,OAAO,IAAI,CAACX,KAAK,CAACY,MAAM,GAAGD,mBAAmB,IAAID,OAAO;EAC3D;AACF;AAAC,eAEczB,iBAAiB;AAAA"}
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
8
9
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
9
10
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
10
11
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
11
12
  var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
12
- var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
13
13
  var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
14
14
  var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
@@ -129,6 +129,22 @@ class ModularUIRequest {
129
129
  };
130
130
  }
131
131
 
132
+ /**
133
+ */
134
+ get requestOptions() {
135
+ /* eslint-disable no-unused-vars */
136
+ const {
137
+ targetModel,
138
+ updateModel,
139
+ childmodels,
140
+ isValidationRequest,
141
+ removeOnUnmount,
142
+ ...requestOptions
143
+ } = this.options;
144
+ /* eslint-enable no-unused-vars */
145
+ return requestOptions;
146
+ }
147
+
132
148
  /**
133
149
  */
134
150
  set options(options) {
@@ -155,14 +171,26 @@ class ModularUIRequest {
155
171
 
156
172
  /**
157
173
  */
158
- createModel() {
159
- const Model = this.targetModel || (0, _resolveModel.default)(this.response);
160
-
161
- // check for ResourceModel
174
+ resolveModel() {
175
+ let availableModels;
176
+ if (this.targetModel) {
177
+ availableModels = Array.isArray(this.targetModel) ? [...this.targetModel] : [this.targetModel];
178
+ }
179
+ const Model = (0, _resolveModel.default)(this.response, availableModels);
162
180
  if (Model && Model.isApplicableModel) {
163
- return new Model(this.response);
181
+ return Model;
164
182
  }
165
- throw new _exceptions.IllegalStateException(`No model available for data: ${(0, _stringify.default)(this.response)}`);
183
+ if (availableModels) {
184
+ throw new _exceptions.IllegalStateException(`data is not applicable for model(s): ${(0, _map.default)(availableModels).call(availableModels, m => m.modelName).join(", ")}`);
185
+ }
186
+ throw new _exceptions.IllegalStateException(`no javascript model is applicable for received response: ${(0, _stringify.default)(this.response)}`);
187
+ }
188
+
189
+ /**
190
+ */
191
+ createModel() {
192
+ const Model = this.resolveModel();
193
+ return new Model(this.response);
166
194
  }
167
195
 
168
196
  /**
@@ -246,7 +274,7 @@ class ModularUIRequest {
246
274
  */
247
275
  fetchDataService() {
248
276
  return (0, _universalFetch.default)({
249
- ...this.options,
277
+ ...this.requestOptions,
250
278
  url: `${_Constants.BASE}${this.href.path}`,
251
279
  params: this.href.getQuerystringForModularUI(),
252
280
  locale: this.options.locale,
@@ -381,7 +409,7 @@ class ModularUIRequest {
381
409
  isHiddenList(name, href) {
382
410
  const HIDE_WHEN_EMPTY_IGNORE_TASKS = (0, _Settings.getSetting)("HIDE_WHEN_EMPTY_IGNORE_TASKS", false);
383
411
  return (0, _universalFetch.default)({
384
- ...this.options,
412
+ ...this.requestOptions,
385
413
  url: `${_Constants.BASE}${href}`
386
414
  }).then(response => {
387
415
  if ((0, _objects.isPlainObject)(response)) {
@@ -437,10 +465,9 @@ class ModularUIRequest {
437
465
  if (!this.options.isValidationRequest && (0, _Settings.getSetting)("USE_INSTANT_SERVER_VALIDATION") && model instanceof _FormModel.default && model.currentFormObject && model.currentFormObject.hasDynamicValidations) {
438
466
  const validationHref = this.href.setParameter("commit", "false");
439
467
  return (0, _universalFetch.default)({
440
- ...this.options,
468
+ ...this.requestOptions,
441
469
  url: `${_Constants.BASE}${this.href.path}`,
442
470
  params: validationHref.getQuerystringForModularUI(),
443
- childmodels: false,
444
471
  data: this.getDynamicValidationData(model)
445
472
  }).then(data => {
446
473
  if (data == null || typeof data !== "object") {
@@ -25,7 +25,11 @@ import { IllegalArgumentException, IllegalStateException } from "../exceptions";
25
25
 
26
26
  import { isPlainObject } from "../utils/helpers/objects";
27
27
 
28
- import type { RequestBaseOptions } from "../utils/fetch/types";
28
+ import type { TargetModel } from "./types";
29
+ import type {
30
+ RequestBaseOptions,
31
+ RequestModularUIOptions,
32
+ } from "../utils/fetch/types";
29
33
  import type { ModularUIModel } from "../models/types";
30
34
 
31
35
  /**
@@ -36,8 +40,8 @@ class ModularUIRequest {
36
40
  _response: ModularUIResponse;
37
41
 
38
42
  _href: Href;
39
- _options: RequestBaseOptions;
40
- _targetModel: ?Class<ModularUIModel>;
43
+ _options: RequestModularUIOptions;
44
+ _targetModel: ?TargetModel;
41
45
  _contributionsHref: string;
42
46
  _locale: string;
43
47
  _method: $Keys<typeof HTTP_METHODS> = HTTP_METHODS.GET;
@@ -46,7 +50,10 @@ class ModularUIRequest {
46
50
 
47
51
  /**
48
52
  */
49
- constructor(href: Href | string, options: $Shape<RequestBaseOptions> = {}) {
53
+ constructor(
54
+ href: Href | string,
55
+ options: $Shape<RequestModularUIOptions> = {}
56
+ ) {
50
57
  if (!href) {
51
58
  throw new IllegalArgumentException(
52
59
  "You must pass a href to the resource that is requested"
@@ -132,7 +139,7 @@ class ModularUIRequest {
132
139
 
133
140
  /**
134
141
  */
135
- get options(): RequestBaseOptions {
142
+ get options(): RequestModularUIOptions {
136
143
  return {
137
144
  ...this._options,
138
145
  locale: this.locale,
@@ -142,7 +149,23 @@ class ModularUIRequest {
142
149
 
143
150
  /**
144
151
  */
145
- set options(options: RequestBaseOptions) {
152
+ get requestOptions(): RequestBaseOptions {
153
+ /* eslint-disable no-unused-vars */
154
+ const {
155
+ targetModel,
156
+ updateModel,
157
+ childmodels,
158
+ isValidationRequest,
159
+ removeOnUnmount,
160
+ ...requestOptions
161
+ } = this.options;
162
+ /* eslint-enable no-unused-vars */
163
+ return requestOptions;
164
+ }
165
+
166
+ /**
167
+ */
168
+ set options(options: RequestModularUIOptions) {
146
169
  this._options = options;
147
170
  }
148
171
 
@@ -156,31 +179,57 @@ class ModularUIRequest {
156
179
 
157
180
  /**
158
181
  */
159
- set targetModel(targetModel: ?Class<ModularUIModel>) {
182
+ set targetModel(targetModel: TargetModel) {
160
183
  this._targetModel = targetModel;
161
184
  }
162
185
 
163
186
  /**
164
187
  */
165
- get targetModel(): ?Class<ModularUIModel> {
188
+ get targetModel(): ?TargetModel {
166
189
  return this._targetModel;
167
190
  }
168
191
 
169
192
  /**
170
193
  */
171
- createModel(): ModularUIModel {
172
- const Model = this.targetModel || resolveModel(this.response);
194
+ resolveModel(): Class<ModularUIModel> {
195
+ let availableModels;
196
+ if (this.targetModel) {
197
+ availableModels = Array.isArray(this.targetModel)
198
+ ? [...this.targetModel]
199
+ : [this.targetModel];
200
+ }
201
+
202
+ const Model: Class<ModularUIModel> | null = resolveModel(
203
+ this.response,
204
+ availableModels
205
+ );
173
206
 
174
- // check for ResourceModel
175
207
  if (Model && Model.isApplicableModel) {
176
- return new Model(this.response);
208
+ return Model;
209
+ }
210
+
211
+ if (availableModels) {
212
+ throw new IllegalStateException(
213
+ `data is not applicable for model(s): ${availableModels
214
+ .map((m) => m.modelName)
215
+ .join(", ")}`
216
+ );
177
217
  }
178
218
 
179
219
  throw new IllegalStateException(
180
- `No model available for data: ${JSON.stringify(this.response)}`
220
+ `no javascript model is applicable for received response: ${JSON.stringify(
221
+ this.response
222
+ )}`
181
223
  );
182
224
  }
183
225
 
226
+ /**
227
+ */
228
+ createModel(): ModularUIModel {
229
+ const Model = this.resolveModel();
230
+ return new Model(this.response);
231
+ }
232
+
184
233
  /**
185
234
  */
186
235
  processContributionsService(contributionsData: Object): void {
@@ -274,7 +323,7 @@ class ModularUIRequest {
274
323
  */
275
324
  fetchDataService(): Promise<any> {
276
325
  return universalFetch({
277
- ...this.options,
326
+ ...this.requestOptions,
278
327
  url: `${BASE}${this.href.path}`,
279
328
  params: this.href.getQuerystringForModularUI(),
280
329
  locale: this.options.locale,
@@ -451,7 +500,7 @@ class ModularUIRequest {
451
500
  );
452
501
 
453
502
  return universalFetch({
454
- ...this.options,
503
+ ...this.requestOptions,
455
504
  url: `${BASE}${href}`,
456
505
  })
457
506
  .then((response: Object) => {
@@ -519,10 +568,9 @@ class ModularUIRequest {
519
568
  ) {
520
569
  const validationHref = this.href.setParameter("commit", "false");
521
570
  return universalFetch({
522
- ...this.options,
571
+ ...this.requestOptions,
523
572
  url: `${BASE}${this.href.path}`,
524
573
  params: validationHref.getQuerystringForModularUI(),
525
- childmodels: false,
526
574
  data: this.getDynamicValidationData(model),
527
575
  }).then((data) => {
528
576
  if (data == null || typeof data !== "object") {