@eo-sdk/client 10.0.0-beta.4 → 10.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/app/eo-client/about-state/about-state.component.d.ts +0 -5
  2. package/app/eo-client/about-state/about-state.component.d.ts.map +1 -1
  3. package/app/eo-client/dashboard/dashboard.component.d.ts +25 -33
  4. package/app/eo-client/dashboard/dashboard.component.d.ts.map +1 -1
  5. package/app/eo-client/dashboard/widgets/iframe-widget/iframe-setup/iframe-setup.component.d.ts +19 -0
  6. package/app/eo-client/dashboard/widgets/iframe-widget/iframe-setup/iframe-setup.component.d.ts.map +1 -0
  7. package/app/eo-client/dashboard/widgets/iframe-widget/iframe-widget.component.d.ts +24 -0
  8. package/app/eo-client/dashboard/widgets/iframe-widget/iframe-widget.component.d.ts.map +1 -0
  9. package/app/eo-client/dashboard/widgets/info-inbox-widget/info-inbox-setup/info-inbox-setup.component.d.ts +20 -0
  10. package/app/eo-client/dashboard/widgets/info-inbox-widget/info-inbox-setup/info-inbox-setup.component.d.ts.map +1 -0
  11. package/app/eo-client/dashboard/widgets/info-inbox-widget/info-inbox-widget.component.d.ts +19 -0
  12. package/app/eo-client/dashboard/widgets/info-inbox-widget/info-inbox-widget.component.d.ts.map +1 -0
  13. package/app/eo-client/dashboard/widgets/info-inbox-widget/info-inbox.model.d.ts +4 -0
  14. package/app/eo-client/dashboard/widgets/info-inbox-widget/info-inbox.model.d.ts.map +1 -0
  15. package/app/eo-client/dashboard/widgets/info-intray-widget/info-intray-setup/info-intray-setup.component.d.ts +25 -0
  16. package/app/eo-client/dashboard/widgets/info-intray-widget/info-intray-setup/info-intray-setup.component.d.ts.map +1 -0
  17. package/app/eo-client/dashboard/widgets/info-intray-widget/info-intray-widget.component.d.ts +20 -0
  18. package/app/eo-client/dashboard/widgets/info-intray-widget/info-intray-widget.component.d.ts.map +1 -0
  19. package/app/eo-client/dashboard/widgets/info-intray-widget/info-intray.model.d.ts +4 -0
  20. package/app/eo-client/dashboard/widgets/info-intray-widget/info-intray.model.d.ts.map +1 -0
  21. package/app/eo-client/dashboard/widgets/last-edited-widget/last-edited-and-created.component.d.ts +28 -0
  22. package/app/eo-client/dashboard/widgets/last-edited-widget/last-edited-and-created.component.d.ts.map +1 -0
  23. package/app/eo-client/dashboard/widgets/search-widget/search-widget.component.d.ts +44 -0
  24. package/app/eo-client/dashboard/widgets/search-widget/search-widget.component.d.ts.map +1 -0
  25. package/app/eo-client/eo-client.module.d.ts +24 -13
  26. package/app/eo-client/eo-client.module.d.ts.map +1 -1
  27. package/app/eo-client/favorite-state/favorite-state.component.d.ts +7 -8
  28. package/app/eo-client/favorite-state/favorite-state.component.d.ts.map +1 -1
  29. package/app/eo-client/inbox-state/inbox-state/inbox-state.component.d.ts +8 -10
  30. package/app/eo-client/inbox-state/inbox-state/inbox-state.component.d.ts.map +1 -1
  31. package/app/eo-client/login/login.component.d.ts +12 -5
  32. package/app/eo-client/login/login.component.d.ts.map +1 -1
  33. package/app/eo-client/notifications-state/notifications-state.component.d.ts +9 -11
  34. package/app/eo-client/notifications-state/notifications-state.component.d.ts.map +1 -1
  35. package/app/eo-client/object-state/object-state/object-state.component.d.ts +10 -11
  36. package/app/eo-client/object-state/object-state/object-state.component.d.ts.map +1 -1
  37. package/app/eo-client/prepare-state/prepare-state/prepare-state.component.d.ts +8 -9
  38. package/app/eo-client/prepare-state/prepare-state/prepare-state.component.d.ts.map +1 -1
  39. package/app/eo-client/process-state/process-state.component.d.ts +8 -10
  40. package/app/eo-client/process-state/process-state.component.d.ts.map +1 -1
  41. package/app/eo-client/recyclebin-state/recyclebin-state.component.d.ts +5 -6
  42. package/app/eo-client/recyclebin-state/recyclebin-state.component.d.ts.map +1 -1
  43. package/app/eo-client/result-state/result-state.component.d.ts +3 -5
  44. package/app/eo-client/result-state/result-state.component.d.ts.map +1 -1
  45. package/app/eo-client/settings/settings.component.d.ts +6 -7
  46. package/app/eo-client/settings/settings.component.d.ts.map +1 -1
  47. package/app/eo-client/stored-queries-state/stored-queries-state.component.d.ts +8 -10
  48. package/app/eo-client/stored-queries-state/stored-queries-state.component.d.ts.map +1 -1
  49. package/app/eo-client/version-state/version-state.component.d.ts +5 -7
  50. package/app/eo-client/version-state/version-state.component.d.ts.map +1 -1
  51. package/app/eo-framework/accordion/accordion.module.d.ts +1 -2
  52. package/app/eo-framework/accordion/accordion.module.d.ts.map +1 -1
  53. package/app/eo-framework/actions/action-menu/action-menu.component.d.ts +4 -5
  54. package/app/eo-framework/actions/action-menu/action-menu.component.d.ts.map +1 -1
  55. package/app/eo-framework/actions/action.module.d.ts +11 -10
  56. package/app/eo-framework/actions/action.module.d.ts.map +1 -1
  57. package/app/eo-framework/actions/actions/add-resubmission-action/add-resubmission/add-resubmission.component.d.ts +3 -2
  58. package/app/eo-framework/actions/actions/add-resubmission-action/add-resubmission/add-resubmission.component.d.ts.map +1 -1
  59. package/app/eo-framework/actions/actions/share-object-action/share-object/share-object.component.d.ts +9 -13
  60. package/app/eo-framework/actions/actions/share-object-action/share-object/share-object.component.d.ts.map +1 -1
  61. package/app/eo-framework/app-shell/app-bar/app-bar.component.d.ts +3 -4
  62. package/app/eo-framework/app-shell/app-bar/app-bar.component.d.ts.map +1 -1
  63. package/app/eo-framework/app-shell/app-bar/app-search/app-search.component.d.ts.map +1 -1
  64. package/app/eo-framework/app-shell/app-bar/side-bar/side-bar.component.d.ts +1 -2
  65. package/app/eo-framework/app-shell/app-bar/side-bar/side-bar.component.d.ts.map +1 -1
  66. package/app/eo-framework/app-shell/app-shell.module.d.ts +18 -20
  67. package/app/eo-framework/app-shell/app-shell.module.d.ts.map +1 -1
  68. package/app/eo-framework/app-shell/index.d.ts +0 -1
  69. package/app/eo-framework/app-shell/index.d.ts.map +1 -1
  70. package/app/eo-framework/eo-framework.module.d.ts +37 -38
  71. package/app/eo-framework/eo-framework.module.d.ts.map +1 -1
  72. package/app/eo-framework/form-elements/date/date.component.d.ts +0 -2
  73. package/app/eo-framework/form-elements/date/date.component.d.ts.map +1 -1
  74. package/app/eo-framework/form-elements/form-elements.module.d.ts +9 -18
  75. package/app/eo-framework/form-elements/form-elements.module.d.ts.map +1 -1
  76. package/app/eo-framework/form-elements/id-reference/reference-finder/reference-finder.component.d.ts +1 -0
  77. package/app/eo-framework/form-elements/id-reference/reference-finder/reference-finder.component.d.ts.map +1 -1
  78. package/app/eo-framework/grid/filters/datetime-filter.component.d.ts +0 -2
  79. package/app/eo-framework/grid/filters/datetime-filter.component.d.ts.map +1 -1
  80. package/app/eo-framework/grid/grid.component.d.ts +7 -8
  81. package/app/eo-framework/grid/grid.component.d.ts.map +1 -1
  82. package/app/eo-framework/grid/grid.module.d.ts +7 -8
  83. package/app/eo-framework/grid/grid.module.d.ts.map +1 -1
  84. package/app/eo-framework/inbox-details/inbox-details.component.d.ts +1 -2
  85. package/app/eo-framework/inbox-details/inbox-details.component.d.ts.map +1 -1
  86. package/app/eo-framework/index.d.ts +0 -4
  87. package/app/eo-framework/index.d.ts.map +1 -1
  88. package/app/eo-framework/media/media.component.d.ts +4 -3
  89. package/app/eo-framework/media/media.component.d.ts.map +1 -1
  90. package/app/eo-framework/object-details/favorite-icon/favorite-icon.component.d.ts +2 -3
  91. package/app/eo-framework/object-details/favorite-icon/favorite-icon.component.d.ts.map +1 -1
  92. package/app/eo-framework/object-details/object-details.component.d.ts +14 -6
  93. package/app/eo-framework/object-details/object-details.component.d.ts.map +1 -1
  94. package/app/eo-framework/object-details/object-details.module.d.ts +2 -1
  95. package/app/eo-framework/object-details/object-details.module.d.ts.map +1 -1
  96. package/app/eo-framework/object-details/object-history/object-history.component.d.ts +2 -3
  97. package/app/eo-framework/object-details/object-history/object-history.component.d.ts.map +1 -1
  98. package/app/eo-framework/object-form/object-form/form-element/form-element-template.directive.d.ts +10 -0
  99. package/app/eo-framework/object-form/object-form/form-element/form-element-template.directive.d.ts.map +1 -0
  100. package/app/eo-framework/object-form/object-form/form-element/form-element.component.d.ts +8 -3
  101. package/app/eo-framework/object-form/object-form/form-element/form-element.component.d.ts.map +1 -1
  102. package/app/eo-framework/object-form/object-form/form-element-table/form-element-table.component.d.ts +1 -2
  103. package/app/eo-framework/object-form/object-form/form-element-table/form-element-table.component.d.ts.map +1 -1
  104. package/app/eo-framework/object-form/object-form/form-element-table/form-element.interface.d.ts +7 -2
  105. package/app/eo-framework/object-form/object-form/form-element-table/form-element.interface.d.ts.map +1 -1
  106. package/app/eo-framework/object-form/object-form/form-element-table/row-edit/row-edit.component.d.ts +28 -11
  107. package/app/eo-framework/object-form/object-form/form-element-table/row-edit/row-edit.component.d.ts.map +1 -1
  108. package/app/eo-framework/object-form/object-form/object-form-script/object-form-script.service.d.ts.map +1 -1
  109. package/app/eo-framework/object-form/object-form/object-form.component.d.ts +1 -2
  110. package/app/eo-framework/object-form/object-form/object-form.component.d.ts.map +1 -1
  111. package/app/eo-framework/object-form/object-form-helper.service.d.ts.map +1 -1
  112. package/app/eo-framework/object-form/object-form.module.d.ts +9 -9
  113. package/app/eo-framework/object-state-details/object-state-details.component.d.ts +1 -2
  114. package/app/eo-framework/object-state-details/object-state-details.component.d.ts.map +1 -1
  115. package/app/eo-framework/prepare-details/prepare-details.component.d.ts +8 -9
  116. package/app/eo-framework/prepare-details/prepare-details.component.d.ts.map +1 -1
  117. package/app/eo-framework/process/details/process-details.component.d.ts +7 -8
  118. package/app/eo-framework/process/details/process-details.component.d.ts.map +1 -1
  119. package/app/eo-framework/recyclebin-details/recyclebin-details.component.d.ts +9 -11
  120. package/app/eo-framework/recyclebin-details/recyclebin-details.component.d.ts.map +1 -1
  121. package/app/eo-framework/result-list/result-list.component.d.ts +5 -6
  122. package/app/eo-framework/result-list/result-list.component.d.ts.map +1 -1
  123. package/app/eo-framework/settings/settings.module.d.ts +3 -4
  124. package/app/eo-framework/settings/settings.module.d.ts.map +1 -1
  125. package/app/eo-framework/stored-query/stored-query-details/stored-query-details.component.d.ts +4 -5
  126. package/app/eo-framework/stored-query/stored-query-details/stored-query-details.component.d.ts.map +1 -1
  127. package/app/eo-framework/ui/eo-dialog/eo-dialog.component.d.ts +2 -3
  128. package/app/eo-framework/ui/eo-dialog/eo-dialog.component.d.ts.map +1 -1
  129. package/app/eo-framework/ui/indexdata-summary/indexdata-summary.component.d.ts +1 -0
  130. package/app/eo-framework/ui/indexdata-summary/indexdata-summary.component.d.ts.map +1 -1
  131. package/app/eo-framework/ui/outside-click/outside-click.directive.d.ts +1 -2
  132. package/app/eo-framework/ui/outside-click/outside-click.directive.d.ts.map +1 -1
  133. package/app/eo-framework/ui/signature-tab/signature-tab.component.d.ts +0 -1
  134. package/app/eo-framework/ui/signature-tab/signature-tab.component.d.ts.map +1 -1
  135. package/app/eo-framework/util/index.d.ts +0 -1
  136. package/app/eo-framework/util/index.d.ts.map +1 -1
  137. package/app/eo-framework/util/util.module.d.ts +0 -1
  138. package/app/eo-framework/util/util.module.d.ts.map +1 -1
  139. package/app/eo-framework-core/layout/layout.service.d.ts +2 -26
  140. package/app/eo-framework-core/layout/layout.service.d.ts.map +1 -1
  141. package/app/eo-framework-core/pipes/locale-number.pipe.d.ts +2 -3
  142. package/app/eo-framework-core/pipes/locale-number.pipe.d.ts.map +1 -1
  143. package/assets/_default/i18n/de.json +32 -2
  144. package/assets/_default/i18n/en.json +37 -7
  145. package/assets/_default/svg/ic_add_document_file_as_new_version.svg +1 -0
  146. package/assets/_default/svg/ic_create_document.svg +1 -0
  147. package/assets/_default/svg/ic_create_document_in_folder.svg +1 -0
  148. package/assets/_default/svg/ic_noUrl.svg +1 -0
  149. package/assets/dashboard.json +47 -0
  150. package/esm2020/app/eo-client/about-state/about-state.component.mjs +5 -11
  151. package/esm2020/app/eo-client/dashboard/dashboard.component.mjs +143 -98
  152. package/esm2020/app/eo-client/dashboard/widgets/iframe-widget/iframe-setup/iframe-setup.component.mjs +59 -0
  153. package/esm2020/app/eo-client/dashboard/widgets/iframe-widget/iframe-widget.component.mjs +39 -0
  154. package/esm2020/app/eo-client/dashboard/widgets/info-inbox-widget/info-inbox-setup/info-inbox-setup.component.mjs +53 -0
  155. package/esm2020/app/eo-client/dashboard/widgets/info-inbox-widget/info-inbox-widget.component.mjs +42 -0
  156. package/esm2020/app/eo-client/dashboard/widgets/info-inbox-widget/info-inbox.model.mjs +2 -0
  157. package/esm2020/app/eo-client/dashboard/widgets/info-intray-widget/info-intray-setup/info-intray-setup.component.mjs +65 -0
  158. package/esm2020/app/eo-client/dashboard/widgets/info-intray-widget/info-intray-widget.component.mjs +43 -0
  159. package/esm2020/app/eo-client/dashboard/widgets/info-intray-widget/info-intray.model.mjs +2 -0
  160. package/esm2020/app/eo-client/dashboard/widgets/last-edited-widget/last-edited-and-created.component.mjs +117 -0
  161. package/esm2020/app/eo-client/dashboard/widgets/search-widget/search-widget.component.mjs +115 -0
  162. package/esm2020/app/eo-client/eo-client.module.mjs +44 -6
  163. package/esm2020/app/eo-client/favorite-state/favorite-state.component.mjs +15 -14
  164. package/esm2020/app/eo-client/inbox-state/inbox-state/inbox-state.component.mjs +14 -11
  165. package/esm2020/app/eo-client/login/login.component.mjs +33 -13
  166. package/esm2020/app/eo-client/notifications-state/notifications-state.component.mjs +16 -12
  167. package/esm2020/app/eo-client/object-state/object-state/object-state.component.mjs +27 -23
  168. package/esm2020/app/eo-client/prepare-state/prepare-state/prepare-state.component.mjs +12 -9
  169. package/esm2020/app/eo-client/process-state/process-state.component.mjs +6 -9
  170. package/esm2020/app/eo-client/recyclebin-state/recyclebin-state.component.mjs +14 -11
  171. package/esm2020/app/eo-client/result-state/result-state.component.mjs +11 -8
  172. package/esm2020/app/eo-client/settings/settings.component.mjs +16 -12
  173. package/esm2020/app/eo-client/stored-queries-state/stored-queries-state.component.mjs +16 -13
  174. package/esm2020/app/eo-client/version-state/version-state.component.mjs +13 -10
  175. package/esm2020/app/eo-framework/accordion/accordion.module.mjs +3 -7
  176. package/esm2020/app/eo-framework/accordion/simple-accordion/simple-accordion.component.mjs +3 -3
  177. package/esm2020/app/eo-framework/actions/action-menu/action-menu.component.mjs +15 -11
  178. package/esm2020/app/eo-framework/actions/action.module.mjs +5 -2
  179. package/esm2020/app/eo-framework/actions/actions/add-resubmission-action/add-resubmission/add-resubmission.component.mjs +5 -7
  180. package/esm2020/app/eo-framework/actions/actions/add-subscription-action/add-subscription/add-subscription.component.mjs +3 -3
  181. package/esm2020/app/eo-framework/actions/actions/custom-actions/custom-actions.component.mjs +2 -2
  182. package/esm2020/app/eo-framework/actions/actions/share-object-action/share-object/share-object.component.mjs +43 -48
  183. package/esm2020/app/eo-framework/actions/actions/signature-action/signature/signature.component.mjs +2 -2
  184. package/esm2020/app/eo-framework/actions/actions/workflow-action/workflow/workflow.component.mjs +2 -2
  185. package/esm2020/app/eo-framework/app-shell/app-bar/app-bar.component.mjs +16 -14
  186. package/esm2020/app/eo-framework/app-shell/app-bar/app-search/app-search.component.mjs +8 -3
  187. package/esm2020/app/eo-framework/app-shell/app-bar/side-bar/side-bar.component.mjs +4 -6
  188. package/esm2020/app/eo-framework/app-shell/app-shell.module.mjs +1 -8
  189. package/esm2020/app/eo-framework/app-shell/index.mjs +1 -2
  190. package/esm2020/app/eo-framework/eo-framework.module.mjs +35 -43
  191. package/esm2020/app/eo-framework/form-elements/date/date.component.mjs +2 -12
  192. package/esm2020/app/eo-framework/form-elements/dynamic-list/dynamic-list.component.mjs +3 -3
  193. package/esm2020/app/eo-framework/form-elements/form-elements.module.mjs +28 -37
  194. package/esm2020/app/eo-framework/form-elements/form-input/form-input.component.mjs +3 -3
  195. package/esm2020/app/eo-framework/form-elements/id-reference/reference-finder/reference-finder.component.mjs +10 -6
  196. package/esm2020/app/eo-framework/form-elements/organization/organization.component.mjs +3 -3
  197. package/esm2020/app/eo-framework/form-elements/reference/reference.component.mjs +5 -6
  198. package/esm2020/app/eo-framework/form-elements/string/string.component.mjs +2 -2
  199. package/esm2020/app/eo-framework/frame/frame.component.mjs +2 -2
  200. package/esm2020/app/eo-framework/grid/filters/datetime-filter.component.mjs +2 -6
  201. package/esm2020/app/eo-framework/grid/filters/dynamic-list-filter.component.mjs +3 -3
  202. package/esm2020/app/eo-framework/grid/filters/organization-filter.component.mjs +3 -3
  203. package/esm2020/app/eo-framework/grid/grid.component.mjs +16 -12
  204. package/esm2020/app/eo-framework/grid/grid.module.mjs +1 -5
  205. package/esm2020/app/eo-framework/inbox-details/inbox-details.component.mjs +16 -11
  206. package/esm2020/app/eo-framework/index.mjs +1 -5
  207. package/esm2020/app/eo-framework/media/media.component.mjs +31 -12
  208. package/esm2020/app/eo-framework/object-details/favorite-icon/favorite-icon.component.mjs +13 -10
  209. package/esm2020/app/eo-framework/object-details/object-details.component.mjs +64 -38
  210. package/esm2020/app/eo-framework/object-details/object-details.module.mjs +7 -3
  211. package/esm2020/app/eo-framework/object-details/object-history/object-history.component.mjs +13 -9
  212. package/esm2020/app/eo-framework/object-form/object-form/form-element/form-element-template.directive.mjs +18 -0
  213. package/esm2020/app/eo-framework/object-form/object-form/form-element/form-element.component.mjs +20 -6
  214. package/esm2020/app/eo-framework/object-form/object-form/form-element-table/form-element-table.component.mjs +21 -22
  215. package/esm2020/app/eo-framework/object-form/object-form/form-element-table/form-element.interface.mjs +1 -1
  216. package/esm2020/app/eo-framework/object-form/object-form/form-element-table/row-edit/row-edit.component.mjs +94 -32
  217. package/esm2020/app/eo-framework/object-form/object-form/object-form-group/object-form-group.component.mjs +6 -4
  218. package/esm2020/app/eo-framework/object-form/object-form/object-form-script/object-form-script.service.mjs +2 -3
  219. package/esm2020/app/eo-framework/object-form/object-form/object-form.component.mjs +3 -5
  220. package/esm2020/app/eo-framework/object-form/object-form-helper.service.mjs +2 -2
  221. package/esm2020/app/eo-framework/object-form/object-form.module.mjs +9 -10
  222. package/esm2020/app/eo-framework/object-state-details/object-state-details.component.mjs +15 -13
  223. package/esm2020/app/eo-framework/prepare-details/prepare-details.component.mjs +16 -14
  224. package/esm2020/app/eo-framework/process/details/process-details.component.mjs +16 -12
  225. package/esm2020/app/eo-framework/process-form/process-form.component.mjs +2 -2
  226. package/esm2020/app/eo-framework/recyclebin-details/recyclebin-details.component.mjs +25 -17
  227. package/esm2020/app/eo-framework/result-list/result-list.component.mjs +21 -15
  228. package/esm2020/app/eo-framework/settings/settings.module.mjs +1 -5
  229. package/esm2020/app/eo-framework/stored-query/stored-query-details/stored-query-details.component.mjs +17 -13
  230. package/esm2020/app/eo-framework/ui/eo-dialog/eo-dialog.component.mjs +12 -8
  231. package/esm2020/app/eo-framework/ui/eo-icon/eo-icon.component.mjs +2 -2
  232. package/esm2020/app/eo-framework/ui/indexdata-summary/indexdata-summary.component.mjs +20 -12
  233. package/esm2020/app/eo-framework/ui/outside-click/outside-click.directive.mjs +11 -8
  234. package/esm2020/app/eo-framework/ui/signature-tab/signature-tab.component.mjs +3 -6
  235. package/esm2020/app/eo-framework/upload-overlay/upload-overlay.component.mjs +3 -3
  236. package/esm2020/app/eo-framework/util/index.mjs +1 -2
  237. package/esm2020/app/eo-framework/util/util.module.mjs +2 -3
  238. package/esm2020/app/eo-framework-core/layout/layout.service.mjs +61 -63
  239. package/esm2020/app/eo-framework-core/pipes/locale-number.pipe.mjs +11 -8
  240. package/esm2020/projects/eo-sdk/core/lib/eo-core.module.mjs +8 -8
  241. package/esm2020/projects/eo-sdk/core/lib/model/inbox-item.model.mjs +2 -6
  242. package/esm2020/projects/eo-sdk/core/lib/service/auth/auth.service.mjs +24 -30
  243. package/esm2020/projects/eo-sdk/core/lib/service/capabilities/capabilities.model.mjs +1 -1
  244. package/esm2020/projects/eo-sdk/core/lib/service/capabilities/capabilities.service.mjs +8 -6
  245. package/esm2020/projects/eo-sdk/core/lib/service/config/config.service.mjs +1 -1
  246. package/esm2020/projects/eo-sdk/core/lib/service/dms/dms.service.mjs +14 -16
  247. package/esm2020/projects/eo-sdk/core/lib/service/prepare/prepare.service.mjs +15 -12
  248. package/esm2020/projects/eo-sdk/core/lib/service/signing/signing.service.mjs +12 -6
  249. package/esm2020/projects/eo-sdk/core/lib/service/system/system.service.mjs +2 -6
  250. package/esm2020/projects/eo-sdk/core/lib/service/user/user.service.mjs +11 -1
  251. package/esm2020/projects/eo-sdk/core/lib/util/utils.mjs +3 -3
  252. package/fesm2015/eo-sdk-client-projects-eo-sdk-core.mjs +1069 -1066
  253. package/fesm2015/eo-sdk-client-projects-eo-sdk-core.mjs.map +1 -1
  254. package/fesm2015/eo-sdk-client.mjs +14808 -15012
  255. package/fesm2015/eo-sdk-client.mjs.map +1 -1
  256. package/fesm2020/eo-sdk-client-projects-eo-sdk-core.mjs +1069 -1066
  257. package/fesm2020/eo-sdk-client-projects-eo-sdk-core.mjs.map +1 -1
  258. package/fesm2020/eo-sdk-client.mjs +16587 -16787
  259. package/fesm2020/eo-sdk-client.mjs.map +1 -1
  260. package/package.json +5 -5
  261. package/projects/eo-sdk/core/lib/eo-core.module.d.ts.map +1 -1
  262. package/projects/eo-sdk/core/lib/model/inbox-item.model.d.ts.map +1 -1
  263. package/projects/eo-sdk/core/lib/service/auth/auth.service.d.ts +14 -20
  264. package/projects/eo-sdk/core/lib/service/auth/auth.service.d.ts.map +1 -1
  265. package/projects/eo-sdk/core/lib/service/capabilities/capabilities.model.d.ts +4 -0
  266. package/projects/eo-sdk/core/lib/service/capabilities/capabilities.model.d.ts.map +1 -1
  267. package/projects/eo-sdk/core/lib/service/capabilities/capabilities.service.d.ts +3 -1
  268. package/projects/eo-sdk/core/lib/service/capabilities/capabilities.service.d.ts.map +1 -1
  269. package/projects/eo-sdk/core/lib/service/config/config.service.d.ts.map +1 -1
  270. package/projects/eo-sdk/core/lib/service/dms/dms.service.d.ts +10 -8
  271. package/projects/eo-sdk/core/lib/service/dms/dms.service.d.ts.map +1 -1
  272. package/projects/eo-sdk/core/lib/service/prepare/prepare.service.d.ts +1 -0
  273. package/projects/eo-sdk/core/lib/service/prepare/prepare.service.d.ts.map +1 -1
  274. package/projects/eo-sdk/core/lib/service/signing/signing.service.d.ts +4 -1
  275. package/projects/eo-sdk/core/lib/service/signing/signing.service.d.ts.map +1 -1
  276. package/projects/eo-sdk/core/lib/service/system/system.service.d.ts.map +1 -1
  277. package/projects/eo-sdk/core/lib/service/user/user.service.d.ts +6 -0
  278. package/projects/eo-sdk/core/lib/service/user/user.service.d.ts.map +1 -1
  279. package/projects/eo-sdk/core/lib/util/utils.d.ts +3 -4
  280. package/projects/eo-sdk/core/lib/util/utils.d.ts.map +1 -1
  281. package/scss/_eo-variables.scss +1 -0
  282. package/scss/_main.scss +1 -1
  283. package/scss/_mixins.scss +6 -6
  284. package/styles.css +2 -1
  285. package/app/eo-framework/app-shell/app-bar/app-layout/app-layout.component.d.ts +0 -24
  286. package/app/eo-framework/app-shell/app-bar/app-layout/app-layout.component.d.ts.map +0 -1
  287. package/app/eo-framework/split/index.d.ts +0 -5
  288. package/app/eo-framework/split/index.d.ts.map +0 -1
  289. package/app/eo-framework/split/split/split.component.d.ts +0 -83
  290. package/app/eo-framework/split/split/split.component.d.ts.map +0 -1
  291. package/app/eo-framework/split/split-area/split-area.component.d.ts +0 -37
  292. package/app/eo-framework/split/split-area/split-area.component.d.ts.map +0 -1
  293. package/app/eo-framework/split/split-gutter/split-gutter.directive.d.ts +0 -21
  294. package/app/eo-framework/split/split-gutter/split-gutter.directive.d.ts.map +0 -1
  295. package/app/eo-framework/split/split.module.d.ts +0 -12
  296. package/app/eo-framework/split/split.module.d.ts.map +0 -1
  297. package/app/eo-framework/undock-split/undock-split.component.d.ts +0 -28
  298. package/app/eo-framework/undock-split/undock-split.component.d.ts.map +0 -1
  299. package/app/eo-framework/undock-split/undock-split.service.d.ts +0 -43
  300. package/app/eo-framework/undock-split/undock-split.service.d.ts.map +0 -1
  301. package/app/eo-framework/undock-split/undock-state.interface.d.ts +0 -6
  302. package/app/eo-framework/undock-split/undock-state.interface.d.ts.map +0 -1
  303. package/app/eo-framework/util/unsubscribe/unsubscribe.component.d.ts +0 -11
  304. package/app/eo-framework/util/unsubscribe/unsubscribe.component.d.ts.map +0 -1
  305. package/esm2020/app/eo-framework/app-shell/app-bar/app-layout/app-layout.component.mjs +0 -67
  306. package/esm2020/app/eo-framework/split/index.mjs +0 -5
  307. package/esm2020/app/eo-framework/split/split/split.component.mjs +0 -373
  308. package/esm2020/app/eo-framework/split/split-area/split-area.component.mjs +0 -131
  309. package/esm2020/app/eo-framework/split/split-gutter/split-gutter.directive.mjs +0 -73
  310. package/esm2020/app/eo-framework/split/split.module.mjs +0 -28
  311. package/esm2020/app/eo-framework/undock-split/undock-split.component.mjs +0 -89
  312. package/esm2020/app/eo-framework/undock-split/undock-split.service.mjs +0 -135
  313. package/esm2020/app/eo-framework/undock-split/undock-state.interface.mjs +0 -2
  314. package/esm2020/app/eo-framework/util/unsubscribe/unsubscribe.component.mjs +0 -23
@@ -1,15 +1,20 @@
1
- import * as i2 from '@ngx-translate/core';
1
+ import * as i1 from '@ngx-translate/core';
2
2
  import { TranslateModule, TranslateLoader, MissingTranslationHandler } from '@ngx-translate/core';
3
3
  export { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
4
- import * as i0 from '@angular/core';
5
- import { InjectionToken, Inject, Injectable, NgModule, APP_INITIALIZER, Optional, SkipSelf } from '@angular/core';
6
4
  import * as i1$1 from '@angular/common/http';
7
5
  import { HttpErrorResponse, HttpHeaders, HttpResponse, HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common/http';
6
+ import * as i0 from '@angular/core';
7
+ import { InjectionToken, Inject, Injectable, NgModule, APP_INITIALIZER, Optional, SkipSelf } from '@angular/core';
8
+ import * as i1$3 from 'ngx-toastr';
9
+ import { ToastrModule } from 'ngx-toastr';
8
10
  import { __decorate, __param } from 'tslib';
9
- import { forkJoin, of, EMPTY, throwError, Subject, Observable, ReplaySubject, BehaviorSubject, timer, interval } from 'rxjs';
10
- import { map, catchError, filter, debounceTime, switchMap, first, tap, finalize, shareReplay, expand, skipWhile, mergeMap, takeUntil } from 'rxjs/operators';
11
- import * as i6 from '@angular/common';
12
- import { registerLocaleData, DatePipe } from '@angular/common';
11
+ import { EMPTY, throwError, Subject, of, forkJoin, Observable, ReplaySubject, BehaviorSubject, timer, interval } from 'rxjs';
12
+ import { filter, map, tap, finalize, shareReplay, debounceTime, switchMap, first, catchError, expand, skipWhile, mergeMap, takeUntil } from 'rxjs/operators';
13
+ import { DatePipe, registerLocaleData } from '@angular/common';
14
+ import moment from 'moment';
15
+ import * as _ from 'lodash';
16
+ import * as FileSaver from 'file-saver';
17
+ import * as i1$2 from '@ngx-pwa/local-storage';
13
18
  import localeDeCh from '@angular/common/locales/de-CH';
14
19
  import localeExtraDeCh from '@angular/common/locales/extra/de-CH';
15
20
  import localeDe from '@angular/common/locales/de';
@@ -70,13 +75,6 @@ import localeId from '@angular/common/locales/id';
70
75
  import localeExtraId from '@angular/common/locales/extra/id';
71
76
  import localeMs from '@angular/common/locales/ms';
72
77
  import localeExtraMs from '@angular/common/locales/extra/ms';
73
- import * as momentImported from 'moment';
74
- import momentImported__default from 'moment';
75
- import * as i1 from '@ngx-pwa/local-storage';
76
- import * as FileSaver from 'file-saver';
77
- import * as _ from 'lodash';
78
- import * as i1$2 from 'ngx-toastr';
79
- import { ToastrModule } from 'ngx-toastr';
80
78
 
81
79
  // @see: http://stackoverflow.com/questions/37611549/how-to-pass-parameters-rendered-from-backend-to-angular2-bootstrap-method#answer-40379803
82
80
  /**
@@ -104,92 +102,6 @@ CoreConfig = __decorate([
104
102
  __param(0, Inject(CUSTOM_CONFIG))
105
103
  ], CoreConfig);
106
104
 
107
- /**
108
- * @ignore
109
- * APP_INITIALIZER function
110
- */
111
- function init_module(coreInit) {
112
- // Need to set to a const before returning due to:
113
- // @see: https://github.com/angular/angular/issues/14485
114
- const fnc = () => coreInit.initialize();
115
- return fnc;
116
- }
117
-
118
- /**
119
- * @ignore
120
- * Handles missing translations
121
- */
122
- class EoxMissingTranslationHandler {
123
- /**
124
- *
125
- * @param MissingTranslationHandlerParams params
126
- * @returns string
127
- */
128
- handle(params) {
129
- return '!missing key: ' + params.key;
130
- }
131
- }
132
-
133
- /**
134
- * @ignore
135
- * Loader that fetches translations based on the configured locations
136
- */
137
- let EoxTranslateJsonLoader = class EoxTranslateJsonLoader {
138
- constructor(http, config) {
139
- this.http = http;
140
- this.config = config;
141
- registerLocaleData(localeDe, 'de', localeExtraDe); // German
142
- registerLocaleData(localeAr, 'ar', localeExtraAr); // Arabic
143
- registerLocaleData(localeEs, 'es', localeExtraEs); // Spanish
144
- registerLocaleData(localePt, 'pt', localeExtraPt); // Portuguese
145
- registerLocaleData(localeFr, 'fr', localeExtraFr); // French
146
- registerLocaleData(localeZh, 'zh', localeExtraZh); // Chinese
147
- registerLocaleData(localeLv, 'lv', localeExtraLv); // Latvian
148
- registerLocaleData(localeRu, 'ru', localeExtraRu); // Russian
149
- registerLocaleData(localeIt, 'it', localeExtraIt); // Italian
150
- registerLocaleData(localeNl, 'nl', localeExtraNl); // Dutch
151
- registerLocaleData(localeSk, 'sk', localeExtraSk); // Slovak
152
- registerLocaleData(localePl, 'pl', localeExtraPl); // Polish
153
- registerLocaleData(localeUk, 'uk', localeExtraUk); // Ukrainian
154
- registerLocaleData(localeJa, 'ja', localeExtraJa); // Japanese
155
- registerLocaleData(localeKo, 'ko', localeExtraKo); // Korean
156
- registerLocaleData(localeHi, 'hi', localeExtraHi); // Hindi
157
- registerLocaleData(localeBn, 'bn', localeExtraBn); // Bengalese
158
- registerLocaleData(localeDeCh, 'de-CH', localeExtraDeCh); // German (switzerland)
159
- registerLocaleData(localeZhHant, 'zh-Hant', localeExtraZhHant); // Chinese (traditional)
160
- registerLocaleData(localeTh, 'th', localeExtraTh); // Thai
161
- registerLocaleData(localeVi, 'vi', localeExtraVi); // Vietnamese
162
- registerLocaleData(localeEnGb, 'en-GB', localeExtraEnGb); // English (Great-Britain)
163
- registerLocaleData(localeHe, 'he', localeExtraHe); // Hebrew
164
- registerLocaleData(localeFi, 'fi', localeExtraFi); // Finish
165
- registerLocaleData(localeDa, 'da', localeExtraDa); // Danish
166
- registerLocaleData(localeSe, 'se', localeExtraSe); // Swedish
167
- registerLocaleData(localeNb, 'nb', localeExtraNb); // Norwegian Bokmål
168
- registerLocaleData(localeNn, 'nn', localeExtraNn); // Norwegian Nynorsk
169
- registerLocaleData(localeId, 'id', localeExtraId); // Indonesian
170
- registerLocaleData(localeMs, 'ms', localeExtraMs); // Malay
171
- }
172
- /**
173
- *
174
- * @param string lang
175
- * @returns Observable<Object>
176
- */
177
- getTranslation(lang) {
178
- return forkJoin(this.config.translations.map(folder => this.loadTranslationFile(folder, lang))).pipe(map((res) => res.reduce((acc, x) => Object.assign(acc, x), {})));
179
- }
180
- loadTranslationFile(folder, lang) {
181
- return this.http.get(`${folder}${lang}.json`).pipe(catchError((e) => {
182
- // ISO codes with more than 2 characters are sub-languages like de-CH.
183
- // If there is no translation file for that sub-language we'll try to load
184
- // the file for the base language (in this case de).
185
- return lang.length > 2 ? this.loadTranslationFile(folder, lang.substring(0, 2)) : of({});
186
- }));
187
- }
188
- };
189
- EoxTranslateJsonLoader = __decorate([
190
- __param(1, Inject(CORE_CONFIG))
191
- ], EoxTranslateJsonLoader);
192
-
193
105
  /**
194
106
  * Set up the default logger.
195
107
  * The default logger doesn't actually log anything;
@@ -1075,7 +987,7 @@ class Utils {
1075
987
  * @returns
1076
988
  */
1077
989
  static getTimezoneOffset() {
1078
- return momentImported__default().format('Z');
990
+ return moment().format('Z');
1079
991
  }
1080
992
  static formatMailTo(value, isEmail) {
1081
993
  if (isEmail && !!value) {
@@ -1303,14 +1215,26 @@ class Config {
1303
1215
  return this.cfg['agent'];
1304
1216
  }
1305
1217
  }
1306
- Config.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: Config, deps: [{ token: i2.TranslateService }, { token: EventService }], target: i0.ɵɵFactoryTarget.Injectable });
1218
+ Config.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: Config, deps: [{ token: i1.TranslateService }, { token: EventService }], target: i0.ɵɵFactoryTarget.Injectable });
1307
1219
  Config.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: Config, providedIn: 'root' });
1308
1220
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: Config, decorators: [{
1309
1221
  type: Injectable,
1310
1222
  args: [{
1311
1223
  providedIn: 'root'
1312
1224
  }]
1313
- }], ctorParameters: function () { return [{ type: i2.TranslateService }, { type: EventService }]; } });
1225
+ }], ctorParameters: function () { return [{ type: i1.TranslateService }, { type: EventService }]; } });
1226
+
1227
+ class EnvironmentEnaio {
1228
+ static isWebEnvironment() {
1229
+ return !EnvironmentEnaio.isDesktopEnvironment() && !EnvironmentEnaio.isMobileEnvironment();
1230
+ }
1231
+ static isMobileEnvironment() {
1232
+ return window.hasOwnProperty('cordova');
1233
+ }
1234
+ static isDesktopEnvironment() {
1235
+ return window.hasOwnProperty('process') && window['process'].versions.hasOwnProperty('electron');
1236
+ }
1237
+ }
1314
1238
 
1315
1239
  class EoUser {
1316
1240
  /**
@@ -1398,124 +1322,6 @@ class EoUser {
1398
1322
  }
1399
1323
  }
1400
1324
 
1401
- class EnvironmentEnaio {
1402
- static isWebEnvironment() {
1403
- return !EnvironmentEnaio.isDesktopEnvironment() && !EnvironmentEnaio.isMobileEnvironment();
1404
- }
1405
- static isMobileEnvironment() {
1406
- return window.hasOwnProperty('cordova');
1407
- }
1408
- static isDesktopEnvironment() {
1409
- return window.hasOwnProperty('process') && window['process'].versions.hasOwnProperty('electron');
1410
- }
1411
- }
1412
-
1413
- /**
1414
- * The apps central caching service. It will provide the app with an easy to use cache that
1415
- * is aware of the platform it is running on. So it abstracts the platform-specific implementations
1416
- * of a cache from the application.
1417
- */
1418
- class AppCacheService {
1419
- constructor(storage, storageMap) {
1420
- this.storage = storage;
1421
- this.storageMap = storageMap;
1422
- /**
1423
- * Key for storing system definition
1424
- */
1425
- this.SYSTEM_DEFINITION = 'eo.framework.cache.systemdefinition';
1426
- /**
1427
- * Key for storing system definition
1428
- */
1429
- this.HOSTS = 'eo.framework.cache.hosts';
1430
- /**
1431
- * Key for storing location history
1432
- */
1433
- this.LOCATION_HISTORY = 'eo.framework.cache.locations.history';
1434
- this.itemsMap = new Map();
1435
- // IndexedDB issue after update - refresh function (transform all wrapped items)
1436
- window['_ngStorageRefresh'] = () => this.getStorage().subscribe(storage => this.setStorage(storage).subscribe() && console.log(storage));
1437
- }
1438
- /**
1439
- * Writes an item to the storage.
1440
- * @param key The item's key
1441
- * @param value The value to be stored
1442
- * @param debounce The debounce time (default: 500) to reduce identical storage calls
1443
- * @returns Resolves true if setting the item succeeded, false otherwise
1444
- */
1445
- setItem(key, value, debounce = 500) {
1446
- if (!debounce) {
1447
- return this.storage.setItem(key, value);
1448
- }
1449
- else {
1450
- if (!this.itemsMap.has(key)) {
1451
- const subject = new Subject();
1452
- subject.pipe(debounceTime(debounce), switchMap(val => this.storage.setItem(key, val))).subscribe();
1453
- this.itemsMap.set(key, subject);
1454
- }
1455
- this.itemsMap.get(key).next(value);
1456
- return of(true);
1457
- }
1458
- }
1459
- /**
1460
- * Get a stored item by its key.
1461
- * @param key The item's key
1462
- * @returns The item's value if the key exists, null otherwise
1463
- */
1464
- getItem(key) {
1465
- return this.storage.getItem(key)
1466
- .pipe(map((item) => {
1467
- // IndexedDB issue after update (transform wrapped items)
1468
- return Object.keys(item || {}).join() === 'value' ? item.value : item;
1469
- }));
1470
- }
1471
- /**
1472
- * Removes an item from the storage.
1473
- * @param key The item's key
1474
- * @returns Resolves true if removing the item succeeded, false otherwise
1475
- */
1476
- removeItem(key) {
1477
- return this.storage.removeItem(key);
1478
- }
1479
- /**
1480
- * Deletes all items from local storage
1481
- * @param filter optional - Delete all keys that pass through filter
1482
- * @returns Resolves true if clearing all items succeeded, false otherwise
1483
- */
1484
- clear(filter) {
1485
- return filter
1486
- ? this.getStorageKeys().pipe(switchMap((keys) => {
1487
- const list = keys.filter((k) => filter(k)).map((k) => this.removeItem(k));
1488
- return list.length ? forkJoin(list).pipe(map(() => true)) : of(true);
1489
- }))
1490
- : this.storage.clear();
1491
- }
1492
- getStorageKeys() {
1493
- return new Observable((observer) => {
1494
- const keys = [];
1495
- this.storageMap.keys().subscribe({
1496
- next: (key) => keys.push(key),
1497
- complete: () => observer.next(keys)
1498
- });
1499
- }).pipe(first());
1500
- }
1501
- getStorage() {
1502
- return this.getStorageKeys().pipe(switchMap((keys) => keys.length
1503
- ? forkJoin(Utils.arrayToObject(keys, (o) => o, (k) => this.getItem(k)))
1504
- : of({})));
1505
- }
1506
- setStorage(options) {
1507
- return forkJoin(Object.keys(options || {}).map((k) => this.setItem(k, options[k])));
1508
- }
1509
- }
1510
- AppCacheService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: AppCacheService, deps: [{ token: i1.LocalStorage }, { token: i1.StorageMap }], target: i0.ɵɵFactoryTarget.Injectable });
1511
- AppCacheService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: AppCacheService, providedIn: 'root' });
1512
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: AppCacheService, decorators: [{
1513
- type: Injectable,
1514
- args: [{
1515
- providedIn: 'root'
1516
- }]
1517
- }], ctorParameters: function () { return [{ type: i1.LocalStorage }, { type: i1.StorageMap }]; } });
1518
-
1519
1325
  /**
1520
1326
  * Wrapper for Cloud Services through Auth Service
1521
1327
  */
@@ -1673,60 +1479,43 @@ var ClipboardAction;
1673
1479
  })(ClipboardAction || (ClipboardAction = {}));
1674
1480
 
1675
1481
  /**
1676
- * Handles the systems capabilities. Capabilities are settings that enable/disable certain client features.
1482
+ * Representation of an object type. Object types are defined with the system definition and describe
1483
+ * different kind of objects that allowed to be created.
1677
1484
  */
1678
- class CapabilitiesService {
1485
+ class ObjectType {
1679
1486
  /**
1680
- * @ignore
1487
+ * Creates a new instance
1488
+ * @param json The JSON object received from the backend. This will be used to construct the new object type instance
1681
1489
  */
1682
- constructor() {
1490
+ constructor(json) {
1491
+ this.id = json.id;
1492
+ this.implements = json.implements ? json.implements : [];
1493
+ this.isFolder = json.folder;
1494
+ this.isContextFolder = json.iscontextfolder;
1495
+ this.isAbstract = json.abstract;
1496
+ this.iconId = json.icon ? json.icon.id : null;
1497
+ this.maxFiles = json.maxfiles;
1498
+ this.minFiles = json.minfiles;
1499
+ this.name = json.name;
1500
+ this.qname = json.qname;
1501
+ this.label = json.label;
1502
+ this.description = json.description;
1503
+ this.group = json.group ? json.group.label : "";
1504
+ this.elements = json.elements;
1505
+ this.allowedcontexttypes = json.allowedcontexttypes
1506
+ ? json.allowedcontexttypes
1507
+ : [];
1508
+ this.supertypes = json.supertypes ? json.supertypes.map(t => t.name) : [];
1509
+ this.shareable = json.shareable;
1510
+ this.parenttypes = this.getParentTypes(json.allowedlocations);
1683
1511
  }
1684
- /**
1685
- * Sets the capabilities based on a given object set by auth.service
1686
- *
1687
- * @param userCapabilities Object containing capabilities properties
1688
- * @param useSingleSingOn Whether or not to set up single signon on capability
1689
- * @returns The newly created capabilities object
1690
- */
1691
- setCapabilities(userCapabilities, useSingleSingOn) {
1692
- this.capabilities = {
1693
- bpm: userCapabilities.bpm,
1694
- favorites: userCapabilities.favorites,
1695
- followup: userCapabilities.followup,
1696
- subscription: userCapabilities.subscription,
1697
- intray: userCapabilities.intray,
1698
- storedqueries: userCapabilities.storedqueries,
1699
- recyclebin: userCapabilities.recyclebin,
1700
- inbox: userCapabilities.bpm || userCapabilities.followup || userCapabilities.subscription,
1701
- notifications: userCapabilities.followup || userCapabilities.subscription,
1702
- template: userCapabilities.template,
1703
- sso: useSingleSingOn || false
1704
- };
1705
- return this.capabilities;
1706
- }
1707
- /**
1708
- * Getter for the Capabilities
1709
- */
1710
- getCapabilities() {
1711
- return this.capabilities;
1712
- }
1713
- /**
1714
- * Check if Capability is present
1715
- * @param capability Capability to check for
1716
- * @returns True if the capability is set, false otherwise
1717
- */
1718
- hasCapability(capability) {
1719
- return this.capabilities[capability];
1512
+ getParentTypes(allowedlocations) {
1513
+ if (allowedlocations) {
1514
+ return allowedlocations.parenttypes.map(types => types.name);
1515
+ }
1516
+ return [];
1720
1517
  }
1721
1518
  }
1722
- CapabilitiesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: CapabilitiesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1723
- CapabilitiesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: CapabilitiesService, providedIn: 'root' });
1724
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: CapabilitiesService, decorators: [{
1725
- type: Injectable,
1726
- args: [{
1727
- providedIn: 'root'
1728
- }]
1729
- }], ctorParameters: function () { return []; } });
1730
1519
 
1731
1520
  // @ts-ignore
1732
1521
  /**
@@ -2077,887 +1866,1003 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
2077
1866
  } });
2078
1867
 
2079
1868
  /**
2080
- * @ignore
2081
- */
2082
- const moment$1 = momentImported;
2083
- /**
2084
- * Items emitted by the inbox service
2085
- */
2086
- class InboxItem {
2087
- /**
2088
- * Creates a new instance
2089
- * @param json The JSON object received from the backend. This will be used to construct the new inbox item instance
2090
- */
2091
- constructor(json) {
2092
- // todo: jsut use Object assign when backend changes are done
2093
- // Object.assign(this, json);
2094
- this.id = json.inboxentryid;
2095
- this.title = json.title;
2096
- this.description = json.description;
2097
- this.type = json.type;
2098
- this.sourceId = json.source ? json.source.id : null;
2099
- this.iconId = json.target && json.target.icon ? json.target.icon.id : null;
2100
- this.accepted = json.accepted;
2101
- this.isdeputy = json.isdeputy;
2102
- this.duetime = json.duetime;
2103
- this.received = json.receivetime;
2104
- this.target = json.target;
2105
- }
2106
- /**
2107
- * Determines whether or not the inbox item is overdue
2108
- * @returns True when inbox item is overdue, false otherwise
2109
- */
2110
- isOverdue() {
2111
- return this.duetime && moment$1(this.duetime).isBefore(moment$1());
2112
- }
2113
- }
2114
- InboxItem.TYPE_BPM = 'BPM';
2115
- InboxItem.TYPE_RESUBMISSION = 'RESUBMISSION';
2116
- InboxItem.TYPE_SUBSCRIPTION = 'SUBSCRIPTION';
2117
-
2118
- /**
2119
- * InboxService handles interaction with the inbox service on the backend side.
1869
+ * The apps central caching service. It will provide the app with an easy to use cache that
1870
+ * is aware of the platform it is running on. So it abstracts the platform-specific implementations
1871
+ * of a cache from the application.
2120
1872
  */
2121
- class InboxService {
2122
- constructor(backend) {
2123
- this.backend = backend;
2124
- // backends maximum page size
2125
- this.MAX_PAGE_SIZE = 1000;
2126
- this.inboxStateSource = new ReplaySubject(1);
2127
- this.inboxState$ = this.inboxStateSource.asObservable();
2128
- this.inboxItemsSource = new ReplaySubject(1);
2129
- this.inboxItemsGridData$ = this.inboxItemsSource.asObservable();
2130
- this.inboxItems$ = this.inboxItemsGridData$.pipe(this.backend.gridDataFilter);
1873
+ class AppCacheService {
1874
+ constructor(storage, storageMap) {
1875
+ this.storage = storage;
1876
+ this.storageMap = storageMap;
1877
+ /**
1878
+ * Key for storing system definition
1879
+ */
1880
+ this.SYSTEM_DEFINITION = 'eo.framework.cache.systemdefinition';
1881
+ /**
1882
+ * Key for storing system definition
1883
+ */
1884
+ this.HOSTS = 'eo.framework.cache.hosts';
1885
+ /**
1886
+ * Key for storing location history
1887
+ */
1888
+ this.LOCATION_HISTORY = 'eo.framework.cache.locations.history';
1889
+ this.itemsMap = new Map();
1890
+ // IndexedDB issue after update - refresh function (transform all wrapped items)
1891
+ window['_ngStorageRefresh'] = () => this.getStorage().subscribe(storage => this.setStorage(storage).subscribe() && console.log(storage));
2131
1892
  }
2132
1893
  /**
2133
- * Fetches inbox items from the backend.
2134
- *
2135
- * @returns Observable of inbox items.
1894
+ * Writes an item to the storage.
1895
+ * @param key The item's key
1896
+ * @param value The value to be stored
1897
+ * @param debounce The debounce time (default: 500) to reduce identical storage calls
1898
+ * @returns Resolves true if setting the item succeeded, false otherwise
2136
1899
  */
2137
- getItems() {
2138
- return this.getAllPages()
2139
- .pipe(map(res => res.map(item => new InboxItem(item))), tap(res => {
2140
- this.inboxItems = res;
2141
- this.inboxItemsSource.next(this.inboxItems);
2142
- }), catchError(Utils.throw(() => this.inboxItemsSource.next([]))));
2143
- }
2144
- getAllPages() {
2145
- let items = [];
2146
- return this.getPage().pipe(expand(res => {
2147
- return !res.last ? this.getPage(res.pageable.pageNumber + 1) : EMPTY;
2148
- }), tap(res => items = [...items, ...res.content]), skipWhile(res => !res.last), map(_ => items));
2149
- }
2150
- getPage(index) {
2151
- return this.backend
2152
- .getJson(`/get?size=${this.MAX_PAGE_SIZE}&page=${index || 0}`, this.backend.getInboxBase());
1900
+ setItem(key, value, debounce = 500) {
1901
+ if (!debounce) {
1902
+ return this.storage.setItem(key, value);
1903
+ }
1904
+ else {
1905
+ if (!this.itemsMap.has(key)) {
1906
+ const subject = new Subject();
1907
+ subject.pipe(debounceTime(debounce), switchMap(val => this.storage.setItem(key, val))).subscribe();
1908
+ this.itemsMap.set(key, subject);
1909
+ }
1910
+ this.itemsMap.get(key).next(value);
1911
+ return of(true);
1912
+ }
2153
1913
  }
2154
1914
  /**
2155
- * Fetches state informations for the users inbox
2156
- *
2157
- * @returns inbox state object
1915
+ * Get a stored item by its key.
1916
+ * @param key The item's key
1917
+ * @returns The item's value if the key exists, null otherwise
2158
1918
  */
2159
- getState() {
2160
- return this.inboxState;
1919
+ getItem(key) {
1920
+ return this.storage.getItem(key)
1921
+ .pipe(map((item) => {
1922
+ // IndexedDB issue after update (transform wrapped items)
1923
+ return Object.keys(item || {}).join() === 'value' ? item.value : item;
1924
+ }));
2161
1925
  }
2162
1926
  /**
2163
- * Public access to fetch inbox
1927
+ * Removes an item from the storage.
1928
+ * @param key The item's key
1929
+ * @returns Resolves true if removing the item succeeded, false otherwise
2164
1930
  */
2165
- refreshInboxState() {
2166
- this.fetchInboxState();
1931
+ removeItem(key) {
1932
+ return this.storage.removeItem(key);
2167
1933
  }
2168
1934
  /**
2169
- * Retrieve inbox state
1935
+ * Deletes all items from local storage
1936
+ * @param filter optional - Delete all keys that pass through filter
1937
+ * @returns Resolves true if clearing all items succeeded, false otherwise
2170
1938
  */
2171
- fetchInboxState() {
2172
- this.backend
2173
- .getJson('/state', this.backend.getInboxBase())
2174
- .pipe(map(res => res))
2175
- .subscribe(res => {
2176
- this.inboxState = res;
2177
- this.inboxStateSource.next(this.inboxState);
2178
- }, Utils.logError(null, 'Failed to fetch inbox state!'));
1939
+ clear(filter) {
1940
+ return filter
1941
+ ? this.getStorageKeys().pipe(switchMap((keys) => {
1942
+ const list = keys.filter((k) => filter(k)).map((k) => this.removeItem(k));
1943
+ return list.length ? forkJoin(list).pipe(map(() => true)) : of(true);
1944
+ }))
1945
+ : this.storage.clear();
2179
1946
  }
2180
- /**
2181
- * Removes an item from the inbox.
2182
- *
2183
- * @param item inbox item to be removed
2184
- * @returns Observable<any>
2185
- */
2186
- removeItem(item) {
2187
- return this.backend
2188
- .del('/' + item.id, this.backend.getInboxBase())
2189
- .pipe(tap(() => this.updateInboxItems(item.id)));
1947
+ getStorageKeys() {
1948
+ return new Observable((observer) => {
1949
+ const keys = [];
1950
+ this.storageMap.keys().subscribe({
1951
+ next: (key) => keys.push(key),
1952
+ complete: () => observer.next(keys)
1953
+ });
1954
+ }).pipe(first());
2190
1955
  }
2191
- /**
2192
- * Soft update for data in the inbox.
2193
- *
2194
- * @param id
2195
- * @param item
2196
- * @param multi
2197
- */
2198
- updateInboxItems(id, item, multi) {
2199
- if (this.backend.update(this.inboxItems, multi || [{ id, item }])) {
2200
- this.inboxItemsSource.next(this.inboxItems);
2201
- }
1956
+ getStorage() {
1957
+ return this.getStorageKeys().pipe(switchMap((keys) => keys.length
1958
+ ? forkJoin(Utils.arrayToObject(keys, (o) => o, (k) => this.getItem(k)))
1959
+ : of({})));
2202
1960
  }
2203
- /**
2204
- * Marks an inbox item as read.
2205
- *
2206
- * @param item the item to be marked as read
2207
- * @returns Observable<any>
2208
- */
2209
- markAsRead(item) {
2210
- return this.backend.put('/read/' + item.id, this.backend.getInboxBase());
1961
+ setStorage(options) {
1962
+ return forkJoin(Object.keys(options || {}).map((k) => this.setItem(k, options[k])));
2211
1963
  }
2212
1964
  }
2213
- InboxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: InboxService, deps: [{ token: BackendService }], target: i0.ɵɵFactoryTarget.Injectable });
2214
- InboxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: InboxService, providedIn: 'root' });
2215
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: InboxService, decorators: [{
1965
+ AppCacheService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: AppCacheService, deps: [{ token: i1$2.LocalStorage }, { token: i1$2.StorageMap }], target: i0.ɵɵFactoryTarget.Injectable });
1966
+ AppCacheService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: AppCacheService, providedIn: 'root' });
1967
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: AppCacheService, decorators: [{
2216
1968
  type: Injectable,
2217
1969
  args: [{
2218
1970
  providedIn: 'root'
2219
1971
  }]
2220
- }], ctorParameters: function () { return [{ type: BackendService }]; } });
1972
+ }], ctorParameters: function () { return [{ type: i1$2.LocalStorage }, { type: i1$2.StorageMap }]; } });
2221
1973
 
2222
1974
  /**
2223
- * `BpmService` handles interaction related to BPM tasks.
2224
- *
2225
- * The main parts provided and used by this service are Processes and WorkItems.
2226
- * Processes are defined on the backend side. They describe a set of tasks that will be executed by the process.
2227
- * Tasks that require user interaction are referred to as WorkItems.
2228
- *
2229
- * Processes can be related to a special object type, but they don't have to. In addition to that they can refer
2230
- * to dms objects.
1975
+ * Collection of System Services
2231
1976
  */
2232
- class BpmService {
2233
- constructor(capabilities, backend, eventService, inboxService) {
2234
- this.capabilities = capabilities;
1977
+ class SystemService {
1978
+ constructor(backend, logger, eventService, appCache) {
2235
1979
  this.backend = backend;
1980
+ this.logger = logger;
2236
1981
  this.eventService = eventService;
2237
- this.inboxService = inboxService;
2238
- this.processItemsSource = new ReplaySubject(1);
2239
- /**
2240
- * Long term observable emitting the current processes
2241
- */
2242
- this.processItems$ = this.processItemsSource.asObservable();
2243
- }
2244
- /**
2245
- * Retrieve all processes of the current user.
2246
- *
2247
- * @param size Maximum number of processes to be fetched
2248
- * @returns List of Processes
2249
- */
2250
- getProcesses(size = 1000) {
2251
- return this.backend
2252
- .getJson(`/process/user?size=${size}`, this.backend.getBpmBase())
2253
- .pipe(map(response => response.content.map(item => new Process(item))), tap((processes) => {
2254
- this.processItems = processes;
2255
- this.processItemsSource.next(this.processItems);
2256
- }));
2257
- }
2258
- /**
2259
- * Getter for the executable Processes. If types are provided, you'll get
2260
- * only the processes that are executable for all of them
2261
- * @param types List of dms object types to fetch executable processes for
2262
- * @param useCached If the cached data should be returned rather than requesting again
2263
- * @param additionalData If the additional form data should be also included
2264
- * @param modelid The process model ID to only return the data for one process
2265
- * @returns List of executable processes
2266
- */
2267
- getExecutableProcesses(types, useCached, additionalData, modelid, global) {
2268
- if (this.capabilities.hasCapability('bpm')) {
2269
- return (!!this.executableProcesses && useCached) ? of(this.executableProcesses) : this.fetchExecutableProcesses(types, additionalData, modelid, global);
2270
- }
2271
- else {
2272
- return of([]);
2273
- }
1982
+ this.appCache = appCache;
1983
+ this.systemSource = new ReplaySubject();
1984
+ this.system$ = this.systemSource.asObservable();
1985
+ // session cache for object type forms
1986
+ this.objectTypeForms = [];
1987
+ this.cachedRoles = [];
1988
+ this.eventService.on(EnaioEvent.SYSTEM_STATUS_SCHEMA_CHANGED).subscribe(() => {
1989
+ this.fetchSystemDefinition(this.user);
1990
+ });
2274
1991
  }
2275
- initExecutableProcesses() {
2276
- let uri = '/bpm/process/executable';
2277
- return this.backend.get(uri).pipe(tap(res => this.hasMainExecutableProcesses = res === null || res === void 0 ? void 0 : res.length));
1992
+ set system(s) {
1993
+ this._system = s;
2278
1994
  }
2279
- /**
2280
- * Gets executable Processes for a given set of dms object.You'll get
2281
- * only the processes that are executable for all of them.
2282
- * @param dmsObjects List of dms objects to fetch executable processes for
2283
- * @returns List of executable processes
2284
- */
2285
- getExecutableProcessesForDmsObjects(dmsObjects) {
2286
- return this.getExecutableProcesses(dmsObjects.map(o => o.typeName), false, true);
1995
+ get system() {
1996
+ return JSON.parse(JSON.stringify(this._system));
2287
1997
  }
2288
1998
  /**
2289
- * Fetches executable Processes from the backend.
2290
- * @param types List of dms object types to fetch executable processes for
2291
- * @param additionalData If the additional form data should be also included
2292
- * @param modelid The process model ID to only return the data for one process
2293
- * @returns List of executable processes
1999
+ * Gets all ObjectTypes
2000
+ *
2001
+ * @returns An array containing all object types
2294
2002
  */
2295
- fetchExecutableProcesses(types, additionalData, modelid, global) {
2296
- let uri = '/bpm/process/executable';
2297
- if (additionalData) {
2298
- uri += '?form=true&fields=true';
2299
- }
2300
- if (types) {
2301
- uri += (additionalData ? '&' : '?') + `type=${types.join(',')}`;
2302
- }
2303
- if (modelid) {
2304
- uri += (additionalData || types ? '&' : '?') + `modelid=${modelid}`;
2305
- }
2306
- return this.backend.get(uri).pipe(map(res => res), tap(res => {
2307
- // Extend existing processes with additional data, instead of overwriting all processes
2308
- if (global) {
2309
- if (additionalData) {
2310
- if (!this.executableProcesses) {
2311
- this.executableProcesses = [];
2312
- }
2313
- res.forEach(proc => {
2314
- const existingProcIndex = this.executableProcesses.findIndex(item => item.id === proc.id);
2315
- if (existingProcIndex === -1) {
2316
- this.executableProcesses.push(proc);
2317
- }
2318
- else {
2319
- this.executableProcesses[existingProcIndex] = proc;
2320
- }
2321
- });
2322
- }
2323
- else {
2324
- this.executableProcesses = res;
2325
- }
2326
- }
2327
- }));
2003
+ getObjectTypes() {
2004
+ return this.system.types;
2328
2005
  }
2329
2006
  /**
2330
- * Getter for a processes file. The file of a process contains
2331
- * dms objects attached to the process.
2332
- * @param processId ID of the process to fetch attached objects for
2007
+ * Gets an ObjectType by name.
2008
+ *
2009
+ * @param objectTypeName The name of the object type
2010
+ * @returns the ObjectType matching the given name
2333
2011
  */
2334
- getProcessFile(processId) {
2335
- return this.backend
2336
- .getJson(`/process/${processId}/file`, this.backend.getBpmBase()).pipe(map(res => res.content.map(i => {
2337
- return {
2338
- id: i.elementid,
2339
- title: i.title,
2340
- description: i.description ? i.description : '',
2341
- iconid: i.iconid,
2342
- creator: i.creator,
2343
- addtime: i.addtime,
2344
- type: i.type
2345
- };
2346
- })));
2012
+ getObjectType(objectTypeName) {
2013
+ return this.system.types.find(t => t.name === objectTypeName);
2347
2014
  }
2348
2015
  /**
2349
- * Retrieves a work item.
2350
- * @param processId ID of the parent process
2351
- * @param itemId ID of the work item itself
2352
- * @param options Options to be added to the backend call
2353
- * @returns a WorkItem
2016
+ * Get form elements from form model. This is useful if you have to fetch them
2017
+ * for a special situation like SEARCH
2018
+ * @param objectTypeName ObjectType to fetch elements for
2019
+ * @param situation Form model situation to be fetched
2020
+ * @param isContextType Flag indicating that the form model should be fetched for a context mode
2354
2021
  */
2355
- getWorkItem(processId, itemId, options) {
2356
- const params = options ? options : { form: true, fields: true };
2357
- const tasks = [
2358
- this.backend.getJson(Utils.buildUri(`/bpm/process/${processId}/${itemId}`, params)),
2359
- this.getProcessFile(processId)
2360
- ];
2361
- return forkJoin(tasks).pipe(map(res => {
2362
- const wi = new WorkItem(res[0]);
2363
- wi.setFile(res[1]);
2364
- return wi;
2022
+ getFormElementsFromFormModel(objectTypeName, situation, isContextType) {
2023
+ return this.getObjectTypeForm(objectTypeName, situation, isContextType ? 'CONTEXT' : null).pipe(switchMap(model => {
2024
+ const elements = [];
2025
+ this.processFormModelElements(model, elements);
2026
+ return of(elements);
2365
2027
  }));
2366
2028
  }
2367
- /**
2368
- * Saves a work item.
2369
- * @param item The work item to be saved
2370
- * @returns The updated WorkItem
2371
- */
2372
- saveWorkItem(item) {
2373
- const { id, processId, file, data } = item;
2374
- const payload = { contents: file, data };
2375
- const params = { keeplock: true, isautolock: false };
2376
- return this.backend
2377
- .post(Utils.buildUri(`/bpm/process/${processId}/${id}/save`, params), payload)
2378
- .pipe(mergeMap(() => this.getWorkItem(processId, id)));
2029
+ processFormModelElements(model, elements) {
2030
+ model.elements.forEach(e => {
2031
+ if (e.type !== "o2mGroup" && e.type !== "o2mGroupStack") {
2032
+ elements.push(e);
2033
+ }
2034
+ else if (e.elements && e.elements.length) {
2035
+ this.processFormModelElements(e, elements);
2036
+ }
2037
+ });
2379
2038
  }
2380
2039
  /**
2381
- * Forwards a work item. If a WorkItem provides different actions (@link WorkItemAction)
2382
- * you can provide the selected action too.
2383
- * @param item The work item to be forwarded
2384
- * @param action Action used for forwarding
2040
+ * Checks whether or not the given type implements a given supertype
2041
+ * @param type Type to be checked
2042
+ * @param superTypeName Name of the supertype
2385
2043
  */
2386
- forwardWorkItem(item, action) {
2387
- const params = { keeplock: false, isautolock: false };
2388
- const payload = {
2389
- action: action,
2390
- contents: item.file,
2391
- data: item.data
2392
- };
2393
- return this.backend
2394
- .post(Utils.buildUri(`/bpm/process/${item.processId}/${item.id}/save`, params), payload)
2395
- .pipe(tap(() => this.inboxService.updateInboxItems(item.id)));
2044
+ implementsType(type, superTypeName) {
2045
+ return type.name === superTypeName || (type.implements && type.implements.indexOf(superTypeName) !== -1);
2396
2046
  }
2397
2047
  /**
2398
- * Locks a WorkItem for the current user (personalization), meaning that the
2399
- * current user is now in charge of fulfilling the WorkItem task.
2400
- * @param item The WorkItem to be locked
2401
- * @returns The updated WorkItem
2048
+ * Gets a codesystem
2049
+ *
2050
+ * @param id The codesystems id
2051
+ * @returns The codesystem object matching the given id
2402
2052
  */
2403
- lockWorkItem(item) {
2404
- return this.backend.put(`/bpm/process/${item.processId}/${item.id}/lock`)
2405
- .pipe(mergeMap(() => this.getWorkItem(item.processId, item.id)));
2053
+ getCodesystem(id) {
2054
+ return this.system.codesystems.find(t => t.id === id || t.name === id);
2406
2055
  }
2407
2056
  /**
2408
- * Releases the lock for a WorkItem.
2409
- * @param item The work item to be unlocked
2410
- * @returns The updated WorkItem
2057
+ * Get the form model of an object type.
2058
+ *
2059
+ * @param objectTypeName The object type name
2060
+ * @param situation The form situation to be fetched
2061
+ * @param mode Form mode to fetch (e.g. CONTEXT)
2062
+ * @returns The object type form model
2411
2063
  */
2412
- unlockWorkItem(item) {
2413
- return this.backend.del(`/bpm/process/${item.processId}/${item.id}/lock`).pipe(mergeMap(() => this.getWorkItem(item.processId, item.id)));
2064
+ getObjectTypeForm(objectTypeName, situation, mode) {
2065
+ /** check if we have a cached form first */
2066
+ let cachedForm;
2067
+ let i = 0;
2068
+ while (!cachedForm && i < this.objectTypeForms.length) {
2069
+ if (this.objectTypeForms[i].name === objectTypeName &&
2070
+ this.objectTypeForms[i].mode === mode &&
2071
+ this.objectTypeForms[i].situation === situation) {
2072
+ cachedForm = this.objectTypeForms[i];
2073
+ }
2074
+ i++;
2075
+ }
2076
+ if (cachedForm) {
2077
+ /** return a clone of the cached model as otherwise model changes will be added to the chached model */
2078
+ return of(_.cloneDeep(cachedForm));
2079
+ }
2080
+ else {
2081
+ let uri = `/ui/form/${objectTypeName}?situation=${situation}`;
2082
+ uri += !!mode ? `&formmode=${mode}` : '';
2083
+ /** fetch and cache the requested form, if no cached version was found */
2084
+ return this.backend.getViaTempCache(uri, () => this.backend
2085
+ .getJson(uri)
2086
+ .pipe(tap((model) => this.objectTypeForms.push(_.cloneDeep(model)))));
2087
+ }
2414
2088
  }
2415
2089
  /**
2416
- * Starts an executable process.
2417
- * @param executableProcessId ID of the executable Process to be started
2418
- * @param data Data to be passed to the process (simple object of key/value pairs)
2419
- * @param contents Objects to be attached to the process (process.file).
2090
+ * Fetches the backends system definition and updates system$ Observable.
2091
+ * Subscribe to the system$ observable instead of calling this function, otherwise you'll trigger fetching the
2092
+ * system definition every time.
2093
+ *
2094
+ * @param user The user to load the system definition for
2095
+ * @returns true when successfull
2420
2096
  */
2421
- startProcess(executableProcessId, data, contents) {
2422
- return this.backend.post(`/bpm/process/?modelid=${executableProcessId}`, {
2423
- data: data,
2424
- contents: contents
2425
- });
2426
- }
2097
+ getSystemDefinition(user) {
2098
+ this.user = user;
2099
+ // todo: temporary: OrgChanges could not be recognized but affect object definition
2100
+ return this.fetchSystemDefinition(user);
2101
+ // todo: enable again when OrgChanges are recognizable (DO NOT DELETE!)
2102
+ // // is there a cached version
2103
+ // return this.appCache
2104
+ // .getItem(this.appCache.SYSTEM_DEFINITION)
2105
+ // .catch((error) => {
2106
+ // this.logger.error('Error fetching cached version of system definition.', error);
2107
+ // return this.fetchSystemDefinition(user);
2108
+ // })
2109
+ // .flatMap((cachedSystemDefinition: any) => {
2110
+ //
2111
+ // // yes? then check if it's up to date
2112
+ // if (cachedSystemDefinition) {
2113
+ //
2114
+ // if (
2115
+ // user.schema.version !== cachedSystemDefinition.info.version ||
2116
+ // user.id !== cachedSystemDefinition.info.user ||
2117
+ // user.getSchemaLocale() !== cachedSystemDefinition.info.locale
2118
+ // ) {
2119
+ // return this.fetchSystemDefinition(user);
2120
+ // } else {
2121
+ // // cache is up to date. return the cached one
2122
+ // this.logger.debug('System definition is up to date, using cached version.', cachedSystemDefinition);
2123
+ // this.system = cachedSystemDefinition;
2124
+ // this.systemSource.next(this.system);
2125
+ // return of(true);
2126
+ // }
2127
+ // } else {
2128
+ // // no cached systemDefinition found
2129
+ // return this.fetchSystemDefinition(user);
2130
+ // }
2131
+ // });
2132
+ }
2427
2133
  /**
2428
- * Returns the history for a process. Which entries are returned depends on the
2429
- * permissions of the current user.
2430
- * @param processId The ID of the process to fetch history for
2431
- * @returns Observable<WorkItemHistoryEntry[]>
2134
+ * Creates a value depending on a given Type
2135
+ *
2136
+ * @param string valueType
2137
+ * @returns any
2432
2138
  */
2433
- getProcessHistory(processId) {
2434
- return this.backend
2435
- .getJson(`/bpm/process/${processId}/history`)
2436
- .pipe(map(res => res && res.length ? res.map(item => new WorkItemHistoryEntry(item)) : []));
2139
+ getDefaultValue(valueType) {
2140
+ let defaultValue;
2141
+ switch (valueType) {
2142
+ case 'CURRENT_USER': {
2143
+ defaultValue = this.user.name;
2144
+ break;
2145
+ }
2146
+ case 'CURRENT_USER_NAME': {
2147
+ defaultValue = this.user.title;
2148
+ break;
2149
+ }
2150
+ case 'CURRENT_DATETIME': {
2151
+ defaultValue = new Date();
2152
+ break;
2153
+ }
2154
+ case 'CURRENT_DATE': {
2155
+ defaultValue = moment().startOf('day').toDate();
2156
+ break;
2157
+ }
2158
+ case 'YEAR': {
2159
+ defaultValue = moment().year();
2160
+ break;
2161
+ }
2162
+ case 'MONTH': {
2163
+ defaultValue = moment().month() + 1;
2164
+ break;
2165
+ }
2166
+ case 'DAY': {
2167
+ defaultValue = moment().date();
2168
+ break;
2169
+ }
2170
+ case 'HOUR': {
2171
+ defaultValue = moment().hour();
2172
+ break;
2173
+ }
2174
+ case 'MINUTE': {
2175
+ defaultValue = moment().minute();
2176
+ break;
2177
+ }
2178
+ case 'SECOND': {
2179
+ defaultValue = moment().second();
2180
+ break;
2181
+ }
2182
+ case 'WEEK_OF_YEAR': {
2183
+ defaultValue = moment().isoWeek();
2184
+ break;
2185
+ }
2186
+ case 'FIRST_DAY_OF_WEEK': {
2187
+ defaultValue = moment().startOf('isoWeek').toDate();
2188
+ break;
2189
+ }
2190
+ case 'FIRST_DAY_OF_MONTH': {
2191
+ defaultValue = moment().startOf('month').toDate();
2192
+ break;
2193
+ }
2194
+ case 'FIRST_DAY_OF_YEAR': {
2195
+ defaultValue = moment().startOf('year').toDate();
2196
+ break;
2197
+ }
2198
+ }
2199
+ return defaultValue;
2437
2200
  }
2438
2201
  /**
2439
- * Removes a content from the work items file.
2440
- * @param processId The ID of the process to remove the item from
2441
- * @param workItemId The ID of the work item containing the file element to be removed
2442
- * @param workItemContentId The the ID of the file element to be removed
2202
+ * Fetches the system definition from the server. Provided params are used for storing the
2203
+ * recent version in cache.
2204
+ *
2205
+ * @param user The user to fetch the system definition for
2206
+ * @return boolean
2443
2207
  */
2444
- removeFileElement(processId, workItemId, workItemContentId) {
2445
- return this.backend
2446
- .del(`/process/${processId}/file/${workItemContentId}?activityid=${workItemId}`, this.backend.getBpmBase());
2208
+ fetchSystemDefinition(user) {
2209
+ const fetches = [
2210
+ this.backend.getJson('/system/type/list?elements=true&basetypes=true'),
2211
+ this.backend.getJson('/system/cs/list?elements=true')
2212
+ ];
2213
+ return forkJoin(fetches)
2214
+ .pipe(catchError(Utils.catch((error) => {
2215
+ this.logger.error('Error fetching recent version of system definition from server.', error);
2216
+ this.systemSource.error('Error fetching recent version of system definition from server.');
2217
+ })), map((data) => {
2218
+ this.objectTypeForms = [];
2219
+ const system = {
2220
+ /**
2221
+ * info about the current system definition
2222
+ */
2223
+ info: {
2224
+ user: user.id,
2225
+ locale: user.getSchemaLocale(),
2226
+ version: user.schema.version
2227
+ },
2228
+ /**
2229
+ * supported backend locales
2230
+ */
2231
+ locales: user.schema.supportedLocales,
2232
+ /**
2233
+ * object type definitions
2234
+ */
2235
+ types: [],
2236
+ /**
2237
+ * codesystems cache
2238
+ */
2239
+ codesystems: []
2240
+ };
2241
+ const types = data[0];
2242
+ system.types = types.map(t => new ObjectType(t));
2243
+ system.codesystems = data[1];
2244
+ this.system = system;
2245
+ this.systemSource.next(system);
2246
+ this.logger.debug('Fetched new version of system definition (user: ' + user.id + ', version: ' + user.schema.version + ').');
2247
+ this.appCache
2248
+ .setItem(this.appCache.SYSTEM_DEFINITION, system)
2249
+ .subscribe(() => {
2250
+ this.logger.debug('Cached recent version');
2251
+ }, Utils.logError(null, 'Error caching recent version of system definition.'));
2252
+ return true;
2253
+ }));
2447
2254
  }
2448
2255
  /**
2449
- * Add contents to a work items file.
2450
- * @param processId The ID of the process
2451
- * @param workItemId The ID of the activity
2452
- * @param elements The Elements to be added
2453
- * @returns The updated WorkItem
2256
+ * Retrieve an organization object by its ID
2257
+ * @param id ID of org object
2454
2258
  */
2455
- addFileElements(processId, workItemId, elements) {
2456
- const tasks = [];
2457
- elements.forEach((e) => {
2458
- tasks.push(this.backend.post(`/process/${processId}/file/${e.id}?type=${e.type.name}&activityid=${workItemId}`, {}, this.backend.getBpmBase()));
2459
- });
2460
- return forkJoin(tasks)
2461
- .pipe(mergeMap(() => this.getWorkItem(processId, workItemId)));
2259
+ getOrganizationObjectById(id) {
2260
+ return this.backend.getJson(`/organization/id/${id}`);
2462
2261
  }
2463
2262
  /**
2464
- * Add a objects from the clipboard to a WorkItem.
2465
- * @param workItem The workItem to add the objects to
2466
- * @param clipboard Clipboard object holding user selected objects
2467
- * @returns The updated WorkItem
2263
+ * Fetches the organization object for a given name.
2264
+ *
2265
+ * @param name The name to fetch object for
2266
+ * @returns
2468
2267
  */
2469
- addFileElementsFromClipboard(workItem, clipboard) {
2470
- if ((workItem && workItem.fileEntryPermissions.add) && clipboard && clipboard.elements.length && clipboard.action === ClipboardAction.COPY) {
2471
- let contents;
2472
- if (workItem.file.length) {
2473
- // only add items that are not already part of the attachments
2474
- const attachmentIds = workItem.file.map(e => e.id);
2475
- contents = clipboard.elements.filter(e => attachmentIds.indexOf(e.id) === -1);
2476
- }
2477
- else {
2478
- contents = clipboard.elements;
2479
- }
2480
- return this.addFileElements(workItem.processId, workItem.id, contents);
2268
+ getOrganizationObject(name) {
2269
+ return this.getOrganizationObjects([name]).pipe(map(res => res[0]));
2270
+ }
2271
+ /**
2272
+ * Fetches a collection of organization objects
2273
+ *
2274
+ * @param names Array of names to fetch objects for
2275
+ * @returns A Array of Organization Objects
2276
+ */
2277
+ getOrganizationObjects(names) {
2278
+ const toFetch = names.map(name => this.backend.getJson(`/organization/name/${name}`).pipe(catchError(error => of({ id: name, active: false }))));
2279
+ return forkJoin(toFetch);
2280
+ }
2281
+ /**
2282
+ * Fetches a collection of organization roles
2283
+ *
2284
+ * @return A Array of Organization Roles
2285
+ */
2286
+ getRoles() {
2287
+ if (this.cachedRoles.length) {
2288
+ return of(this.cachedRoles);
2481
2289
  }
2482
2290
  else {
2483
- return throwError('error');
2291
+ return this.backend
2292
+ .get('/organization/role')
2293
+ .pipe(map(o => o), tap(roles => (this.cachedRoles = roles)));
2484
2294
  }
2485
2295
  }
2486
2296
  }
2487
- BpmService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: BpmService, deps: [{ token: CapabilitiesService }, { token: BackendService }, { token: EventService }, { token: InboxService }], target: i0.ɵɵFactoryTarget.Injectable });
2488
- BpmService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: BpmService, providedIn: 'root' });
2489
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: BpmService, decorators: [{
2297
+ SystemService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: SystemService, deps: [{ token: BackendService }, { token: Logger }, { token: EventService }, { token: AppCacheService }], target: i0.ɵɵFactoryTarget.Injectable });
2298
+ SystemService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: SystemService, providedIn: 'root' });
2299
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: SystemService, decorators: [{
2490
2300
  type: Injectable,
2491
2301
  args: [{
2492
2302
  providedIn: 'root'
2493
2303
  }]
2494
- }], ctorParameters: function () { return [{ type: CapabilitiesService }, { type: BackendService }, { type: EventService }, { type: InboxService }]; } });
2304
+ }], ctorParameters: function () { return [{ type: BackendService }, { type: Logger }, { type: EventService }, { type: AppCacheService }]; } });
2495
2305
 
2496
2306
  /**
2497
- * Representation of an object type. Object types are defined with the system definition and describe
2498
- * different kind of objects that allowed to be created.
2307
+ * Handles the systems capabilities. Capabilities are settings that enable/disable certain client features.
2499
2308
  */
2500
- class ObjectType {
2309
+ class CapabilitiesService {
2501
2310
  /**
2502
- * Creates a new instance
2503
- * @param json The JSON object received from the backend. This will be used to construct the new object type instance
2311
+ * @ignore
2504
2312
  */
2505
- constructor(json) {
2506
- this.id = json.id;
2507
- this.implements = json.implements ? json.implements : [];
2508
- this.isFolder = json.folder;
2509
- this.isContextFolder = json.iscontextfolder;
2510
- this.isAbstract = json.abstract;
2511
- this.iconId = json.icon ? json.icon.id : null;
2512
- this.maxFiles = json.maxfiles;
2513
- this.minFiles = json.minfiles;
2514
- this.name = json.name;
2515
- this.qname = json.qname;
2516
- this.label = json.label;
2517
- this.description = json.description;
2518
- this.group = json.group ? json.group.label : "";
2519
- this.elements = json.elements;
2520
- this.allowedcontexttypes = json.allowedcontexttypes
2521
- ? json.allowedcontexttypes
2522
- : [];
2523
- this.supertypes = json.supertypes ? json.supertypes.map(t => t.name) : [];
2524
- this.shareable = json.shareable;
2525
- this.parenttypes = this.getParentTypes(json.allowedlocations);
2526
- }
2527
- getParentTypes(allowedlocations) {
2528
- if (allowedlocations) {
2529
- return allowedlocations.parenttypes.map(types => types.name);
2530
- }
2531
- return [];
2532
- }
2533
- }
2534
-
2535
- /**
2536
- * Representation of a prepared item. A prepared item is an item that is supposed to create a new dms object.
2537
- * Adding a new object to yuuvis<sup>&reg;</sup> RAD starts with a prepared item. If all the required properties are set up, the item
2538
- * will be used to create a new dms object.
2539
- */
2540
- class PreparedItem {
2541
- /**
2542
- * Prepared items title
2543
- */
2544
- get title() {
2545
- return this.selectedtype ? this.selectedtype.label : '';
2313
+ constructor(system) {
2314
+ this.system = system;
2546
2315
  }
2547
2316
  /**
2548
- * Creates a new instance
2549
- * @param json The JSON object received from the backend. This will be used to construct the new prepared item instance
2317
+ * Sets the capabilities based on a given object set by auth.service
2318
+ *
2319
+ * @param userCapabilities Object containing capabilities properties
2320
+ * @param useSingleSingOn Whether or not to set up single signon on capability
2321
+ * @returns The newly created capabilities object
2550
2322
  */
2551
- constructor(json) {
2552
- Object.assign(this, json);
2323
+ setCapabilities(userCapabilities, useSingleSingOn) {
2324
+ this.capabilities = {
2325
+ bpm: userCapabilities.bpm,
2326
+ favorites: userCapabilities.favorites,
2327
+ followup: userCapabilities.followup,
2328
+ subscription: userCapabilities.subscription,
2329
+ intray: userCapabilities.intray,
2330
+ storedqueries: userCapabilities.storedqueries,
2331
+ recyclebin: userCapabilities.recyclebin,
2332
+ inbox: userCapabilities.bpm || userCapabilities.followup || userCapabilities.subscription,
2333
+ notifications: userCapabilities.followup || userCapabilities.subscription,
2334
+ template: userCapabilities.template,
2335
+ sso: useSingleSingOn || false,
2336
+ };
2337
+ return this.capabilities;
2553
2338
  }
2554
2339
  /**
2555
- * Returns true if the preparedItem contains content (template or actual file), false otherwise
2340
+ * Getter for the Capabilities
2556
2341
  */
2557
- hasContent() {
2558
- return !!this.template || this.contentcount > 0;
2342
+ getCapabilities() {
2343
+ return Object.assign(Object.assign({}, this.capabilities), { signing: !!this.system.getObjectType('yuvsigning') });
2559
2344
  }
2560
2345
  /**
2561
- * Retrieves the prepared items selected type object from the list
2562
- * of available types.
2563
- * @returns The type object that is selected or NULL
2346
+ * Check if Capability is present
2347
+ * @param capability Capability to check for
2348
+ * @returns True if the capability is set, false otherwise
2564
2349
  */
2565
- getSelectedTypeObject() {
2566
- return this.types.find(t => t.selected);
2350
+ hasCapability(capability) {
2351
+ return this.capabilities[capability];
2567
2352
  }
2568
2353
  }
2354
+ CapabilitiesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: CapabilitiesService, deps: [{ token: SystemService }], target: i0.ɵɵFactoryTarget.Injectable });
2355
+ CapabilitiesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: CapabilitiesService, providedIn: 'root' });
2356
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: CapabilitiesService, decorators: [{
2357
+ type: Injectable,
2358
+ args: [{
2359
+ providedIn: 'root'
2360
+ }]
2361
+ }], ctorParameters: function () { return [{ type: SystemService }]; } });
2569
2362
 
2570
- class UploadTarget {
2571
- /**
2572
- * Creates a new instance of UploadTarget
2573
- *
2574
- * @param id Upload targets unique id
2575
- * @param type Upload targets type
2576
- */
2577
- constructor(id, type) {
2578
- this.id = id;
2579
- this.type = type;
2580
- }
2363
+ /**
2364
+ * Items emitted by the inbox service
2365
+ */
2366
+ class InboxItem {
2581
2367
  /**
2582
- * Return Method if the Upload is Successfull
2583
- *
2584
- * @param target
2585
- * @returns the provided UploadTarget if the Upload was Successfull.
2368
+ * Creates a new instance
2369
+ * @param json The JSON object received from the backend. This will be used to construct the new inbox item instance
2586
2370
  */
2587
- onUploadSuccess(target) {
2588
- return target;
2371
+ constructor(json) {
2372
+ // todo: jsut use Object assign when backend changes are done
2373
+ // Object.assign(this, json);
2374
+ this.id = json.inboxentryid;
2375
+ this.title = json.title;
2376
+ this.description = json.description;
2377
+ this.type = json.type;
2378
+ this.sourceId = json.source ? json.source.id : null;
2379
+ this.iconId = json.target && json.target.icon ? json.target.icon.id : null;
2380
+ this.accepted = json.accepted;
2381
+ this.isdeputy = json.isdeputy;
2382
+ this.duetime = json.duetime;
2383
+ this.received = json.receivetime;
2384
+ this.target = json.target;
2589
2385
  }
2590
2386
  /**
2591
- * Return method if the Upload fails
2592
- *
2593
- * @returns an empty Object if the Upload fails
2387
+ * Determines whether or not the inbox item is overdue
2388
+ * @returns True when inbox item is overdue, false otherwise
2594
2389
  */
2595
- onUploadFail() {
2596
- return {};
2390
+ isOverdue() {
2391
+ return this.duetime && moment(this.duetime).isBefore(moment());
2597
2392
  }
2598
2393
  }
2599
- /**
2600
- * general filing target
2601
- */
2602
- UploadTarget.ROOT = 'root';
2603
- /**
2604
- * add file(s) to context folder
2605
- */
2606
- UploadTarget.CONTEXT = 'context';
2607
- /**
2608
- * add file(s) to context folders dynamic structure
2609
- */
2610
- UploadTarget.CONTEXT_TREE = 'contexttree';
2611
- /**
2612
- * set/replace content file of a dms object
2613
- */
2614
- UploadTarget.OBJECT = 'object';
2615
- /**
2616
- * custom targets (e.g. for plugin development)
2617
- */
2618
- UploadTarget.CUSTOM = 'custom';
2619
-
2620
- var Direction;
2621
- (function (Direction) {
2622
- Direction["LTR"] = "ltr";
2623
- Direction["RTL"] = "rtl";
2624
- })(Direction || (Direction = {}));
2394
+ InboxItem.TYPE_BPM = 'BPM';
2395
+ InboxItem.TYPE_RESUBMISSION = 'RESUBMISSION';
2396
+ InboxItem.TYPE_SUBSCRIPTION = 'SUBSCRIPTION';
2625
2397
 
2626
2398
  /**
2627
- * @ignore
2628
- */
2629
- const moment = momentImported;
2630
- /**
2631
- * Collection of System Services
2399
+ * InboxService handles interaction with the inbox service on the backend side.
2632
2400
  */
2633
- class SystemService {
2634
- constructor(backend, logger, eventService, appCache) {
2401
+ class InboxService {
2402
+ constructor(backend) {
2635
2403
  this.backend = backend;
2636
- this.logger = logger;
2637
- this.eventService = eventService;
2638
- this.appCache = appCache;
2639
- this.systemSource = new ReplaySubject();
2640
- this.system$ = this.systemSource.asObservable();
2641
- // session cache for object type forms
2642
- this.objectTypeForms = [];
2643
- this.cachedRoles = [];
2644
- this.eventService.on(EnaioEvent.SYSTEM_STATUS_SCHEMA_CHANGED).subscribe(() => {
2645
- this.fetchSystemDefinition(this.user);
2646
- });
2647
- }
2648
- set system(s) {
2649
- this._system = s;
2650
- }
2651
- get system() {
2652
- return JSON.parse(JSON.stringify(this._system));
2404
+ // backends maximum page size
2405
+ this.MAX_PAGE_SIZE = 1000;
2406
+ this.inboxStateSource = new ReplaySubject(1);
2407
+ this.inboxState$ = this.inboxStateSource.asObservable();
2408
+ this.inboxItemsSource = new ReplaySubject(1);
2409
+ this.inboxItemsGridData$ = this.inboxItemsSource.asObservable();
2410
+ this.inboxItems$ = this.inboxItemsGridData$.pipe(this.backend.gridDataFilter);
2653
2411
  }
2654
2412
  /**
2655
- * Gets all ObjectTypes
2413
+ * Fetches inbox items from the backend.
2656
2414
  *
2657
- * @returns An array containing all object types
2415
+ * @returns Observable of inbox items.
2658
2416
  */
2659
- getObjectTypes() {
2660
- return this.system.types;
2417
+ getItems() {
2418
+ return this.getAllPages()
2419
+ .pipe(map(res => res.map(item => new InboxItem(item))), tap(res => {
2420
+ this.inboxItems = res;
2421
+ this.inboxItemsSource.next(this.inboxItems);
2422
+ }), catchError(Utils.throw(() => this.inboxItemsSource.next([]))));
2423
+ }
2424
+ getAllPages() {
2425
+ let items = [];
2426
+ return this.getPage().pipe(expand(res => {
2427
+ return !res.last ? this.getPage(res.pageable.pageNumber + 1) : EMPTY;
2428
+ }), tap(res => items = [...items, ...res.content]), skipWhile(res => !res.last), map(_ => items));
2429
+ }
2430
+ getPage(index) {
2431
+ return this.backend
2432
+ .getJson(`/get?size=${this.MAX_PAGE_SIZE}&page=${index || 0}`, this.backend.getInboxBase());
2661
2433
  }
2662
2434
  /**
2663
- * Gets an ObjectType by name.
2435
+ * Fetches state informations for the users inbox
2664
2436
  *
2665
- * @param objectTypeName The name of the object type
2666
- * @returns the ObjectType matching the given name
2437
+ * @returns inbox state object
2667
2438
  */
2668
- getObjectType(objectTypeName) {
2669
- return this.system.types.find(t => t.name === objectTypeName);
2439
+ getState() {
2440
+ return this.inboxState;
2670
2441
  }
2671
2442
  /**
2672
- * Get form elements from form model. This is useful if you have to fetch them
2673
- * for a special situation like SEARCH
2674
- * @param objectTypeName ObjectType to fetch elements for
2675
- * @param situation Form model situation to be fetched
2676
- * @param isContextType Flag indicating that the form model should be fetched for a context mode
2443
+ * Public access to fetch inbox
2677
2444
  */
2678
- getFormElementsFromFormModel(objectTypeName, situation, isContextType) {
2679
- return this.getObjectTypeForm(objectTypeName, situation, isContextType ? 'CONTEXT' : null).pipe(switchMap(model => {
2680
- const elements = [];
2681
- this.processFormModelElements(model, elements);
2682
- return of(elements);
2683
- }));
2684
- }
2685
- processFormModelElements(model, elements) {
2686
- model.elements.forEach(e => {
2687
- if (e.type !== "o2mGroup" && e.type !== "o2mGroupStack") {
2688
- elements.push(e);
2689
- }
2690
- else if (e.elements && e.elements.length) {
2691
- this.processFormModelElements(e, elements);
2692
- }
2693
- });
2445
+ refreshInboxState() {
2446
+ this.fetchInboxState();
2694
2447
  }
2695
2448
  /**
2696
- * Checks whether or not the given type implements a given supertype
2697
- * @param type Type to be checked
2698
- * @param superTypeName Name of the supertype
2449
+ * Retrieve inbox state
2699
2450
  */
2700
- implementsType(type, superTypeName) {
2701
- return type.name === superTypeName || (type.implements && type.implements.indexOf(superTypeName) !== -1);
2451
+ fetchInboxState() {
2452
+ this.backend
2453
+ .getJson('/state', this.backend.getInboxBase())
2454
+ .pipe(map(res => res))
2455
+ .subscribe(res => {
2456
+ this.inboxState = res;
2457
+ this.inboxStateSource.next(this.inboxState);
2458
+ }, Utils.logError(null, 'Failed to fetch inbox state!'));
2702
2459
  }
2703
2460
  /**
2704
- * Gets a codesystem
2461
+ * Removes an item from the inbox.
2705
2462
  *
2706
- * @param id The codesystems id
2707
- * @returns The codesystem object matching the given id
2463
+ * @param item inbox item to be removed
2464
+ * @returns Observable<any>
2708
2465
  */
2709
- getCodesystem(id) {
2710
- return this.system.codesystems.find(t => t.id === id || t.name === id);
2466
+ removeItem(item) {
2467
+ return this.backend
2468
+ .del('/' + item.id, this.backend.getInboxBase())
2469
+ .pipe(tap(() => this.updateInboxItems(item.id)));
2711
2470
  }
2712
2471
  /**
2713
- * Get the form model of an object type.
2472
+ * Soft update for data in the inbox.
2714
2473
  *
2715
- * @param objectTypeName The object type name
2716
- * @param situation The form situation to be fetched
2717
- * @param mode Form mode to fetch (e.g. CONTEXT)
2718
- * @returns The object type form model
2474
+ * @param id
2475
+ * @param item
2476
+ * @param multi
2719
2477
  */
2720
- getObjectTypeForm(objectTypeName, situation, mode) {
2721
- /** check if we have a cached form first */
2722
- let cachedForm;
2723
- let i = 0;
2724
- while (!cachedForm && i < this.objectTypeForms.length) {
2725
- if (this.objectTypeForms[i].name === objectTypeName &&
2726
- this.objectTypeForms[i].mode === mode &&
2727
- this.objectTypeForms[i].situation === situation) {
2728
- cachedForm = this.objectTypeForms[i];
2729
- }
2730
- i++;
2478
+ updateInboxItems(id, item, multi) {
2479
+ if (this.backend.update(this.inboxItems, multi || [{ id, item }])) {
2480
+ this.inboxItemsSource.next(this.inboxItems);
2731
2481
  }
2732
- if (cachedForm) {
2733
- /** return a clone of the cached model as otherwise model changes will be added to the chached model */
2734
- return of(_.cloneDeep(cachedForm));
2482
+ }
2483
+ /**
2484
+ * Marks an inbox item as read.
2485
+ *
2486
+ * @param item the item to be marked as read
2487
+ * @returns Observable<any>
2488
+ */
2489
+ markAsRead(item) {
2490
+ return this.backend.put('/read/' + item.id, this.backend.getInboxBase());
2491
+ }
2492
+ }
2493
+ InboxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: InboxService, deps: [{ token: BackendService }], target: i0.ɵɵFactoryTarget.Injectable });
2494
+ InboxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: InboxService, providedIn: 'root' });
2495
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: InboxService, decorators: [{
2496
+ type: Injectable,
2497
+ args: [{
2498
+ providedIn: 'root'
2499
+ }]
2500
+ }], ctorParameters: function () { return [{ type: BackendService }]; } });
2501
+
2502
+ /**
2503
+ * `BpmService` handles interaction related to BPM tasks.
2504
+ *
2505
+ * The main parts provided and used by this service are Processes and WorkItems.
2506
+ * Processes are defined on the backend side. They describe a set of tasks that will be executed by the process.
2507
+ * Tasks that require user interaction are referred to as WorkItems.
2508
+ *
2509
+ * Processes can be related to a special object type, but they don't have to. In addition to that they can refer
2510
+ * to dms objects.
2511
+ */
2512
+ class BpmService {
2513
+ constructor(capabilities, backend, eventService, inboxService) {
2514
+ this.capabilities = capabilities;
2515
+ this.backend = backend;
2516
+ this.eventService = eventService;
2517
+ this.inboxService = inboxService;
2518
+ this.processItemsSource = new ReplaySubject(1);
2519
+ /**
2520
+ * Long term observable emitting the current processes
2521
+ */
2522
+ this.processItems$ = this.processItemsSource.asObservable();
2523
+ }
2524
+ /**
2525
+ * Retrieve all processes of the current user.
2526
+ *
2527
+ * @param size Maximum number of processes to be fetched
2528
+ * @returns List of Processes
2529
+ */
2530
+ getProcesses(size = 1000) {
2531
+ return this.backend
2532
+ .getJson(`/process/user?size=${size}`, this.backend.getBpmBase())
2533
+ .pipe(map(response => response.content.map(item => new Process(item))), tap((processes) => {
2534
+ this.processItems = processes;
2535
+ this.processItemsSource.next(this.processItems);
2536
+ }));
2537
+ }
2538
+ /**
2539
+ * Getter for the executable Processes. If types are provided, you'll get
2540
+ * only the processes that are executable for all of them
2541
+ * @param types List of dms object types to fetch executable processes for
2542
+ * @param useCached If the cached data should be returned rather than requesting again
2543
+ * @param additionalData If the additional form data should be also included
2544
+ * @param modelid The process model ID to only return the data for one process
2545
+ * @returns List of executable processes
2546
+ */
2547
+ getExecutableProcesses(types, useCached, additionalData, modelid, global) {
2548
+ if (this.capabilities.hasCapability('bpm')) {
2549
+ return (!!this.executableProcesses && useCached) ? of(this.executableProcesses) : this.fetchExecutableProcesses(types, additionalData, modelid, global);
2735
2550
  }
2736
2551
  else {
2737
- let uri = `/ui/form/${objectTypeName}?situation=${situation}`;
2738
- uri += !!mode ? `&formmode=${mode}` : '';
2739
- /** fetch and cache the requested form, if no cached version was found */
2740
- return this.backend.getViaTempCache(uri, () => this.backend
2741
- .getJson(uri)
2742
- .pipe(tap((model) => this.objectTypeForms.push(_.cloneDeep(model)))));
2552
+ return of([]);
2743
2553
  }
2744
2554
  }
2555
+ initExecutableProcesses() {
2556
+ let uri = '/bpm/process/executable';
2557
+ return this.backend.get(uri).pipe(tap(res => this.hasMainExecutableProcesses = res === null || res === void 0 ? void 0 : res.length));
2558
+ }
2745
2559
  /**
2746
- * Fetches the backends system definition and updates system$ Observable.
2747
- * Subscribe to the system$ observable instead of calling this function, otherwise you'll trigger fetching the
2748
- * system definition every time.
2749
- *
2750
- * @param user The user to load the system definition for
2751
- * @returns true when successfull
2560
+ * Gets executable Processes for a given set of dms object.You'll get
2561
+ * only the processes that are executable for all of them.
2562
+ * @param dmsObjects List of dms objects to fetch executable processes for
2563
+ * @returns List of executable processes
2752
2564
  */
2753
- getSystemDefinition(user) {
2754
- this.user = user;
2755
- // todo: temporary: OrgChanges could not be recognized but affect object definition
2756
- return this.fetchSystemDefinition(user);
2757
- // todo: enable again when OrgChanges are recognizable (DO NOT DELETE!)
2758
- // // is there a cached version
2759
- // return this.appCache
2760
- // .getItem(this.appCache.SYSTEM_DEFINITION)
2761
- // .catch((error) => {
2762
- // this.logger.error('Error fetching cached version of system definition.', error);
2763
- // return this.fetchSystemDefinition(user);
2764
- // })
2765
- // .flatMap((cachedSystemDefinition: any) => {
2766
- //
2767
- // // yes? then check if it's up to date
2768
- // if (cachedSystemDefinition) {
2769
- //
2770
- // if (
2771
- // user.schema.version !== cachedSystemDefinition.info.version ||
2772
- // user.id !== cachedSystemDefinition.info.user ||
2773
- // user.getSchemaLocale() !== cachedSystemDefinition.info.locale
2774
- // ) {
2775
- // return this.fetchSystemDefinition(user);
2776
- // } else {
2777
- // // cache is up to date. return the cached one
2778
- // this.logger.debug('System definition is up to date, using cached version.', cachedSystemDefinition);
2779
- // this.system = cachedSystemDefinition;
2780
- // this.systemSource.next(this.system);
2781
- // return of(true);
2782
- // }
2783
- // } else {
2784
- // // no cached systemDefinition found
2785
- // return this.fetchSystemDefinition(user);
2786
- // }
2787
- // });
2565
+ getExecutableProcessesForDmsObjects(dmsObjects) {
2566
+ return this.getExecutableProcesses(dmsObjects.map(o => o.typeName), false, true);
2788
2567
  }
2789
2568
  /**
2790
- * Creates a value depending on a given Type
2791
- *
2792
- * @param string valueType
2793
- * @returns any
2569
+ * Fetches executable Processes from the backend.
2570
+ * @param types List of dms object types to fetch executable processes for
2571
+ * @param additionalData If the additional form data should be also included
2572
+ * @param modelid The process model ID to only return the data for one process
2573
+ * @returns List of executable processes
2794
2574
  */
2795
- getDefaultValue(valueType) {
2796
- let defaultValue;
2797
- switch (valueType) {
2798
- case 'CURRENT_USER': {
2799
- defaultValue = this.user.name;
2800
- break;
2801
- }
2802
- case 'CURRENT_USER_NAME': {
2803
- defaultValue = this.user.title;
2804
- break;
2805
- }
2806
- case 'CURRENT_DATETIME': {
2807
- defaultValue = new Date();
2808
- break;
2809
- }
2810
- case 'CURRENT_DATE': {
2811
- defaultValue = moment().startOf('day').toDate();
2812
- break;
2813
- }
2814
- case 'YEAR': {
2815
- defaultValue = moment().year();
2816
- break;
2817
- }
2818
- case 'MONTH': {
2819
- defaultValue = moment().month() + 1;
2820
- break;
2821
- }
2822
- case 'DAY': {
2823
- defaultValue = moment().date();
2824
- break;
2825
- }
2826
- case 'HOUR': {
2827
- defaultValue = moment().hour();
2828
- break;
2829
- }
2830
- case 'MINUTE': {
2831
- defaultValue = moment().minute();
2832
- break;
2833
- }
2834
- case 'SECOND': {
2835
- defaultValue = moment().second();
2836
- break;
2837
- }
2838
- case 'WEEK_OF_YEAR': {
2839
- defaultValue = moment().isoWeek();
2840
- break;
2841
- }
2842
- case 'FIRST_DAY_OF_WEEK': {
2843
- defaultValue = moment().startOf('isoWeek').toDate();
2844
- break;
2575
+ fetchExecutableProcesses(types, additionalData, modelid, global) {
2576
+ let uri = '/bpm/process/executable';
2577
+ if (additionalData) {
2578
+ uri += '?form=true&fields=true';
2579
+ }
2580
+ if (types) {
2581
+ uri += (additionalData ? '&' : '?') + `type=${types.join(',')}`;
2582
+ }
2583
+ if (modelid) {
2584
+ uri += (additionalData || types ? '&' : '?') + `modelid=${modelid}`;
2585
+ }
2586
+ return this.backend.get(uri).pipe(map(res => res), tap(res => {
2587
+ // Extend existing processes with additional data, instead of overwriting all processes
2588
+ if (global) {
2589
+ if (additionalData) {
2590
+ if (!this.executableProcesses) {
2591
+ this.executableProcesses = [];
2592
+ }
2593
+ res.forEach(proc => {
2594
+ const existingProcIndex = this.executableProcesses.findIndex(item => item.id === proc.id);
2595
+ if (existingProcIndex === -1) {
2596
+ this.executableProcesses.push(proc);
2597
+ }
2598
+ else {
2599
+ this.executableProcesses[existingProcIndex] = proc;
2600
+ }
2601
+ });
2602
+ }
2603
+ else {
2604
+ this.executableProcesses = res;
2605
+ }
2845
2606
  }
2846
- case 'FIRST_DAY_OF_MONTH': {
2847
- defaultValue = moment().startOf('month').toDate();
2848
- break;
2607
+ }));
2608
+ }
2609
+ /**
2610
+ * Getter for a processes file. The file of a process contains
2611
+ * dms objects attached to the process.
2612
+ * @param processId ID of the process to fetch attached objects for
2613
+ */
2614
+ getProcessFile(processId) {
2615
+ return this.backend
2616
+ .getJson(`/process/${processId}/file`, this.backend.getBpmBase()).pipe(map(res => res.content.map(i => {
2617
+ return {
2618
+ id: i.elementid,
2619
+ title: i.title,
2620
+ description: i.description ? i.description : '',
2621
+ iconid: i.iconid,
2622
+ creator: i.creator,
2623
+ addtime: i.addtime,
2624
+ type: i.type
2625
+ };
2626
+ })));
2627
+ }
2628
+ /**
2629
+ * Retrieves a work item.
2630
+ * @param processId ID of the parent process
2631
+ * @param itemId ID of the work item itself
2632
+ * @param options Options to be added to the backend call
2633
+ * @returns a WorkItem
2634
+ */
2635
+ getWorkItem(processId, itemId, options) {
2636
+ const params = options ? options : { form: true, fields: true };
2637
+ const tasks = [
2638
+ this.backend.getJson(Utils.buildUri(`/bpm/process/${processId}/${itemId}`, params)),
2639
+ this.getProcessFile(processId)
2640
+ ];
2641
+ return forkJoin(tasks).pipe(map(res => {
2642
+ const wi = new WorkItem(res[0]);
2643
+ wi.setFile(res[1]);
2644
+ return wi;
2645
+ }));
2646
+ }
2647
+ /**
2648
+ * Saves a work item.
2649
+ * @param item The work item to be saved
2650
+ * @returns The updated WorkItem
2651
+ */
2652
+ saveWorkItem(item) {
2653
+ const { id, processId, file, data } = item;
2654
+ const payload = { contents: file, data };
2655
+ const params = { keeplock: true, isautolock: false };
2656
+ return this.backend
2657
+ .post(Utils.buildUri(`/bpm/process/${processId}/${id}/save`, params), payload)
2658
+ .pipe(mergeMap(() => this.getWorkItem(processId, id)));
2659
+ }
2660
+ /**
2661
+ * Forwards a work item. If a WorkItem provides different actions (@link WorkItemAction)
2662
+ * you can provide the selected action too.
2663
+ * @param item The work item to be forwarded
2664
+ * @param action Action used for forwarding
2665
+ */
2666
+ forwardWorkItem(item, action) {
2667
+ const params = { keeplock: false, isautolock: false };
2668
+ const payload = {
2669
+ action: action,
2670
+ contents: item.file,
2671
+ data: item.data
2672
+ };
2673
+ return this.backend
2674
+ .post(Utils.buildUri(`/bpm/process/${item.processId}/${item.id}/save`, params), payload)
2675
+ .pipe(tap(() => this.inboxService.updateInboxItems(item.id)));
2676
+ }
2677
+ /**
2678
+ * Locks a WorkItem for the current user (personalization), meaning that the
2679
+ * current user is now in charge of fulfilling the WorkItem task.
2680
+ * @param item The WorkItem to be locked
2681
+ * @returns The updated WorkItem
2682
+ */
2683
+ lockWorkItem(item) {
2684
+ return this.backend.put(`/bpm/process/${item.processId}/${item.id}/lock`)
2685
+ .pipe(mergeMap(() => this.getWorkItem(item.processId, item.id)));
2686
+ }
2687
+ /**
2688
+ * Releases the lock for a WorkItem.
2689
+ * @param item The work item to be unlocked
2690
+ * @returns The updated WorkItem
2691
+ */
2692
+ unlockWorkItem(item) {
2693
+ return this.backend.del(`/bpm/process/${item.processId}/${item.id}/lock`).pipe(mergeMap(() => this.getWorkItem(item.processId, item.id)));
2694
+ }
2695
+ /**
2696
+ * Starts an executable process.
2697
+ * @param executableProcessId ID of the executable Process to be started
2698
+ * @param data Data to be passed to the process (simple object of key/value pairs)
2699
+ * @param contents Objects to be attached to the process (process.file).
2700
+ */
2701
+ startProcess(executableProcessId, data, contents) {
2702
+ return this.backend.post(`/bpm/process/?modelid=${executableProcessId}`, {
2703
+ data: data,
2704
+ contents: contents
2705
+ });
2706
+ }
2707
+ /**
2708
+ * Returns the history for a process. Which entries are returned depends on the
2709
+ * permissions of the current user.
2710
+ * @param processId The ID of the process to fetch history for
2711
+ * @returns Observable<WorkItemHistoryEntry[]>
2712
+ */
2713
+ getProcessHistory(processId) {
2714
+ return this.backend
2715
+ .getJson(`/bpm/process/${processId}/history`)
2716
+ .pipe(map(res => res && res.length ? res.map(item => new WorkItemHistoryEntry(item)) : []));
2717
+ }
2718
+ /**
2719
+ * Removes a content from the work items file.
2720
+ * @param processId The ID of the process to remove the item from
2721
+ * @param workItemId The ID of the work item containing the file element to be removed
2722
+ * @param workItemContentId The the ID of the file element to be removed
2723
+ */
2724
+ removeFileElement(processId, workItemId, workItemContentId) {
2725
+ return this.backend
2726
+ .del(`/process/${processId}/file/${workItemContentId}?activityid=${workItemId}`, this.backend.getBpmBase());
2727
+ }
2728
+ /**
2729
+ * Add contents to a work items file.
2730
+ * @param processId The ID of the process
2731
+ * @param workItemId The ID of the activity
2732
+ * @param elements The Elements to be added
2733
+ * @returns The updated WorkItem
2734
+ */
2735
+ addFileElements(processId, workItemId, elements) {
2736
+ const tasks = [];
2737
+ elements.forEach((e) => {
2738
+ tasks.push(this.backend.post(`/process/${processId}/file/${e.id}?type=${e.type.name}&activityid=${workItemId}`, {}, this.backend.getBpmBase()));
2739
+ });
2740
+ return forkJoin(tasks)
2741
+ .pipe(mergeMap(() => this.getWorkItem(processId, workItemId)));
2742
+ }
2743
+ /**
2744
+ * Add a objects from the clipboard to a WorkItem.
2745
+ * @param workItem The workItem to add the objects to
2746
+ * @param clipboard Clipboard object holding user selected objects
2747
+ * @returns The updated WorkItem
2748
+ */
2749
+ addFileElementsFromClipboard(workItem, clipboard) {
2750
+ if ((workItem && workItem.fileEntryPermissions.add) && clipboard && clipboard.elements.length && clipboard.action === ClipboardAction.COPY) {
2751
+ let contents;
2752
+ if (workItem.file.length) {
2753
+ // only add items that are not already part of the attachments
2754
+ const attachmentIds = workItem.file.map(e => e.id);
2755
+ contents = clipboard.elements.filter(e => attachmentIds.indexOf(e.id) === -1);
2849
2756
  }
2850
- case 'FIRST_DAY_OF_YEAR': {
2851
- defaultValue = moment().startOf('year').toDate();
2852
- break;
2757
+ else {
2758
+ contents = clipboard.elements;
2853
2759
  }
2760
+ return this.addFileElements(workItem.processId, workItem.id, contents);
2761
+ }
2762
+ else {
2763
+ return throwError('error');
2854
2764
  }
2855
- return defaultValue;
2856
2765
  }
2766
+ }
2767
+ BpmService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: BpmService, deps: [{ token: CapabilitiesService }, { token: BackendService }, { token: EventService }, { token: InboxService }], target: i0.ɵɵFactoryTarget.Injectable });
2768
+ BpmService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: BpmService, providedIn: 'root' });
2769
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: BpmService, decorators: [{
2770
+ type: Injectable,
2771
+ args: [{
2772
+ providedIn: 'root'
2773
+ }]
2774
+ }], ctorParameters: function () { return [{ type: CapabilitiesService }, { type: BackendService }, { type: EventService }, { type: InboxService }]; } });
2775
+
2776
+ /**
2777
+ * Representation of a prepared item. A prepared item is an item that is supposed to create a new dms object.
2778
+ * Adding a new object to yuuvis<sup>&reg;</sup> RAD starts with a prepared item. If all the required properties are set up, the item
2779
+ * will be used to create a new dms object.
2780
+ */
2781
+ class PreparedItem {
2857
2782
  /**
2858
- * Fetches the system definition from the server. Provided params are used for storing the
2859
- * recent version in cache.
2860
- *
2861
- * @param user The user to fetch the system definition for
2862
- * @return boolean
2783
+ * Prepared items title
2863
2784
  */
2864
- fetchSystemDefinition(user) {
2865
- const fetches = [
2866
- this.backend.getJson('/system/type/list?elements=true&basetypes=true'),
2867
- this.backend.getJson('/system/cs/list?elements=true')
2868
- ];
2869
- return forkJoin(fetches)
2870
- .pipe(catchError(Utils.catch((error) => {
2871
- this.logger.error('Error fetching recent version of system definition from server.', error);
2872
- this.systemSource.error('Error fetching recent version of system definition from server.');
2873
- })), map((data) => {
2874
- this.objectTypeForms = [];
2875
- const system = {
2876
- /**
2877
- * info about the current system definition
2878
- */
2879
- info: {
2880
- user: user.id,
2881
- locale: user.getSchemaLocale(),
2882
- version: user.schema.version
2883
- },
2884
- /**
2885
- * supported backend locales
2886
- */
2887
- locales: user.schema.supportedLocales,
2888
- /**
2889
- * object type definitions
2890
- */
2891
- types: [],
2892
- /**
2893
- * codesystems cache
2894
- */
2895
- codesystems: []
2896
- };
2897
- const types = data[0];
2898
- system.types = types.map(t => new ObjectType(t));
2899
- system.codesystems = data[1];
2900
- this.system = system;
2901
- this.systemSource.next(system);
2902
- this.logger.debug('Fetched new version of system definition (user: ' + user.id + ', version: ' + user.schema.version + ').');
2903
- this.appCache
2904
- .setItem(this.appCache.SYSTEM_DEFINITION, system)
2905
- .subscribe(() => {
2906
- this.logger.debug('Cached recent version');
2907
- }, Utils.logError(null, 'Error caching recent version of system definition.'));
2908
- return true;
2909
- }));
2785
+ get title() {
2786
+ return this.selectedtype ? this.selectedtype.label : '';
2787
+ }
2788
+ /**
2789
+ * Creates a new instance
2790
+ * @param json The JSON object received from the backend. This will be used to construct the new prepared item instance
2791
+ */
2792
+ constructor(json) {
2793
+ Object.assign(this, json);
2794
+ }
2795
+ /**
2796
+ * Returns true if the preparedItem contains content (template or actual file), false otherwise
2797
+ */
2798
+ hasContent() {
2799
+ return !!this.template || this.contentcount > 0;
2910
2800
  }
2911
2801
  /**
2912
- * Retrieve an organization object by its ID
2913
- * @param id ID of org object
2802
+ * Retrieves the prepared items selected type object from the list
2803
+ * of available types.
2804
+ * @returns The type object that is selected or NULL
2914
2805
  */
2915
- getOrganizationObjectById(id) {
2916
- return this.backend.getJson(`/organization/id/${id}`);
2806
+ getSelectedTypeObject() {
2807
+ return this.types.find(t => t.selected);
2917
2808
  }
2809
+ }
2810
+
2811
+ class UploadTarget {
2918
2812
  /**
2919
- * Fetches the organization object for a given name.
2813
+ * Creates a new instance of UploadTarget
2920
2814
  *
2921
- * @param name The name to fetch object for
2922
- * @returns
2815
+ * @param id Upload targets unique id
2816
+ * @param type Upload targets type
2923
2817
  */
2924
- getOrganizationObject(name) {
2925
- return this.getOrganizationObjects([name]).pipe(map(res => res[0]));
2818
+ constructor(id, type) {
2819
+ this.id = id;
2820
+ this.type = type;
2926
2821
  }
2927
2822
  /**
2928
- * Fetches a collection of organization objects
2823
+ * Return Method if the Upload is Successfull
2929
2824
  *
2930
- * @param names Array of names to fetch objects for
2931
- * @returns A Array of Organization Objects
2825
+ * @param target
2826
+ * @returns the provided UploadTarget if the Upload was Successfull.
2932
2827
  */
2933
- getOrganizationObjects(names) {
2934
- const toFetch = names.map(name => this.backend.getJson(`/organization/name/${name}`).pipe(catchError(error => of({ id: name, active: false }))));
2935
- return forkJoin(toFetch);
2828
+ onUploadSuccess(target) {
2829
+ return target;
2936
2830
  }
2937
2831
  /**
2938
- * Fetches a collection of organization roles
2832
+ * Return method if the Upload fails
2939
2833
  *
2940
- * @return A Array of Organization Roles
2834
+ * @returns an empty Object if the Upload fails
2941
2835
  */
2942
- getRoles() {
2943
- if (this.cachedRoles.length) {
2944
- return of(this.cachedRoles);
2945
- }
2946
- else {
2947
- return this.backend
2948
- .get('/organization/role')
2949
- .pipe(map(o => o), tap(roles => (this.cachedRoles = roles)));
2950
- }
2836
+ onUploadFail() {
2837
+ return {};
2951
2838
  }
2952
2839
  }
2953
- SystemService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: SystemService, deps: [{ token: BackendService }, { token: Logger }, { token: EventService }, { token: AppCacheService }], target: i0.ɵɵFactoryTarget.Injectable });
2954
- SystemService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: SystemService, providedIn: 'root' });
2955
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: SystemService, decorators: [{
2956
- type: Injectable,
2957
- args: [{
2958
- providedIn: 'root'
2959
- }]
2960
- }], ctorParameters: function () { return [{ type: BackendService }, { type: Logger }, { type: EventService }, { type: AppCacheService }]; } });
2840
+ /**
2841
+ * general filing target
2842
+ */
2843
+ UploadTarget.ROOT = 'root';
2844
+ /**
2845
+ * add file(s) to context folder
2846
+ */
2847
+ UploadTarget.CONTEXT = 'context';
2848
+ /**
2849
+ * add file(s) to context folders dynamic structure
2850
+ */
2851
+ UploadTarget.CONTEXT_TREE = 'contexttree';
2852
+ /**
2853
+ * set/replace content file of a dms object
2854
+ */
2855
+ UploadTarget.OBJECT = 'object';
2856
+ /**
2857
+ * custom targets (e.g. for plugin development)
2858
+ */
2859
+ UploadTarget.CUSTOM = 'custom';
2860
+
2861
+ var Direction;
2862
+ (function (Direction) {
2863
+ Direction["LTR"] = "ltr";
2864
+ Direction["RTL"] = "rtl";
2865
+ })(Direction || (Direction = {}));
2961
2866
 
2962
2867
  /**
2963
2868
  * Applications user service.
@@ -3287,15 +3192,25 @@ class UserService {
3287
3192
  this.refreshCurrentUser().subscribe();
3288
3193
  }));
3289
3194
  }
3195
+ /**
3196
+ * Save or change the workspace of the current user
3197
+ * @param workspaceConfig The value to set the saved workspace or create a new workspace
3198
+ */
3199
+ saveChangeWorkspace(workspaceConfig) {
3200
+ this.user.userSettings.workspaceOptions = workspaceConfig;
3201
+ return this.backend.put('/user/config/web', this.user.userSettings).pipe(map(() => {
3202
+ this.refreshCurrentUser().subscribe();
3203
+ }));
3204
+ }
3290
3205
  }
3291
- UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: UserService, deps: [{ token: BackendService }, { token: i2.TranslateService }, { token: Logger }, { token: EventService }, { token: SystemService }, { token: i1$1.HttpClient }, { token: Config }], target: i0.ɵɵFactoryTarget.Injectable });
3206
+ UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: UserService, deps: [{ token: BackendService }, { token: i1.TranslateService }, { token: Logger }, { token: EventService }, { token: SystemService }, { token: i1$1.HttpClient }, { token: Config }], target: i0.ɵɵFactoryTarget.Injectable });
3292
3207
  UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: UserService, providedIn: 'root' });
3293
3208
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: UserService, decorators: [{
3294
3209
  type: Injectable,
3295
3210
  args: [{
3296
3211
  providedIn: 'root'
3297
3212
  }]
3298
- }], ctorParameters: function () { return [{ type: BackendService }, { type: i2.TranslateService }, { type: Logger }, { type: EventService }, { type: SystemService }, { type: i1$1.HttpClient }, { type: Config }]; } });
3213
+ }], ctorParameters: function () { return [{ type: BackendService }, { type: i1.TranslateService }, { type: Logger }, { type: EventService }, { type: SystemService }, { type: i1$1.HttpClient }, { type: Config }]; } });
3299
3214
 
3300
3215
  /**
3301
3216
  * The Upload Service is provides access to Upload data (files)
@@ -3348,6 +3263,14 @@ class PrepareService {
3348
3263
  this.preparedItems$ = this.preparedItemsSource.asObservable();
3349
3264
  this.preparedItemCountSource = new ReplaySubject(1);
3350
3265
  this.preparedItemCount$ = this.preparedItemCountSource.asObservable();
3266
+ /**
3267
+ * Creates a prepared item on the backed side.
3268
+ *
3269
+ * @param parentId The ID of the parent dms object to add the prepared item to
3270
+ * @param childType The type of object to be created
3271
+ * @returns Observable<any>
3272
+ */
3273
+ this.i = 0;
3351
3274
  }
3352
3275
  /**
3353
3276
  * Public Fetch Prepare items
@@ -3366,14 +3289,9 @@ class PrepareService {
3366
3289
  this.preparedItemCountSource.next(this.preparedItemCount);
3367
3290
  });
3368
3291
  }
3369
- /**
3370
- * Creates a prepared item on the backed side.
3371
- *
3372
- * @param parentId The ID of the parent dms object to add the prepared item to
3373
- * @param childType The type of object to be created
3374
- * @returns Observable<any>
3375
- */
3376
3292
  createPreparedItem(parentId, childType) {
3293
+ console.log('tick');
3294
+ this.i++;
3377
3295
  return this.backend
3378
3296
  .post(this.createPreparedItemPostUrl({
3379
3297
  parentId: parentId,
@@ -3540,7 +3458,7 @@ class PrepareService {
3540
3458
  * @returns Observable<any>
3541
3459
  */
3542
3460
  uploadContent(preparedItemId, file) {
3543
- const uri = `${this.backend.getServiceBase()}/prepare/${preparedItemId}/content.json?form=true&contentmeta=true`;
3461
+ const uri = `${this.backend.getBaseWithContext(this.backend.getServiceBase())}/prepare/${preparedItemId}/content.json?form=true&contentmeta=true`;
3544
3462
  return this.uploadService
3545
3463
  .upload(uri, [file])
3546
3464
  .pipe(
@@ -3576,7 +3494,7 @@ class PrepareService {
3576
3494
  *
3577
3495
  * @type string
3578
3496
  */
3579
- uri = this.backend.getServiceBase() + this.createPreparedItemPostUrl({
3497
+ uri = this.backend.getBaseWithContext(this.backend.getServiceBase()) + this.createPreparedItemPostUrl({
3580
3498
  parentId: null,
3581
3499
  createMany: !useBatchUpload
3582
3500
  });
@@ -3586,7 +3504,7 @@ class PrepareService {
3586
3504
  * upload to dms object, means adding or replacing content file
3587
3505
  */
3588
3506
  const { referenceObject } = uploadTarget;
3589
- uri = `${this.backend.getServiceBase()}/dms/${referenceObject.id}/contents?type=${referenceObject.type.name}`;
3507
+ uri = `${this.backend.getBaseWithContext(this.backend.getServiceBase())}/dms/${referenceObject.id}/contents?type=${referenceObject.type.name}`;
3590
3508
  }
3591
3509
  else if (uploadTarget.type === UploadTarget.CONTEXT || uploadTarget.type === UploadTarget.CONTEXT_TREE) {
3592
3510
  /**
@@ -3596,7 +3514,7 @@ class PrepareService {
3596
3514
  *
3597
3515
  * @type string
3598
3516
  */
3599
- uri = this.backend.getServiceBase() + this.createPreparedItemPostUrl({
3517
+ uri = this.backend.getBaseWithContext(this.backend.getServiceBase()) + this.createPreparedItemPostUrl({
3600
3518
  parentId: uploadTarget.referenceObject.id,
3601
3519
  createMany: !useBatchUpload,
3602
3520
  childType: uploadTarget.subFolder && uploadTarget.subFolder.data.type ? uploadTarget.subFolder.data.type : null
@@ -3838,17 +3756,14 @@ class AuthService {
3838
3756
  /**
3839
3757
  * @ignore
3840
3758
  */
3841
- constructor(config, coreConfig, appCache, envService, http, bpmService, ngZone, location, capabilitiesService, logger, inboxService, prepareService, backend, systemService, userService, eventService, systemStatusService, storage, local) {
3759
+ constructor(config, coreConfig, envService, http, bpmService, ngZone, capabilitiesService, inboxService, prepareService, backend, systemService, userService, eventService, systemStatusService, storage, local) {
3842
3760
  this.config = config;
3843
3761
  this.coreConfig = coreConfig;
3844
- this.appCache = appCache;
3845
3762
  this.envService = envService;
3846
3763
  this.http = http;
3847
3764
  this.bpmService = bpmService;
3848
3765
  this.ngZone = ngZone;
3849
- this.location = location;
3850
3766
  this.capabilitiesService = capabilitiesService;
3851
- this.logger = logger;
3852
3767
  this.inboxService = inboxService;
3853
3768
  this.prepareService = prepareService;
3854
3769
  this.backend = backend;
@@ -4157,7 +4072,7 @@ class AuthService {
4157
4072
  return forkJoin(todo).pipe(map(() => currUser));
4158
4073
  }
4159
4074
  }
4160
- AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: AuthService, deps: [{ token: Config }, { token: CORE_CONFIG }, { token: AppCacheService }, { token: EnvironmentService }, { token: i1$1.HttpClient }, { token: BpmService }, { token: i0.NgZone }, { token: i6.PlatformLocation }, { token: CapabilitiesService }, { token: Logger }, { token: InboxService }, { token: PrepareService }, { token: BackendService }, { token: SystemService }, { token: UserService }, { token: EventService }, { token: SystemStatusService }, { token: i1.LocalStorage }, { token: LocalStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
4075
+ AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: AuthService, deps: [{ token: Config }, { token: CORE_CONFIG }, { token: EnvironmentService }, { token: i1$1.HttpClient }, { token: BpmService }, { token: i0.NgZone }, { token: CapabilitiesService }, { token: InboxService }, { token: PrepareService }, { token: BackendService }, { token: SystemService }, { token: UserService }, { token: EventService }, { token: SystemStatusService }, { token: i1$2.LocalStorage }, { token: LocalStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
4161
4076
  AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: AuthService, providedIn: 'root' });
4162
4077
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: AuthService, decorators: [{
4163
4078
  type: Injectable,
@@ -4168,7 +4083,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
4168
4083
  return [{ type: Config }, { type: CoreConfig, decorators: [{
4169
4084
  type: Inject,
4170
4085
  args: [CORE_CONFIG]
4171
- }] }, { type: AppCacheService }, { type: EnvironmentService }, { type: i1$1.HttpClient }, { type: BpmService }, { type: i0.NgZone }, { type: i6.PlatformLocation }, { type: CapabilitiesService }, { type: Logger }, { type: InboxService }, { type: PrepareService }, { type: BackendService }, { type: SystemService }, { type: UserService }, { type: EventService }, { type: SystemStatusService }, { type: i1.LocalStorage }, { type: LocalStorageService }];
4086
+ }] }, { type: EnvironmentService }, { type: i1$1.HttpClient }, { type: BpmService }, { type: i0.NgZone }, { type: CapabilitiesService }, { type: InboxService }, { type: PrepareService }, { type: BackendService }, { type: SystemService }, { type: UserService }, { type: EventService }, { type: SystemStatusService }, { type: i1$2.LocalStorage }, { type: LocalStorageService }];
4172
4087
  } });
4173
4088
 
4174
4089
  /**
@@ -4236,42 +4151,89 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
4236
4151
 
4237
4152
  /**
4238
4153
  * @ignore
4239
- * logger logging values to the ambient console object.
4154
+ * APP_INITIALIZER function
4240
4155
  */
4241
- class ConsoleLogService {
4242
- apply(fn, args) {
4243
- return console && console[fn] && console[fn](...args);
4244
- }
4245
- assert(...args) {
4246
- this.apply('assert', args);
4247
- }
4248
- debug(...args) {
4249
- this.apply('debug', args);
4250
- }
4251
- error(...args) {
4252
- this.apply('error', args);
4253
- }
4254
- group(...args) {
4255
- this.apply('group', args);
4256
- }
4257
- groupEnd(...args) {
4258
- this.apply('groupEnd', args);
4156
+ function init_module(coreInit) {
4157
+ // Need to set to a const before returning due to:
4158
+ // @see: https://github.com/angular/angular/issues/14485
4159
+ const fnc = () => coreInit.initialize();
4160
+ return fnc;
4161
+ }
4162
+
4163
+ /**
4164
+ * @ignore
4165
+ * Handles missing translations
4166
+ */
4167
+ class EoxMissingTranslationHandler {
4168
+ /**
4169
+ *
4170
+ * @param MissingTranslationHandlerParams params
4171
+ * @returns string
4172
+ */
4173
+ handle(params) {
4174
+ return '!missing key: ' + params.key;
4259
4175
  }
4260
- info(...args) {
4261
- this.apply('info', args);
4176
+ }
4177
+
4178
+ /**
4179
+ * @ignore
4180
+ * Loader that fetches translations based on the configured locations
4181
+ */
4182
+ let EoxTranslateJsonLoader = class EoxTranslateJsonLoader {
4183
+ constructor(http, config) {
4184
+ this.http = http;
4185
+ this.config = config;
4186
+ registerLocaleData(localeDe, 'de', localeExtraDe); // German
4187
+ registerLocaleData(localeAr, 'ar', localeExtraAr); // Arabic
4188
+ registerLocaleData(localeEs, 'es', localeExtraEs); // Spanish
4189
+ registerLocaleData(localePt, 'pt', localeExtraPt); // Portuguese
4190
+ registerLocaleData(localeFr, 'fr', localeExtraFr); // French
4191
+ registerLocaleData(localeZh, 'zh', localeExtraZh); // Chinese
4192
+ registerLocaleData(localeLv, 'lv', localeExtraLv); // Latvian
4193
+ registerLocaleData(localeRu, 'ru', localeExtraRu); // Russian
4194
+ registerLocaleData(localeIt, 'it', localeExtraIt); // Italian
4195
+ registerLocaleData(localeNl, 'nl', localeExtraNl); // Dutch
4196
+ registerLocaleData(localeSk, 'sk', localeExtraSk); // Slovak
4197
+ registerLocaleData(localePl, 'pl', localeExtraPl); // Polish
4198
+ registerLocaleData(localeUk, 'uk', localeExtraUk); // Ukrainian
4199
+ registerLocaleData(localeJa, 'ja', localeExtraJa); // Japanese
4200
+ registerLocaleData(localeKo, 'ko', localeExtraKo); // Korean
4201
+ registerLocaleData(localeHi, 'hi', localeExtraHi); // Hindi
4202
+ registerLocaleData(localeBn, 'bn', localeExtraBn); // Bengalese
4203
+ registerLocaleData(localeDeCh, 'de-CH', localeExtraDeCh); // German (switzerland)
4204
+ registerLocaleData(localeZhHant, 'zh-Hant', localeExtraZhHant); // Chinese (traditional)
4205
+ registerLocaleData(localeTh, 'th', localeExtraTh); // Thai
4206
+ registerLocaleData(localeVi, 'vi', localeExtraVi); // Vietnamese
4207
+ registerLocaleData(localeEnGb, 'en-GB', localeExtraEnGb); // English (Great-Britain)
4208
+ registerLocaleData(localeHe, 'he', localeExtraHe); // Hebrew
4209
+ registerLocaleData(localeFi, 'fi', localeExtraFi); // Finish
4210
+ registerLocaleData(localeDa, 'da', localeExtraDa); // Danish
4211
+ registerLocaleData(localeSe, 'se', localeExtraSe); // Swedish
4212
+ registerLocaleData(localeNb, 'nb', localeExtraNb); // Norwegian Bokmål
4213
+ registerLocaleData(localeNn, 'nn', localeExtraNn); // Norwegian Nynorsk
4214
+ registerLocaleData(localeId, 'id', localeExtraId); // Indonesian
4215
+ registerLocaleData(localeMs, 'ms', localeExtraMs); // Malay
4262
4216
  }
4263
- log(...args) {
4264
- this.apply('log', args);
4217
+ /**
4218
+ *
4219
+ * @param string lang
4220
+ * @returns Observable<Object>
4221
+ */
4222
+ getTranslation(lang) {
4223
+ return forkJoin(this.config.translations.map(folder => this.loadTranslationFile(folder, lang))).pipe(map((res) => res.reduce((acc, x) => Object.assign(acc, x), {})));
4265
4224
  }
4266
- warn(...args) {
4267
- this.apply('warn', args);
4225
+ loadTranslationFile(folder, lang) {
4226
+ return this.http.get(`${folder}${lang}.json`).pipe(catchError((e) => {
4227
+ // ISO codes with more than 2 characters are sub-languages like de-CH.
4228
+ // If there is no translation file for that sub-language we'll try to load
4229
+ // the file for the base language (in this case de).
4230
+ return lang.length > 2 ? this.loadTranslationFile(folder, lang.substring(0, 2)) : of({});
4231
+ }));
4268
4232
  }
4269
- }
4270
- ConsoleLogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ConsoleLogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4271
- ConsoleLogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ConsoleLogService });
4272
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ConsoleLogService, decorators: [{
4273
- type: Injectable
4274
- }] });
4233
+ };
4234
+ EoxTranslateJsonLoader = __decorate([
4235
+ __param(1, Inject(CORE_CONFIG))
4236
+ ], EoxTranslateJsonLoader);
4275
4237
 
4276
4238
  /**
4277
4239
  * `EoSharedModule` re-exports ToastrModule, TranslateModule so you can use directives
@@ -4317,6 +4279,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
4317
4279
  type: Injectable
4318
4280
  }], ctorParameters: function () { return [{ type: AuthService }]; } });
4319
4281
 
4282
+ /**
4283
+ * @ignore
4284
+ * logger logging values to the ambient console object.
4285
+ */
4286
+ class ConsoleLogService {
4287
+ apply(fn, args) {
4288
+ return console && console[fn] && console[fn](...args);
4289
+ }
4290
+ assert(...args) {
4291
+ this.apply('assert', args);
4292
+ }
4293
+ debug(...args) {
4294
+ this.apply('debug', args);
4295
+ }
4296
+ error(...args) {
4297
+ this.apply('error', args);
4298
+ }
4299
+ group(...args) {
4300
+ this.apply('group', args);
4301
+ }
4302
+ groupEnd(...args) {
4303
+ this.apply('groupEnd', args);
4304
+ }
4305
+ info(...args) {
4306
+ this.apply('info', args);
4307
+ }
4308
+ log(...args) {
4309
+ this.apply('log', args);
4310
+ }
4311
+ warn(...args) {
4312
+ this.apply('warn', args);
4313
+ }
4314
+ }
4315
+ ConsoleLogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ConsoleLogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4316
+ ConsoleLogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ConsoleLogService });
4317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ConsoleLogService, decorators: [{
4318
+ type: Injectable
4319
+ }] });
4320
+
4320
4321
  /**
4321
4322
  * Main module for connecting an app to an yuuvis<sup>&reg;</sup> RAD backend. To use it just import int in your app module:
4322
4323
  *
@@ -4374,7 +4375,7 @@ class EoCoreModule {
4374
4375
  }
4375
4376
  }
4376
4377
  EoCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: EoCoreModule, deps: [{ token: EoCoreModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
4377
- EoCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.2", ngImport: i0, type: EoCoreModule, imports: [HttpClientModule, i2.TranslateModule, i1$2.ToastrModule], exports: [EoSharedModule] });
4378
+ EoCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.2", ngImport: i0, type: EoCoreModule, imports: [HttpClientModule, i1.TranslateModule, i1$3.ToastrModule], exports: [EoSharedModule] });
4378
4379
  EoCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: EoCoreModule, providers: [
4379
4380
  {
4380
4381
  /**
@@ -5045,22 +5046,20 @@ class DmsService {
5045
5046
  }));
5046
5047
  }
5047
5048
  /**
5048
- * Setter for Organization Objects With Read Rights
5049
- *
5050
- * @param DmsObject[] dmsObjects
5051
- * @param string[] orgaNames
5052
- * @param string[] orgaNameWithChildren
5053
- * @param id
5054
- * @returns Observable<any>
5049
+ * Shares a dms object (and its children) with certain users
5050
+ * @param dmsObject The dms object to be shared
5051
+ * @param shareWith Array of organization objects to share the object with. Each entry
5052
+ * will have the ID of the target organization object as well as an optional param
5053
+ * whether or not to also share the dms objects children.
5054
+ * @returns Observable being resolved once the request is done
5055
5055
  */
5056
- setOrganizationObjectsWithReadRights(dmsObjects, id, orgaNames, orgaNameWithChildren) {
5057
- const url = `/dms/${id}/share`;
5058
- const shares = [
5059
- ...orgaNameWithChildren.map(field => ({ organizationobject: field, sharechildren: true })),
5060
- ...orgaNames.map(name => ({ organizationobject: name, sharechildren: false }))
5061
- ];
5062
- const data = { shares };
5063
- return this.triggerUpdate(dmsObjects[0], this.backend.put(url, data));
5056
+ share(dmsObject, shareWith) {
5057
+ return this.triggerUpdate(dmsObject, this.backend.put(`/dms/${dmsObject.id}/share`, {
5058
+ shares: shareWith.map(i => ({
5059
+ organizationobject: i.id,
5060
+ sharechildren: !!i.shareChildren
5061
+ }))
5062
+ }));
5064
5063
  }
5065
5064
  /**
5066
5065
  * Move a DMS Object
@@ -5298,14 +5297,14 @@ class NotificationsService {
5298
5297
  }
5299
5298
  }
5300
5299
  }
5301
- NotificationsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: NotificationsService, deps: [{ token: i1$2.ToastrService }], target: i0.ɵɵFactoryTarget.Injectable });
5300
+ NotificationsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: NotificationsService, deps: [{ token: i1$3.ToastrService }], target: i0.ɵɵFactoryTarget.Injectable });
5302
5301
  NotificationsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: NotificationsService, providedIn: 'root' });
5303
5302
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: NotificationsService, decorators: [{
5304
5303
  type: Injectable,
5305
5304
  args: [{
5306
5305
  providedIn: 'root'
5307
5306
  }]
5308
- }], ctorParameters: function () { return [{ type: i1$2.ToastrService }]; } });
5307
+ }], ctorParameters: function () { return [{ type: i1$3.ToastrService }]; } });
5309
5308
 
5310
5309
  /**
5311
5310
  * Collection of Search Services
@@ -6123,10 +6122,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
6123
6122
  * Collection of Signing Services
6124
6123
  */
6125
6124
  class SigningService {
6126
- constructor(backend, translate) {
6125
+ constructor(backend, capabilities, translate) {
6127
6126
  this.backend = backend;
6127
+ this.capabilities = capabilities;
6128
6128
  this.translate = translate;
6129
6129
  }
6130
+ canSign() {
6131
+ return this.capabilities.getCapabilities().signing;
6132
+ }
6130
6133
  /**
6131
6134
  * Sign the document of a DMS Object
6132
6135
  * @param id the id of the dms object
@@ -6135,7 +6138,7 @@ class SigningService {
6135
6138
  */
6136
6139
  signDocument(id, signingData) {
6137
6140
  const uri = `/request/${id}`;
6138
- return this.backend.post(uri, signingData, '/signing');
6141
+ return this.canSign ? this.backend.post(uri, signingData, '/signing') : of(null);
6139
6142
  }
6140
6143
  /**
6141
6144
  * Cancels the signing process of a DMS Object
@@ -6222,14 +6225,14 @@ class SigningService {
6222
6225
  return item.data.yuvsigstatus === 'inprocess';
6223
6226
  }
6224
6227
  }
6225
- SigningService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: SigningService, deps: [{ token: BackendService }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
6228
+ SigningService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: SigningService, deps: [{ token: BackendService }, { token: CapabilitiesService }, { token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
6226
6229
  SigningService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: SigningService, providedIn: 'root' });
6227
6230
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: SigningService, decorators: [{
6228
6231
  type: Injectable,
6229
6232
  args: [{
6230
6233
  providedIn: 'root'
6231
6234
  }]
6232
- }], ctorParameters: function () { return [{ type: BackendService }, { type: i2.TranslateService }]; } });
6235
+ }], ctorParameters: function () { return [{ type: BackendService }, { type: CapabilitiesService }, { type: i1.TranslateService }]; } });
6233
6236
 
6234
6237
  class UploadFileItem {
6235
6238
  /**