@valtimo/dossier 10.8.0 → 11.1.0

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 (223) hide show
  1. package/esm2022/lib/components/dossier-assign-user/dossier-assign-user.component.mjs +98 -0
  2. package/esm2022/lib/components/dossier-bulk-assign-modal/dossier-bulk-assign-modal.component.mjs +75 -0
  3. package/esm2022/lib/components/dossier-detail/dossier-detail.component.mjs +191 -0
  4. package/esm2022/lib/components/dossier-detail/tab/audit/audit.component.mjs +76 -0
  5. package/esm2022/lib/components/dossier-detail/tab/contact-moments/contact-moments.component.mjs +86 -0
  6. package/esm2022/lib/components/dossier-detail/tab/documenten-api-documents/documenten-api-documents.component.mjs +146 -0
  7. package/esm2022/lib/components/dossier-detail/tab/documents/documents.component.mjs +41 -0
  8. package/esm2022/lib/components/dossier-detail/tab/formio/formio.component.mjs +61 -0
  9. package/esm2022/lib/components/dossier-detail/tab/notes/notes.component.mjs +166 -0
  10. package/esm2022/lib/components/dossier-detail/tab/object-type/object-type.component.mjs +121 -0
  11. package/esm2022/lib/components/dossier-detail/tab/progress/progress.component.mjs +52 -0
  12. package/esm2022/lib/components/dossier-detail/tab/s3-documents/s3-documents.component.mjs +136 -0
  13. package/esm2022/lib/components/dossier-detail/tab/summary/summary.component.mjs +134 -0
  14. package/esm2022/lib/components/dossier-detail/tab/zaakobjecten/zaakobjecten.component.mjs +112 -0
  15. package/esm2022/lib/components/dossier-list/dossier-list.component.mjs +370 -0
  16. package/esm2022/lib/components/dossier-list-actions/dossier-list-actions.component.mjs +84 -0
  17. package/esm2022/lib/components/dossier-process-start-modal/dossier-process-start-modal.component.mjs +132 -0
  18. package/esm2022/lib/components/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.mjs +116 -0
  19. package/esm2022/lib/components/dossier-update/dossier-update.component.mjs +113 -0
  20. package/{esm2020 → esm2022}/lib/components/note-modal/note-modal.component.mjs +5 -5
  21. package/esm2022/lib/constants/case-tab-token.mjs +19 -0
  22. package/esm2022/lib/constants/index.mjs +3 -0
  23. package/esm2022/lib/constants/tab.mjs +42 -0
  24. package/esm2022/lib/dossier-routing.module.mjs +76 -0
  25. package/esm2022/lib/dossier.module.mjs +288 -0
  26. package/esm2022/lib/models/candidate-user.model.mjs +17 -0
  27. package/esm2022/lib/models/dossier-detail-tab.model.mjs +27 -0
  28. package/{esm2020 → esm2022}/lib/models/dossier-parameters.model.mjs +1 -1
  29. package/esm2022/lib/models/index.mjs +23 -0
  30. package/esm2022/lib/models/tab-api.model.mjs +23 -0
  31. package/esm2022/lib/models/tabs.model.mjs +116 -0
  32. package/esm2022/lib/permissions/dossier-detail.permissions.mjs +55 -0
  33. package/esm2022/lib/permissions/index.mjs +17 -0
  34. package/esm2022/lib/pipes/index.mjs +17 -0
  35. package/esm2022/lib/pipes/tab-translate/index.mjs +18 -0
  36. package/esm2022/lib/pipes/tab-translate/tab-translate-pipe.module.mjs +33 -0
  37. package/esm2022/lib/pipes/tab-translate/tab-translate.pipe.mjs +41 -0
  38. package/esm2022/lib/services/dossier-bulk-assign.service.mjs +35 -0
  39. package/esm2022/lib/services/dossier-column.service.mjs +98 -0
  40. package/esm2022/lib/services/dossier-list-assignee.service.mjs +89 -0
  41. package/esm2022/lib/services/dossier-list-pagination.service.mjs +119 -0
  42. package/esm2022/lib/services/dossier-list-search.service.mjs +59 -0
  43. package/esm2022/lib/services/dossier-list.service.mjs +74 -0
  44. package/esm2022/lib/services/dossier-parameter.service.mjs +165 -0
  45. package/esm2022/lib/services/dossier-tab-api.service.mjs +23 -0
  46. package/esm2022/lib/services/dossier-tab.service.mjs +130 -0
  47. package/esm2022/lib/services/dossier.service.mjs +58 -0
  48. package/{esm2020 → esm2022}/lib/services/file-sort.service.mjs +4 -4
  49. package/esm2022/lib/services/index.mjs +27 -0
  50. package/esm2022/lib/services/notes.service.mjs +76 -0
  51. package/{esm2020 → esm2022}/lib/services/zaakobjecten.service.mjs +4 -4
  52. package/esm2022/public_api.mjs +34 -0
  53. package/fesm2022/valtimo-dossier.mjs +3979 -0
  54. package/fesm2022/valtimo-dossier.mjs.map +1 -0
  55. package/lib/components/dossier-assign-user/dossier-assign-user.component.d.ts +28 -0
  56. package/lib/components/dossier-assign-user/dossier-assign-user.component.d.ts.map +1 -0
  57. package/lib/components/dossier-bulk-assign-modal/dossier-bulk-assign-modal.component.d.ts +22 -0
  58. package/lib/components/dossier-bulk-assign-modal/dossier-bulk-assign-modal.component.d.ts.map +1 -0
  59. package/lib/{dossier-detail → components/dossier-detail}/dossier-detail.component.d.ts +36 -33
  60. package/lib/components/dossier-detail/dossier-detail.component.d.ts.map +1 -0
  61. package/lib/{dossier-detail → components/dossier-detail}/tab/audit/audit.component.d.ts +1 -1
  62. package/lib/components/dossier-detail/tab/audit/audit.component.d.ts.map +1 -0
  63. package/lib/{dossier-detail → components/dossier-detail}/tab/contact-moments/contact-moments.component.d.ts +1 -1
  64. package/lib/components/dossier-detail/tab/contact-moments/contact-moments.component.d.ts.map +1 -0
  65. package/lib/{dossier-detail → components/dossier-detail}/tab/documenten-api-documents/documenten-api-documents.component.d.ts +3 -4
  66. package/lib/components/dossier-detail/tab/documenten-api-documents/documenten-api-documents.component.d.ts.map +1 -0
  67. package/lib/{dossier-detail → components/dossier-detail}/tab/documents/documents.component.d.ts +1 -1
  68. package/lib/components/dossier-detail/tab/documents/documents.component.d.ts.map +1 -0
  69. package/lib/components/dossier-detail/tab/formio/formio.component.d.ts +20 -0
  70. package/lib/components/dossier-detail/tab/formio/formio.component.d.ts.map +1 -0
  71. package/lib/{dossier-detail → components/dossier-detail}/tab/notes/notes.component.d.ts +19 -12
  72. package/lib/components/dossier-detail/tab/notes/notes.component.d.ts.map +1 -0
  73. package/lib/{dossier-detail → components/dossier-detail}/tab/object-type/object-type.component.d.ts +5 -5
  74. package/lib/components/dossier-detail/tab/object-type/object-type.component.d.ts.map +1 -0
  75. package/lib/{dossier-detail → components/dossier-detail}/tab/progress/progress.component.d.ts +1 -1
  76. package/lib/components/dossier-detail/tab/progress/progress.component.d.ts.map +1 -0
  77. package/lib/{dossier-detail → components/dossier-detail}/tab/s3-documents/s3-documents.component.d.ts +3 -3
  78. package/lib/components/dossier-detail/tab/s3-documents/s3-documents.component.d.ts.map +1 -0
  79. package/lib/{dossier-detail → components/dossier-detail}/tab/summary/summary.component.d.ts +8 -4
  80. package/lib/components/dossier-detail/tab/summary/summary.component.d.ts.map +1 -0
  81. package/lib/{dossier-detail → components/dossier-detail}/tab/zaakobjecten/zaakobjecten.component.d.ts +5 -5
  82. package/lib/components/dossier-detail/tab/zaakobjecten/zaakobjecten.component.d.ts.map +1 -0
  83. package/lib/components/dossier-list/dossier-list.component.d.ts +94 -0
  84. package/lib/components/dossier-list/dossier-list.component.d.ts.map +1 -0
  85. package/lib/{dossier-list-actions → components/dossier-list-actions}/dossier-list-actions.component.d.ts +6 -7
  86. package/lib/components/dossier-list-actions/dossier-list-actions.component.d.ts.map +1 -0
  87. package/lib/{dossier-process-start-modal → components/dossier-process-start-modal}/dossier-process-start-modal.component.d.ts +4 -7
  88. package/lib/components/dossier-process-start-modal/dossier-process-start-modal.component.d.ts.map +1 -0
  89. package/lib/{dossier-supporting-process-start-modal → components/dossier-supporting-process-start-modal}/dossier-supporting-process-start-modal.component.d.ts +4 -7
  90. package/lib/components/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.d.ts.map +1 -0
  91. package/lib/{dossier-update → components/dossier-update}/dossier-update.component.d.ts +2 -2
  92. package/lib/components/dossier-update/dossier-update.component.d.ts.map +1 -0
  93. package/lib/components/note-modal/note-modal.component.d.ts +3 -3
  94. package/lib/components/note-modal/note-modal.component.d.ts.map +1 -1
  95. package/lib/constants/case-tab-token.d.ts +5 -0
  96. package/lib/constants/case-tab-token.d.ts.map +1 -0
  97. package/lib/constants/index.d.ts +3 -0
  98. package/lib/constants/index.d.ts.map +1 -0
  99. package/lib/constants/tab.d.ts +7 -0
  100. package/lib/constants/tab.d.ts.map +1 -0
  101. package/lib/dossier-routing.module.d.ts.map +1 -1
  102. package/lib/dossier.module.d.ts +35 -33
  103. package/lib/dossier.module.d.ts.map +1 -1
  104. package/lib/models/candidate-user.model.d.ts +7 -0
  105. package/lib/models/candidate-user.model.d.ts.map +1 -0
  106. package/lib/models/dossier-detail-tab.model.d.ts +18 -0
  107. package/lib/models/dossier-detail-tab.model.d.ts.map +1 -0
  108. package/lib/models/dossier-parameters.model.d.ts +0 -1
  109. package/lib/models/dossier-parameters.model.d.ts.map +1 -1
  110. package/lib/models/index.d.ts +5 -2
  111. package/lib/models/index.d.ts.map +1 -1
  112. package/lib/models/search.model.d.ts +3 -3
  113. package/lib/models/search.model.d.ts.map +1 -1
  114. package/lib/models/tab-api.model.d.ts +13 -0
  115. package/lib/models/tab-api.model.d.ts.map +1 -0
  116. package/lib/models/tabs.model.d.ts +11 -10
  117. package/lib/models/tabs.model.d.ts.map +1 -1
  118. package/lib/permissions/dossier-detail.permissions.d.ts +14 -0
  119. package/lib/permissions/dossier-detail.permissions.d.ts.map +1 -0
  120. package/lib/permissions/index.d.ts +2 -0
  121. package/lib/permissions/index.d.ts.map +1 -0
  122. package/lib/pipes/index.d.ts +2 -0
  123. package/lib/pipes/index.d.ts.map +1 -0
  124. package/lib/pipes/tab-translate/index.d.ts +3 -0
  125. package/lib/pipes/tab-translate/index.d.ts.map +1 -0
  126. package/lib/pipes/tab-translate/tab-translate-pipe.module.d.ts +9 -0
  127. package/lib/pipes/tab-translate/tab-translate-pipe.module.d.ts.map +1 -0
  128. package/lib/pipes/tab-translate/tab-translate.pipe.d.ts +13 -0
  129. package/lib/pipes/tab-translate/tab-translate.pipe.d.ts.map +1 -0
  130. package/lib/services/dossier-bulk-assign.service.d.ts +17 -0
  131. package/lib/services/dossier-bulk-assign.service.d.ts.map +1 -0
  132. package/lib/services/dossier-column.service.d.ts +1 -1
  133. package/lib/services/dossier-column.service.d.ts.map +1 -1
  134. package/lib/services/dossier-list-assignee.service.d.ts +5 -4
  135. package/lib/services/dossier-list-assignee.service.d.ts.map +1 -1
  136. package/lib/services/dossier-list-pagination.service.d.ts +2 -2
  137. package/lib/services/dossier-list-pagination.service.d.ts.map +1 -1
  138. package/lib/services/dossier-list-search.service.d.ts +0 -3
  139. package/lib/services/dossier-list-search.service.d.ts.map +1 -1
  140. package/lib/services/dossier-list.service.d.ts +6 -0
  141. package/lib/services/dossier-list.service.d.ts.map +1 -1
  142. package/lib/services/dossier-parameter.service.d.ts.map +1 -1
  143. package/lib/services/dossier-tab-api.service.d.ts +15 -0
  144. package/lib/services/dossier-tab-api.service.d.ts.map +1 -0
  145. package/lib/services/dossier-tab.service.d.ts +31 -0
  146. package/lib/services/dossier-tab.service.d.ts.map +1 -0
  147. package/lib/{dossier.service.d.ts → services/dossier.service.d.ts} +5 -1
  148. package/lib/services/dossier.service.d.ts.map +1 -0
  149. package/lib/services/index.d.ts +4 -1
  150. package/lib/services/index.d.ts.map +1 -1
  151. package/lib/services/notes.service.d.ts.map +1 -1
  152. package/lib/services/zaakobjecten.service.d.ts.map +1 -1
  153. package/package.json +13 -19
  154. package/public_api.d.ts +13 -14
  155. package/public_api.d.ts.map +1 -1
  156. package/esm2020/lib/dossier-assign-user/dossier-assign-user.component.mjs +0 -126
  157. package/esm2020/lib/dossier-detail/dossier-detail.component.mjs +0 -175
  158. package/esm2020/lib/dossier-detail/tab/audit/audit.component.mjs +0 -76
  159. package/esm2020/lib/dossier-detail/tab/contact-moments/contact-moments.component.mjs +0 -86
  160. package/esm2020/lib/dossier-detail/tab/documenten-api-documents/documenten-api-documents.component.mjs +0 -147
  161. package/esm2020/lib/dossier-detail/tab/documents/documents.component.mjs +0 -41
  162. package/esm2020/lib/dossier-detail/tab/notes/notes.component.mjs +0 -153
  163. package/esm2020/lib/dossier-detail/tab/object-type/object-type.component.mjs +0 -122
  164. package/esm2020/lib/dossier-detail/tab/progress/progress.component.mjs +0 -51
  165. package/esm2020/lib/dossier-detail/tab/s3-documents/s3-documents.component.mjs +0 -134
  166. package/esm2020/lib/dossier-detail/tab/summary/summary.component.mjs +0 -124
  167. package/esm2020/lib/dossier-detail/tab/zaakobjecten/zaakobjecten.component.mjs +0 -113
  168. package/esm2020/lib/dossier-detail-tab-enum.mjs +0 -26
  169. package/esm2020/lib/dossier-list/dossier-list.component.mjs +0 -224
  170. package/esm2020/lib/dossier-list-actions/dossier-list-actions.component.mjs +0 -86
  171. package/esm2020/lib/dossier-process-start-modal/dossier-process-start-modal.component.mjs +0 -192
  172. package/esm2020/lib/dossier-routing.module.mjs +0 -66
  173. package/esm2020/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.mjs +0 -181
  174. package/esm2020/lib/dossier-update/dossier-update.component.mjs +0 -113
  175. package/esm2020/lib/dossier.config.mjs +0 -29
  176. package/esm2020/lib/dossier.module.mjs +0 -259
  177. package/esm2020/lib/dossier.service.mjs +0 -50
  178. package/esm2020/lib/models/index.mjs +0 -20
  179. package/esm2020/lib/models/tabs.model.mjs +0 -112
  180. package/esm2020/lib/services/dossier-column.service.mjs +0 -100
  181. package/esm2020/lib/services/dossier-list-assignee.service.mjs +0 -82
  182. package/esm2020/lib/services/dossier-list-pagination.service.mjs +0 -116
  183. package/esm2020/lib/services/dossier-list-search.service.mjs +0 -66
  184. package/esm2020/lib/services/dossier-list.service.mjs +0 -56
  185. package/esm2020/lib/services/dossier-parameter.service.mjs +0 -167
  186. package/esm2020/lib/services/index.mjs +0 -24
  187. package/esm2020/lib/services/notes.service.mjs +0 -76
  188. package/esm2020/lib/tab.service.mjs +0 -80
  189. package/esm2020/public_api.mjs +0 -35
  190. package/fesm2015/valtimo-dossier.mjs +0 -3348
  191. package/fesm2015/valtimo-dossier.mjs.map +0 -1
  192. package/fesm2020/valtimo-dossier.mjs +0 -3447
  193. package/fesm2020/valtimo-dossier.mjs.map +0 -1
  194. package/lib/dossier-assign-user/dossier-assign-user.component.d.ts +0 -34
  195. package/lib/dossier-assign-user/dossier-assign-user.component.d.ts.map +0 -1
  196. package/lib/dossier-detail/dossier-detail.component.d.ts.map +0 -1
  197. package/lib/dossier-detail/tab/audit/audit.component.d.ts.map +0 -1
  198. package/lib/dossier-detail/tab/contact-moments/contact-moments.component.d.ts.map +0 -1
  199. package/lib/dossier-detail/tab/documenten-api-documents/documenten-api-documents.component.d.ts.map +0 -1
  200. package/lib/dossier-detail/tab/documents/documents.component.d.ts.map +0 -1
  201. package/lib/dossier-detail/tab/notes/notes.component.d.ts.map +0 -1
  202. package/lib/dossier-detail/tab/object-type/object-type.component.d.ts.map +0 -1
  203. package/lib/dossier-detail/tab/progress/progress.component.d.ts.map +0 -1
  204. package/lib/dossier-detail/tab/s3-documents/s3-documents.component.d.ts.map +0 -1
  205. package/lib/dossier-detail/tab/summary/summary.component.d.ts.map +0 -1
  206. package/lib/dossier-detail/tab/zaakobjecten/zaakobjecten.component.d.ts.map +0 -1
  207. package/lib/dossier-detail-tab-enum.d.ts +0 -10
  208. package/lib/dossier-detail-tab-enum.d.ts.map +0 -1
  209. package/lib/dossier-list/dossier-list.component.d.ts +0 -66
  210. package/lib/dossier-list/dossier-list.component.d.ts.map +0 -1
  211. package/lib/dossier-list-actions/dossier-list-actions.component.d.ts.map +0 -1
  212. package/lib/dossier-process-start-modal/dossier-process-start-modal.component.d.ts.map +0 -1
  213. package/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.d.ts.map +0 -1
  214. package/lib/dossier-update/dossier-update.component.d.ts.map +0 -1
  215. package/lib/dossier.config.d.ts +0 -4
  216. package/lib/dossier.config.d.ts.map +0 -1
  217. package/lib/dossier.service.d.ts.map +0 -1
  218. package/lib/tab.service.d.ts +0 -21
  219. package/lib/tab.service.d.ts.map +0 -1
  220. /package/{esm2020 → esm2022}/lib/models/notes.model.mjs +0 -0
  221. /package/{esm2020 → esm2022}/lib/models/search.model.mjs +0 -0
  222. /package/{esm2020 → esm2022}/lib/models/zaakobjecten.model.mjs +0 -0
  223. /package/{esm2020 → esm2022}/valtimo-dossier.mjs +0 -0
@@ -0,0 +1,3979 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, ViewEncapsulation, ViewChild, EventEmitter, Output, Input, InjectionToken, ChangeDetectionStrategy, Inject, Optional, HostBinding, Pipe, ViewContainerRef, NgModule } from '@angular/core';
3
+ import * as i5$2 from '@angular/forms';
4
+ import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
+ import { BehaviorSubject, take, map, distinctUntilChanged, combineLatest, Subject, switchMap, tap, filter, Subscription, of, from, startWith, forkJoin } from 'rxjs';
6
+ import * as i1 from '@valtimo/config';
7
+ import { UploadProvider, DossierListTab, ROLE_USER, ConfigModule, HttpLoaderFactory } from '@valtimo/config';
8
+ import * as i2 from '@angular/common/http';
9
+ import { HttpClient } from '@angular/common/http';
10
+ import * as i2$1 from '@valtimo/document';
11
+ import { AdvancedDocumentSearchRequestImpl } from '@valtimo/document';
12
+ import * as i6 from '@ngx-translate/core';
13
+ import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
14
+ import * as i1$1 from '@angular/router';
15
+ import { RouterModule } from '@angular/router';
16
+ import * as i6$1 from 'ngx-logger';
17
+ import * as i3 from '@valtimo/task';
18
+ import { CAN_VIEW_TASK_PERMISSION, TASK_DETAIL_PERMISSION_RESOURCE, TaskModule } from '@valtimo/task';
19
+ import * as i3$1 from '@valtimo/components';
20
+ import { FormioOptionsImpl, TimelineItemImpl, CarbonListComponent, ListModule, WidgetModule, BpmnJsDiagramModule, TimelineModule, CamundaFormModule, FilterSidebarModule, DataListModule, FormIoModule, ModalModule, SpinnerModule, UploaderModule, DropzoneModule, SelectModule, InputLabelModule, ParagraphModule, TableModule, VModalModule, TitleModule, ButtonModule, DocumentenApiMetadataModalModule, SearchableDropdownSelectModule, SearchFieldsModule, PageModule, InputModule, FormModule as FormModule$1, ConfirmationModalModule, CarbonListModule, IsArrayPipe } from '@valtimo/components';
21
+ import moment from 'moment';
22
+ import { catchError, switchMap as switchMap$1, map as map$1, tap as tap$1, take as take$1 } from 'rxjs/operators';
23
+ import * as i2$2 from '@valtimo/process';
24
+ import { ProcessModule } from '@valtimo/process';
25
+ import * as i5 from '@valtimo/form';
26
+ import { FormModule } from '@valtimo/form';
27
+ import * as i6$2 from '@valtimo/security';
28
+ import { AuthGuardService } from '@valtimo/security';
29
+ import * as i7 from '@valtimo/access-control';
30
+ import * as i5$1 from '@angular/common';
31
+ import { CommonModule } from '@angular/common';
32
+ import * as i10 from '@ng-bootstrap/ng-bootstrap';
33
+ import { NgbButtonsModule, NgbTooltipModule, NgbPaginationModule, NgbModule } from '@ng-bootstrap/ng-bootstrap';
34
+ import * as i4 from 'carbon-components-angular';
35
+ import { Tabs, LoadingModule, ButtonModule as ButtonModule$1, IconModule, ModalModule as ModalModule$1, SelectModule as SelectModule$1, DropdownModule, TabsModule, ComboBoxModule } from 'carbon-components-angular';
36
+ import * as i3$2 from 'ngx-spinner';
37
+ import * as i3$3 from 'ngx-toastr';
38
+ import * as i4$1 from '@valtimo/resource';
39
+ import * as i1$2 from '@valtimo/contact-moment';
40
+ import * as i4$2 from 'keycloak-angular';
41
+ import * as i3$4 from '@valtimo/form-link';
42
+ import { FormLinkModule } from '@valtimo/form-link';
43
+ import { isEqual } from 'lodash';
44
+
45
+ class DossierBulkAssignService {
46
+ constructor(configService, http) {
47
+ this.configService = configService;
48
+ this.http = http;
49
+ this.candidateUsers$ = new BehaviorSubject([]);
50
+ this._valtimoEndpointUri = `${this.configService.config.valtimoApi.endpointUri}v1/document/`;
51
+ }
52
+ bulkAssign(assigneeId, documentIds) {
53
+ return this.http.post(`${this._valtimoEndpointUri}assign`, { assigneeId, documentIds });
54
+ }
55
+ loadCandidateUsers(documentIds) {
56
+ this.http
57
+ .post(`${this._valtimoEndpointUri}candidate-user`, { documentIds })
58
+ .pipe(take(1))
59
+ .subscribe({
60
+ next: (candidateUsers) => {
61
+ this.candidateUsers$.next(candidateUsers);
62
+ },
63
+ error: error => {
64
+ console.error(error);
65
+ },
66
+ });
67
+ }
68
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierBulkAssignService, deps: [{ token: i1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
69
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierBulkAssignService }); }
70
+ }
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierBulkAssignService, decorators: [{
72
+ type: Injectable
73
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2.HttpClient }]; } });
74
+
75
+ /*
76
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
77
+ *
78
+ * Licensed under EUPL, Version 1.2 (the "License");
79
+ * you may not use this file except in compliance with the License.
80
+ * You may obtain a copy of the License at
81
+ *
82
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
83
+ *
84
+ * Unless required by applicable law or agreed to in writing, software
85
+ * distributed under the License is distributed on an "AS IS" basis,
86
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
87
+ * See the License for the specific language governing permissions and
88
+ * limitations under the License.
89
+ */
90
+ class DossierColumnService {
91
+ constructor(configService, documentService, translateService) {
92
+ this.configService = configService;
93
+ this.documentService = documentService;
94
+ this.translateService = translateService;
95
+ }
96
+ getDefinitionColumns(documentDefinitionName) {
97
+ const config = this.configService.config;
98
+ const customDefinitionTable = config.customDefinitionTables[documentDefinitionName];
99
+ const defaultDefinitionTable = config.defaultDefinitionTable;
100
+ return this.documentService.getCaseList(documentDefinitionName).pipe(map(caseListColumns => {
101
+ const apiCaseListColumns = config?.featureToggles?.caseListColumn &&
102
+ caseListColumns &&
103
+ Array.isArray(caseListColumns) &&
104
+ caseListColumns.length > 0 &&
105
+ this.mapCaseListColumnsToDefinitionColumns(caseListColumns);
106
+ return {
107
+ columns: customDefinitionTable || apiCaseListColumns || defaultDefinitionTable,
108
+ hasApiConfig: !!apiCaseListColumns,
109
+ };
110
+ }));
111
+ }
112
+ hasEnvironmentConfig(documentDefinitionName) {
113
+ return !!this.configService.config?.customDefinitionTables[documentDefinitionName];
114
+ }
115
+ mapDefinitionColumnsToListFields(columns, hasEnvColumnConfig, hasApiColumnConfig) {
116
+ return columns.map(column => {
117
+ const translationKey = `fieldLabels.${column.translationKey}`;
118
+ const translation = this.translateService.instant(translationKey);
119
+ const validTranslation = translation !== translationKey && translation;
120
+ return {
121
+ key: hasEnvColumnConfig || !hasApiColumnConfig ? column.propertyName : column.translationKey,
122
+ label: column.title || validTranslation || column.translationKey,
123
+ sortable: column.sortable,
124
+ ...(column.viewType && { viewType: column.viewType }),
125
+ ...(column.enum && { enum: column.enum }),
126
+ ...(column.format && { format: column.format }),
127
+ ...(column.default && { default: column.default }),
128
+ };
129
+ });
130
+ }
131
+ mapCaseListColumnsToDefinitionColumns(caseListColumns) {
132
+ return caseListColumns.map(caseListColumn => ({
133
+ translationKey: caseListColumn.key,
134
+ sortable: caseListColumn.sortable,
135
+ default: caseListColumn.defaultSort,
136
+ viewType: this.getViewType(caseListColumn.displayType.type),
137
+ propertyName: this.getPropertyName(caseListColumn.path),
138
+ ...(caseListColumn.title && { title: caseListColumn.title }),
139
+ ...(caseListColumn?.displayType?.displayTypeParameters?.enum && {
140
+ enum: caseListColumn.displayType.displayTypeParameters.enum,
141
+ }),
142
+ ...(caseListColumn.displayType?.displayTypeParameters?.dateFormat && {
143
+ format: caseListColumn.displayType?.displayTypeParameters?.dateFormat,
144
+ }),
145
+ }));
146
+ }
147
+ getViewType(caseListColumnDisplayType) {
148
+ switch (caseListColumnDisplayType) {
149
+ case 'arrayCount':
150
+ return 'relatedFiles';
151
+ case 'underscoresToSpaces':
152
+ return 'stringReplaceUnderscore';
153
+ default:
154
+ return caseListColumnDisplayType;
155
+ }
156
+ }
157
+ getPropertyName(caseListColumnPath) {
158
+ return caseListColumnPath.replace('doc:', '$.').replace('case:', '');
159
+ }
160
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierColumnService, deps: [{ token: i1.ConfigService }, { token: i2$1.DocumentService }, { token: i6.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
161
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierColumnService }); }
162
+ }
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierColumnService, decorators: [{
164
+ type: Injectable
165
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2$1.DocumentService }, { type: i6.TranslateService }]; } });
166
+
167
+ /*
168
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
169
+ *
170
+ * Licensed under EUPL, Version 1.2 (the "License");
171
+ * you may not use this file except in compliance with the License.
172
+ * You may obtain a copy of the License at
173
+ *
174
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
175
+ *
176
+ * Unless required by applicable law or agreed to in writing, software
177
+ * distributed under the License is distributed on an "AS IS" basis,
178
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
179
+ * See the License for the specific language governing permissions and
180
+ * limitations under the License.
181
+ */
182
+ class ZaakobjectenService {
183
+ constructor(configService, http) {
184
+ this.configService = configService;
185
+ this.http = http;
186
+ this.VALTIMO_API_ENDPOINT_URI = this.configService.config.valtimoApi.endpointUri;
187
+ }
188
+ getDocumentObjectTypes(documentId) {
189
+ return this.http.get(`${this.VALTIMO_API_ENDPOINT_URI}v1/document/${documentId}/zaak/objecttype`);
190
+ }
191
+ getDocumentObjectsOfType(documentId, typeUrl) {
192
+ return this.http.get(`${this.VALTIMO_API_ENDPOINT_URI}v1/document/${documentId}/zaak/object?typeUrl=${typeUrl}`);
193
+ }
194
+ getObjectTypeForm(documentId, objectUrl) {
195
+ return this.http.get(`${this.VALTIMO_API_ENDPOINT_URI}v1/document/${documentId}/zaak/object/form?objectUrl=${objectUrl}`);
196
+ }
197
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ZaakobjectenService, deps: [{ token: i1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
198
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ZaakobjectenService, providedIn: 'root' }); }
199
+ }
200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ZaakobjectenService, decorators: [{
201
+ type: Injectable,
202
+ args: [{
203
+ providedIn: 'root',
204
+ }]
205
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2.HttpClient }]; } });
206
+
207
+ /*
208
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
209
+ *
210
+ * Licensed under EUPL, Version 1.2 (the "License");
211
+ * you may not use this file except in compliance with the License.
212
+ * You may obtain a copy of the License at
213
+ *
214
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
215
+ *
216
+ * Unless required by applicable law or agreed to in writing, software
217
+ * distributed under the License is distributed on an "AS IS" basis,
218
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
219
+ * See the License for the specific language governing permissions and
220
+ * limitations under the License.
221
+ */
222
+ class DossierParameterService {
223
+ get dossierParameters$() {
224
+ return this._dossierParameters$.asObservable();
225
+ }
226
+ get searchFieldValues$() {
227
+ return this._searchFieldValues$.asObservable();
228
+ }
229
+ get querySearchParams$() {
230
+ return this.route.queryParams.pipe(map(params => {
231
+ if (params.search) {
232
+ return JSON.parse(atob(params.search));
233
+ }
234
+ return {};
235
+ }), distinctUntilChanged((prevParams, currParams) => JSON.stringify(prevParams) === JSON.stringify(currParams)));
236
+ }
237
+ get queryPaginationParams$() {
238
+ return this.route.queryParams.pipe(map(params => {
239
+ const paramsCopy = { ...params };
240
+ if (paramsCopy.search) {
241
+ delete paramsCopy.search;
242
+ }
243
+ return paramsCopy.collectionSize
244
+ ? {
245
+ collectionSize: Number(paramsCopy.collectionSize),
246
+ page: Number(paramsCopy.page),
247
+ size: Number(paramsCopy.size),
248
+ ...(paramsCopy.isSorting === 'true' && {
249
+ sort: {
250
+ isSorting: !!(paramsCopy.isSorting === 'true'),
251
+ state: {
252
+ name: paramsCopy.sortStateName,
253
+ direction: paramsCopy.sortStateDirection,
254
+ },
255
+ },
256
+ }),
257
+ }
258
+ : null;
259
+ }), distinctUntilChanged((prevParams, currParams) => JSON.stringify(prevParams) === JSON.stringify(currParams)));
260
+ }
261
+ get queryAssigneeParam$() {
262
+ return this.route.queryParams.pipe(map(params => {
263
+ if (params?.assignee) {
264
+ return params?.assignee?.toUpperCase();
265
+ }
266
+ return '';
267
+ }), distinctUntilChanged((prevParams, currParams) => prevParams === currParams));
268
+ }
269
+ constructor(router, route) {
270
+ this.router = router;
271
+ this.route = route;
272
+ this._dossierParameters$ = new BehaviorSubject(undefined);
273
+ this._searchFieldValues$ = new BehaviorSubject({});
274
+ this.setDossierParameters();
275
+ }
276
+ ngOnDestroy() {
277
+ this.dossierParametersSubscription?.unsubscribe();
278
+ }
279
+ setSearchFieldValues(searchFieldValues) {
280
+ this._searchFieldValues$.next(searchFieldValues);
281
+ }
282
+ setSearchParameters(searchParameters) {
283
+ this._dossierParameters$.pipe(take(1)).subscribe(dossierParameters => {
284
+ if (Object.keys(searchParameters || {}).length > 0) {
285
+ this._dossierParameters$.next({
286
+ ...dossierParameters,
287
+ search: this.objectToBase64(searchParameters),
288
+ });
289
+ }
290
+ else {
291
+ if (dossierParameters?.search) {
292
+ delete dossierParameters.search;
293
+ }
294
+ this._dossierParameters$.next(dossierParameters);
295
+ }
296
+ });
297
+ }
298
+ setPaginationParameters(pagination) {
299
+ if (pagination) {
300
+ this._dossierParameters$.pipe(take(1)).subscribe(dossierParameters => {
301
+ this._dossierParameters$.next({
302
+ ...dossierParameters,
303
+ size: `${pagination.size}`,
304
+ collectionSize: `${pagination.collectionSize}`,
305
+ page: `${pagination.page}`,
306
+ isSorting: pagination.sort?.isSorting ? 'true' : 'false',
307
+ ...(pagination.sort?.state?.name && { sortStateName: `${pagination.sort?.state.name}` }),
308
+ ...(pagination.sort?.state?.direction && {
309
+ sortStateDirection: `${pagination.sort?.state.direction}`,
310
+ }),
311
+ });
312
+ });
313
+ }
314
+ }
315
+ setAssigneeParameter(assigneeFilter) {
316
+ this._dossierParameters$.pipe(take(1)).subscribe(dossierParameters => {
317
+ this._dossierParameters$.next({
318
+ ...dossierParameters,
319
+ assignee: assigneeFilter.toLowerCase(),
320
+ });
321
+ });
322
+ }
323
+ clearSearchFieldValues() {
324
+ this._searchFieldValues$.next({});
325
+ }
326
+ clearParameters() {
327
+ this._dossierParameters$.next(undefined);
328
+ this.router.navigate([this.getUrlWithoutParams()]);
329
+ }
330
+ openDossierParametersSubscription() {
331
+ this.dossierParametersSubscription = this.dossierParameters$.subscribe(dossierParams => {
332
+ this.router.navigate([this.getUrlWithoutParams()], { queryParams: dossierParams });
333
+ });
334
+ }
335
+ objectToBase64(jsObject) {
336
+ return btoa(JSON.stringify(jsObject));
337
+ }
338
+ getUrlWithoutParams() {
339
+ const urlTree = this.router.parseUrl(this.router.url);
340
+ urlTree.queryParams = {};
341
+ urlTree.fragment = null;
342
+ return urlTree.toString();
343
+ }
344
+ setDossierParameters() {
345
+ combineLatest([this.queryPaginationParams$, this.querySearchParams$, this.queryAssigneeParam$])
346
+ .pipe(take(1))
347
+ .subscribe(([paginationParams, searchParams, assigneeParams]) => {
348
+ if (paginationParams) {
349
+ this.setPaginationParameters(paginationParams);
350
+ }
351
+ if (searchParams) {
352
+ this.setSearchParameters(searchParams);
353
+ this.setSearchFieldValues(searchParams);
354
+ }
355
+ if (assigneeParams) {
356
+ this.setAssigneeParameter(assigneeParams);
357
+ }
358
+ this.openDossierParametersSubscription();
359
+ });
360
+ }
361
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierParameterService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable }); }
362
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierParameterService }); }
363
+ }
364
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierParameterService, decorators: [{
365
+ type: Injectable
366
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }]; } });
367
+
368
+ /*
369
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
370
+ *
371
+ * Licensed under EUPL, Version 1.2 (the "License");
372
+ * you may not use this file except in compliance with the License.
373
+ * You may obtain a copy of the License at
374
+ *
375
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
376
+ *
377
+ * Unless required by applicable law or agreed to in writing, software
378
+ * distributed under the License is distributed on an "AS IS" basis,
379
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
380
+ * See the License for the specific language governing permissions and
381
+ * limitations under the License.
382
+ */
383
+ class DossierListService {
384
+ get documentDefinitionName$() {
385
+ return this._documentDefinitionName$.asObservable();
386
+ }
387
+ get hasEnvColumnConfig$() {
388
+ return this._hasEnvColumnConfig$;
389
+ }
390
+ get checkRefresh$() {
391
+ return this._checkRefresh$.asObservable();
392
+ }
393
+ get forceRefresh$() {
394
+ return this._forceRefresh$.asObservable();
395
+ }
396
+ constructor(dossierColumnService) {
397
+ this.dossierColumnService = dossierColumnService;
398
+ this._documentDefinitionName$ = new BehaviorSubject('');
399
+ this._hasEnvColumnConfig$ = this.documentDefinitionName$.pipe(map(documentDefinitionName => this.dossierColumnService.hasEnvironmentConfig(documentDefinitionName)));
400
+ this._checkRefresh$ = new BehaviorSubject(false);
401
+ this._forceRefresh$ = new BehaviorSubject(false);
402
+ }
403
+ setDocumentDefinitionName(documentDefinitionName) {
404
+ this._documentDefinitionName$.next(documentDefinitionName);
405
+ }
406
+ mapDocuments(documents, hasEnvColumnConfig, hasApiColumnConfig) {
407
+ if (hasEnvColumnConfig || !hasApiColumnConfig) {
408
+ return documents.content.map(document => {
409
+ const { content, ...others } = document;
410
+ return { ...content, ...others };
411
+ });
412
+ }
413
+ return documents.content.reduce((acc, curr) => {
414
+ const propsObject = { id: curr.id };
415
+ curr.items?.forEach(item => {
416
+ propsObject[item.key] = item.value;
417
+ });
418
+ return [...acc, propsObject];
419
+ }, []);
420
+ }
421
+ forceRefresh() {
422
+ this._forceRefresh$.pipe(take(1)).subscribe(forceRefresh => {
423
+ this._forceRefresh$.next(!forceRefresh);
424
+ });
425
+ }
426
+ checkRefresh() {
427
+ this._checkRefresh$.pipe(take(1)).subscribe(checkRefresh => {
428
+ this._checkRefresh$.next(!checkRefresh);
429
+ });
430
+ }
431
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListService, deps: [{ token: DossierColumnService }], target: i0.ɵɵFactoryTarget.Injectable }); }
432
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListService }); }
433
+ }
434
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListService, decorators: [{
435
+ type: Injectable
436
+ }], ctorParameters: function () { return [{ type: DossierColumnService }]; } });
437
+
438
+ /*
439
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
440
+ *
441
+ * Licensed under EUPL, Version 1.2 (the "License");
442
+ * you may not use this file except in compliance with the License.
443
+ * You may obtain a copy of the License at
444
+ *
445
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
446
+ *
447
+ * Unless required by applicable law or agreed to in writing, software
448
+ * distributed under the License is distributed on an "AS IS" basis,
449
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
450
+ * See the License for the specific language governing permissions and
451
+ * limitations under the License.
452
+ */
453
+ class DossierListAssigneeService {
454
+ get assigneeFilter$() {
455
+ return this._assigneeFilter$.asObservable();
456
+ }
457
+ constructor(configService, dossierListService, documentService, translateService, dossierParameterService) {
458
+ this.configService = configService;
459
+ this.dossierListService = dossierListService;
460
+ this.documentService = documentService;
461
+ this.translateService = translateService;
462
+ this.dossierParameterService = dossierParameterService;
463
+ this.ASSIGNEE_KEY = 'assigneeFullName';
464
+ this._defaultAssigneeFilter$ = new Subject();
465
+ this._assigneeFilter$ = new BehaviorSubject(null);
466
+ this.canHaveAssignee$ = this.dossierListService.documentDefinitionName$.pipe(switchMap(documentDefinitionName => this.documentService.getCaseSettings(documentDefinitionName)), map(caseSettings => caseSettings?.canHaveAssignee), tap(canHaveAssignee => {
467
+ const visibleTabs = this.configService.config.visibleDossierListTabs;
468
+ this._defaultAssigneeFilter$.next(!!visibleTabs && canHaveAssignee ? visibleTabs[0] : 'ALL');
469
+ }));
470
+ }
471
+ resetAssigneeFilter() {
472
+ combineLatest([this.dossierParameterService.queryAssigneeParam$, this._defaultAssigneeFilter$])
473
+ .pipe(take(1))
474
+ .subscribe(([assigneeParam, defaultAssigneeFilter]) => {
475
+ if (assigneeParam) {
476
+ this._assigneeFilter$.next(assigneeParam);
477
+ this.dossierParameterService.setAssigneeParameter(assigneeParam);
478
+ }
479
+ else {
480
+ this._assigneeFilter$.next(defaultAssigneeFilter);
481
+ this.dossierParameterService.setAssigneeParameter(defaultAssigneeFilter);
482
+ }
483
+ });
484
+ }
485
+ setAssigneeFilter(assigneeFilter) {
486
+ this._assigneeFilter$.next(assigneeFilter);
487
+ this.dossierParameterService.setAssigneeParameter(assigneeFilter);
488
+ }
489
+ filterAssigneeColumns(columns, canHaveAssignee) {
490
+ return columns.filter(column => {
491
+ if (column?.key === this.ASSIGNEE_KEY && !canHaveAssignee) {
492
+ return false;
493
+ }
494
+ return true;
495
+ });
496
+ }
497
+ addAssigneeListField(columns, listFields, canHaveAssignee) {
498
+ return [
499
+ ...listFields,
500
+ ...(canHaveAssignee && !columns.find(column => column.propertyName === this.ASSIGNEE_KEY)
501
+ ? [
502
+ {
503
+ key: this.ASSIGNEE_KEY,
504
+ label: this.translateService.instant(`fieldLabels.${this.ASSIGNEE_KEY}`),
505
+ sortable: true,
506
+ viewType: 'string',
507
+ },
508
+ ]
509
+ : []),
510
+ ];
511
+ }
512
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListAssigneeService, deps: [{ token: i1.ConfigService }, { token: DossierListService }, { token: i2$1.DocumentService }, { token: i6.TranslateService }, { token: DossierParameterService }], target: i0.ɵɵFactoryTarget.Injectable }); }
513
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListAssigneeService }); }
514
+ }
515
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListAssigneeService, decorators: [{
516
+ type: Injectable
517
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: DossierListService }, { type: i2$1.DocumentService }, { type: i6.TranslateService }, { type: DossierParameterService }]; } });
518
+
519
+ /*
520
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
521
+ *
522
+ * Licensed under EUPL, Version 1.2 (the "License");
523
+ * you may not use this file except in compliance with the License.
524
+ * You may obtain a copy of the License at
525
+ *
526
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
527
+ *
528
+ * Unless required by applicable law or agreed to in writing, software
529
+ * distributed under the License is distributed on an "AS IS" basis,
530
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
531
+ * See the License for the specific language governing permissions and
532
+ * limitations under the License.
533
+ */
534
+ class DossierService {
535
+ constructor(configService) {
536
+ this.configService = configService;
537
+ this._refreshDocument$ = new BehaviorSubject(null);
538
+ this.definitions = configService.config.definitions;
539
+ }
540
+ getImplementationEnvironmentDefinitions(name) {
541
+ return this.definitions.dossiers.find(definition => definition.name === name);
542
+ }
543
+ getInitialSortState(columns) {
544
+ const defaultColumn = columns.find(column => column.default);
545
+ const isSorting = defaultColumn?.default === 'ASC' || defaultColumn?.default === 'DESC';
546
+ const direction = typeof !defaultColumn || defaultColumn.default === 'boolean'
547
+ ? 'DESC'
548
+ : defaultColumn.default;
549
+ return {
550
+ isSorting,
551
+ state: {
552
+ name: defaultColumn ? defaultColumn.propertyName : columns[0].propertyName,
553
+ direction,
554
+ },
555
+ };
556
+ }
557
+ get refreshDocument$() {
558
+ return this._refreshDocument$.asObservable();
559
+ }
560
+ refresh() {
561
+ this._refreshDocument$.next(null);
562
+ }
563
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierService, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
564
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierService, providedIn: 'root' }); }
565
+ }
566
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierService, decorators: [{
567
+ type: Injectable,
568
+ args: [{
569
+ providedIn: 'root',
570
+ }]
571
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }]; } });
572
+
573
+ /*
574
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
575
+ *
576
+ * Licensed under EUPL, Version 1.2 (the "License");
577
+ * you may not use this file except in compliance with the License.
578
+ * You may obtain a copy of the License at
579
+ *
580
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
581
+ *
582
+ * Unless required by applicable law or agreed to in writing, software
583
+ * distributed under the License is distributed on an "AS IS" basis,
584
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
585
+ * See the License for the specific language governing permissions and
586
+ * limitations under the License.
587
+ */
588
+ class DossierListPaginationService {
589
+ get pagination$() {
590
+ return this._paginationCopy$;
591
+ }
592
+ constructor(logger, dossierParameterService, dossierService) {
593
+ this.logger = logger;
594
+ this.dossierParameterService = dossierParameterService;
595
+ this.dossierService = dossierService;
596
+ this.DEFAULT_PAGINATION = {
597
+ collectionSize: 0,
598
+ page: 1,
599
+ size: 10,
600
+ sort: undefined,
601
+ };
602
+ this._pagination$ = new BehaviorSubject(undefined);
603
+ this._paginationCopy$ = this._pagination$.pipe(filter(pagination => !!pagination), map(pagination => pagination && JSON.parse(JSON.stringify(pagination))), tap(pagination => this.dossierParameterService.setPaginationParameters(pagination)));
604
+ }
605
+ pageChange(newPage) {
606
+ this._pagination$.pipe(take(1)).subscribe(pagination => {
607
+ if (pagination && pagination.page !== newPage) {
608
+ this.logger.debug(`Page change: ${newPage}`);
609
+ this._pagination$.next({ ...pagination, page: newPage });
610
+ }
611
+ });
612
+ }
613
+ pageSizeChange(newPageSize) {
614
+ this._pagination$.pipe(take(1)).subscribe(pagination => {
615
+ if (pagination && pagination.size !== newPageSize) {
616
+ const amountOfAvailablePages = Math.ceil(+pagination.collectionSize / newPageSize);
617
+ const newPage = amountOfAvailablePages < pagination.page ? amountOfAvailablePages : pagination.page;
618
+ this.logger.debug(`Page size change. New Page: ${newPage} New page size: ${newPageSize}`);
619
+ this._pagination$.next({ ...pagination, size: newPageSize, page: newPage });
620
+ }
621
+ });
622
+ }
623
+ sortChanged(newSortState) {
624
+ this._pagination$.pipe(take(1)).subscribe(pagination => {
625
+ if (pagination && JSON.stringify(pagination.sort) !== JSON.stringify(newSortState)) {
626
+ this.logger.debug(`Sort state change: ${JSON.stringify(newSortState)}`);
627
+ this._pagination$.next({ ...pagination, sort: newSortState });
628
+ }
629
+ });
630
+ }
631
+ setPage(newPageNumber) {
632
+ this._pagination$.pipe(take(1)).subscribe(pagination => {
633
+ this._pagination$.next({ ...pagination, page: newPageNumber });
634
+ });
635
+ }
636
+ setCollectionSize(documents) {
637
+ this._pagination$.pipe(take(1)).subscribe(pagination => {
638
+ if (pagination && pagination.collectionSize !== documents.totalElements) {
639
+ this._pagination$.next({ ...pagination, collectionSize: documents.totalElements });
640
+ }
641
+ });
642
+ }
643
+ checkPage(documents) {
644
+ this._pagination$.pipe(take(1)).subscribe(pagination => {
645
+ if (pagination) {
646
+ const amountOfItems = documents.totalElements;
647
+ const amountOfPages = Math.ceil(amountOfItems / pagination.size);
648
+ const currentPage = pagination.page;
649
+ if (!!amountOfItems && !currentPage) {
650
+ this._pagination$.next({ ...pagination, page: 1 });
651
+ return;
652
+ }
653
+ if (currentPage > amountOfPages) {
654
+ this._pagination$.next({ ...pagination, page: amountOfPages });
655
+ }
656
+ }
657
+ });
658
+ }
659
+ clearPagination() {
660
+ this._pagination$.next(undefined);
661
+ }
662
+ setPagination(columns) {
663
+ this.dossierParameterService.queryPaginationParams$
664
+ .pipe(take(1))
665
+ .subscribe(queryPaginationParams => {
666
+ const defaultPagination = this.getDefaultPagination(columns);
667
+ const paginationToUse = queryPaginationParams || defaultPagination;
668
+ this.logger.debug(`Set pagination: ${JSON.stringify(paginationToUse)}`);
669
+ this._pagination$.next(paginationToUse);
670
+ });
671
+ }
672
+ getDefaultPagination(columns) {
673
+ const defaultSortState = this.dossierService.getInitialSortState(columns);
674
+ return {
675
+ ...this.DEFAULT_PAGINATION,
676
+ sort: defaultSortState,
677
+ };
678
+ }
679
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListPaginationService, deps: [{ token: i6$1.NGXLogger }, { token: DossierParameterService }, { token: DossierService }], target: i0.ɵɵFactoryTarget.Injectable }); }
680
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListPaginationService }); }
681
+ }
682
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListPaginationService, decorators: [{
683
+ type: Injectable
684
+ }], ctorParameters: function () { return [{ type: i6$1.NGXLogger }, { type: DossierParameterService }, { type: DossierService }]; } });
685
+
686
+ /*
687
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
688
+ *
689
+ * Licensed under EUPL, Version 1.2 (the "License");
690
+ * you may not use this file except in compliance with the License.
691
+ * You may obtain a copy of the License at
692
+ *
693
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
694
+ *
695
+ * Unless required by applicable law or agreed to in writing, software
696
+ * distributed under the License is distributed on an "AS IS" basis,
697
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
698
+ * See the License for the specific language governing permissions and
699
+ * limitations under the License.
700
+ */
701
+ class DossierListSearchService {
702
+ get documentSearchFields$() {
703
+ return this._documentSearchFields$;
704
+ }
705
+ constructor(dossierListService, documentService, dossierParameterService) {
706
+ this.dossierListService = dossierListService;
707
+ this.documentService = documentService;
708
+ this.dossierParameterService = dossierParameterService;
709
+ this._documentSearchFields$ = this.dossierListService.documentDefinitionName$.pipe(switchMap(documentDefinitionName => this.documentService.getDocumentSearchFields(documentDefinitionName)));
710
+ }
711
+ search(searchFieldValues) {
712
+ this.dossierParameterService.setSearchFieldValues(searchFieldValues || {});
713
+ this.dossierParameterService.setSearchParameters(searchFieldValues);
714
+ this.dossierListService.checkRefresh();
715
+ }
716
+ mapSearchValuesToFilters(values) {
717
+ const filters = [];
718
+ Object.keys(values).forEach(valueKey => {
719
+ const searchValue = values[valueKey];
720
+ if (searchValue.start) {
721
+ filters.push({ key: valueKey, rangeFrom: searchValue.start, rangeTo: searchValue.end });
722
+ }
723
+ else if (Array.isArray(searchValue)) {
724
+ filters.push({ key: valueKey, values: searchValue });
725
+ }
726
+ else {
727
+ filters.push({ key: valueKey, values: [searchValue] });
728
+ }
729
+ });
730
+ return filters;
731
+ }
732
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListSearchService, deps: [{ token: DossierListService }, { token: i2$1.DocumentService }, { token: DossierParameterService }], target: i0.ɵɵFactoryTarget.Injectable }); }
733
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListSearchService }); }
734
+ }
735
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListSearchService, decorators: [{
736
+ type: Injectable
737
+ }], ctorParameters: function () { return [{ type: DossierListService }, { type: i2$1.DocumentService }, { type: DossierParameterService }]; } });
738
+
739
+ /*
740
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
741
+ *
742
+ * Licensed under EUPL, Version 1.2 (the "License");
743
+ * you may not use this file except in compliance with the License.
744
+ * You may obtain a copy of the License at
745
+ *
746
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
747
+ *
748
+ * Unless required by applicable law or agreed to in writing, software
749
+ * distributed under the License is distributed on an "AS IS" basis,
750
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
751
+ * See the License for the specific language governing permissions and
752
+ * limitations under the License.
753
+ */
754
+
755
+ /*
756
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
757
+ *
758
+ * Licensed under EUPL, Version 1.2 (the "License");
759
+ * you may not use this file except in compliance with the License.
760
+ * You may obtain a copy of the License at
761
+ *
762
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
763
+ *
764
+ * Unless required by applicable law or agreed to in writing, software
765
+ * distributed under the License is distributed on an "AS IS" basis,
766
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
767
+ * See the License for the specific language governing permissions and
768
+ * limitations under the License.
769
+ */
770
+
771
+ /*
772
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
773
+ *
774
+ * Licensed under EUPL, Version 1.2 (the "License");
775
+ * you may not use this file except in compliance with the License.
776
+ * You may obtain a copy of the License at
777
+ *
778
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
779
+ *
780
+ * Unless required by applicable law or agreed to in writing, software
781
+ * distributed under the License is distributed on an "AS IS" basis,
782
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
783
+ * See the License for the specific language governing permissions and
784
+ * limitations under the License.
785
+ */
786
+
787
+ /*
788
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
789
+ *
790
+ * Licensed under EUPL, Version 1.2 (the "License");
791
+ * you may not use this file except in compliance with the License.
792
+ * You may obtain a copy of the License at
793
+ *
794
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
795
+ *
796
+ * Unless required by applicable law or agreed to in writing, software
797
+ * distributed under the License is distributed on an "AS IS" basis,
798
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
799
+ * See the License for the specific language governing permissions and
800
+ * limitations under the License.
801
+ */
802
+ class TabLoaderImpl {
803
+ constructor(tabs, componentFactoryResolver, viewContainerRef, router, route) {
804
+ this._tabs = null;
805
+ this._componentFactoryResolver = null;
806
+ this._viewContainerRef = null;
807
+ this._activeComponent = null;
808
+ this._activeTab = null;
809
+ this._tabs = tabs;
810
+ this._componentFactoryResolver = componentFactoryResolver;
811
+ this._viewContainerRef = viewContainerRef;
812
+ this._router = router;
813
+ this._route = route;
814
+ }
815
+ get tabs() {
816
+ return this._tabs;
817
+ }
818
+ initial(tabName) {
819
+ let initialTab;
820
+ if (tabName) {
821
+ initialTab =
822
+ this._tabs.find(tab => tab.name === tabName) ||
823
+ this._tabs.find(tab => tab.contentKey === tabName);
824
+ }
825
+ if (!initialTab) {
826
+ initialTab = this._tabs[0] || null;
827
+ }
828
+ this.load(initialTab);
829
+ }
830
+ load(newTab) {
831
+ if (newTab !== this._activeTab) {
832
+ this._tabs.forEach(tab => tab.deactivate());
833
+ this.replaceView(newTab);
834
+ this.replaceUrlState(newTab);
835
+ this.setActive(newTab);
836
+ }
837
+ }
838
+ refreshView() {
839
+ this.replaceView(this._activeTab);
840
+ }
841
+ replaceView(tab) {
842
+ const componentFactory = this._componentFactoryResolver.resolveComponentFactory(tab.component);
843
+ this._viewContainerRef.clear();
844
+ if (this._activeTab !== null) {
845
+ this._activeComponent.destroy();
846
+ }
847
+ this._activeComponent = this._viewContainerRef.createComponent(componentFactory);
848
+ }
849
+ replaceUrlState(nextTab) {
850
+ this._route.params.pipe(take(1)).subscribe(params => {
851
+ const currentUrl = this._router.url;
852
+ const currentDocumentId = params?.documentId;
853
+ const queryParams = currentUrl.split('?')[1] || '';
854
+ const urlBeforeDocumentId = currentUrl.split(currentDocumentId)[0];
855
+ this._router.navigateByUrl(`${urlBeforeDocumentId}${currentDocumentId}/${nextTab.name}${queryParams ? `?${queryParams}` : ''}`);
856
+ });
857
+ }
858
+ setActive(tab) {
859
+ tab.activate();
860
+ this._activeTab = tab;
861
+ }
862
+ }
863
+ class TabImpl {
864
+ constructor(name, sequence, component, contentKey, title) {
865
+ this._active = false;
866
+ this._name = name;
867
+ this._sequence = sequence;
868
+ this._component = component;
869
+ if (contentKey) {
870
+ this._contentKey = contentKey;
871
+ }
872
+ if (title) {
873
+ this._title = title;
874
+ }
875
+ }
876
+ get name() {
877
+ return this._name;
878
+ }
879
+ get sequence() {
880
+ return this._sequence;
881
+ }
882
+ get component() {
883
+ return this._component;
884
+ }
885
+ get contentKey() {
886
+ return this._contentKey;
887
+ }
888
+ get title() {
889
+ return this._title;
890
+ }
891
+ activate() {
892
+ this._active = true;
893
+ }
894
+ deactivate() {
895
+ this._active = false;
896
+ }
897
+ isActive() {
898
+ return this._active;
899
+ }
900
+ }
901
+
902
+ /*
903
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
904
+ *
905
+ * Licensed under EUPL, Version 1.2 (the "License");
906
+ * you may not use this file except in compliance with the License.
907
+ * You may obtain a copy of the License at
908
+ *
909
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
910
+ *
911
+ * Unless required by applicable law or agreed to in writing, software
912
+ * distributed under the License is distributed on an "AS IS" basis,
913
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
914
+ * See the License for the specific language governing permissions and
915
+ * limitations under the License.
916
+ */
917
+
918
+ /*
919
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
920
+ *
921
+ * Licensed under EUPL, Version 1.2 (the "License");
922
+ * you may not use this file except in compliance with the License.
923
+ * You may obtain a copy of the License at
924
+ *
925
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
926
+ *
927
+ * Unless required by applicable law or agreed to in writing, software
928
+ * distributed under the License is distributed on an "AS IS" basis,
929
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
930
+ * See the License for the specific language governing permissions and
931
+ * limitations under the License.
932
+ */
933
+ var DefaultTabs;
934
+ (function (DefaultTabs) {
935
+ DefaultTabs["summary"] = "summary";
936
+ DefaultTabs["progress"] = "progress";
937
+ DefaultTabs["audit"] = "audit";
938
+ DefaultTabs["documents"] = "documents";
939
+ DefaultTabs["contactMoments"] = "contact-moments";
940
+ DefaultTabs["zaakobjecten"] = "zaakobjecten";
941
+ DefaultTabs["notes"] = "notes";
942
+ })(DefaultTabs || (DefaultTabs = {}));
943
+
944
+ /*
945
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
946
+ *
947
+ * Licensed under EUPL, Version 1.2 (the "License");
948
+ * you may not use this file except in compliance with the License.
949
+ * You may obtain a copy of the License at
950
+ *
951
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
952
+ *
953
+ * Unless required by applicable law or agreed to in writing, software
954
+ * distributed under the License is distributed on an "AS IS" basis,
955
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
956
+ * See the License for the specific language governing permissions and
957
+ * limitations under the License.
958
+ */
959
+ var ApiTabType;
960
+ (function (ApiTabType) {
961
+ ApiTabType["STANDARD"] = "standard";
962
+ ApiTabType["FORMIO"] = "formio";
963
+ ApiTabType["CUSTOM"] = "custom";
964
+ })(ApiTabType || (ApiTabType = {}));
965
+
966
+ /*
967
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
968
+ *
969
+ * Licensed under EUPL, Version 1.2 (the "License");
970
+ * you may not use this file except in compliance with the License.
971
+ * You may obtain a copy of the License at
972
+ *
973
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
974
+ *
975
+ * Unless required by applicable law or agreed to in writing, software
976
+ * distributed under the License is distributed on an "AS IS" basis,
977
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
978
+ * See the License for the specific language governing permissions and
979
+ * limitations under the License.
980
+ */
981
+
982
+ /*
983
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
984
+ *
985
+ * Licensed under EUPL, Version 1.2 (the "License");
986
+ * you may not use this file except in compliance with the License.
987
+ * You may obtain a copy of the License at
988
+ *
989
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
990
+ *
991
+ * Unless required by applicable law or agreed to in writing, software
992
+ * distributed under the License is distributed on an "AS IS" basis,
993
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
994
+ * See the License for the specific language governing permissions and
995
+ * limitations under the License.
996
+ */
997
+ moment.locale(localStorage.getItem('langKey') || '');
998
+ moment.defaultFormat = 'DD MMM YYYY HH:mm';
999
+ class DossierDetailTabSummaryComponent {
1000
+ constructor(router, documentService, taskService, processService, el, renderer, route, formService, userProviderService, permissionService) {
1001
+ this.router = router;
1002
+ this.documentService = documentService;
1003
+ this.taskService = taskService;
1004
+ this.processService = processService;
1005
+ this.el = el;
1006
+ this.renderer = renderer;
1007
+ this.route = route;
1008
+ this.formService = formService;
1009
+ this.userProviderService = userProviderService;
1010
+ this.permissionService = permissionService;
1011
+ this.processDocumentInstances = [];
1012
+ this.tasks = [];
1013
+ this.formDefinition = null;
1014
+ this.roles = [];
1015
+ this.loadingTasks$ = new BehaviorSubject(true);
1016
+ this._subscriptions = new Subscription();
1017
+ this.snapshot = this.route.snapshot.paramMap;
1018
+ this.documentDefinitionName = this.snapshot.get('documentDefinitionName') || '';
1019
+ this.documentId = this.snapshot.get('documentId') || '';
1020
+ this.options = new FormioOptionsImpl();
1021
+ this.options.disableAlerts = true;
1022
+ }
1023
+ ngOnInit() {
1024
+ this.moment = moment;
1025
+ this.init();
1026
+ }
1027
+ ngOnDestroy() {
1028
+ this._subscriptions.unsubscribe();
1029
+ }
1030
+ init() {
1031
+ this._subscriptions.add(this.documentService.getDocument(this.documentId).subscribe(document => {
1032
+ this.document = document;
1033
+ }));
1034
+ this._subscriptions.add(this.formService
1035
+ .getFormDefinitionByNamePreFilled(`${this.documentDefinitionName}.summary`, this.documentId)
1036
+ .subscribe(formDefinition => {
1037
+ this.formDefinition = formDefinition;
1038
+ }));
1039
+ this._subscriptions.add(this.userProviderService.getUserSubject().subscribe(user => {
1040
+ this.roles = user.roles;
1041
+ this.tasks = [];
1042
+ this.loadProcessDocumentInstances(this.documentId);
1043
+ }));
1044
+ }
1045
+ loadProcessDocumentInstances(documentId) {
1046
+ this._subscriptions.add(this.documentService
1047
+ .findProcessDocumentInstances(documentId)
1048
+ .subscribe(processDocumentInstances => {
1049
+ this.processDocumentInstances = processDocumentInstances;
1050
+ this.processDocumentInstances.forEach(instance => {
1051
+ this.loadProcessInstanceTasks(instance.id.processInstanceId);
1052
+ });
1053
+ }));
1054
+ }
1055
+ rowTaskClick(task) {
1056
+ this.taskDetail.openTaskDetails(task);
1057
+ }
1058
+ loadProcessInstanceTasks(processInstanceId) {
1059
+ this._subscriptions.add(this.processService
1060
+ .getProcessInstanceTasks(processInstanceId)
1061
+ .pipe(switchMap(tasks => combineLatest([
1062
+ of(tasks),
1063
+ ...tasks.map(task => this.permissionService.requestPermission(CAN_VIEW_TASK_PERMISSION, {
1064
+ resource: TASK_DETAIL_PERMISSION_RESOURCE.task,
1065
+ identifier: task.id,
1066
+ })),
1067
+ ])), catchError(() => {
1068
+ this.loadingTasks$.next(false);
1069
+ return of(null);
1070
+ }))
1071
+ .subscribe(res => {
1072
+ const tasks = res[0];
1073
+ const permissions = res.filter((_, index) => index !== 0);
1074
+ if (tasks != null) {
1075
+ tasks.forEach((task, taskIndex) => {
1076
+ task.createdUnix = this.moment(task.created).unix();
1077
+ task.created = this.moment(task.created).format('DD MMM YYYY HH:mm');
1078
+ task.isLocked = !permissions[taskIndex];
1079
+ });
1080
+ this.tasks = this.tasks.concat(tasks);
1081
+ this.tasks.sort((t1, t2) => t2.createdUnix - t1.createdUnix);
1082
+ }
1083
+ this.loadingTasks$.next(false);
1084
+ }));
1085
+ }
1086
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabSummaryComponent, deps: [{ token: i1$1.Router }, { token: i2$1.DocumentService }, { token: i3.TaskService }, { token: i2$2.ProcessService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1$1.ActivatedRoute }, { token: i5.FormService }, { token: i6$2.UserProviderService }, { token: i7.PermissionService }], target: i0.ɵɵFactoryTarget.Component }); }
1087
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabSummaryComponent, selector: "valtimo-dossier-detail-tab-summary", viewQueries: [{ propertyName: "taskDetail", first: true, predicate: ["taskDetail"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"container-fluid\" *ngIf=\"{loadingTasks: loadingTasks$ | async} as obs\">\n <div class=\"row py-4\">\n <div class=\"col-sm-12 col-md-8 col-xl-9\">\n <div *ngIf=\"document\">\n <div *ngIf=\"formDefinition\" class=\"summaryForm\">\n <div class=\"mb-4\">\n <valtimo-form-io [form]=\"formDefinition\" [options]=\"options\"></valtimo-form-io>\n </div>\n </div>\n </div>\n </div>\n\n <!--Current user tasks right side-->\n <div class=\"col-sm-12 col-md-4 col-xl-3\">\n <h4 class=\"user-tasks-title\">{{ 'summary.userTasks' | translate }}</h4>\n <ng-container *ngIf=\"!obs.loadingTasks; else loadingTasksTemplate\">\n <ng-container *ngIf=\"(tasks | isArray: 1) === false\">\n <valtimo-widget>\n <div class=\"p-3\">\n <img class=\"float-left\" src=\"assets/audit-2.png\" height=\"25\" />\n <span class=\"float-right\">{{ 'summary.userTasksDoneState' | translate }}</span>\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </ng-container>\n\n <ng-container *ngIf=\"tasks | isArray: 1\">\n <valtimo-widget *ngFor=\"let task of tasks\">\n <div\n *ngIf=\"!task.isLocked\"\n class=\"p-3 clickable hoverable\"\n (click)=\"rowTaskClick(task)\"\n >\n <span class=\"float-right badge badge-pill badge-primary\">{{\n 'summary.taskOpen' | translate\n }}</span>\n <strong>{{ task.name }}</strong>\n <div class=\"mt-1\">{{ 'summary.taskCreated' | translate }} {{ task.created }}</div>\n </div>\n <div class=\"p-3 hoverable\" *ngIf=\"task.isLocked\">\n <span\n class=\"float-right badge badge-pill badge-secondary bg-grey\"\n ngbTooltip=\"{{ 'summary.taskLocked' | translate }}\"\n >\n <i class=\"icon mdi mdi-lock\"></i>\n </span>\n <strong>{{ task.name }}</strong>\n <div>{{ 'summary.taskCreated' | translate }} {{ task.created }}</div>\n </div>\n </valtimo-widget>\n </ng-container>\n </ng-container>\n\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"init()\"\n (assignmentOfTaskChanged)=\"init()\"\n ></valtimo-task-detail-modal>\n </div>\n </div>\n</div>\n\n<ng-template #loadingTasksTemplate>\n <div class=\"loading-container\">\n <cds-loading size=\"sm\"></cds-loading>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.hoverable:hover{background-color:#eee}.summaryForm .formio-component{margin-bottom:0!important}.summaryForm .formio-component div[ref=element] .form-control{height:24px!important;background-color:#fff;border:0px;margin:0;padding:0!important;font-size:13px}.summaryForm .formio-field div[ref=element] .form-control{font-weight:400}.summaryForm .formio-value div[ref=element] .form-control{font-weight:700}.user-tasks-title{margin-top:0;margin-bottom:12px;font-weight:400;color:#000;height:20px}.loading-container{display:flex;width:100%;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: i3$1.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i3.TaskDetailModalComponent, selector: "valtimo-task-detail-modal", outputs: ["formSubmit", "assignmentOfTaskChanged"] }, { kind: "directive", type: i10.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { kind: "component", type: i4.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }, { kind: "pipe", type: i3$1.IsArrayPipe, name: "isArray" }], encapsulation: i0.ViewEncapsulation.None }); }
1088
+ }
1089
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabSummaryComponent, decorators: [{
1090
+ type: Component,
1091
+ args: [{ selector: 'valtimo-dossier-detail-tab-summary', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"container-fluid\" *ngIf=\"{loadingTasks: loadingTasks$ | async} as obs\">\n <div class=\"row py-4\">\n <div class=\"col-sm-12 col-md-8 col-xl-9\">\n <div *ngIf=\"document\">\n <div *ngIf=\"formDefinition\" class=\"summaryForm\">\n <div class=\"mb-4\">\n <valtimo-form-io [form]=\"formDefinition\" [options]=\"options\"></valtimo-form-io>\n </div>\n </div>\n </div>\n </div>\n\n <!--Current user tasks right side-->\n <div class=\"col-sm-12 col-md-4 col-xl-3\">\n <h4 class=\"user-tasks-title\">{{ 'summary.userTasks' | translate }}</h4>\n <ng-container *ngIf=\"!obs.loadingTasks; else loadingTasksTemplate\">\n <ng-container *ngIf=\"(tasks | isArray: 1) === false\">\n <valtimo-widget>\n <div class=\"p-3\">\n <img class=\"float-left\" src=\"assets/audit-2.png\" height=\"25\" />\n <span class=\"float-right\">{{ 'summary.userTasksDoneState' | translate }}</span>\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </ng-container>\n\n <ng-container *ngIf=\"tasks | isArray: 1\">\n <valtimo-widget *ngFor=\"let task of tasks\">\n <div\n *ngIf=\"!task.isLocked\"\n class=\"p-3 clickable hoverable\"\n (click)=\"rowTaskClick(task)\"\n >\n <span class=\"float-right badge badge-pill badge-primary\">{{\n 'summary.taskOpen' | translate\n }}</span>\n <strong>{{ task.name }}</strong>\n <div class=\"mt-1\">{{ 'summary.taskCreated' | translate }} {{ task.created }}</div>\n </div>\n <div class=\"p-3 hoverable\" *ngIf=\"task.isLocked\">\n <span\n class=\"float-right badge badge-pill badge-secondary bg-grey\"\n ngbTooltip=\"{{ 'summary.taskLocked' | translate }}\"\n >\n <i class=\"icon mdi mdi-lock\"></i>\n </span>\n <strong>{{ task.name }}</strong>\n <div>{{ 'summary.taskCreated' | translate }} {{ task.created }}</div>\n </div>\n </valtimo-widget>\n </ng-container>\n </ng-container>\n\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"init()\"\n (assignmentOfTaskChanged)=\"init()\"\n ></valtimo-task-detail-modal>\n </div>\n </div>\n</div>\n\n<ng-template #loadingTasksTemplate>\n <div class=\"loading-container\">\n <cds-loading size=\"sm\"></cds-loading>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.hoverable:hover{background-color:#eee}.summaryForm .formio-component{margin-bottom:0!important}.summaryForm .formio-component div[ref=element] .form-control{height:24px!important;background-color:#fff;border:0px;margin:0;padding:0!important;font-size:13px}.summaryForm .formio-field div[ref=element] .form-control{font-weight:400}.summaryForm .formio-value div[ref=element] .form-control{font-weight:700}.user-tasks-title{margin-top:0;margin-bottom:12px;font-weight:400;color:#000;height:20px}.loading-container{display:flex;width:100%;justify-content:center}\n"] }]
1092
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i2$1.DocumentService }, { type: i3.TaskService }, { type: i2$2.ProcessService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1$1.ActivatedRoute }, { type: i5.FormService }, { type: i6$2.UserProviderService }, { type: i7.PermissionService }]; }, propDecorators: { taskDetail: [{
1093
+ type: ViewChild,
1094
+ args: ['taskDetail']
1095
+ }] } });
1096
+
1097
+ /*
1098
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1099
+ *
1100
+ * Licensed under EUPL, Version 1.2 (the "License");
1101
+ * you may not use this file except in compliance with the License.
1102
+ * You may obtain a copy of the License at
1103
+ *
1104
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1105
+ *
1106
+ * Unless required by applicable law or agreed to in writing, software
1107
+ * distributed under the License is distributed on an "AS IS" basis,
1108
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1109
+ * See the License for the specific language governing permissions and
1110
+ * limitations under the License.
1111
+ */
1112
+ class DossierDetailTabProgressComponent {
1113
+ constructor(route, documentService) {
1114
+ this.route = route;
1115
+ this.documentService = documentService;
1116
+ const snapshot = this.route.snapshot.paramMap;
1117
+ this.documentId = snapshot.get('documentId') || '';
1118
+ }
1119
+ ngOnInit() {
1120
+ this.documentService
1121
+ .findProcessDocumentInstances(this.documentId)
1122
+ .subscribe(processDocumentInstances => {
1123
+ this.processDocumentInstances = processDocumentInstances.sort((a, b) => a.isActive === b.isActive ? 0 : a.isActive ? -1 : 1);
1124
+ if (processDocumentInstances.length > 0) {
1125
+ this.selectedProcessInstanceId = processDocumentInstances[0].id.processInstanceId;
1126
+ }
1127
+ });
1128
+ }
1129
+ loadProcessInstance(processInstanceId) {
1130
+ this.selectedProcessInstanceId = processInstanceId;
1131
+ }
1132
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabProgressComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i2$1.DocumentService }], target: i0.ɵɵFactoryTarget.Component }); }
1133
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabProgressComponent, selector: "valtimo-dossier-detail-tab-progress", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"full-height-tab-content\"\n *ngIf=\"\n processDocumentInstances && processDocumentInstances.length > 0;\n else emptyProcessDocumentInstances\n \"\n>\n <div class=\"col-3\">\n <label><strong>Process</strong></label\n ><br />\n <select class=\"form-control\" (change)=\"loadProcessInstance($event.target.value)\">\n <option\n *ngFor=\"let processDocumentInstance of processDocumentInstances\"\n [value]=\"processDocumentInstance.id.processInstanceId\"\n [selected]=\"selectedProcessInstanceId === processDocumentInstance.id.processInstanceId\"\n >\n {{ processDocumentInstance.processName }}\n </option>\n </select>\n </div>\n <valtimo-process-diagram\n [processInstanceId]=\"selectedProcessInstanceId\"\n ></valtimo-process-diagram>\n</div>\n\n<ng-template #emptyProcessDocumentInstances>\n <span> {{ 'progress.noProcessDocumentInstances' | translate }}</span>\n</ng-template>\n", styles: [".full-height-tab-content{height:calc(100vh - 380px);width:100%}\n"], dependencies: [{ kind: "directive", type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$2.ProcessDiagramComponent, selector: "valtimo-process-diagram", inputs: ["processDefinitionKey", "processInstanceId"], outputs: ["importDone"] }, { kind: "directive", type: i5$2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5$2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.Option, selector: "option" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
1134
+ }
1135
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabProgressComponent, decorators: [{
1136
+ type: Component,
1137
+ args: [{ selector: 'valtimo-dossier-detail-tab-progress', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"full-height-tab-content\"\n *ngIf=\"\n processDocumentInstances && processDocumentInstances.length > 0;\n else emptyProcessDocumentInstances\n \"\n>\n <div class=\"col-3\">\n <label><strong>Process</strong></label\n ><br />\n <select class=\"form-control\" (change)=\"loadProcessInstance($event.target.value)\">\n <option\n *ngFor=\"let processDocumentInstance of processDocumentInstances\"\n [value]=\"processDocumentInstance.id.processInstanceId\"\n [selected]=\"selectedProcessInstanceId === processDocumentInstance.id.processInstanceId\"\n >\n {{ processDocumentInstance.processName }}\n </option>\n </select>\n </div>\n <valtimo-process-diagram\n [processInstanceId]=\"selectedProcessInstanceId\"\n ></valtimo-process-diagram>\n</div>\n\n<ng-template #emptyProcessDocumentInstances>\n <span> {{ 'progress.noProcessDocumentInstances' | translate }}</span>\n</ng-template>\n", styles: [".full-height-tab-content{height:calc(100vh - 380px);width:100%}\n"] }]
1138
+ }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i2$1.DocumentService }]; } });
1139
+
1140
+ /*
1141
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1142
+ *
1143
+ * Licensed under EUPL, Version 1.2 (the "License");
1144
+ * you may not use this file except in compliance with the License.
1145
+ * You may obtain a copy of the License at
1146
+ *
1147
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1148
+ *
1149
+ * Unless required by applicable law or agreed to in writing, software
1150
+ * distributed under the License is distributed on an "AS IS" basis,
1151
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1152
+ * See the License for the specific language governing permissions and
1153
+ * limitations under the License.
1154
+ */
1155
+ moment.locale(localStorage.getItem('langKey') || '');
1156
+ moment.defaultFormat = 'DD MMM YYYY HH:mm';
1157
+ class DossierDetailTabAuditComponent {
1158
+ constructor(route, documentService, spinnerService) {
1159
+ this.route = route;
1160
+ this.documentService = documentService;
1161
+ this.spinnerService = spinnerService;
1162
+ this.paginationClicked = new EventEmitter();
1163
+ this.defaultAuditPage = 0;
1164
+ this.spinnerService.show('auditSpinner');
1165
+ const snapshot = this.route.snapshot.paramMap;
1166
+ this.documentId = snapshot.get('documentId') || '';
1167
+ }
1168
+ static getTranslationKey(auditEvent) {
1169
+ const classNameArray = auditEvent.className.split('.');
1170
+ const eventName = classNameArray[classNameArray.length - 1];
1171
+ return 'events.' + eventName;
1172
+ }
1173
+ ngOnInit() {
1174
+ this.loadAuditPage(this.defaultAuditPage);
1175
+ }
1176
+ loadAuditPage(pageNumber) {
1177
+ this.documentService.getAuditLog(this.documentId, pageNumber).subscribe(page => {
1178
+ const timelineItems = [];
1179
+ page.content.forEach(auditRecord => {
1180
+ const occurredOn = moment(auditRecord.metaData.occurredOn);
1181
+ const fromNow = occurredOn.fromNow();
1182
+ timelineItems.push(new TimelineItemImpl(occurredOn.format('DD MMM YYYY'), occurredOn.format('HH:mm'), auditRecord.metaData.user, fromNow, DossierDetailTabAuditComponent.getTranslationKey(auditRecord.auditEvent), auditRecord.auditEvent));
1183
+ });
1184
+ this.timelineItems = timelineItems;
1185
+ this.spinnerService.hide('auditSpinner');
1186
+ this.pagination = page;
1187
+ this.pagination.number += 1;
1188
+ });
1189
+ }
1190
+ onChangePagination(page) {
1191
+ this.paginationClicked.emit(page);
1192
+ this.currentAuditPage = page - 1;
1193
+ this.loadAuditPage(this.currentAuditPage);
1194
+ }
1195
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabAuditComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i2$1.DocumentService }, { token: i3$2.NgxSpinnerService }], target: i0.ɵɵFactoryTarget.Component }); }
1196
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabAuditComponent, selector: "valtimo-dossier-detail-tab-audit", outputs: { paginationClicked: "paginationClicked" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngIf=\"timelineItems\">\n <valtimo-timeline [items]=\"timelineItems\"></valtimo-timeline>\n</div>\n<valtimo-spinner\n [useBootstrapSpinner]=\"false\"\n name=\"auditSpinner\"\n bdColor=\"rgba(125, 125, 125, 0.35)\"\n color=\"#264251\"\n type=\"square-jelly-box\"\n>\n</valtimo-spinner>\n<div\n class=\"pagination-holder audit-pagination bg-light px-4 pt-4 pb-2 overflow-auto row mr-0 ml-0\"\n *ngIf=\"pagination && pagination.totalElements > pagination.size\"\n>\n <div class=\"float-left page-count col-4\">\n <strong>{{\n 'list.currentPage' | translate: {current: pagination.number, total: pagination.totalPages}\n }}</strong>\n <br />\n {{\n pagination.totalElements === 1\n ? ('list.showingResult' | translate: {number: pagination.content.length})\n : ('list.showingResults'\n | translate: {number: pagination.content.length, total: pagination.totalElements})\n }}\n </div>\n <div class=\"col-8\">\n <ngb-pagination\n *ngIf=\"pagination.totalElements > pagination.size\"\n class=\"float-right\"\n [collectionSize]=\"pagination.totalElements\"\n [(page)]=\"pagination.number\"\n [pageSize]=\"pagination.size\"\n [maxSize]=\"pagination.size\"\n [rotate]=\"true\"\n (pageChange)=\"onChangePagination(pagination.number)\"\n ></ngb-pagination>\n </div>\n</div>\n", styles: [".audit-pagination{margin:0 -1.923rem -1.923rem!important;border-top:1px solid #dee2e6}\n"], dependencies: [{ kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.TimelineComponent, selector: "valtimo-timeline", inputs: ["items", "actions"] }, { kind: "component", type: i3$1.SpinnerComponent, selector: "valtimo-spinner", inputs: ["useBootstrapSpinner", "name", "type", "size", "color", "bdColor", "fullScreen", "noMarginTop"] }, { kind: "component", type: i10.NgbPagination, selector: "ngb-pagination", inputs: ["disabled", "boundaryLinks", "directionLinks", "ellipses", "rotate", "collectionSize", "maxSize", "page", "pageSize", "size"], outputs: ["pageChange"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
1197
+ }
1198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabAuditComponent, decorators: [{
1199
+ type: Component,
1200
+ args: [{ selector: 'valtimo-dossier-detail-tab-audit', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngIf=\"timelineItems\">\n <valtimo-timeline [items]=\"timelineItems\"></valtimo-timeline>\n</div>\n<valtimo-spinner\n [useBootstrapSpinner]=\"false\"\n name=\"auditSpinner\"\n bdColor=\"rgba(125, 125, 125, 0.35)\"\n color=\"#264251\"\n type=\"square-jelly-box\"\n>\n</valtimo-spinner>\n<div\n class=\"pagination-holder audit-pagination bg-light px-4 pt-4 pb-2 overflow-auto row mr-0 ml-0\"\n *ngIf=\"pagination && pagination.totalElements > pagination.size\"\n>\n <div class=\"float-left page-count col-4\">\n <strong>{{\n 'list.currentPage' | translate: {current: pagination.number, total: pagination.totalPages}\n }}</strong>\n <br />\n {{\n pagination.totalElements === 1\n ? ('list.showingResult' | translate: {number: pagination.content.length})\n : ('list.showingResults'\n | translate: {number: pagination.content.length, total: pagination.totalElements})\n }}\n </div>\n <div class=\"col-8\">\n <ngb-pagination\n *ngIf=\"pagination.totalElements > pagination.size\"\n class=\"float-right\"\n [collectionSize]=\"pagination.totalElements\"\n [(page)]=\"pagination.number\"\n [pageSize]=\"pagination.size\"\n [maxSize]=\"pagination.size\"\n [rotate]=\"true\"\n (pageChange)=\"onChangePagination(pagination.number)\"\n ></ngb-pagination>\n </div>\n</div>\n", styles: [".audit-pagination{margin:0 -1.923rem -1.923rem!important;border-top:1px solid #dee2e6}\n"] }]
1201
+ }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i2$1.DocumentService }, { type: i3$2.NgxSpinnerService }]; }, propDecorators: { paginationClicked: [{
1202
+ type: Output
1203
+ }] } });
1204
+
1205
+ /*
1206
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1207
+ *
1208
+ * Licensed under EUPL, Version 1.2 (the "License");
1209
+ * you may not use this file except in compliance with the License.
1210
+ * You may obtain a copy of the License at
1211
+ *
1212
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1213
+ *
1214
+ * Unless required by applicable law or agreed to in writing, software
1215
+ * distributed under the License is distributed on an "AS IS" basis,
1216
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1217
+ * See the License for the specific language governing permissions and
1218
+ * limitations under the License.
1219
+ */
1220
+ class FileSortService {
1221
+ constructor(configService) {
1222
+ this.configService = configService;
1223
+ }
1224
+ sortRelatedFilesByDateDescending(relatedFiles) {
1225
+ const sortByDate = this.configService.config?.featureToggles?.sortFilesByDate;
1226
+ if (sortByDate) {
1227
+ return relatedFiles.sort((a, b) => new Date(b.createdOn).getTime() - new Date(a.createdOn).getTime());
1228
+ }
1229
+ return relatedFiles;
1230
+ }
1231
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileSortService, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1232
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileSortService, providedIn: 'root' }); }
1233
+ }
1234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileSortService, decorators: [{
1235
+ type: Injectable,
1236
+ args: [{
1237
+ providedIn: 'root',
1238
+ }]
1239
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }]; } });
1240
+
1241
+ /*
1242
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1243
+ *
1244
+ * Licensed under EUPL, Version 1.2 (the "License");
1245
+ * you may not use this file except in compliance with the License.
1246
+ * You may obtain a copy of the License at
1247
+ *
1248
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1249
+ *
1250
+ * Unless required by applicable law or agreed to in writing, software
1251
+ * distributed under the License is distributed on an "AS IS" basis,
1252
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1253
+ * See the License for the specific language governing permissions and
1254
+ * limitations under the License.
1255
+ */
1256
+ class DossierDetailTabDocumentenApiDocumentsComponent {
1257
+ constructor(route, documentService, toastrService, uploadProviderService, downloadService, promptService, translateService, configService, userProviderService, fileSortService) {
1258
+ this.route = route;
1259
+ this.documentService = documentService;
1260
+ this.toastrService = toastrService;
1261
+ this.uploadProviderService = uploadProviderService;
1262
+ this.downloadService = downloadService;
1263
+ this.promptService = promptService;
1264
+ this.translateService = translateService;
1265
+ this.configService = configService;
1266
+ this.userProviderService = userProviderService;
1267
+ this.fileSortService = fileSortService;
1268
+ this.maxFileSize = this.configService?.config?.caseFileSizeUploadLimitMB || 5;
1269
+ this.acceptedFiles = this.configService?.config?.caseFileUploadAcceptedFiles || null;
1270
+ this.fields = [
1271
+ { key: 'fileName', label: 'File name' },
1272
+ { key: 'sizeInBytes', label: 'Size in bytes' },
1273
+ { key: 'createdOn', label: 'Created on' },
1274
+ { key: 'createdBy', label: 'Created by' },
1275
+ ];
1276
+ this.uploadProcessLinkedSet = false;
1277
+ this.uploading$ = new BehaviorSubject(false);
1278
+ this.showModal$ = new Subject();
1279
+ this.hideModal$ = new Subject();
1280
+ this.modalDisabled$ = new BehaviorSubject(false);
1281
+ this.fileToBeUploaded$ = new BehaviorSubject(null);
1282
+ this.loading$ = new BehaviorSubject(true);
1283
+ this.refetch$ = new BehaviorSubject(null);
1284
+ this.relatedFiles$ = this.refetch$.pipe(switchMap$1(() => combineLatest([
1285
+ this.documentService.getZakenApiDocuments(this.documentId),
1286
+ this.translateService.stream('key'),
1287
+ ])), map$1(([relatedFiles]) => {
1288
+ const translatedFiles = relatedFiles?.map(file => ({
1289
+ ...file,
1290
+ createdBy: file.createdBy || this.translateService.instant('list.automaticallyGenerated'),
1291
+ }));
1292
+ return translatedFiles || [];
1293
+ }), map$1(relatedFiles => this.fileSortService.sortRelatedFilesByDateDescending(relatedFiles)), map$1(relatedFiles => {
1294
+ moment.locale(this.translateService.currentLang);
1295
+ return relatedFiles.map(file => ({
1296
+ ...file,
1297
+ createdOn: moment(new Date(file.createdOn)).format('L'),
1298
+ }));
1299
+ }), tap$1(() => this.loading$.next(false)), catchError(() => {
1300
+ this.showZaakLinkWarning = true;
1301
+ return of([]);
1302
+ }));
1303
+ this.downloadingFileIndexes$ = new BehaviorSubject([]);
1304
+ const snapshot = this.route.snapshot.paramMap;
1305
+ this.documentId = snapshot.get('documentId') || '';
1306
+ this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
1307
+ }
1308
+ ngOnInit() {
1309
+ this.refetchDocuments();
1310
+ this.setUploadProcessLinked();
1311
+ this.isUserAdmin();
1312
+ }
1313
+ fileSelected(file) {
1314
+ this.fileToBeUploaded$.next(file);
1315
+ this.showModal$.next(null);
1316
+ }
1317
+ downloadDocument(relatedFile, index) {
1318
+ this.downloadingFileIndexes$.pipe(take$1(1)).subscribe(indexes => {
1319
+ this.downloadingFileIndexes$.next([...indexes, index]);
1320
+ const finished$ = this.downloadService.downloadFile(`/api/v1/documenten-api/${relatedFile.pluginConfigurationId}/files/${relatedFile.fileId}/download`, relatedFile.fileName);
1321
+ finished$.pipe(take$1(1)).subscribe(() => {
1322
+ this.downloadingFileIndexes$.next(this.downloadingFileIndexes$.getValue().filter(downloadIndex => downloadIndex !== index));
1323
+ });
1324
+ });
1325
+ }
1326
+ metadataSet(metadata) {
1327
+ this.uploading$.next(true);
1328
+ this.hideModal$.next(null);
1329
+ this.fileToBeUploaded$
1330
+ .pipe(take$1(1))
1331
+ .pipe(tap$1(file => {
1332
+ this.uploadProviderService
1333
+ .uploadFileWithMetadata(file, this.documentId, metadata)
1334
+ .subscribe(res => {
1335
+ this.refetchDocuments();
1336
+ this.uploading$.next(false);
1337
+ this.fileToBeUploaded$.next(null);
1338
+ });
1339
+ }))
1340
+ .subscribe();
1341
+ }
1342
+ indexesIncludeIndex(indexes, index) {
1343
+ return indexes.includes(index);
1344
+ }
1345
+ isUserAdmin() {
1346
+ this.userProviderService.getUserSubject().subscribe(userIdentity => {
1347
+ this.isAdmin = userIdentity.roles.includes('ROLE_ADMIN');
1348
+ }, error => {
1349
+ this.isAdmin = false;
1350
+ });
1351
+ }
1352
+ refetchDocuments() {
1353
+ this.refetch$.next(null);
1354
+ }
1355
+ setUploadProcessLinked() {
1356
+ this.uploadProviderService.checkUploadProcessLink(this.documentDefinitionName).subscribe(linked => {
1357
+ this.uploadProcessLinked = linked;
1358
+ this.uploadProcessLinkedSet = true;
1359
+ }, () => {
1360
+ this.uploadProcessLinkedSet = true;
1361
+ });
1362
+ }
1363
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabDocumentenApiDocumentsComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i2$1.DocumentService }, { token: i3$3.ToastrService }, { token: i4$1.UploadProviderService }, { token: i4$1.DownloadService }, { token: i3$1.PromptService }, { token: i6.TranslateService }, { token: i1.ConfigService }, { token: i6$2.UserProviderService }, { token: FileSortService }], target: i0.ɵɵFactoryTarget.Component }); }
1364
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabDocumentenApiDocumentsComponent, selector: "valtimo-dossier-detail-tab-documenten-api-documents", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"{loading: loading$ | async} as obs\">\n <div *ngIf=\"uploadProcessLinkedSet && !uploadProcessLinked\">\n <div\n *ngIf=\"isAdmin\"\n [translate]=\"'dossier.documenten.noProcessLinked.adminRole'\"\n class=\"bg-warning text-black mb-2 p-3 text-center\"\n ></div>\n <div\n *ngIf=\"!isAdmin\"\n [translate]=\"'dossier.documenten.noProcessLinked.regularUser'\"\n class=\"bg-warning text-black mb-2 p-3 text-center\"\n ></div>\n </div>\n <div *ngIf=\"showZaakLinkWarning\">\n <div\n [translate]=\"'dossier.documenten.noZaakFound'\"\n class=\"bg-warning text-black mb-2 p-3 text-center\"\n ></div>\n </div>\n\n <valtimo-dropzone\n *ngIf=\"!obs.loading\"\n (fileSelected)=\"fileSelected($event)\"\n [acceptedFiles]=\"acceptedFiles\"\n [camera]=\"false\"\n [disabled]=\"\n !uploadProcessLinkedSet || !uploadProcessLinked || obs.loading || showZaakLinkWarning\n \"\n [hideFilePreview]=\"true\"\n [hideTitle]=\"true\"\n [maxFileSize]=\"maxFileSize\"\n [maxFiles]=\"1\"\n [showMaxFileSize]=\"true\"\n [uploading]=\"uploading$ | async\"\n ></valtimo-dropzone>\n\n <valtimo-widget>\n <valtimo-list\n [ngClass]=\"{hidden: obs.loading}\"\n [fields]=\"fields\"\n [header]=\"true\"\n [isSearchable]=\"true\"\n [items]=\"relatedFiles$ | async\"\n [viewMode]=\"true\"\n [lastColumnTemplate]=\"downloadButton\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Related documents' | translate }}</h3>\n <h5 class=\"list-header-description\">\n {{ 'Overview of all documents in this dossier' | translate }}\n </h5>\n </div>\n </valtimo-list>\n <ng-container *ngTemplateOutlet=\"loading; context: {loading: obs.loading}\"></ng-container>\n </valtimo-widget>\n</ng-container>\n\n<valtimo-documenten-api-metadata-modal\n (metadata)=\"metadataSet($event)\"\n [disabled$]=\"modalDisabled$\"\n [file$]=\"fileToBeUploaded$\"\n [hide$]=\"hideModal$\"\n [show$]=\"showModal$\"\n></valtimo-documenten-api-metadata-modal>\n\n<ng-template #loading let-loading=\"loading\">\n <div *ngIf=\"loading\" class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n</ng-template>\n\n<ng-template #downloadButton let-index=\"index\" let-item=\"item\">\n <div\n class=\"download-button-container\"\n *ngIf=\"{isDownloading: indexesIncludeIndex(downloadingFileIndexes$ | async, index)} as vars\"\n >\n <button\n *ngIf=\"!vars.isDownloading\"\n cdsButton=\"primary\"\n size=\"sm\"\n (click)=\"downloadDocument(item, index)\"\n >\n {{ 'interface.download' | translate\n }}<svg class=\"cds--btn__icon\" cdsIcon=\"download\" size=\"16\"></svg>\n </button>\n <cds-loading size=\"sm\" *ngIf=\"vars.isDownloading\"></cds-loading>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.hidden{display:none}.loading-container{padding:var(--cds-grid-margin);display:flex;align-items:center;justify-content:center}.download-button-container{display:flex;width:100%;flex-direction:row;justify-content:flex-end;align-items:center;min-height:32px}\n"], dependencies: [{ kind: "directive", type: i5$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$1.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState", "lastColumnTemplate"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: i3$1.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "directive", type: i6.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: i3$1.DropzoneComponent, selector: "valtimo-dropzone", inputs: ["title", "hideTitle", "subtitle", "externalError$", "maxFileSize", "showMaxFileSize", "acceptedFiles", "clear$", "disabled", "hideFilePreview", "uploading", "camera", "maxFiles"], outputs: ["fileSelected"] }, { kind: "component", type: i3$1.DocumentenApiMetadataModalComponent, selector: "valtimo-documenten-api-metadata-modal", inputs: ["show$", "hide$", "disabled$", "file$", "documentTitle", "disableDocumentTitle", "filename", "disableFilename", "author", "disableAuthor", "status", "disableStatus", "language", "disableLanguage", "documentType", "disableDocumentType", "description", "disableDescription", "confidentialityLevel", "disableConfidentialityLevel"], outputs: ["metadata"] }, { kind: "component", type: i4.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "directive", type: i4.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i4.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
1365
+ }
1366
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabDocumentenApiDocumentsComponent, decorators: [{
1367
+ type: Component,
1368
+ args: [{ selector: 'valtimo-dossier-detail-tab-documenten-api-documents', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"{loading: loading$ | async} as obs\">\n <div *ngIf=\"uploadProcessLinkedSet && !uploadProcessLinked\">\n <div\n *ngIf=\"isAdmin\"\n [translate]=\"'dossier.documenten.noProcessLinked.adminRole'\"\n class=\"bg-warning text-black mb-2 p-3 text-center\"\n ></div>\n <div\n *ngIf=\"!isAdmin\"\n [translate]=\"'dossier.documenten.noProcessLinked.regularUser'\"\n class=\"bg-warning text-black mb-2 p-3 text-center\"\n ></div>\n </div>\n <div *ngIf=\"showZaakLinkWarning\">\n <div\n [translate]=\"'dossier.documenten.noZaakFound'\"\n class=\"bg-warning text-black mb-2 p-3 text-center\"\n ></div>\n </div>\n\n <valtimo-dropzone\n *ngIf=\"!obs.loading\"\n (fileSelected)=\"fileSelected($event)\"\n [acceptedFiles]=\"acceptedFiles\"\n [camera]=\"false\"\n [disabled]=\"\n !uploadProcessLinkedSet || !uploadProcessLinked || obs.loading || showZaakLinkWarning\n \"\n [hideFilePreview]=\"true\"\n [hideTitle]=\"true\"\n [maxFileSize]=\"maxFileSize\"\n [maxFiles]=\"1\"\n [showMaxFileSize]=\"true\"\n [uploading]=\"uploading$ | async\"\n ></valtimo-dropzone>\n\n <valtimo-widget>\n <valtimo-list\n [ngClass]=\"{hidden: obs.loading}\"\n [fields]=\"fields\"\n [header]=\"true\"\n [isSearchable]=\"true\"\n [items]=\"relatedFiles$ | async\"\n [viewMode]=\"true\"\n [lastColumnTemplate]=\"downloadButton\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Related documents' | translate }}</h3>\n <h5 class=\"list-header-description\">\n {{ 'Overview of all documents in this dossier' | translate }}\n </h5>\n </div>\n </valtimo-list>\n <ng-container *ngTemplateOutlet=\"loading; context: {loading: obs.loading}\"></ng-container>\n </valtimo-widget>\n</ng-container>\n\n<valtimo-documenten-api-metadata-modal\n (metadata)=\"metadataSet($event)\"\n [disabled$]=\"modalDisabled$\"\n [file$]=\"fileToBeUploaded$\"\n [hide$]=\"hideModal$\"\n [show$]=\"showModal$\"\n></valtimo-documenten-api-metadata-modal>\n\n<ng-template #loading let-loading=\"loading\">\n <div *ngIf=\"loading\" class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n</ng-template>\n\n<ng-template #downloadButton let-index=\"index\" let-item=\"item\">\n <div\n class=\"download-button-container\"\n *ngIf=\"{isDownloading: indexesIncludeIndex(downloadingFileIndexes$ | async, index)} as vars\"\n >\n <button\n *ngIf=\"!vars.isDownloading\"\n cdsButton=\"primary\"\n size=\"sm\"\n (click)=\"downloadDocument(item, index)\"\n >\n {{ 'interface.download' | translate\n }}<svg class=\"cds--btn__icon\" cdsIcon=\"download\" size=\"16\"></svg>\n </button>\n <cds-loading size=\"sm\" *ngIf=\"vars.isDownloading\"></cds-loading>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.hidden{display:none}.loading-container{padding:var(--cds-grid-margin);display:flex;align-items:center;justify-content:center}.download-button-container{display:flex;width:100%;flex-direction:row;justify-content:flex-end;align-items:center;min-height:32px}\n"] }]
1369
+ }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i2$1.DocumentService }, { type: i3$3.ToastrService }, { type: i4$1.UploadProviderService }, { type: i4$1.DownloadService }, { type: i3$1.PromptService }, { type: i6.TranslateService }, { type: i1.ConfigService }, { type: i6$2.UserProviderService }, { type: FileSortService }]; } });
1370
+
1371
+ /*
1372
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1373
+ *
1374
+ * Licensed under EUPL, Version 1.2 (the "License");
1375
+ * you may not use this file except in compliance with the License.
1376
+ * You may obtain a copy of the License at
1377
+ *
1378
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1379
+ *
1380
+ * Unless required by applicable law or agreed to in writing, software
1381
+ * distributed under the License is distributed on an "AS IS" basis,
1382
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1383
+ * See the License for the specific language governing permissions and
1384
+ * limitations under the License.
1385
+ */
1386
+ class DossierDetailTabS3DocumentsComponent {
1387
+ constructor(route, documentService, toastrService, uploadProviderService, downloadService, promptService, translateService, configService, fileSortService) {
1388
+ this.route = route;
1389
+ this.documentService = documentService;
1390
+ this.toastrService = toastrService;
1391
+ this.uploadProviderService = uploadProviderService;
1392
+ this.downloadService = downloadService;
1393
+ this.promptService = promptService;
1394
+ this.translateService = translateService;
1395
+ this.configService = configService;
1396
+ this.fileSortService = fileSortService;
1397
+ this.maxFileSize = this.configService?.config?.caseFileSizeUploadLimitMB || 5;
1398
+ this.acceptedFiles = this.configService?.config?.caseFileUploadAcceptedFiles || null;
1399
+ this.fields = [
1400
+ { key: 'fileName', label: 'File name' },
1401
+ { key: 'sizeInBytes', label: 'Size in bytes' },
1402
+ { key: 'createdOn', label: 'Created on', viewType: 'date' },
1403
+ { key: 'createdBy', label: 'Created by' },
1404
+ ];
1405
+ this.actions = [
1406
+ {
1407
+ columnName: '',
1408
+ iconClass: 'mdi mdi-open-in-new',
1409
+ callback: this.downloadDocument.bind(this),
1410
+ },
1411
+ {
1412
+ columnName: '',
1413
+ iconClass: 'mdi mdi-delete',
1414
+ callback: this.removeRelatedFile.bind(this),
1415
+ },
1416
+ ];
1417
+ this.uploading$ = new BehaviorSubject(false);
1418
+ this.refetch$ = new BehaviorSubject(null);
1419
+ this.relatedFiles$ = this.refetch$.pipe(switchMap$1(() => combineLatest([
1420
+ this.documentService.getDocument(this.documentId),
1421
+ this.translateService.stream('key'),
1422
+ ])), map$1(([document]) => {
1423
+ const relatedFiles = document?.relatedFiles || [];
1424
+ const translatedFiles = relatedFiles.map(file => ({
1425
+ ...file,
1426
+ createdBy: file.createdBy || this.translateService.instant('list.automaticallyGenerated'),
1427
+ }));
1428
+ return translatedFiles || [];
1429
+ }), map$1(relatedFiles => this.fileSortService.sortRelatedFilesByDateDescending(relatedFiles)));
1430
+ const snapshot = this.route.snapshot.paramMap;
1431
+ this.documentId = snapshot.get('documentId') || '';
1432
+ this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
1433
+ }
1434
+ ngOnInit() {
1435
+ this.refetchDocuments();
1436
+ }
1437
+ fileSelected(file) {
1438
+ this.uploading$.next(true);
1439
+ this.uploadProviderService
1440
+ .uploadFile(file, this.documentDefinitionName, this.documentId)
1441
+ .pipe(switchMap$1(resourceFile => this.documentService.assignResource(this.documentId, resourceFile.data.resourceId)))
1442
+ .subscribe({
1443
+ next: () => {
1444
+ this.toastrService.success('Successfully uploaded document to dossier');
1445
+ this.refetchDocuments();
1446
+ this.uploading$.next(false);
1447
+ },
1448
+ error: () => {
1449
+ this.toastrService.error('Failed to upload document to dossier');
1450
+ this.uploading$.next(false);
1451
+ },
1452
+ });
1453
+ }
1454
+ downloadDocument(relatedFile) {
1455
+ this.uploadProviderService
1456
+ .getResource(relatedFile.fileId)
1457
+ .subscribe((resource) => {
1458
+ this.downloadService.downloadFile(resource.url, resource.resource.name);
1459
+ });
1460
+ }
1461
+ removeRelatedFile(relatedFile) {
1462
+ this.promptService.openPrompt({
1463
+ headerText: this.translateService.instant('dossier.deleteConfirmation.title'),
1464
+ bodyText: this.translateService.instant('dossier.deleteConfirmation.description'),
1465
+ cancelButtonText: this.translateService.instant('dossier.deleteConfirmation.cancel'),
1466
+ confirmButtonText: this.translateService.instant('dossier.deleteConfirmation.delete'),
1467
+ cancelMdiIcon: 'cancel',
1468
+ confirmMdiIcon: 'delete',
1469
+ cancelButtonType: 'secondary',
1470
+ confirmButtonType: 'primary',
1471
+ closeOnConfirm: true,
1472
+ closeOnCancel: true,
1473
+ confirmCallBackFunction: () => {
1474
+ this.documentService.removeResource(this.documentId, relatedFile.fileId).subscribe(() => {
1475
+ this.toastrService.success('Successfully removed document from dossier');
1476
+ this.refetchDocuments();
1477
+ }, () => {
1478
+ this.toastrService.error('Failed to remove document from dossier');
1479
+ });
1480
+ },
1481
+ });
1482
+ }
1483
+ refetchDocuments() {
1484
+ this.refetch$.next(null);
1485
+ }
1486
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabS3DocumentsComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i2$1.DocumentService }, { token: i3$3.ToastrService }, { token: i4$1.UploadProviderService }, { token: i4$1.DownloadService }, { token: i3$1.PromptService }, { token: i6.TranslateService }, { token: i1.ConfigService }, { token: FileSortService }], target: i0.ɵɵFactoryTarget.Component }); }
1487
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabS3DocumentsComponent, selector: "valtimo-dossier-detail-tab-s3-documents", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-dropzone\n (fileSelected)=\"fileSelected($event)\"\n [acceptedFiles]=\"acceptedFiles\"\n [hideFilePreview]=\"true\"\n [hideTitle]=\"true\"\n [maxFileSize]=\"maxFileSize\"\n [showMaxFileSize]=\"true\"\n [camera]=\"false\"\n [uploading]=\"uploading$ | async\"\n></valtimo-dropzone>\n\n<valtimo-widget>\n <valtimo-list\n [fields]=\"fields\"\n [items]=\"relatedFiles$ | async\"\n [header]=\"true\"\n [isSearchable]=\"true\"\n [viewMode]=\"true\"\n [actions]=\"actions\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Related documents' | translate }}</h3>\n <h5 class=\"list-header-description\">\n {{ 'Overview of all documents in this dossier' | translate }}\n </h5>\n </div>\n </valtimo-list>\n</valtimo-widget>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "component", type: i3$1.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState", "lastColumnTemplate"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: i3$1.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: i3$1.DropzoneComponent, selector: "valtimo-dropzone", inputs: ["title", "hideTitle", "subtitle", "externalError$", "maxFileSize", "showMaxFileSize", "acceptedFiles", "clear$", "disabled", "hideFilePreview", "uploading", "camera", "maxFiles"], outputs: ["fileSelected"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
1488
+ }
1489
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabS3DocumentsComponent, decorators: [{
1490
+ type: Component,
1491
+ args: [{ selector: 'valtimo-dossier-detail-tab-s3-documents', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-dropzone\n (fileSelected)=\"fileSelected($event)\"\n [acceptedFiles]=\"acceptedFiles\"\n [hideFilePreview]=\"true\"\n [hideTitle]=\"true\"\n [maxFileSize]=\"maxFileSize\"\n [showMaxFileSize]=\"true\"\n [camera]=\"false\"\n [uploading]=\"uploading$ | async\"\n></valtimo-dropzone>\n\n<valtimo-widget>\n <valtimo-list\n [fields]=\"fields\"\n [items]=\"relatedFiles$ | async\"\n [header]=\"true\"\n [isSearchable]=\"true\"\n [viewMode]=\"true\"\n [actions]=\"actions\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Related documents' | translate }}</h3>\n <h5 class=\"list-header-description\">\n {{ 'Overview of all documents in this dossier' | translate }}\n </h5>\n </div>\n </valtimo-list>\n</valtimo-widget>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
1492
+ }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i2$1.DocumentService }, { type: i3$3.ToastrService }, { type: i4$1.UploadProviderService }, { type: i4$1.DownloadService }, { type: i3$1.PromptService }, { type: i6.TranslateService }, { type: i1.ConfigService }, { type: FileSortService }]; } });
1493
+
1494
+ /*
1495
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1496
+ *
1497
+ * Licensed under EUPL, Version 1.2 (the "License");
1498
+ * you may not use this file except in compliance with the License.
1499
+ * You may obtain a copy of the License at
1500
+ *
1501
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1502
+ *
1503
+ * Unless required by applicable law or agreed to in writing, software
1504
+ * distributed under the License is distributed on an "AS IS" basis,
1505
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1506
+ * See the License for the specific language governing permissions and
1507
+ * limitations under the License.
1508
+ */
1509
+ class DossierDetailTabDocumentsComponent {
1510
+ constructor(configService) {
1511
+ this.configService = configService;
1512
+ this.setConfig(configService.config);
1513
+ }
1514
+ setConfig(config) {
1515
+ const uploadProvider = config.uploadProvider;
1516
+ this.openZaakUploadProvider = uploadProvider === UploadProvider.OPEN_ZAAK;
1517
+ this.documentenApiUploadProvider = uploadProvider === UploadProvider.DOCUMENTEN_API;
1518
+ this.s3UploadProvider = config.uploadProvider === UploadProvider.S3;
1519
+ }
1520
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabDocumentsComponent, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
1521
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabDocumentsComponent, selector: "valtimo-dossier-detail-tab-documents", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-dossier-detail-tab-s3-documents\n *ngIf=\"s3UploadProvider || openZaakUploadProvider\"\n></valtimo-dossier-detail-tab-s3-documents>\n<valtimo-dossier-detail-tab-documenten-api-documents *ngIf=\"documentenApiUploadProvider\">\n</valtimo-dossier-detail-tab-documenten-api-documents>\n", styles: [""], dependencies: [{ kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: DossierDetailTabDocumentenApiDocumentsComponent, selector: "valtimo-dossier-detail-tab-documenten-api-documents" }, { kind: "component", type: DossierDetailTabS3DocumentsComponent, selector: "valtimo-dossier-detail-tab-s3-documents" }] }); }
1522
+ }
1523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabDocumentsComponent, decorators: [{
1524
+ type: Component,
1525
+ args: [{ selector: 'valtimo-dossier-detail-tab-documents', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-dossier-detail-tab-s3-documents\n *ngIf=\"s3UploadProvider || openZaakUploadProvider\"\n></valtimo-dossier-detail-tab-s3-documents>\n<valtimo-dossier-detail-tab-documenten-api-documents *ngIf=\"documentenApiUploadProvider\">\n</valtimo-dossier-detail-tab-documenten-api-documents>\n" }]
1526
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }]; } });
1527
+
1528
+ /*
1529
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1530
+ *
1531
+ * Licensed under EUPL, Version 1.2 (the "License");
1532
+ * you may not use this file except in compliance with the License.
1533
+ * You may obtain a copy of the License at
1534
+ *
1535
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1536
+ *
1537
+ * Unless required by applicable law or agreed to in writing, software
1538
+ * distributed under the License is distributed on an "AS IS" basis,
1539
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1540
+ * See the License for the specific language governing permissions and
1541
+ * limitations under the License.
1542
+ */
1543
+ moment.locale(localStorage.getItem('langKey') || '');
1544
+ class DossierDetailTabContactMomentsComponent {
1545
+ constructor(contactMomentService, alertService, translateService) {
1546
+ this.contactMomentService = contactMomentService;
1547
+ this.alertService = alertService;
1548
+ this.translateService = translateService;
1549
+ this.refetchContactMoments$ = new BehaviorSubject('');
1550
+ this.contactMoments$ = this.refetchContactMoments$.pipe(switchMap$1(() => this.contactMomentService.getContactMoments()), map$1(contactMoments => contactMoments.map(contactMoment => {
1551
+ const registratieDatum = moment(contactMoment.registratiedatum);
1552
+ return new TimelineItemImpl(registratieDatum.format('DD MMM YYYY'), registratieDatum.format('HH:mm'), contactMoment.medewerkerIdentificatie.achternaam, contactMoment.kanaal, contactMoment.tekst, null);
1553
+ })));
1554
+ this.text$ = new BehaviorSubject('');
1555
+ this.channel$ = new BehaviorSubject('MAIL');
1556
+ this.requestData$ = combineLatest([this.text$, this.channel$]);
1557
+ this.valid$ = this.requestData$.pipe(map$1(([text, channel]) => !!(text && channel)));
1558
+ this.disabled$ = new BehaviorSubject(false);
1559
+ }
1560
+ textChange(text) {
1561
+ this.text$.next(text);
1562
+ }
1563
+ buttonClick() {
1564
+ this.modal.show();
1565
+ }
1566
+ saveNote() {
1567
+ this.disable();
1568
+ this.requestData$.pipe(take$1(1)).subscribe(([text, channel]) => {
1569
+ this.contactMomentService.saveContactMoment({ kanaal: channel, tekst: text }).subscribe(() => {
1570
+ this.alertService.success(this.translateService.instant('dossier.contactMoments.saveSuccess'));
1571
+ this.enable();
1572
+ this.clear();
1573
+ this.modal.hide();
1574
+ this.refetchContactMoments();
1575
+ }, () => {
1576
+ this.enable();
1577
+ });
1578
+ });
1579
+ }
1580
+ disable() {
1581
+ this.disabled$.next(true);
1582
+ }
1583
+ enable() {
1584
+ this.disabled$.next(false);
1585
+ }
1586
+ clear() {
1587
+ this.text$.next('');
1588
+ }
1589
+ refetchContactMoments() {
1590
+ this.refetchContactMoments$.next('');
1591
+ }
1592
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabContactMomentsComponent, deps: [{ token: i1$2.ContactMomentService }, { token: i3$1.AlertService }, { token: i6.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
1593
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabContactMomentsComponent, selector: "valtimo-dossier-detail-tab-contact-moments", viewQueries: [{ propertyName: "modal", first: true, predicate: ["contactMomentsNoteModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"contact-moments-container\">\n <ng-container *ngTemplateOutlet=\"buttons\"></ng-container>\n <ng-container *ngTemplateOutlet=\"moments\"></ng-container>\n</div>\n\n<valtimo-modal\n #contactMomentsNoteModal\n [title]=\"'dossier.contactMoments.popupTitle' | translate\"\n [showFooter]=\"true\"\n [elementId]=\"'contact-moments-modal'\"\n>\n <div class=\"mt-2\" body>\n <ng-container *ngTemplateOutlet=\"body\"></ng-container>\n </div>\n <div footer>\n <ng-container *ngTemplateOutlet=\"footer\"></ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #body>\n <form>\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"body\">\n {{ 'dossier.contactMoments.noteText' | translate }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <textarea\n [disabled]=\"disabled$ | async\"\n class=\"form-control\"\n id=\"body\"\n name=\"body\"\n [ngModel]=\"text$ | async\"\n (ngModelChange)=\"textChange($event)\"\n ></textarea>\n </div>\n </div>\n </form>\n</ng-template>\n\n<ng-template #footer>\n <button\n *ngIf=\"(disabled$ | async) === false; else loading\"\n class=\"btn btn-primary\"\n [disabled]=\"(valid$ | async) === false || (disabled$ | async)\"\n (click)=\"saveNote()\"\n >\n {{ 'dossier.contactMoments.saveButtonText' | translate }}\n </button>\n</ng-template>\n\n<ng-template #loading>\n <valtimo-spinner [noMarginTop]=\"true\"></valtimo-spinner>\n</ng-template>\n\n<ng-template #buttons>\n <div class=\"btn-group mt-m3px mb-3 button-container\">\n <button class=\"btn btn-primary btn-space\" (click)=\"buttonClick()\">\n <i class=\"icon mdi mdi-note-plus\"></i>\n &nbsp;{{ 'dossier.contactMoments.makeNoteButton' | translate }}\n </button>\n </div>\n</ng-template>\n\n<ng-template #moments>\n <div *ngIf=\"contactMoments$ | async as contactMoments; else loading\">\n <valtimo-timeline [items]=\"contactMoments\"></valtimo-timeline>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.contact-moments-container{display:flex;flex-direction:column}.button-container{display:inline;align-self:flex-end}\n"], dependencies: [{ kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$1.TimelineComponent, selector: "valtimo-timeline", inputs: ["items", "actions"] }, { kind: "directive", type: i5$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3$1.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "component", type: i3$1.SpinnerComponent, selector: "valtimo-spinner", inputs: ["useBootstrapSpinner", "name", "type", "size", "color", "bdColor", "fullScreen", "noMarginTop"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
1594
+ }
1595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabContactMomentsComponent, decorators: [{
1596
+ type: Component,
1597
+ args: [{ selector: 'valtimo-dossier-detail-tab-contact-moments', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"contact-moments-container\">\n <ng-container *ngTemplateOutlet=\"buttons\"></ng-container>\n <ng-container *ngTemplateOutlet=\"moments\"></ng-container>\n</div>\n\n<valtimo-modal\n #contactMomentsNoteModal\n [title]=\"'dossier.contactMoments.popupTitle' | translate\"\n [showFooter]=\"true\"\n [elementId]=\"'contact-moments-modal'\"\n>\n <div class=\"mt-2\" body>\n <ng-container *ngTemplateOutlet=\"body\"></ng-container>\n </div>\n <div footer>\n <ng-container *ngTemplateOutlet=\"footer\"></ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #body>\n <form>\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"body\">\n {{ 'dossier.contactMoments.noteText' | translate }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <textarea\n [disabled]=\"disabled$ | async\"\n class=\"form-control\"\n id=\"body\"\n name=\"body\"\n [ngModel]=\"text$ | async\"\n (ngModelChange)=\"textChange($event)\"\n ></textarea>\n </div>\n </div>\n </form>\n</ng-template>\n\n<ng-template #footer>\n <button\n *ngIf=\"(disabled$ | async) === false; else loading\"\n class=\"btn btn-primary\"\n [disabled]=\"(valid$ | async) === false || (disabled$ | async)\"\n (click)=\"saveNote()\"\n >\n {{ 'dossier.contactMoments.saveButtonText' | translate }}\n </button>\n</ng-template>\n\n<ng-template #loading>\n <valtimo-spinner [noMarginTop]=\"true\"></valtimo-spinner>\n</ng-template>\n\n<ng-template #buttons>\n <div class=\"btn-group mt-m3px mb-3 button-container\">\n <button class=\"btn btn-primary btn-space\" (click)=\"buttonClick()\">\n <i class=\"icon mdi mdi-note-plus\"></i>\n &nbsp;{{ 'dossier.contactMoments.makeNoteButton' | translate }}\n </button>\n </div>\n</ng-template>\n\n<ng-template #moments>\n <div *ngIf=\"contactMoments$ | async as contactMoments; else loading\">\n <valtimo-timeline [items]=\"contactMoments\"></valtimo-timeline>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.contact-moments-container{display:flex;flex-direction:column}.button-container{display:inline;align-self:flex-end}\n"] }]
1598
+ }], ctorParameters: function () { return [{ type: i1$2.ContactMomentService }, { type: i3$1.AlertService }, { type: i6.TranslateService }]; }, propDecorators: { modal: [{
1599
+ type: ViewChild,
1600
+ args: ['contactMomentsNoteModal']
1601
+ }] } });
1602
+
1603
+ /*
1604
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1605
+ *
1606
+ * Licensed under EUPL, Version 1.2 (the "License");
1607
+ * you may not use this file except in compliance with the License.
1608
+ * You may obtain a copy of the License at
1609
+ *
1610
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1611
+ *
1612
+ * Unless required by applicable law or agreed to in writing, software
1613
+ * distributed under the License is distributed on an "AS IS" basis,
1614
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1615
+ * See the License for the specific language governing permissions and
1616
+ * limitations under the License.
1617
+ */
1618
+ class DossierDetailTabZaakobjectenComponent {
1619
+ constructor(route, zaakobjectenService, modalService) {
1620
+ this.route = route;
1621
+ this.zaakobjectenService = zaakobjectenService;
1622
+ this.modalService = modalService;
1623
+ this.documentId$ = this.route.params.pipe(map(params => params.documentId));
1624
+ this.objecttypes$ = this.documentId$.pipe(switchMap(documentId => this.zaakobjectenService.getDocumentObjectTypes(documentId)));
1625
+ this.objecttypeSelectItems$ = this.objecttypes$.pipe(map(objecttypes => objecttypes.map(type => ({ id: type.url, text: type.name || '-' }))));
1626
+ this.selectedObjecttypeUrl$ = new BehaviorSubject(null);
1627
+ this.objects$ = combineLatest([
1628
+ this.documentId$,
1629
+ this.selectedObjecttypeUrl$,
1630
+ ]).pipe(switchMap(([documentId, selectedObjecttypeUrl]) => documentId && selectedObjecttypeUrl
1631
+ ? this.zaakobjectenService
1632
+ .getDocumentObjectsOfType(documentId, selectedObjecttypeUrl)
1633
+ .pipe(map(objects => objects.map(object => ({ ...object, title: object.title || '-' }))))
1634
+ : of(null)));
1635
+ this.columns$ = new BehaviorSubject([
1636
+ {
1637
+ labelTranslationKey: 'dossier.zaakobjecten.index',
1638
+ dataKey: 'index',
1639
+ },
1640
+ {
1641
+ labelTranslationKey: 'dossier.zaakobjecten.registrationAt',
1642
+ dataKey: 'registrationAt',
1643
+ },
1644
+ {
1645
+ labelTranslationKey: 'dossier.zaakobjecten.title',
1646
+ dataKey: 'title',
1647
+ },
1648
+ ]);
1649
+ this.objectForm$ = new BehaviorSubject(null);
1650
+ this.objectName$ = new BehaviorSubject('');
1651
+ this.noFormDefinitionComponent$ = new BehaviorSubject(false);
1652
+ }
1653
+ selectObjectType(objectTypeUrl) {
1654
+ this.selectedObjecttypeUrl$.next(objectTypeUrl);
1655
+ }
1656
+ rowClicked(object, objectTypeSelectItems) {
1657
+ this.documentId$.pipe(take$1(1)).subscribe(documentId => {
1658
+ this.zaakobjectenService.getObjectTypeForm(documentId, object.url).subscribe(res => {
1659
+ const definition = res.formDefinition;
1660
+ definition.components = definition.components.map(component => ({
1661
+ ...component,
1662
+ disabled: true,
1663
+ }));
1664
+ this.setModalData(objectTypeSelectItems, definition);
1665
+ }, () => {
1666
+ this.setModalData(objectTypeSelectItems);
1667
+ });
1668
+ });
1669
+ }
1670
+ hide() {
1671
+ this.modalService.closeModal(() => {
1672
+ this.objectName$.next('');
1673
+ this.objectForm$.next(null);
1674
+ });
1675
+ }
1676
+ show() {
1677
+ this.modalService.openModal(this.viewZaakobjectModal);
1678
+ }
1679
+ getObjectTypeName(objectTypeSelectItems) {
1680
+ const selectedObjectTypeUrl = this.selectedObjecttypeUrl$.getValue();
1681
+ const currentTypeSelectItem = objectTypeSelectItems.find(selectItem => selectItem.id === selectedObjectTypeUrl);
1682
+ return currentTypeSelectItem.text;
1683
+ }
1684
+ setModalData(objectTypeSelectItems, definition) {
1685
+ if (definition) {
1686
+ this.objectForm$.next(definition);
1687
+ this.noFormDefinitionComponent$.next(false);
1688
+ }
1689
+ else {
1690
+ this.noFormDefinitionComponent$.next(true);
1691
+ }
1692
+ this.objectName$.next(this.getObjectTypeName(objectTypeSelectItems));
1693
+ this.show();
1694
+ }
1695
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabZaakobjectenComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: ZaakobjectenService }, { token: i3$1.ModalService }], target: i0.ɵɵFactoryTarget.Component }); }
1696
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabZaakobjectenComponent, selector: "valtimo-dossier-detail-tab-zaakobjecten", viewQueries: [{ propertyName: "viewZaakobjectModal", first: true, predicate: ["viewZaakobjectModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n objecttypeSelectItems: objecttypeSelectItems$ | async,\n objects: objects$ | async,\n columns: columns$ | async,\n selectedObjectTypeUrl: selectedObjecttypeUrl$ | async\n } as obs\"\n>\n <v-select\n [items]=\"obs.objecttypeSelectItems\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objecttypes\"\n [title]=\"'dossier.zaakobjecten.objecttype' | translate\"\n [placeholder]=\"'dossier.zaakobjecten.objecttypePlaceholder' | translate\"\n [loading]=\"!obs.objecttypeSelectItems\"\n (selectedChange)=\"selectObjectType($event)\"\n ></v-select>\n <v-input-label\n titleTranslationKey=\"dossier.zaakobjecten.objecten\"\n [largeMargin]=\"!!obs.selectedObjectTypeUrl\"\n ></v-input-label>\n <v-paragraph *ngIf=\"!obs.selectedObjectTypeUrl\">{{\n 'dossier.zaakobjecten.objectenPlaceholder' | translate\n }}</v-paragraph>\n <v-table\n *ngIf=\"obs.selectedObjectTypeUrl\"\n [loading]=\"!obs.objects\"\n [items]=\"obs.objects\"\n [columns]=\"obs.columns\"\n [showEditButtons]=\"true\"\n [amountOfLoadingRows]=\"2\"\n [itemsTranslationKey]=\"'pluginManagement.tableItemsText'\"\n [showPagination]=\"false\"\n editButtonTranslationKey=\"dossier.zaakobjecten.objectType.viewObject\"\n (editButtonClicked)=\"rowClicked($event, obs.objecttypeSelectItems)\"\n ></v-table>\n</ng-container>\n\n<v-modal #viewZaakobjectModal (closeEvent)=\"hide()\" [hideFooter]=\"true\" [maxWidthPx]=\"750\">\n <div role=\"header\">\n <v-title [margin]=\"false\" type=\"h2\" [fullWidth]=\"true\" [center]=\"true\">{{\n objectName$ | async\n }}</v-title>\n </div>\n\n <div role=\"content\">\n <valtimo-form-io\n *ngIf=\"(noFormDefinitionComponent$ | async) === false\"\n [form]=\"objectForm$ | async\"\n ></valtimo-form-io>\n <v-paragraph *ngIf=\"noFormDefinitionComponent$ | async\" [center]=\"true\">{{\n 'dossier.zaakobjecten.noFormDefinitionComponent' | translate\n }}</v-paragraph>\n </div>\n</v-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i3$1.SelectComponent, selector: "v-select", inputs: ["items", "defaultSelection", "defaultSelectionId", "defaultSelectionIds", "disabled", "multiple", "margin", "widthInPx", "notFoundText", "clearAllText", "clearText", "name", "title", "titleTranslationKey", "clearSelectionSubject$", "tooltip", "required", "loading", "loadingText", "placeholder", "smallMargin", "carbonTheme"], outputs: ["selectedChange"] }, { kind: "component", type: i3$1.InputLabelComponent, selector: "v-input-label", inputs: ["name", "tooltip", "largeMargin", "small", "title", "titleTranslationKey", "required", "disabled", "carbonTheme"] }, { kind: "component", type: i3$1.ParagraphComponent, selector: "v-paragraph", inputs: ["center", "fullWidth", "margin", "italic", "loading"] }, { kind: "component", type: i3$1.TableComponent, selector: "v-table", inputs: ["items", "columns", "loading", "showEditButtons", "showPagination", "editButtonTranslationKey", "itemsTranslationKey", "noResultsTranslationKey", "mobileBreakpointPx", "amountOfLoadingRows", "collectionSize", "page", "size"], outputs: ["editButtonClicked", "paginationSizeSet", "paginationPageSet"] }, { kind: "component", type: i3$1.VModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx", "hideFooter"], outputs: ["closeEvent"] }, { kind: "component", type: i3$1.TitleComponent, selector: "v-title", inputs: ["type", "margin", "fullWidth", "center"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
1697
+ }
1698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabZaakobjectenComponent, decorators: [{
1699
+ type: Component,
1700
+ args: [{ selector: 'valtimo-dossier-detail-tab-zaakobjecten', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n objecttypeSelectItems: objecttypeSelectItems$ | async,\n objects: objects$ | async,\n columns: columns$ | async,\n selectedObjectTypeUrl: selectedObjecttypeUrl$ | async\n } as obs\"\n>\n <v-select\n [items]=\"obs.objecttypeSelectItems\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objecttypes\"\n [title]=\"'dossier.zaakobjecten.objecttype' | translate\"\n [placeholder]=\"'dossier.zaakobjecten.objecttypePlaceholder' | translate\"\n [loading]=\"!obs.objecttypeSelectItems\"\n (selectedChange)=\"selectObjectType($event)\"\n ></v-select>\n <v-input-label\n titleTranslationKey=\"dossier.zaakobjecten.objecten\"\n [largeMargin]=\"!!obs.selectedObjectTypeUrl\"\n ></v-input-label>\n <v-paragraph *ngIf=\"!obs.selectedObjectTypeUrl\">{{\n 'dossier.zaakobjecten.objectenPlaceholder' | translate\n }}</v-paragraph>\n <v-table\n *ngIf=\"obs.selectedObjectTypeUrl\"\n [loading]=\"!obs.objects\"\n [items]=\"obs.objects\"\n [columns]=\"obs.columns\"\n [showEditButtons]=\"true\"\n [amountOfLoadingRows]=\"2\"\n [itemsTranslationKey]=\"'pluginManagement.tableItemsText'\"\n [showPagination]=\"false\"\n editButtonTranslationKey=\"dossier.zaakobjecten.objectType.viewObject\"\n (editButtonClicked)=\"rowClicked($event, obs.objecttypeSelectItems)\"\n ></v-table>\n</ng-container>\n\n<v-modal #viewZaakobjectModal (closeEvent)=\"hide()\" [hideFooter]=\"true\" [maxWidthPx]=\"750\">\n <div role=\"header\">\n <v-title [margin]=\"false\" type=\"h2\" [fullWidth]=\"true\" [center]=\"true\">{{\n objectName$ | async\n }}</v-title>\n </div>\n\n <div role=\"content\">\n <valtimo-form-io\n *ngIf=\"(noFormDefinitionComponent$ | async) === false\"\n [form]=\"objectForm$ | async\"\n ></valtimo-form-io>\n <v-paragraph *ngIf=\"noFormDefinitionComponent$ | async\" [center]=\"true\">{{\n 'dossier.zaakobjecten.noFormDefinitionComponent' | translate\n }}</v-paragraph>\n </div>\n</v-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
1701
+ }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: ZaakobjectenService }, { type: i3$1.ModalService }]; }, propDecorators: { viewZaakobjectModal: [{
1702
+ type: ViewChild,
1703
+ args: ['viewZaakobjectModal']
1704
+ }] } });
1705
+
1706
+ /*
1707
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1708
+ *
1709
+ * Licensed under EUPL, Version 1.2 (the "License");
1710
+ * you may not use this file except in compliance with the License.
1711
+ * You may obtain a copy of the License at
1712
+ *
1713
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1714
+ *
1715
+ * Unless required by applicable law or agreed to in writing, software
1716
+ * distributed under the License is distributed on an "AS IS" basis,
1717
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1718
+ * See the License for the specific language governing permissions and
1719
+ * limitations under the License.
1720
+ */
1721
+ var PERMISSION_ACTION;
1722
+ (function (PERMISSION_ACTION) {
1723
+ PERMISSION_ACTION["add"] = "create";
1724
+ PERMISSION_ACTION["assign"] = "assign";
1725
+ PERMISSION_ACTION["claim"] = "claim";
1726
+ PERMISSION_ACTION["delete"] = "delete";
1727
+ PERMISSION_ACTION["edit"] = "modify";
1728
+ })(PERMISSION_ACTION || (PERMISSION_ACTION = {}));
1729
+ var DOSSIER_DETAIL_PERMISSION_RESOURCE;
1730
+ (function (DOSSIER_DETAIL_PERMISSION_RESOURCE) {
1731
+ DOSSIER_DETAIL_PERMISSION_RESOURCE["jsonSchemaDocument"] = "com.ritense.document.domain.impl.JsonSchemaDocument";
1732
+ DOSSIER_DETAIL_PERMISSION_RESOURCE["note"] = "com.ritense.note.domain.Note";
1733
+ DOSSIER_DETAIL_PERMISSION_RESOURCE["jsonSchemaDocumentDefinition"] = "com.ritense.document.domain.impl.JsonSchemaDocumentDefinition";
1734
+ })(DOSSIER_DETAIL_PERMISSION_RESOURCE || (DOSSIER_DETAIL_PERMISSION_RESOURCE = {}));
1735
+ const CAN_CLAIM_CASE_PERMISSION = {
1736
+ action: PERMISSION_ACTION.claim,
1737
+ resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
1738
+ };
1739
+ const CAN_ADD_NOTE_PERMISSION = {
1740
+ action: PERMISSION_ACTION.add,
1741
+ resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.note,
1742
+ };
1743
+ const CAN_DELETE_NOTE_PERMISSION = {
1744
+ action: PERMISSION_ACTION.delete,
1745
+ resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.note,
1746
+ };
1747
+ const CAN_EDIT_NOTE_PERMISSION = {
1748
+ action: PERMISSION_ACTION.edit,
1749
+ resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.note,
1750
+ };
1751
+ const CAN_ASSIGN_CASE_PERMISSION = {
1752
+ action: PERMISSION_ACTION.assign,
1753
+ resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
1754
+ };
1755
+ const CAN_CREATE_CASE_PERMISSION = {
1756
+ action: PERMISSION_ACTION.add,
1757
+ resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
1758
+ };
1759
+
1760
+ /*
1761
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1762
+ *
1763
+ * Licensed under EUPL, Version 1.2 (the "License");
1764
+ * you may not use this file except in compliance with the License.
1765
+ * You may obtain a copy of the License at
1766
+ *
1767
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1768
+ *
1769
+ * Unless required by applicable law or agreed to in writing, software
1770
+ * distributed under the License is distributed on an "AS IS" basis,
1771
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1772
+ * See the License for the specific language governing permissions and
1773
+ * limitations under the License.
1774
+ */
1775
+
1776
+ /*
1777
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1778
+ *
1779
+ * Licensed under EUPL, Version 1.2 (the "License");
1780
+ * you may not use this file except in compliance with the License.
1781
+ * You may obtain a copy of the License at
1782
+ *
1783
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1784
+ *
1785
+ * Unless required by applicable law or agreed to in writing, software
1786
+ * distributed under the License is distributed on an "AS IS" basis,
1787
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1788
+ * See the License for the specific language governing permissions and
1789
+ * limitations under the License.
1790
+ */
1791
+ class NotesService {
1792
+ constructor(configService, http) {
1793
+ this.configService = configService;
1794
+ this.http = http;
1795
+ this.VALTIMO_API_ENDPOINT_URI = this.configService.config.valtimoApi.endpointUri;
1796
+ this._showModal$ = new Subject();
1797
+ this._hideModal$ = new Subject();
1798
+ this._refresh$ = new BehaviorSubject(null);
1799
+ this._modalType$ = new BehaviorSubject('add');
1800
+ }
1801
+ getDocumentNotes(documentId, params) {
1802
+ return this.http.get(`${this.VALTIMO_API_ENDPOINT_URI}v1/document/${documentId}/note`, { params });
1803
+ }
1804
+ createDocumentNote(documentId, request) {
1805
+ return this.http.post(`${this.VALTIMO_API_ENDPOINT_URI}v1/document/${documentId}/note`, request);
1806
+ }
1807
+ updateNote(noteId, request) {
1808
+ return this.http.put(`${this.VALTIMO_API_ENDPOINT_URI}v1/note/${noteId}`, request);
1809
+ }
1810
+ deleteNote(noteId) {
1811
+ return this.http.delete(`${this.VALTIMO_API_ENDPOINT_URI}v1/note/${noteId}`);
1812
+ }
1813
+ get showModal$() {
1814
+ return this._showModal$.asObservable();
1815
+ }
1816
+ get hideModal$() {
1817
+ return this._hideModal$.asObservable();
1818
+ }
1819
+ get refresh$() {
1820
+ return this._refresh$.asObservable();
1821
+ }
1822
+ get modalType$() {
1823
+ return this._modalType$.asObservable();
1824
+ }
1825
+ showModal() {
1826
+ this._showModal$.next(null);
1827
+ }
1828
+ hideModal() {
1829
+ this._hideModal$.next(null);
1830
+ }
1831
+ refresh() {
1832
+ this._refresh$.next(null);
1833
+ }
1834
+ setModalType(type) {
1835
+ this._modalType$.next(type);
1836
+ }
1837
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NotesService, deps: [{ token: i1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
1838
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NotesService, providedIn: 'root' }); }
1839
+ }
1840
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NotesService, decorators: [{
1841
+ type: Injectable,
1842
+ args: [{
1843
+ providedIn: 'root',
1844
+ }]
1845
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2.HttpClient }]; } });
1846
+
1847
+ /*
1848
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1849
+ *
1850
+ * Licensed under EUPL, Version 1.2 (the "License");
1851
+ * you may not use this file except in compliance with the License.
1852
+ * You may obtain a copy of the License at
1853
+ *
1854
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1855
+ *
1856
+ * Unless required by applicable law or agreed to in writing, software
1857
+ * distributed under the License is distributed on an "AS IS" basis,
1858
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1859
+ * See the License for the specific language governing permissions and
1860
+ * limitations under the License.
1861
+ */
1862
+ class NoteModalComponent {
1863
+ constructor(notesService, modalService) {
1864
+ this.notesService = notesService;
1865
+ this.modalService = modalService;
1866
+ this.createNoteEvent = new EventEmitter();
1867
+ this.editNoteEvent = new EventEmitter();
1868
+ this.valid$ = new BehaviorSubject(false);
1869
+ this.showForm$ = this.modalService.modalVisible$;
1870
+ this.formData$ = new BehaviorSubject(null);
1871
+ this.modalType$ = this.notesService.modalType$;
1872
+ this.returnToFirstStepSubject$ = new Subject();
1873
+ }
1874
+ ngAfterViewInit() {
1875
+ this.openShowSubscription();
1876
+ this.openHideSubscription();
1877
+ }
1878
+ ngOnDestroy() {
1879
+ this.showSubscription?.unsubscribe();
1880
+ this.hideSubscription?.unsubscribe();
1881
+ }
1882
+ hide() {
1883
+ this.formData$.next(null);
1884
+ this.valid$.next(false);
1885
+ this.modalService.closeModal();
1886
+ }
1887
+ cancel() {
1888
+ this.hide();
1889
+ }
1890
+ save() {
1891
+ combineLatest([this.valid$, this.formData$])
1892
+ .pipe(take$1(1))
1893
+ .subscribe(([valid, formData]) => {
1894
+ if (valid) {
1895
+ this.createNoteEvent.emit(formData);
1896
+ }
1897
+ });
1898
+ }
1899
+ emitNoteData() {
1900
+ combineLatest([this.valid$, this.formData$, this.modalType$])
1901
+ .pipe(take$1(1))
1902
+ .subscribe(([valid, formData, modalType]) => {
1903
+ if (valid) {
1904
+ if (modalType === 'add') {
1905
+ this.createNoteEvent.emit(formData);
1906
+ }
1907
+ else {
1908
+ this.editNoteEvent.emit({ formData, data: this.customData });
1909
+ }
1910
+ }
1911
+ });
1912
+ }
1913
+ openShowSubscription() {
1914
+ this.showSubscription = this.notesService.showModal$.subscribe(() => {
1915
+ this.show();
1916
+ });
1917
+ }
1918
+ openHideSubscription() {
1919
+ this.hideSubscription = this.notesService.hideModal$.subscribe(() => {
1920
+ this.hide();
1921
+ });
1922
+ }
1923
+ show() {
1924
+ this.notesService.modalType$.pipe(take$1(1)).subscribe(() => {
1925
+ this.modalService.openModal(this.noteModal);
1926
+ });
1927
+ }
1928
+ formValueChange(data) {
1929
+ this.formData$.next(data);
1930
+ this.setValid(data);
1931
+ }
1932
+ setValid(data) {
1933
+ this.valid$.next(!!data.content);
1934
+ }
1935
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoteModalComponent, deps: [{ token: NotesService }, { token: i3$1.ModalService }], target: i0.ɵɵFactoryTarget.Component }); }
1936
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NoteModalComponent, selector: "valtimo-note-modal", inputs: { customData: "customData" }, outputs: { createNoteEvent: "createNoteEvent", editNoteEvent: "editNoteEvent" }, viewQueries: [{ propertyName: "noteModal", first: true, predicate: ["noteModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<v-modal\n #noteModal\n *ngIf=\"{disabled: disabled$ | async, valid: valid$ | async, modalType: modalType$ | async} as obs\"\n>\n <div role=\"header\">\n <div class=\"add-note-title\">\n <v-title [margin]=\"false\">{{\n (obs.modalType === 'add' ? 'dossier.notes.addNote' : 'dossier.notes.modifyNote') | translate\n }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <ng-container *ngTemplateOutlet=\"form\"></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <v-button (clickEvent)=\"cancel()\" [disabled]=\"obs.disabled\" type=\"secondary\">\n {{ 'document.cancel' | translate }}\n </v-button>\n <ng-container\n *ngTemplateOutlet=\"\n obs.modalType === 'add' ? addNoteButton : editNoteButton;\n context: {obs: obs}\n \"\n ></ng-container>\n </div>\n </div>\n</v-modal>\n\n<ng-template #addNoteButton let-obs=\"obs\">\n <v-button\n (clickEvent)=\"emitNoteData()\"\n [disabled]=\"obs.disabled || !obs.valid\"\n mdiIcon=\"plus\"\n type=\"success\"\n >\n {{ 'dossier.notes.addNote' | translate }}\n </v-button>\n</ng-template>\n<ng-template #editNoteButton let-obs=\"obs\">\n <v-button\n [disabled]=\"obs.disabled || !obs.valid\"\n (clickEvent)=\"emitNoteData()\"\n mdiIcon=\"pencil\"\n type=\"success\"\n >\n {{ 'dossier.notes.modifyNote' | translate }}\n </v-button>\n</ng-template>\n\n<ng-template #form>\n <ng-container *ngIf=\"showForm$ | async\">\n <v-form (valueChange)=\"formValueChange($event)\">\n <v-input\n type=\"textarea\"\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'dossier.notes.input.content' | translate\"\n name=\"content\"\n [fullWidth]=\"true\"\n [rows]=\"10\"\n [defaultValue]=\"customData?.summaryTranslationKey || ''\"\n >\n </v-input>\n </v-form>\n </ng-container>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.buttons,.add-note-title{width:100%;display:flex;flex-direction:row;justify-content:space-between}.add-note-title{justify-content:center}\n"], dependencies: [{ kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$1.VModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx", "hideFooter"], outputs: ["closeEvent"] }, { kind: "component", type: i3$1.TitleComponent, selector: "v-title", inputs: ["type", "margin", "fullWidth", "center"] }, { kind: "component", type: i3$1.ButtonComponent, selector: "v-button", inputs: ["type", "mdiIcon", "disabled", "title", "titleTranslationKey"], outputs: ["clickEvent"] }, { kind: "component", type: i3$1.InputComponent, selector: "v-input", inputs: ["name", "type", "title", "titleTranslationKey", "defaultValue", "widthPx", "fullWidth", "margin", "smallMargin", "disabled", "step", "min", "maxLength", "tooltip", "required", "hideNumberSpinBox", "smallLabel", "rows", "clear$", "carbonTheme", "placeholder"], outputs: ["valueChange"] }, { kind: "component", type: i3$1.FormComponent, selector: "v-form", inputs: ["className"], outputs: ["valueChange"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
1937
+ }
1938
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoteModalComponent, decorators: [{
1939
+ type: Component,
1940
+ args: [{ selector: 'valtimo-note-modal', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<v-modal\n #noteModal\n *ngIf=\"{disabled: disabled$ | async, valid: valid$ | async, modalType: modalType$ | async} as obs\"\n>\n <div role=\"header\">\n <div class=\"add-note-title\">\n <v-title [margin]=\"false\">{{\n (obs.modalType === 'add' ? 'dossier.notes.addNote' : 'dossier.notes.modifyNote') | translate\n }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <ng-container *ngTemplateOutlet=\"form\"></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <v-button (clickEvent)=\"cancel()\" [disabled]=\"obs.disabled\" type=\"secondary\">\n {{ 'document.cancel' | translate }}\n </v-button>\n <ng-container\n *ngTemplateOutlet=\"\n obs.modalType === 'add' ? addNoteButton : editNoteButton;\n context: {obs: obs}\n \"\n ></ng-container>\n </div>\n </div>\n</v-modal>\n\n<ng-template #addNoteButton let-obs=\"obs\">\n <v-button\n (clickEvent)=\"emitNoteData()\"\n [disabled]=\"obs.disabled || !obs.valid\"\n mdiIcon=\"plus\"\n type=\"success\"\n >\n {{ 'dossier.notes.addNote' | translate }}\n </v-button>\n</ng-template>\n<ng-template #editNoteButton let-obs=\"obs\">\n <v-button\n [disabled]=\"obs.disabled || !obs.valid\"\n (clickEvent)=\"emitNoteData()\"\n mdiIcon=\"pencil\"\n type=\"success\"\n >\n {{ 'dossier.notes.modifyNote' | translate }}\n </v-button>\n</ng-template>\n\n<ng-template #form>\n <ng-container *ngIf=\"showForm$ | async\">\n <v-form (valueChange)=\"formValueChange($event)\">\n <v-input\n type=\"textarea\"\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'dossier.notes.input.content' | translate\"\n name=\"content\"\n [fullWidth]=\"true\"\n [rows]=\"10\"\n [defaultValue]=\"customData?.summaryTranslationKey || ''\"\n >\n </v-input>\n </v-form>\n </ng-container>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.buttons,.add-note-title{width:100%;display:flex;flex-direction:row;justify-content:space-between}.add-note-title{justify-content:center}\n"] }]
1941
+ }], ctorParameters: function () { return [{ type: NotesService }, { type: i3$1.ModalService }]; }, propDecorators: { noteModal: [{
1942
+ type: ViewChild,
1943
+ args: ['noteModal']
1944
+ }], customData: [{
1945
+ type: Input
1946
+ }], createNoteEvent: [{
1947
+ type: Output
1948
+ }], editNoteEvent: [{
1949
+ type: Output
1950
+ }] } });
1951
+
1952
+ /*
1953
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
1954
+ *
1955
+ * Licensed under EUPL, Version 1.2 (the "License");
1956
+ * you may not use this file except in compliance with the License.
1957
+ * You may obtain a copy of the License at
1958
+ *
1959
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1960
+ *
1961
+ * Unless required by applicable law or agreed to in writing, software
1962
+ * distributed under the License is distributed on an "AS IS" basis,
1963
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1964
+ * See the License for the specific language governing permissions and
1965
+ * limitations under the License.
1966
+ */
1967
+ class DossierDetailTabNotesComponent {
1968
+ constructor(notesService, permissionService, promptService, route, toastrService, translateService) {
1969
+ this.notesService = notesService;
1970
+ this.permissionService = permissionService;
1971
+ this.promptService = promptService;
1972
+ this.route = route;
1973
+ this.toastrService = toastrService;
1974
+ this.translateService = translateService;
1975
+ this.timelineItems = [];
1976
+ this.loading$ = new BehaviorSubject(true);
1977
+ this.fields$ = new BehaviorSubject([]);
1978
+ this.customData$ = new BehaviorSubject({});
1979
+ this.documentId$ = this.route.params.pipe(map(params => params.documentId));
1980
+ this.actions = [
1981
+ { id: 'edit', label: 'Edit', icon: 'mdi-pencil', callback: this.editNote.bind(this) },
1982
+ { id: 'delete', label: 'Delete', icon: 'mdi-delete', callback: this.deleteNote.bind(this) },
1983
+ ];
1984
+ this.canAdd$ = this.documentId$.pipe(switchMap$1((identifier) => this.permissionService.requestPermission(CAN_ADD_NOTE_PERMISSION, {
1985
+ resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
1986
+ identifier,
1987
+ })));
1988
+ this.currentPageAndSize$ = new BehaviorSubject({
1989
+ page: 0,
1990
+ size: 10,
1991
+ });
1992
+ this.pageSizes$ = new BehaviorSubject({
1993
+ collectionSize: 0,
1994
+ });
1995
+ this.pagination$ = combineLatest([
1996
+ this.currentPageAndSize$,
1997
+ this.pageSizes$,
1998
+ ]).pipe(map(([currentPage, sizes]) => ({ ...currentPage, ...sizes, page: (currentPage.page ?? 0) + 1 })));
1999
+ this.notes$ = combineLatest([
2000
+ this.documentId$,
2001
+ this.currentPageAndSize$,
2002
+ this.notesService.refresh$,
2003
+ this.notesService.refresh$,
2004
+ ]).pipe(tap$1(() => (this.timelineItems = [])), switchMap$1(([documentId, currentPage]) => this.notesService.getDocumentNotes(documentId, {
2005
+ page: currentPage.page,
2006
+ size: currentPage.size,
2007
+ })), tap$1((res) => {
2008
+ this.timelineItems = [];
2009
+ this.pageSizes$.pipe(take$1(1)).subscribe(sizes => {
2010
+ this.pageSizes$.next({ ...sizes, collectionSize: res.totalElements });
2011
+ });
2012
+ }), switchMap$1(res => combineLatest([
2013
+ of(res),
2014
+ ...res.content.map(note => this.permissionService.requestPermission(CAN_DELETE_NOTE_PERMISSION, {
2015
+ resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.note,
2016
+ identifier: note.id,
2017
+ })),
2018
+ ...res.content.map(note => this.permissionService.requestPermission(CAN_EDIT_NOTE_PERMISSION, {
2019
+ resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.note,
2020
+ identifier: note.id,
2021
+ })),
2022
+ ])), map(combinedResults => {
2023
+ const permissionResults = combinedResults.filter((curr, index) => index !== 0);
2024
+ const halfIndex = Math.ceil(permissionResults.length / 2);
2025
+ const deletePermissions = permissionResults.slice(0, halfIndex);
2026
+ const editPermissions = permissionResults.slice(halfIndex);
2027
+ return combinedResults[0].content.map((note, index) => {
2028
+ const noteCreatedDate = moment(note.createdDate).locale(this.translateService.currentLang);
2029
+ this.timelineItems.push(new TimelineItemImpl(noteCreatedDate.format('DD MMM YYYY'), noteCreatedDate.format('HH:mm'), note.createdByUserFullName, noteCreatedDate.fromNow(), note.content, {}, { id: note.id }, [
2030
+ ...(deletePermissions[index] ? ['delete'] : []),
2031
+ ...(editPermissions[index] ? ['edit'] : []),
2032
+ ]));
2033
+ return {
2034
+ ...note,
2035
+ };
2036
+ });
2037
+ }), tap$1(() => this.loading$.next(false)));
2038
+ }
2039
+ ngOnInit() {
2040
+ this.translateService.onLangChange.subscribe(() => {
2041
+ this.notesService.refresh();
2042
+ });
2043
+ }
2044
+ paginationClicked(newPageNumber) {
2045
+ this.currentPageAndSize$.pipe(take$1(1)).subscribe(currentPage => {
2046
+ this.currentPageAndSize$.next({ ...currentPage, page: newPageNumber - 1 });
2047
+ });
2048
+ }
2049
+ showAddModal() {
2050
+ this.customData$.next({});
2051
+ this.notesService.setModalType('add');
2052
+ this.notesService.showModal();
2053
+ }
2054
+ createNewNote(content) {
2055
+ this.documentId$
2056
+ .pipe(take$1(1), switchMap$1((documentId) => this.notesService.createDocumentNote(documentId, content)))
2057
+ .subscribe(() => {
2058
+ this.notesService.refresh();
2059
+ this.notesService.hideModal();
2060
+ });
2061
+ }
2062
+ editNoteEvent(content) {
2063
+ this.notesService.updateNote(content.data.customData.id, content.formData).subscribe(() => {
2064
+ this.notesService.refresh();
2065
+ this.notesService.hideModal();
2066
+ this.toastrService.success(this.translateService.instant('dossier.notes.editedMessage'));
2067
+ });
2068
+ }
2069
+ editNote(data) {
2070
+ this.customData$.next(data);
2071
+ this.notesService.setModalType('modify');
2072
+ this.notesService.showModal();
2073
+ }
2074
+ deleteNote(data) {
2075
+ this.promptService.openPrompt({
2076
+ headerText: this.translateService.instant('dossier.notes.deleteConfirmation.title'),
2077
+ bodyText: this.translateService.instant('dossier.notes.deleteConfirmation.description'),
2078
+ cancelButtonText: this.translateService.instant('dossier.deleteConfirmation.cancel'),
2079
+ confirmButtonText: this.translateService.instant('dossier.deleteConfirmation.delete'),
2080
+ cancelMdiIcon: 'cancel',
2081
+ confirmMdiIcon: 'delete',
2082
+ cancelButtonType: 'secondary',
2083
+ confirmButtonType: 'primary',
2084
+ closeOnConfirm: true,
2085
+ closeOnCancel: true,
2086
+ confirmCallBackFunction: () => {
2087
+ this.notesService.deleteNote(data.customData.id).subscribe(() => {
2088
+ this.notesService.refresh();
2089
+ this.toastrService.success(this.translateService.instant('dossier.notes.deleteConfirmation.deletedMessage'));
2090
+ });
2091
+ },
2092
+ });
2093
+ }
2094
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabNotesComponent, deps: [{ token: NotesService }, { token: i7.PermissionService }, { token: i3$1.PromptService }, { token: i1$1.ActivatedRoute }, { token: i3$3.ToastrService }, { token: i6.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
2095
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabNotesComponent, selector: "valtimo-dossier-detail-tab-notes", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<div\n *ngIf=\"{\n canAdd: canAdd$ | async,\n notes: notes$ | async,\n pagination: pagination$ | async,\n loading: loading$ | async\n } as obs\"\n class=\"notes\"\n>\n <button\n *ngIf=\"obs.canAdd\"\n [disabled]=\"obs.loading\"\n (click)=\"showAddModal()\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n class=\"btn btn-space btn-primary mr-1 add-note\"\n type=\"button\"\n >\n <span>{{ 'dossier.notes.addNote' | translate }}</span>\n\n <i class=\"ml-1 icon mdi mdi-plus\"></i>\n </button>\n\n <div *ngIf=\"timelineItems\">\n <valtimo-timeline [actions]=\"actions\" [items]=\"timelineItems\"></valtimo-timeline>\n </div>\n\n <valtimo-spinner\n [useBootstrapSpinner]=\"false\"\n name=\"auditSpinner\"\n bdColor=\"rgba(125, 125, 125, 0.35)\"\n color=\"#264251\"\n type=\"square-jelly-box\"\n >\n </valtimo-spinner>\n\n <div *ngIf=\"obs.pagination\" class=\"d-flex justify-content-end row mr-0 ml-0\">\n <ngb-pagination\n *ngIf=\"obs.pagination.collectionSize > obs.pagination.size\"\n [collectionSize]=\"obs.pagination.collectionSize\"\n [maxSize]=\"obs.pagination.size\"\n [pageSize]=\"obs.pagination.size\"\n [rotate]=\"true\"\n [(page)]=\"obs.pagination.page\"\n (pageChange)=\"paginationClicked($event)\"\n ></ngb-pagination>\n </div>\n</div>\n\n<valtimo-note-modal\n [customData]=\"customData$ | async\"\n (createNoteEvent)=\"createNewNote($event)\"\n (editNoteEvent)=\"editNoteEvent($event)\"\n></valtimo-note-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.notes{position:relative}.add-note{position:absolute;right:0}\n"], dependencies: [{ kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.TimelineComponent, selector: "valtimo-timeline", inputs: ["items", "actions"] }, { kind: "component", type: i3$1.SpinnerComponent, selector: "valtimo-spinner", inputs: ["useBootstrapSpinner", "name", "type", "size", "color", "bdColor", "fullScreen", "noMarginTop"] }, { kind: "component", type: i10.NgbPagination, selector: "ngb-pagination", inputs: ["disabled", "boundaryLinks", "directionLinks", "ellipses", "rotate", "collectionSize", "maxSize", "page", "pageSize", "size"], outputs: ["pageChange"] }, { kind: "component", type: NoteModalComponent, selector: "valtimo-note-modal", inputs: ["customData"], outputs: ["createNoteEvent", "editNoteEvent"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
2096
+ }
2097
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabNotesComponent, decorators: [{
2098
+ type: Component,
2099
+ args: [{ selector: 'valtimo-dossier-detail-tab-notes', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<div\n *ngIf=\"{\n canAdd: canAdd$ | async,\n notes: notes$ | async,\n pagination: pagination$ | async,\n loading: loading$ | async\n } as obs\"\n class=\"notes\"\n>\n <button\n *ngIf=\"obs.canAdd\"\n [disabled]=\"obs.loading\"\n (click)=\"showAddModal()\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n class=\"btn btn-space btn-primary mr-1 add-note\"\n type=\"button\"\n >\n <span>{{ 'dossier.notes.addNote' | translate }}</span>\n\n <i class=\"ml-1 icon mdi mdi-plus\"></i>\n </button>\n\n <div *ngIf=\"timelineItems\">\n <valtimo-timeline [actions]=\"actions\" [items]=\"timelineItems\"></valtimo-timeline>\n </div>\n\n <valtimo-spinner\n [useBootstrapSpinner]=\"false\"\n name=\"auditSpinner\"\n bdColor=\"rgba(125, 125, 125, 0.35)\"\n color=\"#264251\"\n type=\"square-jelly-box\"\n >\n </valtimo-spinner>\n\n <div *ngIf=\"obs.pagination\" class=\"d-flex justify-content-end row mr-0 ml-0\">\n <ngb-pagination\n *ngIf=\"obs.pagination.collectionSize > obs.pagination.size\"\n [collectionSize]=\"obs.pagination.collectionSize\"\n [maxSize]=\"obs.pagination.size\"\n [pageSize]=\"obs.pagination.size\"\n [rotate]=\"true\"\n [(page)]=\"obs.pagination.page\"\n (pageChange)=\"paginationClicked($event)\"\n ></ngb-pagination>\n </div>\n</div>\n\n<valtimo-note-modal\n [customData]=\"customData$ | async\"\n (createNoteEvent)=\"createNewNote($event)\"\n (editNoteEvent)=\"editNoteEvent($event)\"\n></valtimo-note-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.notes{position:relative}.add-note{position:absolute;right:0}\n"] }]
2100
+ }], ctorParameters: function () { return [{ type: NotesService }, { type: i7.PermissionService }, { type: i3$1.PromptService }, { type: i1$1.ActivatedRoute }, { type: i3$3.ToastrService }, { type: i6.TranslateService }]; } });
2101
+
2102
+ /*
2103
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
2104
+ *
2105
+ * Licensed under EUPL, Version 1.2 (the "License");
2106
+ * you may not use this file except in compliance with the License.
2107
+ * You may obtain a copy of the License at
2108
+ *
2109
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2110
+ *
2111
+ * Unless required by applicable law or agreed to in writing, software
2112
+ * distributed under the License is distributed on an "AS IS" basis,
2113
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2114
+ * See the License for the specific language governing permissions and
2115
+ * limitations under the License.
2116
+ */
2117
+ const TAB_MAP = new InjectionToken('TabMap');
2118
+ const DEFAULT_TABS = new Map([
2119
+ [DefaultTabs.summary, DossierDetailTabSummaryComponent],
2120
+ [DefaultTabs.progress, DossierDetailTabProgressComponent],
2121
+ [DefaultTabs.audit, DossierDetailTabAuditComponent],
2122
+ [DefaultTabs.documents, DossierDetailTabDocumentsComponent],
2123
+ ]);
2124
+ const DEFAULT_TAB_COMPONENTS = {
2125
+ [DefaultTabs.summary]: DossierDetailTabSummaryComponent,
2126
+ [DefaultTabs.progress]: DossierDetailTabProgressComponent,
2127
+ [DefaultTabs.audit]: DossierDetailTabAuditComponent,
2128
+ [DefaultTabs.documents]: DossierDetailTabDocumentsComponent,
2129
+ [DefaultTabs.contactMoments]: DossierDetailTabContactMomentsComponent,
2130
+ [DefaultTabs.zaakobjecten]: DossierDetailTabZaakobjectenComponent,
2131
+ [DefaultTabs.notes]: DossierDetailTabNotesComponent,
2132
+ };
2133
+
2134
+ /*
2135
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
2136
+ *
2137
+ * Licensed under EUPL, Version 1.2 (the "License");
2138
+ * you may not use this file except in compliance with the License.
2139
+ * You may obtain a copy of the License at
2140
+ *
2141
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2142
+ *
2143
+ * Unless required by applicable law or agreed to in writing, software
2144
+ * distributed under the License is distributed on an "AS IS" basis,
2145
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2146
+ * See the License for the specific language governing permissions and
2147
+ * limitations under the License.
2148
+ */
2149
+ const CASE_TAB_TOKEN = new InjectionToken('Specify a component to display per configured tab key.');
2150
+
2151
+ /*
2152
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
2153
+ *
2154
+ * Licensed under EUPL, Version 1.2 (the "License");
2155
+ * you may not use this file except in compliance with the License.
2156
+ * You may obtain a copy of the License at
2157
+ *
2158
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2159
+ *
2160
+ * Unless required by applicable law or agreed to in writing, software
2161
+ * distributed under the License is distributed on an "AS IS" basis,
2162
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2163
+ * See the License for the specific language governing permissions and
2164
+ * limitations under the License.
2165
+ */
2166
+ class DossierDetailTabObjectTypeComponent {
2167
+ constructor(route, zaakobjectenService, modalService) {
2168
+ this.route = route;
2169
+ this.zaakobjectenService = zaakobjectenService;
2170
+ this.modalService = modalService;
2171
+ this.documentId$ = this.route.params.pipe(map(params => params.documentId));
2172
+ this.objecttypes$ = this.documentId$.pipe(switchMap(documentId => this.zaakobjectenService.getDocumentObjectTypes(documentId)));
2173
+ this.objectName$ = this.route.params.pipe(map(() => {
2174
+ const currentUrl = window.location.href;
2175
+ const splitUrl = currentUrl.split('/');
2176
+ const lastUrlPart = splitUrl[splitUrl.length - 1];
2177
+ return lastUrlPart;
2178
+ }));
2179
+ this.selectedObjecttypeUrl$ = combineLatest([
2180
+ this.objecttypes$,
2181
+ this.objectName$,
2182
+ ]).pipe(map(([objectTypes, objectName]) => {
2183
+ const currentType = objectTypes?.find(type => type?.name.toLowerCase() === objectName?.toLowerCase());
2184
+ const currentTypeUrl = currentType?.url;
2185
+ if (objectTypes && objectName && currentTypeUrl)
2186
+ return currentTypeUrl;
2187
+ return '';
2188
+ }));
2189
+ this.loading$ = new BehaviorSubject(true);
2190
+ this.hasData$ = new BehaviorSubject(false);
2191
+ this.objects$ = combineLatest([
2192
+ this.documentId$,
2193
+ this.selectedObjecttypeUrl$,
2194
+ ]).pipe(switchMap(([documentId, selectedObjecttypeUrl]) => documentId && selectedObjecttypeUrl
2195
+ ? this.zaakobjectenService.getDocumentObjectsOfType(documentId, selectedObjecttypeUrl).pipe(map(objects => objects.map(object => ({ ...object, title: object.title || '-' }))), tap(() => {
2196
+ this.loading$.next(false);
2197
+ this.hasData$.next(true);
2198
+ }))
2199
+ : of(null).pipe(tap(() => {
2200
+ this.loading$.next(false);
2201
+ this.hasData$.next(false);
2202
+ }))));
2203
+ this.columns$ = new BehaviorSubject([
2204
+ {
2205
+ labelTranslationKey: 'dossier.zaakobjecten.index',
2206
+ dataKey: 'index',
2207
+ },
2208
+ {
2209
+ labelTranslationKey: 'dossier.zaakobjecten.registrationAt',
2210
+ dataKey: 'registrationAt',
2211
+ },
2212
+ {
2213
+ labelTranslationKey: 'dossier.zaakobjecten.title',
2214
+ dataKey: 'title',
2215
+ },
2216
+ ]);
2217
+ this.objectForm$ = new BehaviorSubject(null);
2218
+ this.noFormDefinitionComponent$ = new BehaviorSubject(false);
2219
+ }
2220
+ rowClicked(object) {
2221
+ this.documentId$.pipe(take$1(1)).subscribe(documentId => {
2222
+ this.zaakobjectenService.getObjectTypeForm(documentId, object.url).subscribe(res => {
2223
+ const definition = res.formDefinition;
2224
+ definition.components = definition.components.map(component => ({
2225
+ ...component,
2226
+ disabled: true,
2227
+ }));
2228
+ this.setModalData(definition);
2229
+ }, () => {
2230
+ this.setModalData();
2231
+ });
2232
+ });
2233
+ }
2234
+ hide() {
2235
+ this.modalService.closeModal(() => {
2236
+ this.objectForm$.next(null);
2237
+ });
2238
+ }
2239
+ show() {
2240
+ this.modalService.openModal(this.viewObjectModal);
2241
+ }
2242
+ setModalData(definition) {
2243
+ if (definition) {
2244
+ this.objectForm$.next(definition);
2245
+ this.noFormDefinitionComponent$.next(false);
2246
+ }
2247
+ else {
2248
+ this.noFormDefinitionComponent$.next(true);
2249
+ }
2250
+ this.show();
2251
+ }
2252
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabObjectTypeComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: ZaakobjectenService }, { token: i3$1.ModalService }], target: i0.ɵɵFactoryTarget.Component }); }
2253
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabObjectTypeComponent, selector: "valtimo-object-type", viewQueries: [{ propertyName: "viewObjectModal", first: true, predicate: ["viewObjectModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n objects: objects$ | async,\n columns: columns$ | async,\n loading: loading$ | async,\n hasData: hasData$ | async\n } as obs\"\n>\n <v-table\n *ngIf=\"obs.hasData || obs.loading\"\n [loading]=\"obs.loading\"\n [items]=\"obs.objects\"\n [columns]=\"obs.columns\"\n [showEditButtons]=\"true\"\n editButtonTranslationKey=\"dossier.zaakobjecten.objectType.viewObject\"\n [amountOfLoadingRows]=\"2\"\n [itemsTranslationKey]=\"'pluginManagement.tableItemsText'\"\n [showPagination]=\"false\"\n (editButtonClicked)=\"rowClicked($event)\"\n ></v-table>\n\n <v-paragraph *ngIf=\"!obs.hasData && !obs.loading\" [center]=\"true\">{{\n 'dossier.zaakobjecten.noObjectType' | translate\n }}</v-paragraph>\n</ng-container>\n\n<v-modal #viewObjectModal (closeEvent)=\"hide()\" [hideFooter]=\"true\" [maxWidthPx]=\"750\">\n <div role=\"header\">\n <v-title [margin]=\"false\" type=\"h2\" [fullWidth]=\"true\" [center]=\"true\">{{\n objectName$ | async\n }}</v-title>\n </div>\n\n <div role=\"content\">\n <valtimo-form-io\n *ngIf=\"(noFormDefinitionComponent$ | async) === false\"\n [form]=\"objectForm$ | async\"\n ></valtimo-form-io>\n <v-paragraph *ngIf=\"noFormDefinitionComponent$ | async\" [center]=\"true\">{{\n 'dossier.zaakobjecten.noFormDefinitionComponent' | translate\n }}</v-paragraph>\n </div>\n</v-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i3$1.ParagraphComponent, selector: "v-paragraph", inputs: ["center", "fullWidth", "margin", "italic", "loading"] }, { kind: "component", type: i3$1.TableComponent, selector: "v-table", inputs: ["items", "columns", "loading", "showEditButtons", "showPagination", "editButtonTranslationKey", "itemsTranslationKey", "noResultsTranslationKey", "mobileBreakpointPx", "amountOfLoadingRows", "collectionSize", "page", "size"], outputs: ["editButtonClicked", "paginationSizeSet", "paginationPageSet"] }, { kind: "component", type: i3$1.VModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx", "hideFooter"], outputs: ["closeEvent"] }, { kind: "component", type: i3$1.TitleComponent, selector: "v-title", inputs: ["type", "margin", "fullWidth", "center"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
2254
+ }
2255
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabObjectTypeComponent, decorators: [{
2256
+ type: Component,
2257
+ args: [{ selector: 'valtimo-object-type', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n objects: objects$ | async,\n columns: columns$ | async,\n loading: loading$ | async,\n hasData: hasData$ | async\n } as obs\"\n>\n <v-table\n *ngIf=\"obs.hasData || obs.loading\"\n [loading]=\"obs.loading\"\n [items]=\"obs.objects\"\n [columns]=\"obs.columns\"\n [showEditButtons]=\"true\"\n editButtonTranslationKey=\"dossier.zaakobjecten.objectType.viewObject\"\n [amountOfLoadingRows]=\"2\"\n [itemsTranslationKey]=\"'pluginManagement.tableItemsText'\"\n [showPagination]=\"false\"\n (editButtonClicked)=\"rowClicked($event)\"\n ></v-table>\n\n <v-paragraph *ngIf=\"!obs.hasData && !obs.loading\" [center]=\"true\">{{\n 'dossier.zaakobjecten.noObjectType' | translate\n }}</v-paragraph>\n</ng-container>\n\n<v-modal #viewObjectModal (closeEvent)=\"hide()\" [hideFooter]=\"true\" [maxWidthPx]=\"750\">\n <div role=\"header\">\n <v-title [margin]=\"false\" type=\"h2\" [fullWidth]=\"true\" [center]=\"true\">{{\n objectName$ | async\n }}</v-title>\n </div>\n\n <div role=\"content\">\n <valtimo-form-io\n *ngIf=\"(noFormDefinitionComponent$ | async) === false\"\n [form]=\"objectForm$ | async\"\n ></valtimo-form-io>\n <v-paragraph *ngIf=\"noFormDefinitionComponent$ | async\" [center]=\"true\">{{\n 'dossier.zaakobjecten.noFormDefinitionComponent' | translate\n }}</v-paragraph>\n </div>\n</v-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
2258
+ }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: ZaakobjectenService }, { type: i3$1.ModalService }]; }, propDecorators: { viewObjectModal: [{
2259
+ type: ViewChild,
2260
+ args: ['viewObjectModal']
2261
+ }] } });
2262
+
2263
+ /*
2264
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
2265
+ *
2266
+ * Licensed under EUPL, Version 1.2 (the "License");
2267
+ * you may not use this file except in compliance with the License.
2268
+ * You may obtain a copy of the License at
2269
+ *
2270
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2271
+ *
2272
+ * Unless required by applicable law or agreed to in writing, software
2273
+ * distributed under the License is distributed on an "AS IS" basis,
2274
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2275
+ * See the License for the specific language governing permissions and
2276
+ * limitations under the License.
2277
+ */
2278
+ class DossierDetailTabFormioComponent {
2279
+ constructor(tabService, route, formService) {
2280
+ this.tabService = tabService;
2281
+ this.route = route;
2282
+ this.formService = formService;
2283
+ this.loading$ = new BehaviorSubject(true);
2284
+ this.formNotFound$ = new BehaviorSubject('');
2285
+ this.noFormSpecified$ = new BehaviorSubject(false);
2286
+ this.prefilledForm$ = combineLatest([
2287
+ this.tabService.tabs$,
2288
+ this.route.params,
2289
+ ]).pipe(switchMap(([tabs, params]) => {
2290
+ const currentTabName = params?.tab;
2291
+ const documentId = params?.documentId;
2292
+ const currentTab = tabs.find(tab => tab.name === currentTabName);
2293
+ if (!documentId || !currentTab?.contentKey) {
2294
+ this.noFormSpecified$.next(true);
2295
+ return of(null);
2296
+ }
2297
+ this._formDefinitionName = currentTab.contentKey;
2298
+ return this.formService.getFormDefinitionByNamePreFilled(currentTab.contentKey, documentId);
2299
+ }), tap(() => this.loading$.next(false)), catchError(() => {
2300
+ this.formNotFound$.next(this._formDefinitionName);
2301
+ this.loading$.next(false);
2302
+ return of(null);
2303
+ }));
2304
+ }
2305
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabFormioComponent, deps: [{ token: DossierTabService }, { token: i1$1.ActivatedRoute }, { token: i5.FormService }], target: i0.ɵɵFactoryTarget.Component }); }
2306
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabFormioComponent, selector: "ng-component", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n prefilledForm: prefilledForm$ | async,\n loading: loading$ | async,\n formNotFound: formNotFound$ | async,\n noFormSpecified: noFormSpecified$ | async\n } as obs\"\n>\n <div *ngIf=\"obs.loading\" class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n\n <p *ngIf=\"obs.formNotFound\" class=\"error-message\">\n {{ 'dossier.formio.formNotFound' | translate: {formDefinitionName: obs.formNotFound} }}\n </p>\n\n <p *ngIf=\"obs.noFormSpecified\" class=\"error-message\">\n {{ 'dossier.formio.noFormSpecified' | translate }}\n </p>\n\n <valtimo-form-io *ngIf=\"obs.prefilledForm\" [form]=\"obs.prefilledForm\"> </valtimo-form-io>\n</ng-container>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.loading-container{display:flex;width:100%;flex-direction:row;justify-content:center}.error-message{text-align:center}\n"], dependencies: [{ kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i4.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2307
+ }
2308
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabFormioComponent, decorators: [{
2309
+ type: Component,
2310
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n prefilledForm: prefilledForm$ | async,\n loading: loading$ | async,\n formNotFound: formNotFound$ | async,\n noFormSpecified: noFormSpecified$ | async\n } as obs\"\n>\n <div *ngIf=\"obs.loading\" class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n\n <p *ngIf=\"obs.formNotFound\" class=\"error-message\">\n {{ 'dossier.formio.formNotFound' | translate: {formDefinitionName: obs.formNotFound} }}\n </p>\n\n <p *ngIf=\"obs.noFormSpecified\" class=\"error-message\">\n {{ 'dossier.formio.noFormSpecified' | translate }}\n </p>\n\n <valtimo-form-io *ngIf=\"obs.prefilledForm\" [form]=\"obs.prefilledForm\"> </valtimo-form-io>\n</ng-container>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.loading-container{display:flex;width:100%;flex-direction:row;justify-content:center}.error-message{text-align:center}\n"] }]
2311
+ }], ctorParameters: function () { return [{ type: DossierTabService }, { type: i1$1.ActivatedRoute }, { type: i5.FormService }]; } });
2312
+
2313
+ class DossierTabApiService {
2314
+ constructor(configService, http) {
2315
+ this.configService = configService;
2316
+ this.http = http;
2317
+ this.VALTIMO_API_ENDPOINT_URI = this.configService.config.valtimoApi.endpointUri;
2318
+ }
2319
+ getDossierTabs(documentDefinitionName) {
2320
+ return this.http.get(`${this.VALTIMO_API_ENDPOINT_URI}v1/case-definition/${documentDefinitionName}/tab`);
2321
+ }
2322
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierTabApiService, deps: [{ token: i1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
2323
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierTabApiService, providedIn: 'root' }); }
2324
+ }
2325
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierTabApiService, decorators: [{
2326
+ type: Injectable,
2327
+ args: [{
2328
+ providedIn: 'root',
2329
+ }]
2330
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2.HttpClient }]; } });
2331
+
2332
+ /*
2333
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
2334
+ *
2335
+ * Licensed under EUPL, Version 1.2 (the "License");
2336
+ * you may not use this file except in compliance with the License.
2337
+ * You may obtain a copy of the License at
2338
+ *
2339
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2340
+ *
2341
+ * Unless required by applicable law or agreed to in writing, software
2342
+ * distributed under the License is distributed on an "AS IS" basis,
2343
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2344
+ * See the License for the specific language governing permissions and
2345
+ * limitations under the License.
2346
+ */
2347
+ class DossierTabService {
2348
+ get tabs$() {
2349
+ return this._tabs$.pipe(filter(tabs => !!tabs));
2350
+ }
2351
+ constructor(tabMap = DEFAULT_TABS, caseTabConfig, configService, route, dossierTabApiService) {
2352
+ this.tabMap = tabMap;
2353
+ this.caseTabConfig = caseTabConfig;
2354
+ this.configService = configService;
2355
+ this.route = route;
2356
+ this.dossierTabApiService = dossierTabApiService;
2357
+ this._documentDefinitionName$ = this.route.params.pipe(map(params => params?.documentDefinitionName), filter(documentDefinitionName => !!documentDefinitionName));
2358
+ this._tabs$ = new BehaviorSubject(null);
2359
+ this._subscriptions = new Subscription();
2360
+ this._tabManagementEnabled = this.configService.config?.featureToggles?.enableTabManagement;
2361
+ this.openDocumentDefinitionNameSubscription();
2362
+ }
2363
+ ngOnDestroy() {
2364
+ this._subscriptions.unsubscribe();
2365
+ }
2366
+ getConfigurableTabs(documentDefinitionName) {
2367
+ const tabMap = new Map();
2368
+ if (this.configService?.config?.caseObjectTypes) {
2369
+ const allNamesObjects = this.configService?.config?.caseObjectTypes[documentDefinitionName];
2370
+ allNamesObjects?.forEach(name => {
2371
+ tabMap.set(name, DossierDetailTabObjectTypeComponent);
2372
+ });
2373
+ }
2374
+ return tabMap;
2375
+ }
2376
+ getAllEnvironmentTabs(extraTabs) {
2377
+ let i = 0;
2378
+ const tabMap = extraTabs
2379
+ ? new Map([...Array.from(this.tabMap.entries()), ...Array.from(extraTabs.entries())])
2380
+ : this.tabMap;
2381
+ const tabs = [];
2382
+ tabMap.forEach((component, name) => {
2383
+ tabs.push(new TabImpl(name, i, component));
2384
+ i++;
2385
+ });
2386
+ return tabs;
2387
+ }
2388
+ openDocumentDefinitionNameSubscription() {
2389
+ this._subscriptions.add(this._documentDefinitionName$.subscribe(documentDefinitionName => {
2390
+ if (this._tabManagementEnabled) {
2391
+ this.setApiTabs(documentDefinitionName);
2392
+ }
2393
+ else {
2394
+ this.setEnvironmentTabs(documentDefinitionName);
2395
+ }
2396
+ }));
2397
+ }
2398
+ setEnvironmentTabs(documentDefinitionName) {
2399
+ const configurableTabs = this.getConfigurableTabs(documentDefinitionName);
2400
+ const allEnvironmentTabs = this.getAllEnvironmentTabs(configurableTabs);
2401
+ this._tabs$.next(allEnvironmentTabs);
2402
+ }
2403
+ setApiTabs(documentDefinitionName) {
2404
+ this.dossierTabApiService.getDossierTabs(documentDefinitionName).subscribe({
2405
+ next: tabs => {
2406
+ const supportedTabs = tabs.filter(tab => this.filterTab(tab));
2407
+ const mappedTabs = supportedTabs.map((tab, index) => this.mapTab(tab, index));
2408
+ this._tabs$.next(mappedTabs.filter(tab => !!tab));
2409
+ },
2410
+ error: () => {
2411
+ this._tabs$.next([]);
2412
+ },
2413
+ });
2414
+ }
2415
+ filterTab(tab) {
2416
+ switch (tab.type) {
2417
+ case ApiTabType.STANDARD:
2418
+ return !!DEFAULT_TAB_COMPONENTS[tab.contentKey];
2419
+ case ApiTabType.CUSTOM:
2420
+ return !!(this.caseTabConfig || {})[tab.contentKey];
2421
+ default:
2422
+ return true;
2423
+ }
2424
+ }
2425
+ mapTab(tab, index) {
2426
+ switch (tab.type) {
2427
+ case ApiTabType.STANDARD:
2428
+ return new TabImpl(tab.key, index, DEFAULT_TAB_COMPONENTS[tab.contentKey], tab.contentKey, tab.name);
2429
+ case ApiTabType.FORMIO:
2430
+ return new TabImpl(tab.key, index, DossierDetailTabFormioComponent, tab.contentKey, tab.name);
2431
+ case ApiTabType.CUSTOM:
2432
+ return new TabImpl(tab.key, index, this.caseTabConfig[tab.contentKey], tab.contentKey, tab.name);
2433
+ default:
2434
+ return null;
2435
+ }
2436
+ }
2437
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierTabService, deps: [{ token: TAB_MAP }, { token: CASE_TAB_TOKEN, optional: true }, { token: i1.ConfigService }, { token: i1$1.ActivatedRoute }, { token: DossierTabApiService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2438
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierTabService }); }
2439
+ }
2440
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierTabService, decorators: [{
2441
+ type: Injectable
2442
+ }], ctorParameters: function () { return [{ type: Map, decorators: [{
2443
+ type: Inject,
2444
+ args: [TAB_MAP]
2445
+ }] }, { type: undefined, decorators: [{
2446
+ type: Optional
2447
+ }, {
2448
+ type: Inject,
2449
+ args: [CASE_TAB_TOKEN]
2450
+ }] }, { type: i1.ConfigService }, { type: i1$1.ActivatedRoute }, { type: DossierTabApiService }]; } });
2451
+
2452
+ /*
2453
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
2454
+ *
2455
+ * Licensed under EUPL, Version 1.2 (the "License");
2456
+ * you may not use this file except in compliance with the License.
2457
+ * You may obtain a copy of the License at
2458
+ *
2459
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2460
+ *
2461
+ * Unless required by applicable law or agreed to in writing, software
2462
+ * distributed under the License is distributed on an "AS IS" basis,
2463
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2464
+ * See the License for the specific language governing permissions and
2465
+ * limitations under the License.
2466
+ */
2467
+
2468
+ /*
2469
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
2470
+ *
2471
+ * Licensed under EUPL, Version 1.2 (the "License");
2472
+ * you may not use this file except in compliance with the License.
2473
+ * You may obtain a copy of the License at
2474
+ *
2475
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2476
+ *
2477
+ * Unless required by applicable law or agreed to in writing, software
2478
+ * distributed under the License is distributed on an "AS IS" basis,
2479
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2480
+ * See the License for the specific language governing permissions and
2481
+ * limitations under the License.
2482
+ */
2483
+ class DossierBulkAssignModalComponent {
2484
+ set documentIds(value) {
2485
+ if (!value.length) {
2486
+ return;
2487
+ }
2488
+ this.bulkAssignService.loadCandidateUsers(value);
2489
+ }
2490
+ constructor(bulkAssignService, fb) {
2491
+ this.bulkAssignService = bulkAssignService;
2492
+ this.fb = fb;
2493
+ this.modalClass = 'valtimo-dossier-bulk-assign-modal';
2494
+ this.open = false;
2495
+ this.closeEvent = new EventEmitter();
2496
+ this.candidateUsers$ = this.bulkAssignService.candidateUsers$.pipe(map((candidateUsers) => candidateUsers.map((candidateUser) => ({
2497
+ id: candidateUser.id,
2498
+ content: `${candidateUser.firstName} ${candidateUser.lastName}`,
2499
+ selected: this.formGroup.get('assignee')?.value?.id === candidateUser.id,
2500
+ }))));
2501
+ this.formGroup = this.fb.group({
2502
+ assignee: this.fb.control({ id: '', content: '', selected: false }, Validators.required),
2503
+ });
2504
+ }
2505
+ closeModal(confirm) {
2506
+ const assignee = this.formGroup.get('assignee')?.value ?? null;
2507
+ if (!assignee) {
2508
+ this.closeEvent.emit(null);
2509
+ return;
2510
+ }
2511
+ this.closeEvent.emit(confirm ? assignee.id : null);
2512
+ this.formGroup.reset();
2513
+ }
2514
+ trackByIndex(index) {
2515
+ return index;
2516
+ }
2517
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierBulkAssignModalComponent, deps: [{ token: DossierBulkAssignService }, { token: i5$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
2518
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierBulkAssignModalComponent, selector: "valtimo-dossier-bulk-assign-modal", inputs: { documentIds: "documentIds", open: "open" }, outputs: { closeEvent: "closeEvent" }, host: { properties: { "class": "this.modalClass" } }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal valtimoCdsModal [open]=\"open\" (close)=\"closeModal()\" showFooter=\"true\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'dossier.bulkAssign.modal.title' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <form *ngIf=\"candidateUsers$ | async as candidateUsers\" [formGroup]=\"formGroup\">\n <cds-combo-box\n formControlName=\"assignee\"\n [dropUp]=\"false\"\n [items]=\"candidateUsers\"\n [label]=\"'dossier.bulkAssign.modal.selectLabel' | translate\"\n [placeholder]=\"'dossier.bulkAssign.modal.selectPlaceholder' | translate\"\n >\n <cds-dropdown-list></cds-dropdown-list>\n </cds-combo-box>\n </form>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">{{ 'interface.cancel' | translate }}</button>\n\n <button cdsButton=\"primary\" [disabled]=\"formGroup.invalid\" (click)=\"closeModal(true)\">\n {{ 'dossier.bulkAssign.modal.confirm' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["::ng-deep .valtimo-dossier-bulk-assign-modal .cds--list-box__field{background-color:#fff}::ng-deep .valtimo-dossier-bulk-assign-modal .cds--modal-container,::ng-deep .valtimo-dossier-bulk-assign-modal .cds--modal-content{overflow:unset}\n"], dependencies: [{ kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i4.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i4.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i4.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i4.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i4.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "component", type: i4.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "component", type: i4.ComboBox, selector: "cds-combo-box, ibm-combo-box", inputs: ["placeholder", "openMenuAria", "closeMenuAria", "clearSelectionsTitle", "clearSelectionsAria", "clearSelectionTitle", "clearSelectionAria", "id", "items", "type", "size", "itemValueKey", "label", "helperText", "appendInline", "invalid", "invalidText", "warn", "warnText", "maxLength", "theme", "selectionFeedback", "autocomplete", "dropUp", "disabled"], outputs: ["selected", "submit", "close", "search", "clear"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2519
+ }
2520
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierBulkAssignModalComponent, decorators: [{
2521
+ type: Component,
2522
+ args: [{ selector: 'valtimo-dossier-bulk-assign-modal', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal valtimoCdsModal [open]=\"open\" (close)=\"closeModal()\" showFooter=\"true\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'dossier.bulkAssign.modal.title' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <form *ngIf=\"candidateUsers$ | async as candidateUsers\" [formGroup]=\"formGroup\">\n <cds-combo-box\n formControlName=\"assignee\"\n [dropUp]=\"false\"\n [items]=\"candidateUsers\"\n [label]=\"'dossier.bulkAssign.modal.selectLabel' | translate\"\n [placeholder]=\"'dossier.bulkAssign.modal.selectPlaceholder' | translate\"\n >\n <cds-dropdown-list></cds-dropdown-list>\n </cds-combo-box>\n </form>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">{{ 'interface.cancel' | translate }}</button>\n\n <button cdsButton=\"primary\" [disabled]=\"formGroup.invalid\" (click)=\"closeModal(true)\">\n {{ 'dossier.bulkAssign.modal.confirm' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["::ng-deep .valtimo-dossier-bulk-assign-modal .cds--list-box__field{background-color:#fff}::ng-deep .valtimo-dossier-bulk-assign-modal .cds--modal-container,::ng-deep .valtimo-dossier-bulk-assign-modal .cds--modal-content{overflow:unset}\n"] }]
2523
+ }], ctorParameters: function () { return [{ type: DossierBulkAssignService }, { type: i5$2.FormBuilder }]; }, propDecorators: { modalClass: [{
2524
+ type: HostBinding,
2525
+ args: ['class']
2526
+ }], documentIds: [{
2527
+ type: Input
2528
+ }], open: [{
2529
+ type: Input
2530
+ }], closeEvent: [{
2531
+ type: Output
2532
+ }] } });
2533
+
2534
+ /*
2535
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
2536
+ *
2537
+ * Licensed under EUPL, Version 1.2 (the "License");
2538
+ * you may not use this file except in compliance with the License.
2539
+ * You may obtain a copy of the License at
2540
+ *
2541
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2542
+ *
2543
+ * Unless required by applicable law or agreed to in writing, software
2544
+ * distributed under the License is distributed on an "AS IS" basis,
2545
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2546
+ * See the License for the specific language governing permissions and
2547
+ * limitations under the License.
2548
+ */
2549
+ class DossierSupportingProcessStartModalComponent {
2550
+ constructor(route, router, processService, processLinkService, documentService, formFlowService, logger, userProviderService) {
2551
+ this.route = route;
2552
+ this.router = router;
2553
+ this.processService = processService;
2554
+ this.processLinkService = processLinkService;
2555
+ this.documentService = documentService;
2556
+ this.formFlowService = formFlowService;
2557
+ this.logger = logger;
2558
+ this.userProviderService = userProviderService;
2559
+ this.isAdmin$ = this.userProviderService
2560
+ .getUserSubject()
2561
+ .pipe(map$1(userIdentity => userIdentity?.roles?.includes('ROLE_ADMIN')));
2562
+ this.formSubmit = new EventEmitter();
2563
+ }
2564
+ loadProcessLink() {
2565
+ this.processLinkId = null;
2566
+ this.formDefinition = null;
2567
+ this.formFlowInstanceId = null;
2568
+ this.processService
2569
+ .getProcessDefinitionStartProcessLink(this.processDefinitionId, this.documentId, null)
2570
+ .pipe(take$1(1))
2571
+ .subscribe(startProcessResult => {
2572
+ if (startProcessResult) {
2573
+ switch (startProcessResult.type) {
2574
+ case 'form':
2575
+ this.formDefinition = startProcessResult.properties.prefilledForm;
2576
+ this.processLinkId = startProcessResult.processLinkId;
2577
+ break;
2578
+ case 'form-flow':
2579
+ this.formFlowInstanceId = startProcessResult.properties.formFlowInstanceId;
2580
+ break;
2581
+ }
2582
+ }
2583
+ this.modal.show();
2584
+ });
2585
+ }
2586
+ openModal(processDocumentDefinition, documentId) {
2587
+ this.documentId = documentId;
2588
+ this.documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
2589
+ this.processDefinitionKey = processDocumentDefinition.id.processDefinitionKey;
2590
+ this.processDefinitionId = processDocumentDefinition.latestVersionId;
2591
+ this.processName = processDocumentDefinition.processName;
2592
+ this.options = new FormioOptionsImpl();
2593
+ this.options.disableAlerts = true;
2594
+ const formioBeforeSubmit = function (submission, callback) {
2595
+ callback(null, submission);
2596
+ };
2597
+ this.options.setHooks(formioBeforeSubmit);
2598
+ this.loadProcessLink();
2599
+ }
2600
+ onSubmit(submission) {
2601
+ this.formioSubmission = submission;
2602
+ this.processLinkService
2603
+ .submitForm(this.processLinkId, submission.data, this.documentId)
2604
+ .subscribe({
2605
+ next: (formSubmissionResult) => {
2606
+ this.formSubmitted();
2607
+ },
2608
+ error: errors => {
2609
+ this.form.showErrors(errors);
2610
+ },
2611
+ });
2612
+ }
2613
+ formSubmitted() {
2614
+ this.modal.hide();
2615
+ this.formSubmit.emit();
2616
+ }
2617
+ gotoProcessLinkScreen() {
2618
+ this.modal.hide();
2619
+ this.router.navigate(['process-links'], { queryParams: { process: this.processDefinitionKey } });
2620
+ }
2621
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierSupportingProcessStartModalComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i1$1.Router }, { token: i2$2.ProcessService }, { token: i3$4.ProcessLinkService }, { token: i2$1.DocumentService }, { token: i3$4.FormFlowService }, { token: i6$1.NGXLogger }, { token: i6$2.UserProviderService }], target: i0.ɵɵFactoryTarget.Component }); }
2622
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierSupportingProcessStartModalComponent, selector: "valtimo-dossier-supporting-process-start-modal", outputs: { formSubmit: "formSubmit" }, viewQueries: [{ propertyName: "form", first: true, predicate: ["form"], descendants: true }, { propertyName: "modal", first: true, predicate: ["supportingProcessStartModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #supportingProcessStartModal\n elementId=\"supportingProcessStartModal\"\n [title]=\"\n (processDefinitionKey | translate) !== processDefinitionKey\n ? (processDefinitionKey | translate)\n : processName\n \"\n>\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io\n #form\n [submission]=\"submission\"\n [form]=\"formDefinition\"\n [options]=\"options\"\n (submit)=\"onSubmit($event)\"\n >\n </valtimo-form-io>\n </div>\n <div body *ngIf=\"formFlowInstanceId\">\n <valtimo-form-flow\n #formFlow\n [formFlowInstanceId]=\"formFlowInstanceId\"\n (formFlowComplete)=\"formSubmitted()\"\n ></valtimo-form-flow>\n </div>\n <div body *ngIf=\"!formDefinition && !formFlowInstanceId\">\n <div class=\"bg-warning text-black mb-0 p-3 text-center\">\n {{\n (isAdmin$ | async)\n ? ('formManagement.noFormDefinitionFoundAdmin' | translate)\n : ('formManagement.noFormDefinitionFoundUser' | translate)\n }}\n </div>\n <div class=\"mb-0 mt-4 p-3 text-center\">\n <button\n (click)=\"gotoProcessLinkScreen()\"\n class=\"btn btn-secondary btn-space\"\n id=\"process-link-button\"\n type=\"button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#supportingProcessStartModal .formio-component-submit{text-align:right}\n"], dependencies: [{ kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i3$1.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "component", type: i3$4.FormFlowComponent, selector: "valtimo-form-flow", inputs: ["formIoFormData", "formFlowInstanceId"], outputs: ["formFlowComplete"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
2623
+ }
2624
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierSupportingProcessStartModalComponent, decorators: [{
2625
+ type: Component,
2626
+ args: [{ selector: 'valtimo-dossier-supporting-process-start-modal', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #supportingProcessStartModal\n elementId=\"supportingProcessStartModal\"\n [title]=\"\n (processDefinitionKey | translate) !== processDefinitionKey\n ? (processDefinitionKey | translate)\n : processName\n \"\n>\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io\n #form\n [submission]=\"submission\"\n [form]=\"formDefinition\"\n [options]=\"options\"\n (submit)=\"onSubmit($event)\"\n >\n </valtimo-form-io>\n </div>\n <div body *ngIf=\"formFlowInstanceId\">\n <valtimo-form-flow\n #formFlow\n [formFlowInstanceId]=\"formFlowInstanceId\"\n (formFlowComplete)=\"formSubmitted()\"\n ></valtimo-form-flow>\n </div>\n <div body *ngIf=\"!formDefinition && !formFlowInstanceId\">\n <div class=\"bg-warning text-black mb-0 p-3 text-center\">\n {{\n (isAdmin$ | async)\n ? ('formManagement.noFormDefinitionFoundAdmin' | translate)\n : ('formManagement.noFormDefinitionFoundUser' | translate)\n }}\n </div>\n <div class=\"mb-0 mt-4 p-3 text-center\">\n <button\n (click)=\"gotoProcessLinkScreen()\"\n class=\"btn btn-secondary btn-space\"\n id=\"process-link-button\"\n type=\"button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#supportingProcessStartModal .formio-component-submit{text-align:right}\n"] }]
2627
+ }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: i2$2.ProcessService }, { type: i3$4.ProcessLinkService }, { type: i2$1.DocumentService }, { type: i3$4.FormFlowService }, { type: i6$1.NGXLogger }, { type: i6$2.UserProviderService }]; }, propDecorators: { form: [{
2628
+ type: ViewChild,
2629
+ args: ['form', { static: false }]
2630
+ }], modal: [{
2631
+ type: ViewChild,
2632
+ args: ['supportingProcessStartModal', { static: false }]
2633
+ }], formSubmit: [{
2634
+ type: Output
2635
+ }] } });
2636
+
2637
+ /*
2638
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
2639
+ *
2640
+ * Licensed under EUPL, Version 1.2 (the "License");
2641
+ * you may not use this file except in compliance with the License.
2642
+ * You may obtain a copy of the License at
2643
+ *
2644
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2645
+ *
2646
+ * Unless required by applicable law or agreed to in writing, software
2647
+ * distributed under the License is distributed on an "AS IS" basis,
2648
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2649
+ * See the License for the specific language governing permissions and
2650
+ * limitations under the License.
2651
+ */
2652
+ class DossierAssignUserComponent {
2653
+ set documentId(value) {
2654
+ this.documentId$.next(value);
2655
+ }
2656
+ set assigneeId(value) {
2657
+ this.assigneeId$.next(value);
2658
+ }
2659
+ set assigneeFullName(value) {
2660
+ this.assigneeFullName$.next(value);
2661
+ }
2662
+ constructor(documentService) {
2663
+ this.documentService = documentService;
2664
+ this.hasPermission = true;
2665
+ this.assignmentOfDocumentChanged = new EventEmitter();
2666
+ this.disabled$ = new BehaviorSubject(true);
2667
+ this.documentId$ = new BehaviorSubject('');
2668
+ this.userItems$ = this.documentId$.pipe(filter(documentId => !!documentId), switchMap(documentId => this.hasPermission ? this.documentService.getCandidateUsers(documentId) : of([])), map(candidateUsers => this.mapUsersForDropdown(candidateUsers)), tap$1(() => this.enable()));
2669
+ this.assigneeId$ = new BehaviorSubject('');
2670
+ this.assigneeFullName$ = new BehaviorSubject('');
2671
+ }
2672
+ assignDocument(userId) {
2673
+ this.disable();
2674
+ this.documentId$
2675
+ .pipe(switchMap(documentId => this.documentService.assignHandlerToDocument(documentId, userId)))
2676
+ .subscribe(() => {
2677
+ this.emitChange();
2678
+ this.enable();
2679
+ });
2680
+ }
2681
+ unassignDocument() {
2682
+ this.disable();
2683
+ this.documentId$
2684
+ .pipe(switchMap(documentId => this.documentService.unassignHandlerFromDocument(documentId)))
2685
+ .subscribe(() => {
2686
+ this.emitChange();
2687
+ this.enable();
2688
+ });
2689
+ }
2690
+ mapUsersForDropdown(users) {
2691
+ return users
2692
+ .sort((a, b) => {
2693
+ if (a.lastName && b.lastName) {
2694
+ return a.lastName.localeCompare(b.lastName);
2695
+ }
2696
+ return 0;
2697
+ })
2698
+ .map(user => ({ text: user.label, id: user.id }));
2699
+ }
2700
+ emitChange() {
2701
+ this.assignmentOfDocumentChanged.emit();
2702
+ }
2703
+ enable() {
2704
+ this.disabled$.next(false);
2705
+ }
2706
+ disable() {
2707
+ this.disabled$.next(true);
2708
+ }
2709
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierAssignUserComponent, deps: [{ token: i2$1.DocumentService }], target: i0.ɵɵFactoryTarget.Component }); }
2710
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierAssignUserComponent, selector: "valtimo-dossier-assign-user", inputs: { documentId: "documentId", assigneeId: "assigneeId", assigneeFullName: "assigneeFullName", hasPermission: "hasPermission" }, outputs: { assignmentOfDocumentChanged: "assignmentOfDocumentChanged" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-12 pl-0 d-flex flex-row align-items-center\">\n <ng-container *ngTemplateOutlet=\"content\"> </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #content>\n <ng-container\n *ngIf=\"{\n disabled: disabled$ | async,\n assigneeFullName: assigneeFullName$ | async,\n assigneeId: assigneeId$ | async\n } as obs\"\n >\n <ng-container *ngIf=\"!hasPermission && obs.assigneeFullName\">\n <ng-container *ngTemplateOutlet=\"fullName; context: {obs: obs}\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"hasPermission\">\n <ng-container *ngTemplateOutlet=\"selectUser; context: {obs: obs}\"></ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #fullName let-obs=\"obs\">\n <valtimo-searchable-dropdown-select\n [buttonText]=\"'assignDocument.header' | translate\"\n [clearSelectionButtonTitle]=\"'assignDocument.remove' | translate\"\n [hasPermission]=\"false\"\n [hasSelection]=\"true\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [selectedTextValue]=\"obs.assigneeFullName\"\n [selectedText]=\"'assignDocument.assignedTo' | translate\"\n [style]=\"'underlinedText'\"\n [width]=\"250\"\n class=\"dossier-candidates-dropdown\"\n >\n </valtimo-searchable-dropdown-select>\n</ng-template>\n\n<ng-template #selectUser let-obs=\"obs\">\n <ng-container *ngIf=\"userItems$ | async as userItems; else loadingUsers\">\n <valtimo-searchable-dropdown-select\n [buttonText]=\"'assignDocument.header' | translate\"\n [clearSelectionButtonTitle]=\"'assignDocument.remove' | translate\"\n [disabled]=\"obs.disabled\"\n [hasPermission]=\"hasPermission\"\n [hasSelection]=\"obs.assigneeId\"\n [items]=\"userItems\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [selectedTextValue]=\"obs.assigneeFullName\"\n [selectedText]=\"'assignDocument.assignedTo' | translate\"\n [style]=\"'underlinedText'\"\n [width]=\"250\"\n (clearSelection)=\"unassignDocument()\"\n (itemSelected)=\"assignDocument($event)\"\n class=\"dossier-candidates-dropdown\"\n >\n </valtimo-searchable-dropdown-select>\n </ng-container>\n</ng-template>\n\n<ng-template #loadingUsers>\n <h5>\n <b>{{ 'assignDocument.fetchingUsers' | translate }}</b>\n </h5>\n</ng-template>\n", styles: [".container-fluid{color:#959595}valtimo-searchable-dropdown-select{font-size:13px}:host .dossier-candidates-dropdown h5{margin-block:0}\n"], dependencies: [{ kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$1.SearchableDropdownSelectComponent, selector: "valtimo-searchable-dropdown-select", inputs: ["style", "items", "buttonText", "searchText", "noResultsText", "disabled", "selectedText", "selectedTextValue", "clearSelectionButtonTitle", "hasSelection", "width", "hasPermission"], outputs: ["itemSelected", "clearSelection"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
2711
+ }
2712
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierAssignUserComponent, decorators: [{
2713
+ type: Component,
2714
+ args: [{ selector: 'valtimo-dossier-assign-user', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-12 pl-0 d-flex flex-row align-items-center\">\n <ng-container *ngTemplateOutlet=\"content\"> </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #content>\n <ng-container\n *ngIf=\"{\n disabled: disabled$ | async,\n assigneeFullName: assigneeFullName$ | async,\n assigneeId: assigneeId$ | async\n } as obs\"\n >\n <ng-container *ngIf=\"!hasPermission && obs.assigneeFullName\">\n <ng-container *ngTemplateOutlet=\"fullName; context: {obs: obs}\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"hasPermission\">\n <ng-container *ngTemplateOutlet=\"selectUser; context: {obs: obs}\"></ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #fullName let-obs=\"obs\">\n <valtimo-searchable-dropdown-select\n [buttonText]=\"'assignDocument.header' | translate\"\n [clearSelectionButtonTitle]=\"'assignDocument.remove' | translate\"\n [hasPermission]=\"false\"\n [hasSelection]=\"true\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [selectedTextValue]=\"obs.assigneeFullName\"\n [selectedText]=\"'assignDocument.assignedTo' | translate\"\n [style]=\"'underlinedText'\"\n [width]=\"250\"\n class=\"dossier-candidates-dropdown\"\n >\n </valtimo-searchable-dropdown-select>\n</ng-template>\n\n<ng-template #selectUser let-obs=\"obs\">\n <ng-container *ngIf=\"userItems$ | async as userItems; else loadingUsers\">\n <valtimo-searchable-dropdown-select\n [buttonText]=\"'assignDocument.header' | translate\"\n [clearSelectionButtonTitle]=\"'assignDocument.remove' | translate\"\n [disabled]=\"obs.disabled\"\n [hasPermission]=\"hasPermission\"\n [hasSelection]=\"obs.assigneeId\"\n [items]=\"userItems\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [selectedTextValue]=\"obs.assigneeFullName\"\n [selectedText]=\"'assignDocument.assignedTo' | translate\"\n [style]=\"'underlinedText'\"\n [width]=\"250\"\n (clearSelection)=\"unassignDocument()\"\n (itemSelected)=\"assignDocument($event)\"\n class=\"dossier-candidates-dropdown\"\n >\n </valtimo-searchable-dropdown-select>\n </ng-container>\n</ng-template>\n\n<ng-template #loadingUsers>\n <h5>\n <b>{{ 'assignDocument.fetchingUsers' | translate }}</b>\n </h5>\n</ng-template>\n", styles: [".container-fluid{color:#959595}valtimo-searchable-dropdown-select{font-size:13px}:host .dossier-candidates-dropdown h5{margin-block:0}\n"] }]
2715
+ }], ctorParameters: function () { return [{ type: i2$1.DocumentService }]; }, propDecorators: { documentId: [{
2716
+ type: Input
2717
+ }], assigneeId: [{
2718
+ type: Input
2719
+ }], assigneeFullName: [{
2720
+ type: Input
2721
+ }], hasPermission: [{
2722
+ type: Input
2723
+ }], assignmentOfDocumentChanged: [{
2724
+ type: Output
2725
+ }] } });
2726
+
2727
+ /*
2728
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
2729
+ *
2730
+ * Licensed under EUPL, Version 1.2 (the "License");
2731
+ * you may not use this file except in compliance with the License.
2732
+ * You may obtain a copy of the License at
2733
+ *
2734
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2735
+ *
2736
+ * Unless required by applicable law or agreed to in writing, software
2737
+ * distributed under the License is distributed on an "AS IS" basis,
2738
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2739
+ * See the License for the specific language governing permissions and
2740
+ * limitations under the License.
2741
+ */
2742
+ class TabTranslatePipe {
2743
+ constructor(translateService) {
2744
+ this.translateService = translateService;
2745
+ }
2746
+ transform(tab) {
2747
+ const translationId = 'dossier.tabs.' + tab.name;
2748
+ return tab.title
2749
+ ? of(tab.title)
2750
+ : this.translateService
2751
+ .stream(translationId)
2752
+ .pipe(map(translation => (translationId !== translation ? translation : tab.name)));
2753
+ }
2754
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabTranslatePipe, deps: [{ token: i6.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe }); }
2755
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TabTranslatePipe, name: "tabTranslate" }); }
2756
+ }
2757
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabTranslatePipe, decorators: [{
2758
+ type: Pipe,
2759
+ args: [{
2760
+ name: 'tabTranslate',
2761
+ }]
2762
+ }], ctorParameters: function () { return [{ type: i6.TranslateService }]; } });
2763
+
2764
+ class DossierDetailComponent {
2765
+ constructor(breadcrumbService, componentFactoryResolver, configService, documentService, keyCloakService, location, logger, permissionService, route, router, dossierTabService, dossierService) {
2766
+ this.breadcrumbService = breadcrumbService;
2767
+ this.componentFactoryResolver = componentFactoryResolver;
2768
+ this.configService = configService;
2769
+ this.documentService = documentService;
2770
+ this.keyCloakService = keyCloakService;
2771
+ this.location = location;
2772
+ this.logger = logger;
2773
+ this.permissionService = permissionService;
2774
+ this.route = route;
2775
+ this.router = router;
2776
+ this.dossierTabService = dossierTabService;
2777
+ this.dossierService = dossierService;
2778
+ this.customDossierHeaderItems = [];
2779
+ this.document = null;
2780
+ this.processDefinitionListFields = [];
2781
+ this.processDocumentDefinitions = [];
2782
+ this.tabLoader = null;
2783
+ this.assigneeId$ = new BehaviorSubject('');
2784
+ this.document$ = this.dossierService.refreshDocument$.pipe(switchMap(() => this.route.params), map((params) => params?.documentId), switchMap((documentId) => documentId ? this.documentService.getDocument(this.documentId) : of(null)), tap((document) => {
2785
+ if (document) {
2786
+ this.assigneeId$.next(document.assigneeId);
2787
+ this.document = document;
2788
+ if (this.configService.config.customDossierHeader?.hasOwnProperty(this.documentDefinitionName.toLowerCase()) &&
2789
+ this.customDossierHeaderItems.length === 0) {
2790
+ this.configService.config.customDossierHeader[this.documentDefinitionName.toLowerCase()]?.forEach(item => this.getCustomDossierHeaderItem(item));
2791
+ }
2792
+ }
2793
+ }));
2794
+ this.documentDefinitionName$ = this.route.params.pipe(map(params => params.documentDefinitionName || ''));
2795
+ this.userId$ = from(this.keyCloakService.isLoggedIn()).pipe(switchMap(() => this.keyCloakService.loadUserProfile()), map(profile => profile?.id));
2796
+ this.isAssigning$ = new BehaviorSubject(false);
2797
+ this.isAssignedToCurrentUser$ = combineLatest([
2798
+ this.assigneeId$,
2799
+ this.userId$,
2800
+ ]).pipe(map(([assigneeId, userId]) => !!assigneeId && !!userId && assigneeId === userId), startWith(true));
2801
+ this.canHaveAssignee$ = this.documentDefinitionName$.pipe(switchMap(documentDefinitionName => this.documentService.getCaseSettings(documentDefinitionName)), map(caseSettings => caseSettings?.canHaveAssignee));
2802
+ this.canAssignLoaded$ = new BehaviorSubject(false);
2803
+ this.canAssign$ = this.route.paramMap.pipe(switchMap((params) => this.permissionService.requestPermission(CAN_ASSIGN_CASE_PERMISSION, {
2804
+ resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
2805
+ identifier: params.get('documentId') ?? '',
2806
+ })), tap(() => {
2807
+ this.canAssignLoaded$.next(true);
2808
+ }));
2809
+ this.canClaim$ = this.route.paramMap.pipe(switchMap((params) => this.permissionService.requestPermission(CAN_CLAIM_CASE_PERMISSION, {
2810
+ resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
2811
+ identifier: params.get('documentId') ?? '',
2812
+ })));
2813
+ this.loadingTabs$ = new BehaviorSubject(true);
2814
+ this.noTabsConfigured$ = new BehaviorSubject(false);
2815
+ this._snapshot = this.route.snapshot.paramMap;
2816
+ this.documentDefinitionName = this._snapshot.get('documentDefinitionName') || '';
2817
+ this.documentId = this._snapshot.get('documentId') || '';
2818
+ }
2819
+ ngAfterViewInit() {
2820
+ this.initTabLoader();
2821
+ this.initBreadcrumb();
2822
+ this.getAllAssociatedProcessDefinitions();
2823
+ }
2824
+ ngOnDestroy() {
2825
+ this.breadcrumbService.clearSecondBreadcrumb();
2826
+ }
2827
+ getAllAssociatedProcessDefinitions() {
2828
+ this.documentService
2829
+ .findProcessDocumentDefinitions(this.documentDefinitionName)
2830
+ .subscribe((processDocumentDefinitions) => {
2831
+ this.processDocumentDefinitions = processDocumentDefinitions.filter(processDocumentDefinition => processDocumentDefinition.startableByUser);
2832
+ this.processDefinitionListFields = [
2833
+ {
2834
+ key: 'processName',
2835
+ label: 'Proces',
2836
+ },
2837
+ ];
2838
+ });
2839
+ }
2840
+ startProcess(processDocumentDefinition) {
2841
+ this.supportingProcessStart.openModal(processDocumentDefinition, this.documentId);
2842
+ }
2843
+ claimAssignee() {
2844
+ this.isAssigning$.next(true);
2845
+ this.userId$
2846
+ .pipe(take(1), switchMap((userId) => this.documentService.assignHandlerToDocument(this.documentId, userId ?? '')))
2847
+ .subscribe({
2848
+ next: () => {
2849
+ this.isAssigning$.next(false);
2850
+ this.dossierService.refresh();
2851
+ },
2852
+ error: () => {
2853
+ this.isAssigning$.next(false);
2854
+ this.logger.debug('Something went wrong while assigning user to case');
2855
+ },
2856
+ });
2857
+ }
2858
+ initBreadcrumb() {
2859
+ this.documentService
2860
+ .getDocumentDefinition(this.documentDefinitionName)
2861
+ .subscribe(definition => {
2862
+ this.documentDefinitionNameTitle = definition.schema.title;
2863
+ this.setBreadcrumb();
2864
+ });
2865
+ }
2866
+ initTabLoader() {
2867
+ this.dossierTabService.tabs$.pipe(take(1)).subscribe(tabs => {
2868
+ if (tabs?.length > 0) {
2869
+ this._initialTabName = this._snapshot.get('tab') ?? '';
2870
+ this.tabLoader = new TabLoaderImpl(tabs, this.componentFactoryResolver, this.viewContainerRef, this.router, this.route);
2871
+ this.tabLoader.initial(this._initialTabName);
2872
+ this.loadingTabs$.next(false);
2873
+ }
2874
+ else {
2875
+ this.noTabsConfigured$.next(true);
2876
+ this.loadingTabs$.next(false);
2877
+ }
2878
+ });
2879
+ }
2880
+ assignmentOfDocumentChanged() {
2881
+ this.dossierService.refresh();
2882
+ }
2883
+ getCustomDossierHeaderItem(item) {
2884
+ this.customDossierHeaderItems.push({
2885
+ label: item['labelTranslationKey'] || '',
2886
+ columnSize: item['columnSize'] || 3,
2887
+ textSize: item['textSize'] || 'md',
2888
+ customClass: item['customClass'] || '',
2889
+ modifier: item['modifier'] || '',
2890
+ value: item['propertyPaths']?.reduce((prev, curr) => prev + this.getStringFromDocumentPath(item, curr), ''),
2891
+ });
2892
+ }
2893
+ getStringFromDocumentPath(item, path) {
2894
+ const prefix = item['propertyPaths'].indexOf(path) > 0 ? ' ' : '';
2895
+ let string = path.split('.').reduce((o, i) => o[i], this.document?.content) || item['noValueText'] || '';
2896
+ const dateFormats = [moment.ISO_8601, 'MM-DD-YYYY', 'DD-MM-YYYY', 'YYYY-MM-DD'];
2897
+ switch (item['modifier']) {
2898
+ case 'age': {
2899
+ if (moment(string, dateFormats, true).isValid()) {
2900
+ string = moment().diff(string, 'years');
2901
+ }
2902
+ break;
2903
+ }
2904
+ default: {
2905
+ if (moment(string, dateFormats, true).isValid()) {
2906
+ string = moment(string).format('DD-MM-YYYY');
2907
+ }
2908
+ }
2909
+ }
2910
+ return prefix + string;
2911
+ }
2912
+ setBreadcrumb() {
2913
+ this.breadcrumbService.setSecondBreadcrumb({
2914
+ route: [`/dossiers/${this.documentDefinitionName}`],
2915
+ content: this.documentDefinitionNameTitle,
2916
+ href: `/dossiers/${this.documentDefinitionName}`,
2917
+ });
2918
+ }
2919
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailComponent, deps: [{ token: i3$1.BreadcrumbService }, { token: i0.ComponentFactoryResolver }, { token: i1.ConfigService }, { token: i2$1.DocumentService }, { token: i4$2.KeycloakService }, { token: i5$1.Location }, { token: i6$1.NGXLogger }, { token: i7.PermissionService }, { token: i1$1.ActivatedRoute }, { token: i1$1.Router }, { token: DossierTabService }, { token: DossierService }], target: i0.ɵɵFactoryTarget.Component }); }
2920
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailComponent, selector: "valtimo-dossier-detail", providers: [DossierTabService], viewQueries: [{ propertyName: "supportingProcessStart", first: true, predicate: ["supportingProcessStartModal"], descendants: true }, { propertyName: "viewContainerRef", first: true, predicate: ["tabContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<div\n *ngIf=\"{\n canAssign: canAssign$ | async,\n canClaim: canClaim$ | async,\n canHaveAssignee: canHaveAssignee$ | async,\n document: document$ | async\n } as obs\"\n class=\"main-content\"\n>\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div class=\"card-header bg-light card-header-divider pb-2\">\n <div class=\"row\">\n <div class=\"col\">\n <ng-container\n *ngTemplateOutlet=\"\n caseDetailHeader;\n context: {\n canHaveAssignee: obs.canHaveAssignee,\n document: obs.document,\n canAssign: obs.canAssign\n }\n \"\n ></ng-container>\n </div>\n\n <div class=\"btn-group mt-m3px mb-3 col-auto\">\n <valtimo-extension\n module=\"dossier\"\n page=\"dossier-detail\"\n section=\"card-header\"\n ></valtimo-extension>\n\n <ng-container\n *ngTemplateOutlet=\"\n claimButton;\n context: {canClaim: obs.canClaim, canHaveAssignee: obs.canHaveAssignee}\n \"\n ></ng-container>\n\n <div class=\"dropdown\">\n <button\n [disabled]=\"processDocumentDefinitions.length === 0\"\n [ngbTooltip]=\"processDocumentDefinitions.length === 0 ? 'No action' : null\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n class=\"btn btn-primary dropdown-toggle\"\n data-toggle=\"dropdown\"\n id=\"startProcessDropdown\"\n placement=\"bottom\"\n type=\"button\"\n >\n <span>{{ 'dossier.startSubProcess' | translate }}</span>\n\n <i class=\"ml-1 mdi mdi-chevron-down\"></i>\n </button>\n\n <div\n aria-labelledby=\"startProcessDropdown\"\n class=\"dropdown-menu dropdown-menu-right\"\n >\n <button\n *ngFor=\"let processDocumentDefinition of processDocumentDefinitions\"\n (click)=\"startProcess(processDocumentDefinition)\"\n class=\"dropdown-item p\"\n href=\"#\"\n >\n {{\n (processDocumentDefinition?.id?.processDefinitionKey | translate) !==\n processDocumentDefinition?.id?.processDefinitionKey\n ? (processDocumentDefinition.id.processDefinitionKey | translate)\n : processDocumentDefinition.processName\n }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <ul *ngIf=\"tabLoader\" class=\"nav nav-tabs\">\n <li class=\"nav-item\" *ngFor=\"let tab of tabLoader.tabs\">\n <a\n [ngClass]=\"{active: tab.isActive()}\"\n (click)=\"tabLoader.load(tab)\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n id=\"{{ tab.name }}-tab\"\n >\n {{ tab | tabTranslate | async }}\n </a>\n </li>\n </ul>\n\n <div class=\"card-body bg-white p-5 position-relative tab-container\">\n <div *ngIf=\"loadingTabs$ | async\" class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n\n <valtimo-no-results\n *ngIf=\"noTabsConfigured$ | async\"\n [description]=\"'dossier.tabs.noResultsDescription' | translate\"\n [title]=\"'dossier.tabs.noResults' | translate\"\n ></valtimo-no-results>\n\n <ng-template #tabContainer></ng-template>\n\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </div>\n\n <valtimo-dossier-supporting-process-start-modal\n (formSubmit)=\"tabLoader.refreshView()\"\n #supportingProcessStartModal\n ></valtimo-dossier-supporting-process-start-modal>\n </div>\n</div>\n\n<ng-template\n #caseDetailHeader\n let-canHaveAssignee=\"canHaveAssignee\"\n let-document=\"document\"\n let-canAssign=\"canAssign\"\n>\n <div class=\"row\" *ngIf=\"customDossierHeaderItems.length > 0; else defaultTitle\">\n <span\n *ngFor=\"let item of customDossierHeaderItems\"\n [ngClass]=\"{\n h1: item.textSize === 'xl',\n h2: item.textSize === 'lg',\n h3: item.textSize === 'md',\n h4: item.textSize === 'sm',\n h5: item.textSize === 'xs'\n }\"\n class=\"mb-0 mt-0 pb-2 align-self-end col-xl-{{ item.columnSize }} col-lg-{{\n item.columnSize * 2\n }} {{ item.customClass }}\"\n >\n <span *ngIf=\"item.label\">{{ item.label | translate }}</span>\n\n <span *ngIf=\"item.label && item.value\">: </span>\n\n <strong>{{ item.value }}</strong>\n </span>\n </div>\n\n <ng-container\n *ngTemplateOutlet=\"\n caseDetailAssignee;\n context: {canHaveAssignee: canHaveAssignee, document: document, canAssign: canAssign}\n \"\n ></ng-container>\n</ng-template>\n\n<ng-template #defaultTitle>\n <div class=\"row ml-0 mr-0\">{{ documentDefinitionNameTitle?.trim() }}</div>\n</ng-template>\n\n<ng-template\n #caseDetailAssignee\n let-canHaveAssignee=\"canHaveAssignee\"\n let-document=\"document\"\n let-canAssign=\"canAssign\"\n>\n <div class=\"row ml-0 mr-0 mt-1 mb-1\" *ngIf=\"canHaveAssignee && document\">\n <valtimo-dossier-assign-user\n *ngIf=\"canAssignLoaded$ | async\"\n [assigneeFullName]=\"document?.assigneeFullName\"\n [assigneeId]=\"document.assigneeId\"\n [documentId]=\"document.id\"\n [hasPermission]=\"canAssign\"\n (assignmentOfDocumentChanged)=\"assignmentOfDocumentChanged()\"\n ></valtimo-dossier-assign-user>\n </div>\n</ng-template>\n\n<ng-template #claimButton let-canClaim=\"canClaim\" let-canHaveAssignee=\"canHaveAssignee\">\n <div class=\"user-full-name\" *ngIf=\"canClaim && canHaveAssignee\">\n <button\n [disabled]=\"(isAssigning$ | async) || (isAssignedToCurrentUser$ | async)\"\n (click)=\"claimAssignee()\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n class=\"btn btn-space btn-primary mr-1\"\n placement=\"bottom\"\n type=\"button\"\n >\n <span>{{ 'dossier.claimAssigneeCase' | translate }}</span>\n </button>\n </div>\n</ng-template>\n", styles: [".tab-container{min-height:300px}.loading-container{display:flex;justify-content:center;flex-direction:row}\n"], dependencies: [{ kind: "directive", type: i5$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$1.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "directive", type: i10.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { kind: "component", type: i1.ExtensionComponent, selector: "valtimo-extension", inputs: ["module", "page", "section"] }, { kind: "component", type: i4.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "component", type: i3$1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title"] }, { kind: "component", type: DossierSupportingProcessStartModalComponent, selector: "valtimo-dossier-supporting-process-start-modal", outputs: ["formSubmit"] }, { kind: "component", type: DossierAssignUserComponent, selector: "valtimo-dossier-assign-user", inputs: ["documentId", "assigneeId", "assigneeFullName", "hasPermission"], outputs: ["assignmentOfDocumentChanged"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }, { kind: "pipe", type: TabTranslatePipe, name: "tabTranslate" }] }); }
2921
+ }
2922
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailComponent, decorators: [{
2923
+ type: Component,
2924
+ args: [{ selector: 'valtimo-dossier-detail', providers: [DossierTabService], template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<div\n *ngIf=\"{\n canAssign: canAssign$ | async,\n canClaim: canClaim$ | async,\n canHaveAssignee: canHaveAssignee$ | async,\n document: document$ | async\n } as obs\"\n class=\"main-content\"\n>\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div class=\"card-header bg-light card-header-divider pb-2\">\n <div class=\"row\">\n <div class=\"col\">\n <ng-container\n *ngTemplateOutlet=\"\n caseDetailHeader;\n context: {\n canHaveAssignee: obs.canHaveAssignee,\n document: obs.document,\n canAssign: obs.canAssign\n }\n \"\n ></ng-container>\n </div>\n\n <div class=\"btn-group mt-m3px mb-3 col-auto\">\n <valtimo-extension\n module=\"dossier\"\n page=\"dossier-detail\"\n section=\"card-header\"\n ></valtimo-extension>\n\n <ng-container\n *ngTemplateOutlet=\"\n claimButton;\n context: {canClaim: obs.canClaim, canHaveAssignee: obs.canHaveAssignee}\n \"\n ></ng-container>\n\n <div class=\"dropdown\">\n <button\n [disabled]=\"processDocumentDefinitions.length === 0\"\n [ngbTooltip]=\"processDocumentDefinitions.length === 0 ? 'No action' : null\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n class=\"btn btn-primary dropdown-toggle\"\n data-toggle=\"dropdown\"\n id=\"startProcessDropdown\"\n placement=\"bottom\"\n type=\"button\"\n >\n <span>{{ 'dossier.startSubProcess' | translate }}</span>\n\n <i class=\"ml-1 mdi mdi-chevron-down\"></i>\n </button>\n\n <div\n aria-labelledby=\"startProcessDropdown\"\n class=\"dropdown-menu dropdown-menu-right\"\n >\n <button\n *ngFor=\"let processDocumentDefinition of processDocumentDefinitions\"\n (click)=\"startProcess(processDocumentDefinition)\"\n class=\"dropdown-item p\"\n href=\"#\"\n >\n {{\n (processDocumentDefinition?.id?.processDefinitionKey | translate) !==\n processDocumentDefinition?.id?.processDefinitionKey\n ? (processDocumentDefinition.id.processDefinitionKey | translate)\n : processDocumentDefinition.processName\n }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <ul *ngIf=\"tabLoader\" class=\"nav nav-tabs\">\n <li class=\"nav-item\" *ngFor=\"let tab of tabLoader.tabs\">\n <a\n [ngClass]=\"{active: tab.isActive()}\"\n (click)=\"tabLoader.load(tab)\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n id=\"{{ tab.name }}-tab\"\n >\n {{ tab | tabTranslate | async }}\n </a>\n </li>\n </ul>\n\n <div class=\"card-body bg-white p-5 position-relative tab-container\">\n <div *ngIf=\"loadingTabs$ | async\" class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n\n <valtimo-no-results\n *ngIf=\"noTabsConfigured$ | async\"\n [description]=\"'dossier.tabs.noResultsDescription' | translate\"\n [title]=\"'dossier.tabs.noResults' | translate\"\n ></valtimo-no-results>\n\n <ng-template #tabContainer></ng-template>\n\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </div>\n\n <valtimo-dossier-supporting-process-start-modal\n (formSubmit)=\"tabLoader.refreshView()\"\n #supportingProcessStartModal\n ></valtimo-dossier-supporting-process-start-modal>\n </div>\n</div>\n\n<ng-template\n #caseDetailHeader\n let-canHaveAssignee=\"canHaveAssignee\"\n let-document=\"document\"\n let-canAssign=\"canAssign\"\n>\n <div class=\"row\" *ngIf=\"customDossierHeaderItems.length > 0; else defaultTitle\">\n <span\n *ngFor=\"let item of customDossierHeaderItems\"\n [ngClass]=\"{\n h1: item.textSize === 'xl',\n h2: item.textSize === 'lg',\n h3: item.textSize === 'md',\n h4: item.textSize === 'sm',\n h5: item.textSize === 'xs'\n }\"\n class=\"mb-0 mt-0 pb-2 align-self-end col-xl-{{ item.columnSize }} col-lg-{{\n item.columnSize * 2\n }} {{ item.customClass }}\"\n >\n <span *ngIf=\"item.label\">{{ item.label | translate }}</span>\n\n <span *ngIf=\"item.label && item.value\">: </span>\n\n <strong>{{ item.value }}</strong>\n </span>\n </div>\n\n <ng-container\n *ngTemplateOutlet=\"\n caseDetailAssignee;\n context: {canHaveAssignee: canHaveAssignee, document: document, canAssign: canAssign}\n \"\n ></ng-container>\n</ng-template>\n\n<ng-template #defaultTitle>\n <div class=\"row ml-0 mr-0\">{{ documentDefinitionNameTitle?.trim() }}</div>\n</ng-template>\n\n<ng-template\n #caseDetailAssignee\n let-canHaveAssignee=\"canHaveAssignee\"\n let-document=\"document\"\n let-canAssign=\"canAssign\"\n>\n <div class=\"row ml-0 mr-0 mt-1 mb-1\" *ngIf=\"canHaveAssignee && document\">\n <valtimo-dossier-assign-user\n *ngIf=\"canAssignLoaded$ | async\"\n [assigneeFullName]=\"document?.assigneeFullName\"\n [assigneeId]=\"document.assigneeId\"\n [documentId]=\"document.id\"\n [hasPermission]=\"canAssign\"\n (assignmentOfDocumentChanged)=\"assignmentOfDocumentChanged()\"\n ></valtimo-dossier-assign-user>\n </div>\n</ng-template>\n\n<ng-template #claimButton let-canClaim=\"canClaim\" let-canHaveAssignee=\"canHaveAssignee\">\n <div class=\"user-full-name\" *ngIf=\"canClaim && canHaveAssignee\">\n <button\n [disabled]=\"(isAssigning$ | async) || (isAssignedToCurrentUser$ | async)\"\n (click)=\"claimAssignee()\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n class=\"btn btn-space btn-primary mr-1\"\n placement=\"bottom\"\n type=\"button\"\n >\n <span>{{ 'dossier.claimAssigneeCase' | translate }}</span>\n </button>\n </div>\n</ng-template>\n", styles: [".tab-container{min-height:300px}.loading-container{display:flex;justify-content:center;flex-direction:row}\n"] }]
2925
+ }], ctorParameters: function () { return [{ type: i3$1.BreadcrumbService }, { type: i0.ComponentFactoryResolver }, { type: i1.ConfigService }, { type: i2$1.DocumentService }, { type: i4$2.KeycloakService }, { type: i5$1.Location }, { type: i6$1.NGXLogger }, { type: i7.PermissionService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: DossierTabService }, { type: DossierService }]; }, propDecorators: { supportingProcessStart: [{
2926
+ type: ViewChild,
2927
+ args: ['supportingProcessStartModal']
2928
+ }], viewContainerRef: [{
2929
+ type: ViewChild,
2930
+ args: ['tabContainer', { read: ViewContainerRef }]
2931
+ }] } });
2932
+
2933
+ /*
2934
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
2935
+ *
2936
+ * Licensed under EUPL, Version 1.2 (the "License");
2937
+ * you may not use this file except in compliance with the License.
2938
+ * You may obtain a copy of the License at
2939
+ *
2940
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2941
+ *
2942
+ * Unless required by applicable law or agreed to in writing, software
2943
+ * distributed under the License is distributed on an "AS IS" basis,
2944
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2945
+ * See the License for the specific language governing permissions and
2946
+ * limitations under the License.
2947
+ */
2948
+ class DossierProcessStartModalComponent {
2949
+ constructor(route, router, processService, documentService, processLinkService, formFlowService, userProviderService, logger) {
2950
+ this.route = route;
2951
+ this.router = router;
2952
+ this.processService = processService;
2953
+ this.documentService = documentService;
2954
+ this.processLinkService = processLinkService;
2955
+ this.formFlowService = formFlowService;
2956
+ this.userProviderService = userProviderService;
2957
+ this.logger = logger;
2958
+ this.formFlowComplete = new EventEmitter();
2959
+ }
2960
+ ngOnInit() {
2961
+ this.isUserAdmin();
2962
+ }
2963
+ loadProcessLink() {
2964
+ this.processLinkId = null;
2965
+ this.formDefinition = null;
2966
+ this.formFlowInstanceId = null;
2967
+ this.processService
2968
+ .getProcessDefinitionStartProcessLink(this.processDefinitionId, null, this.documentDefinitionName)
2969
+ .pipe(take$1(1))
2970
+ .subscribe(startProcessResult => {
2971
+ if (startProcessResult) {
2972
+ switch (startProcessResult.type) {
2973
+ case 'form':
2974
+ this.formDefinition = startProcessResult.properties.prefilledForm;
2975
+ this.processLinkId = startProcessResult.processLinkId;
2976
+ break;
2977
+ case 'form-flow':
2978
+ this.formFlowInstanceId = startProcessResult.properties.formFlowInstanceId;
2979
+ break;
2980
+ }
2981
+ }
2982
+ this.modal.show();
2983
+ });
2984
+ }
2985
+ gotoProcessLinkScreen() {
2986
+ this.modal.hide();
2987
+ this.router.navigate(['process-links'], { queryParams: { process: this.processDefinitionKey } });
2988
+ }
2989
+ get modalTitle() {
2990
+ return `Start - ${this.processName}`;
2991
+ }
2992
+ openModal(processDocumentDefinition) {
2993
+ this.processDefinitionKey = processDocumentDefinition.id.processDefinitionKey;
2994
+ this.processDefinitionId = processDocumentDefinition.latestVersionId;
2995
+ this.documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
2996
+ this.processName = processDocumentDefinition.processName;
2997
+ this.options = new FormioOptionsImpl();
2998
+ this.options.disableAlerts = true;
2999
+ const formioBeforeSubmit = function (submission, callback) {
3000
+ callback(null, submission);
3001
+ };
3002
+ this.options.setHooks(formioBeforeSubmit);
3003
+ this.loadProcessLink();
3004
+ }
3005
+ onSubmit(submission) {
3006
+ this.formioSubmission = submission;
3007
+ this.processLinkService.submitForm(this.processLinkId, submission.data).subscribe({
3008
+ next: (formSubmissionResult) => {
3009
+ this.submitCompleted(formSubmissionResult);
3010
+ },
3011
+ error: errors => {
3012
+ this.form.showErrors(errors);
3013
+ },
3014
+ });
3015
+ }
3016
+ formFlowSubmitted() {
3017
+ this.formFlowComplete.emit(null);
3018
+ this.modal.hide();
3019
+ }
3020
+ isUserAdmin() {
3021
+ this.userProviderService.getUserSubject().subscribe(userIdentity => {
3022
+ this.isAdmin = userIdentity.roles.includes('ROLE_ADMIN');
3023
+ }, error => {
3024
+ this.isAdmin = false;
3025
+ });
3026
+ }
3027
+ submitCompleted(formSubmissionResult) {
3028
+ this.modal.hide();
3029
+ this.router.navigate([
3030
+ 'dossiers',
3031
+ this.documentDefinitionName,
3032
+ 'document',
3033
+ formSubmissionResult.documentId,
3034
+ ]);
3035
+ }
3036
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierProcessStartModalComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i1$1.Router }, { token: i2$2.ProcessService }, { token: i2$1.DocumentService }, { token: i3$4.ProcessLinkService }, { token: i3$4.FormFlowService }, { token: i6$2.UserProviderService }, { token: i6$1.NGXLogger }], target: i0.ɵɵFactoryTarget.Component }); }
3037
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierProcessStartModalComponent, selector: "valtimo-dossier-process-start-modal", outputs: { formFlowComplete: "formFlowComplete" }, viewQueries: [{ propertyName: "form", first: true, predicate: ["form"], descendants: true }, { propertyName: "modal", first: true, predicate: ["processStartModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal #processStartModal elementId=\"processStartModal\" [title]=\"modalTitle\">\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io #form [form]=\"formDefinition\" [options]=\"options\" (submit)=\"onSubmit($event)\">\n </valtimo-form-io>\n </div>\n <div body *ngIf=\"formFlowInstanceId\">\n <valtimo-form-flow\n [formFlowInstanceId]=\"formFlowInstanceId\"\n (formFlowComplete)=\"formFlowSubmitted()\"\n ></valtimo-form-flow>\n </div>\n <div body *ngIf=\"!formFlowInstanceId && !formDefinition && isAdmin\">\n <div\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'formManagement.noFormDefinitionFoundAdmin'\"\n ></div>\n <div class=\"mb-0 mt-4 p-3 text-center\">\n <button\n (click)=\"gotoProcessLinkScreen()\"\n class=\"btn btn-secondary btn-space\"\n id=\"process-link-button\"\n type=\"button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | translate }}\n </button>\n </div>\n </div>\n <div body *ngIf=\"!formFlowInstanceId && !formDefinition && !isAdmin\">\n <div\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'formManagement.noFormDefinitionFoundUser'\"\n ></div>\n </div>\n</valtimo-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#processStartModal .formio-component-submit{text-align:right}\n"], dependencies: [{ kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i3$1.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "directive", type: i6.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: i3$4.FormFlowComponent, selector: "valtimo-form-flow", inputs: ["formIoFormData", "formFlowInstanceId"], outputs: ["formFlowComplete"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
3038
+ }
3039
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierProcessStartModalComponent, decorators: [{
3040
+ type: Component,
3041
+ args: [{ selector: 'valtimo-dossier-process-start-modal', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal #processStartModal elementId=\"processStartModal\" [title]=\"modalTitle\">\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io #form [form]=\"formDefinition\" [options]=\"options\" (submit)=\"onSubmit($event)\">\n </valtimo-form-io>\n </div>\n <div body *ngIf=\"formFlowInstanceId\">\n <valtimo-form-flow\n [formFlowInstanceId]=\"formFlowInstanceId\"\n (formFlowComplete)=\"formFlowSubmitted()\"\n ></valtimo-form-flow>\n </div>\n <div body *ngIf=\"!formFlowInstanceId && !formDefinition && isAdmin\">\n <div\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'formManagement.noFormDefinitionFoundAdmin'\"\n ></div>\n <div class=\"mb-0 mt-4 p-3 text-center\">\n <button\n (click)=\"gotoProcessLinkScreen()\"\n class=\"btn btn-secondary btn-space\"\n id=\"process-link-button\"\n type=\"button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | translate }}\n </button>\n </div>\n </div>\n <div body *ngIf=\"!formFlowInstanceId && !formDefinition && !isAdmin\">\n <div\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'formManagement.noFormDefinitionFoundUser'\"\n ></div>\n </div>\n</valtimo-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#processStartModal .formio-component-submit{text-align:right}\n"] }]
3042
+ }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: i2$2.ProcessService }, { type: i2$1.DocumentService }, { type: i3$4.ProcessLinkService }, { type: i3$4.FormFlowService }, { type: i6$2.UserProviderService }, { type: i6$1.NGXLogger }]; }, propDecorators: { form: [{
3043
+ type: ViewChild,
3044
+ args: ['form', { static: false }]
3045
+ }], modal: [{
3046
+ type: ViewChild,
3047
+ args: ['processStartModal', { static: false }]
3048
+ }], formFlowComplete: [{
3049
+ type: Output
3050
+ }] } });
3051
+
3052
+ /*
3053
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
3054
+ *
3055
+ * Licensed under EUPL, Version 1.2 (the "License");
3056
+ * you may not use this file except in compliance with the License.
3057
+ * You may obtain a copy of the License at
3058
+ *
3059
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3060
+ *
3061
+ * Unless required by applicable law or agreed to in writing, software
3062
+ * distributed under the License is distributed on an "AS IS" basis,
3063
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3064
+ * See the License for the specific language governing permissions and
3065
+ * limitations under the License.
3066
+ */
3067
+ class DossierListActionsComponent {
3068
+ constructor(documentService, listService) {
3069
+ this.documentService = documentService;
3070
+ this.listService = listService;
3071
+ this.formFlowComplete = new EventEmitter();
3072
+ this.associatedProcessDocumentDefinitions$ = this.listService.documentDefinitionName$.pipe(switchMap(documentDefinitionName => documentDefinitionName
3073
+ ? this.documentService.findProcessDocumentDefinitions(documentDefinitionName)
3074
+ : of([])), map(processDocumentDefinitions => processDocumentDefinitions.filter(definition => definition.canInitializeDocument)), tap(processDocumentDefinitions => {
3075
+ this._cachedAssociatedProcessDocumentDefinitions = processDocumentDefinitions;
3076
+ }));
3077
+ this.disableStartDossierButton$ = this.associatedProcessDocumentDefinitions$.pipe(map(definitions => definitions.length === 0 || this.loading));
3078
+ this.selectedProcessDocumentDefinition = null;
3079
+ this.modalListenerAdded = false;
3080
+ this._cachedAssociatedProcessDocumentDefinitions = [];
3081
+ }
3082
+ ngOnInit() {
3083
+ this.modalListenerAdded = false;
3084
+ }
3085
+ startDossier() {
3086
+ const associatedProcessDocumentDefinitions = this._cachedAssociatedProcessDocumentDefinitions;
3087
+ if (associatedProcessDocumentDefinitions.length > 1) {
3088
+ $('#startProcess').modal('show');
3089
+ }
3090
+ else {
3091
+ this.selectedProcessDocumentDefinition = associatedProcessDocumentDefinitions[0];
3092
+ this.showStartProcessModal();
3093
+ }
3094
+ }
3095
+ selectProcess(processDocumentDefinition) {
3096
+ const modal = $('#startProcess');
3097
+ if (!this.modalListenerAdded) {
3098
+ modal.on('hidden.bs.modal', this.showStartProcessModal.bind(this));
3099
+ this.modalListenerAdded = true;
3100
+ }
3101
+ this.selectedProcessDocumentDefinition = processDocumentDefinition;
3102
+ modal.modal('hide');
3103
+ }
3104
+ onFormFlowComplete() {
3105
+ this.formFlowComplete.emit(null);
3106
+ }
3107
+ showStartProcessModal() {
3108
+ if (this.selectedProcessDocumentDefinition !== null) {
3109
+ this.processStart.openModal(this.selectedProcessDocumentDefinition);
3110
+ this.selectedProcessDocumentDefinition = null;
3111
+ }
3112
+ }
3113
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListActionsComponent, deps: [{ token: i2$1.DocumentService }, { token: DossierListService }], target: i0.ɵɵFactoryTarget.Component }); }
3114
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierListActionsComponent, selector: "valtimo-dossier-list-actions", inputs: { loading: "loading" }, outputs: { formFlowComplete: "formFlowComplete" }, viewQueries: [{ propertyName: "processStart", first: true, predicate: ["processStartModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngIf=\"associatedProcessDocumentDefinitions$ | async as associatedProcessDocumentDefinitions\">\n <div\n class=\"modal fade\"\n id=\"startProcess\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-labelledby=\"startProcessLabel\"\n aria-hidden=\"true\"\n >\n <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h3 class=\"modal-title\" id=\"startProcessLabel\">\n {{ 'dashboard.startProcess.title' | translate }}\n </h3>\n\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"table-responsive\">\n <table class=\"table m-0\">\n <tr\n *ngFor=\"let processDocumentDefinition of associatedProcessDocumentDefinitions\"\n (click)=\"selectProcess(processDocumentDefinition)\"\n style=\"cursor: pointer\"\n >\n <td>{{ processDocumentDefinition.processName }}</td>\n </tr>\n </table>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">\n {{ 'cta.close' | translate }}\n </button>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<valtimo-dossier-process-start-modal\n #processStartModal\n (formFlowComplete)=\"onFormFlowComplete()\"\n></valtimo-dossier-process-start-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: DossierProcessStartModalComponent, selector: "valtimo-dossier-process-start-modal", outputs: ["formFlowComplete"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
3115
+ }
3116
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListActionsComponent, decorators: [{
3117
+ type: Component,
3118
+ args: [{ selector: 'valtimo-dossier-list-actions', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngIf=\"associatedProcessDocumentDefinitions$ | async as associatedProcessDocumentDefinitions\">\n <div\n class=\"modal fade\"\n id=\"startProcess\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-labelledby=\"startProcessLabel\"\n aria-hidden=\"true\"\n >\n <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h3 class=\"modal-title\" id=\"startProcessLabel\">\n {{ 'dashboard.startProcess.title' | translate }}\n </h3>\n\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"table-responsive\">\n <table class=\"table m-0\">\n <tr\n *ngFor=\"let processDocumentDefinition of associatedProcessDocumentDefinitions\"\n (click)=\"selectProcess(processDocumentDefinition)\"\n style=\"cursor: pointer\"\n >\n <td>{{ processDocumentDefinition.processName }}</td>\n </tr>\n </table>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">\n {{ 'cta.close' | translate }}\n </button>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<valtimo-dossier-process-start-modal\n #processStartModal\n (formFlowComplete)=\"onFormFlowComplete()\"\n></valtimo-dossier-process-start-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
3119
+ }], ctorParameters: function () { return [{ type: i2$1.DocumentService }, { type: DossierListService }]; }, propDecorators: { processStart: [{
3120
+ type: ViewChild,
3121
+ args: ['processStartModal']
3122
+ }], loading: [{
3123
+ type: Input
3124
+ }], formFlowComplete: [{
3125
+ type: Output
3126
+ }] } });
3127
+
3128
+ /*
3129
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
3130
+ *
3131
+ * Licensed under EUPL, Version 1.2 (the "License");
3132
+ * you may not use this file except in compliance with the License.
3133
+ * You may obtain a copy of the License at
3134
+ *
3135
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3136
+ *
3137
+ * Unless required by applicable law or agreed to in writing, software
3138
+ * distributed under the License is distributed on an "AS IS" basis,
3139
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3140
+ * See the License for the specific language governing permissions and
3141
+ * limitations under the License.
3142
+ */
3143
+ class DossierListComponent {
3144
+ constructor(assigneeService, breadcrumbService, bulkAssignService, columnService, configService, documentService, listService, pageTitleService, paginationService, parameterService, route, router, searchService, translateService, permissionService) {
3145
+ this.assigneeService = assigneeService;
3146
+ this.breadcrumbService = breadcrumbService;
3147
+ this.bulkAssignService = bulkAssignService;
3148
+ this.columnService = columnService;
3149
+ this.configService = configService;
3150
+ this.documentService = documentService;
3151
+ this.listService = listService;
3152
+ this.pageTitleService = pageTitleService;
3153
+ this.paginationService = paginationService;
3154
+ this.parameterService = parameterService;
3155
+ this.route = route;
3156
+ this.router = router;
3157
+ this.searchService = searchService;
3158
+ this.translateService = translateService;
3159
+ this.permissionService = permissionService;
3160
+ this.activeTab = null;
3161
+ this.loadingFields = true;
3162
+ this.loadingPagination = true;
3163
+ this.loadingSearchFields = true;
3164
+ this.loadingAssigneeFilter = true;
3165
+ this.loadingDocumentItems = true;
3166
+ this.visibleDossierTabs = null;
3167
+ this.defaultTabs = [
3168
+ DossierListTab.ALL,
3169
+ DossierListTab.MINE,
3170
+ DossierListTab.OPEN,
3171
+ ];
3172
+ this.tableTranslations = {
3173
+ select: {
3174
+ single: 'dossier.select.single',
3175
+ multiple: 'dossier.select.multiple',
3176
+ },
3177
+ pagination: {
3178
+ itemsPerPage: 'dossier.pagination.itemsPerPage',
3179
+ totalItem: 'dossier.pagination.totalItem',
3180
+ totalItems: 'dossier.pagination.totalItems',
3181
+ },
3182
+ };
3183
+ this.noResultsMessage$ = new BehaviorSubject({
3184
+ description: 'dossier.noResults.ALL.description',
3185
+ isSearchResult: false,
3186
+ title: 'dossier.noResults.ALL.title',
3187
+ });
3188
+ this.showAssignModal$ = new BehaviorSubject(false);
3189
+ this.showChangePageModal$ = new BehaviorSubject(false);
3190
+ this.showChangeTabModal$ = new BehaviorSubject(false);
3191
+ this.searchFields$ = this.searchService.documentSearchFields$.pipe(tap(() => {
3192
+ this.loadingSearchFields = false;
3193
+ }));
3194
+ this.documentDefinitionName$ = this.listService.documentDefinitionName$;
3195
+ this.canCreateDocument$ = this.documentDefinitionName$.pipe(switchMap(documentDefinitionName => this.permissionService.requestPermission(CAN_CREATE_CASE_PERMISSION, {
3196
+ resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocumentDefinition,
3197
+ identifier: documentDefinitionName,
3198
+ })));
3199
+ this.selectedDocumentIds$ = new BehaviorSubject([]);
3200
+ this.schema$ = this.listService.documentDefinitionName$.pipe(switchMap(documentDefinitionName => this.documentService.getDocumentDefinition(documentDefinitionName)), map(documentDefinition => documentDefinition?.schema), tap(schema => {
3201
+ if (schema?.title) {
3202
+ this.pageTitleService.setCustomPageTitle(schema?.title, true);
3203
+ }
3204
+ }));
3205
+ this.searchFieldValues$ = this.parameterService.searchFieldValues$;
3206
+ this.assigneeFilter$ = this.assigneeService.assigneeFilter$.pipe(tap(assigneeFilter => (this.activeTab = assigneeFilter)));
3207
+ this.paginationChange$ = new BehaviorSubject(null);
3208
+ this.tabChange$ = new BehaviorSubject(null);
3209
+ this._pagination$ = this.paginationService.pagination$.pipe(tap(pagination => {
3210
+ this.pagination = pagination;
3211
+ this.loadingPagination = false;
3212
+ }));
3213
+ this._hasEnvColumnConfig$ = this.listService.hasEnvColumnConfig$;
3214
+ this._hasApiColumnConfig$ = new BehaviorSubject(false);
3215
+ this._canHaveAssignee$ = this.assigneeService.canHaveAssignee$;
3216
+ this._columns$ = this.listService.documentDefinitionName$.pipe(switchMap(documentDefinitionName => this.columnService.getDefinitionColumns(documentDefinitionName)), map(res => {
3217
+ this._hasApiColumnConfig$.next(res.hasApiConfig);
3218
+ return res.columns;
3219
+ }), tap(columns => {
3220
+ this.listService.documentDefinitionName$.pipe(take(1)).subscribe(_ => {
3221
+ this.paginationService.setPagination(columns);
3222
+ });
3223
+ }));
3224
+ this.fields$ = combineLatest([
3225
+ this._canHaveAssignee$,
3226
+ this._columns$,
3227
+ this._hasEnvColumnConfig$,
3228
+ this._hasApiColumnConfig$,
3229
+ this.translateService.stream('key'),
3230
+ ]).pipe(tap(([canHaveAssignee]) => {
3231
+ this.canHaveAssignee = canHaveAssignee;
3232
+ }), map(([canHaveAssignee, columns, hasEnvConfig, hasApiConfig]) => {
3233
+ const filteredAssigneeColumns = this.assigneeService.filterAssigneeColumns(columns, canHaveAssignee);
3234
+ const listFields = this.columnService.mapDefinitionColumnsToListFields(filteredAssigneeColumns, hasEnvConfig, hasApiConfig);
3235
+ const fieldsToReturn = this.assigneeService.addAssigneeListField(columns, listFields, canHaveAssignee);
3236
+ return fieldsToReturn;
3237
+ }), tap(listFields => {
3238
+ const defaultListField = listFields.find(field => field.default);
3239
+ // set default sort state if no pagination query parameters for sorting are available
3240
+ this.parameterService.queryPaginationParams$
3241
+ .pipe(take(1))
3242
+ .subscribe(queryPaginationParams => {
3243
+ if (defaultListField && !queryPaginationParams?.sort?.isSorting) {
3244
+ const sortDirection = typeof defaultListField.default === 'string' ? defaultListField.default : 'DESC';
3245
+ this.paginationService.sortChanged({
3246
+ isSorting: true,
3247
+ state: { name: defaultListField.key, direction: sortDirection },
3248
+ });
3249
+ }
3250
+ });
3251
+ }), tap(() => {
3252
+ this.loadingFields = false;
3253
+ }));
3254
+ this._documentSearchRequest$ = combineLatest([this._pagination$, this.listService.documentDefinitionName$]).pipe(filter(([pagination]) => !!pagination), map(([pagination, documentDefinitionName]) => {
3255
+ const page = pagination.page - 1;
3256
+ return new AdvancedDocumentSearchRequestImpl(documentDefinitionName, page >= 0 ? page : 0, pagination.size, pagination.sort);
3257
+ }));
3258
+ this.documentItems$ = this.listService.checkRefresh$.pipe(switchMap(() => combineLatest([
3259
+ this._documentSearchRequest$,
3260
+ this.assigneeFilter$,
3261
+ this.searchFieldValues$,
3262
+ this.listService.forceRefresh$,
3263
+ this._hasEnvColumnConfig$,
3264
+ this._hasApiColumnConfig$,
3265
+ ])), distinctUntilChanged(([prevSearchRequest, prevAssigneeFilter, prevSearchFieldValues, prevForceRefresh], [currSearchRequest, currAssigneeFilter, currSearchFieldValues, currForceRefresh]) => isEqual({
3266
+ ...prevSearchRequest,
3267
+ assignee: prevAssigneeFilter,
3268
+ ...prevSearchFieldValues,
3269
+ forceRefresh: prevForceRefresh,
3270
+ }, {
3271
+ ...currSearchRequest,
3272
+ assignee: currAssigneeFilter,
3273
+ ...currSearchFieldValues,
3274
+ forceRefresh: currForceRefresh,
3275
+ })), switchMap(([documentSearchRequest, assigneeFilter, searchValues, _, hasEnvColumnConfig, hasApiColumnConfig,]) => {
3276
+ const obsEnv = of(hasEnvColumnConfig);
3277
+ const obsApi = of(hasApiColumnConfig);
3278
+ if ((Object.keys(searchValues) || []).length > 0) {
3279
+ return forkJoin({
3280
+ documents: hasEnvColumnConfig || !hasApiColumnConfig
3281
+ ? this.documentService.getDocumentsSearch(documentSearchRequest, 'AND', assigneeFilter, this.searchService.mapSearchValuesToFilters(searchValues))
3282
+ : this.documentService.getSpecifiedDocumentsSearch(documentSearchRequest, 'AND', assigneeFilter, this.searchService.mapSearchValuesToFilters(searchValues)),
3283
+ hasEnvColumnConfig: obsEnv,
3284
+ hasApiColumnConfig: obsApi,
3285
+ isSearchResult: of(true),
3286
+ });
3287
+ }
3288
+ return forkJoin({
3289
+ documents: hasEnvColumnConfig || !hasApiColumnConfig
3290
+ ? this.documentService.getDocumentsSearch(documentSearchRequest, 'AND', assigneeFilter)
3291
+ : this.documentService.getSpecifiedDocumentsSearch(documentSearchRequest, 'AND', assigneeFilter),
3292
+ hasEnvColumnConfig: obsEnv,
3293
+ hasApiColumnConfig: obsApi,
3294
+ isSearchResult: of(false),
3295
+ });
3296
+ }), map((res) => {
3297
+ this.paginationService.setCollectionSize(res.documents);
3298
+ this.paginationService.checkPage(res.documents);
3299
+ this.updateNoResultsMessage(res.isSearchResult);
3300
+ return this.listService.mapDocuments(res.documents, res.hasEnvColumnConfig, res.hasApiColumnConfig);
3301
+ }), tap(() => {
3302
+ this.loadingAssigneeFilter = false;
3303
+ this.loadingDocumentItems = false;
3304
+ }));
3305
+ }
3306
+ ngOnInit() {
3307
+ this.setVisibleTabs();
3308
+ this.openDocumentDefinitionNameSubscription();
3309
+ }
3310
+ ngOnDestroy() {
3311
+ this._documentDefinitionNameSubscription?.unsubscribe();
3312
+ this.pageTitleService.enableReset();
3313
+ }
3314
+ trackByIndex(index) {
3315
+ return index;
3316
+ }
3317
+ search(searchFieldValues) {
3318
+ this.searchService.search(searchFieldValues);
3319
+ }
3320
+ rowClick(document) {
3321
+ this.listService.documentDefinitionName$.pipe(take(1)).subscribe(documentDefinitionName => {
3322
+ this.breadcrumbService.cacheQueryParams(`/dossiers/${documentDefinitionName}`, this.route.snapshot.queryParams);
3323
+ this.router.navigate([
3324
+ `/dossiers/${documentDefinitionName}/document/${document.id}`,
3325
+ ]);
3326
+ });
3327
+ }
3328
+ tabChange(tab) {
3329
+ if (!this.activeTab) {
3330
+ this.activeTab = tab;
3331
+ this.updateNoResultsMessage(false);
3332
+ return;
3333
+ }
3334
+ if (this.activeTab.toLowerCase() === tab.toLowerCase()) {
3335
+ return;
3336
+ }
3337
+ if (this.carbonList.model.selectedRowsCount()) {
3338
+ this.showChangeTabModal$.next(true);
3339
+ this.tabChange$.next(tab);
3340
+ return;
3341
+ }
3342
+ this.onChangeTabConfirm(tab);
3343
+ }
3344
+ onChangeTabCancel() {
3345
+ if (!this.tabsComponent) {
3346
+ return;
3347
+ }
3348
+ const prevTab = this.tabsComponent.tabs.find((tab) => tab.id === this.activeTab);
3349
+ if (!prevTab) {
3350
+ return;
3351
+ }
3352
+ this.tabsComponent.tabs.find((tab) => tab.active).active = false;
3353
+ prevTab.active = true;
3354
+ }
3355
+ pageChange(page) {
3356
+ if (this.carbonList?.model.selectedRowsCount()) {
3357
+ this.showChangePageModal$.next(true);
3358
+ this.paginationChange$.next({ page, size: this.pagination.size });
3359
+ return;
3360
+ }
3361
+ this.paginationService.pageChange(page);
3362
+ }
3363
+ pageSizeChange(size) {
3364
+ if (this.carbonList?.model.selectedRowsCount()) {
3365
+ this.showChangePageModal$.next(true);
3366
+ this.paginationChange$.next({ page: this.pagination.page, size });
3367
+ return;
3368
+ }
3369
+ this.paginationService.pageSizeChange(size);
3370
+ }
3371
+ sortChanged(newSortState) {
3372
+ this.paginationService.sortChanged(newSortState);
3373
+ }
3374
+ onChangeTabConfirm(tab) {
3375
+ this.loadingAssigneeFilter = true;
3376
+ this.activeTab = tab;
3377
+ this.updateNoResultsMessage(false);
3378
+ this.paginationService.setPage(1);
3379
+ this.assigneeService.setAssigneeFilter(tab);
3380
+ }
3381
+ showAssignModal() {
3382
+ this.selectedDocumentIds$.next(this.carbonList.selectedItems.map((document) => document.id));
3383
+ this.showAssignModal$.next(true);
3384
+ }
3385
+ onCloseEvent(assigneeId, documentIds) {
3386
+ this.showAssignModal$.next(false);
3387
+ if (!assigneeId) {
3388
+ return;
3389
+ }
3390
+ this.bulkAssignService.bulkAssign(assigneeId, documentIds).subscribe(() => {
3391
+ this.forceRefresh();
3392
+ });
3393
+ }
3394
+ onChangePageConfirm(pagination) {
3395
+ if (pagination.size !== this.pagination.size) {
3396
+ this.paginationService.pageSizeChange(pagination.size);
3397
+ return;
3398
+ }
3399
+ this.paginationService.pageChange(pagination.page);
3400
+ }
3401
+ startDossier() {
3402
+ this.listActionsComponent.startDossier();
3403
+ }
3404
+ forceRefresh() {
3405
+ this.listService.forceRefresh();
3406
+ }
3407
+ openDocumentDefinitionNameSubscription() {
3408
+ this._documentDefinitionNameSubscription = this.route.params
3409
+ .pipe(map((params) => params?.documentDefinitionName), filter(docDefName => !!docDefName), distinctUntilChanged())
3410
+ .subscribe(documentDefinitonName => {
3411
+ if (this._previousDocumentDefinitionName) {
3412
+ this.parameterService.clearParameters();
3413
+ this.parameterService.clearSearchFieldValues();
3414
+ }
3415
+ this._previousDocumentDefinitionName = documentDefinitonName;
3416
+ this.setLoading();
3417
+ this.paginationService.clearPagination();
3418
+ this.assigneeService.resetAssigneeFilter();
3419
+ this.listService.setDocumentDefinitionName(documentDefinitonName);
3420
+ });
3421
+ }
3422
+ setLoading() {
3423
+ this.loadingFields = true;
3424
+ this.loadingPagination = true;
3425
+ this.loadingSearchFields = true;
3426
+ this.loadingAssigneeFilter = true;
3427
+ this.loadingDocumentItems = true;
3428
+ }
3429
+ setVisibleTabs() {
3430
+ this.visibleDossierTabs = this.configService.config?.visibleDossierListTabs || null;
3431
+ }
3432
+ updateNoResultsMessage(isSearchResult) {
3433
+ this.noResultsMessage$.next(isSearchResult
3434
+ ? {
3435
+ description: 'dossier.noResults.search.description',
3436
+ isSearchResult,
3437
+ title: 'dossier.noResults.search.title',
3438
+ }
3439
+ : {
3440
+ description: `dossier.noResults.${this.activeTab ?? 'ALL'}.description`,
3441
+ isSearchResult,
3442
+ title: `dossier.noResults.${this.activeTab ?? 'ALL'}.title`,
3443
+ });
3444
+ }
3445
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListComponent, deps: [{ token: DossierListAssigneeService }, { token: i3$1.BreadcrumbService }, { token: DossierBulkAssignService }, { token: DossierColumnService }, { token: i1.ConfigService }, { token: i2$1.DocumentService }, { token: DossierListService }, { token: i3$1.PageTitleService }, { token: DossierListPaginationService }, { token: DossierParameterService }, { token: i1$1.ActivatedRoute }, { token: i1$1.Router }, { token: DossierListSearchService }, { token: i6.TranslateService }, { token: i7.PermissionService }], target: i0.ɵɵFactoryTarget.Component }); }
3446
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierListComponent, selector: "valtimo-dossier-list", providers: [
3447
+ DossierListService,
3448
+ DossierColumnService,
3449
+ DossierListAssigneeService,
3450
+ DossierParameterService,
3451
+ DossierListPaginationService,
3452
+ DossierListSearchService,
3453
+ ], viewQueries: [{ propertyName: "carbonList", first: true, predicate: CarbonListComponent, descendants: true }, { propertyName: "listActionsComponent", first: true, predicate: DossierListActionsComponent, descendants: true }, { propertyName: "tabsComponent", first: true, predicate: Tabs, descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n fields: fields$ | async,\n documentItems: documentItems$ | async,\n noResultsMessage: noResultsMessage$ | async,\n searchFields: searchFields$ | async,\n schema: schema$ | async,\n showAssignModal: showAssignModal$ | async,\n selectedDocumentIds: selectedDocumentIds$ | async,\n loaded:\n !loadingFields &&\n !loadingPagination &&\n !loadingSearchFields &&\n !loadingAssigneeFilter &&\n !loadingDocumentItems\n } as obs\"\n>\n <div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-dossier-list-actions\n [loading]=\"!obs.loaded\"\n (formFlowComplete)=\"forceRefresh()\"\n ></valtimo-dossier-list-actions>\n <ng-container *ngTemplateOutlet=\"searchFields; context: {obs: obs}\"></ng-container>\n\n <ng-container *ngIf=\"obs.loaded; else loading\">\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"bulkAssignModal; context: {obs: obs}\"></ng-container>\n\n <ng-container *ngTemplateOutlet=\"changePageModal\"></ng-container>\n\n <ng-container *ngTemplateOutlet=\"changeTabModal\"></ng-container>\n</ng-container>\n\n<ng-template #searchFields let-obs=\"obs\">\n <div class=\"mb-3\">\n <valtimo-search-fields\n [searchFields]=\"obs.searchFields\"\n (doSearch)=\"search($event)\"\n [documentDefinitionName]=\"documentDefinitionName$ | async\"\n [defaultValues]=\"searchFieldValues$ | async\"\n [inputDisabled]=\"!obs.loaded\"\n ></valtimo-search-fields>\n </div>\n</ng-template>\n\n<ng-template #list let-obs=\"obs\">\n <valtimo-carbon-list\n [fields]=\"obs.fields\"\n [header]=\"false\"\n [initialSortState]=\"pagination.sort\"\n [items]=\"obs.documentItems\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"dossierList\"\n [showSelectionColumn]=\"canHaveAssignee\"\n [tableTranslations]=\"tableTranslations\"\n (paginationClicked)=\"pageChange($event)\"\n (paginationSet)=\"pageSizeChange($event)\"\n (rowClicked)=\"rowClick($event)\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <ng-container carbonToolbarActions>\n <button cdsButton=\"primary\" (click)=\"showAssignModal()\">\n {{ 'dossier.bulkAssign.assign' | translate }}\n </button>\n </ng-container>\n\n <div carbonToolbarContent>\n <ng-container *ngTemplateOutlet=\"dossierListActions\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"obs.noResultsMessage.isSearchResult ? null : dossierListActions\"\n [description]=\"obs.noResultsMessage.description | translate\"\n [title]=\"obs.noResultsMessage.title | translate\"\n ></valtimo-no-results>\n\n <div tabs *ngIf=\"canHaveAssignee\">\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n </div>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #tabs>\n <ng-container *ngIf=\"assigneeFilter$ | async as assigneeFilter\">\n <cds-tabs\n *ngIf=\"!visibleDossierTabs; else configuredTabs\"\n type=\"contained\"\n data-carbon-theme=\"g10\"\n class=\"dossier-list-tabs\"\n >\n <cds-tab\n *ngFor=\"let tab of defaultTabs; trackBy: trackByIndex\"\n [active]=\"assigneeFilter === tab\"\n heading=\"{{ 'dossier.tabs.' + tab | translate }}\"\n [id]=\"tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n </ng-container>\n</ng-template>\n\n<ng-template #configuredTabs>\n <ng-container *ngIf=\"assigneeFilter$ | async as assigneeFilter\">\n <cds-tabs type=\"contained\" class=\"dossier-list-tabs\">\n <cds-tab\n *ngFor=\"let tab of visibleDossierTabs; trackBy: trackByIndex\"\n [active]=\"assigneeFilter === tab\"\n heading=\"{{ 'dossier.tabs.' + tab | translate }}\"\n [id]=\"tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n </ng-container>\n</ng-template>\n\n<ng-template #loading\n ><valtimo-carbon-list [loading]=\"true\">\n <div tabs *ngIf=\"canHaveAssignee\">\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n </div> </valtimo-carbon-list\n></ng-template>\n\n<ng-template #bulkAssignModal let-obs=\"obs\">\n <valtimo-dossier-bulk-assign-modal\n [documentIds]=\"obs.selectedDocumentIds\"\n [open]=\"obs.showAssignModal\"\n (closeEvent)=\"onCloseEvent($event, obs.selectedDocumentIds)\"\n ></valtimo-dossier-bulk-assign-modal>\n</ng-template>\n\n<ng-template #changePageModal>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"dossier.changePageModal.confirm\"\n contentTranslationKey=\"dossier.changePageModal.content\"\n [outputOnConfirm]=\"paginationChange$ | async\"\n [showModalSubject$]=\"showChangePageModal$\"\n titleTranslationKey=\"dossier.changePageModal.title\"\n (confirmEvent)=\"onChangePageConfirm($event)\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #changeTabModal>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"dossier.changeTabModal.confirm\"\n contentTranslationKey=\"dossier.changeTabModal.content\"\n [outputOnConfirm]=\"tabChange$ | async\"\n [showModalSubject$]=\"showChangeTabModal$\"\n titleTranslationKey=\"dossier.changeTabModal.title\"\n (cancelEvent)=\"onChangeTabCancel()\"\n (confirmEvent)=\"onChangeTabConfirm($event)\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #dossierListActions>\n <button\n cdsButton=\"primary\"\n [disabled]=\"listActionsComponent?.disableStartDossierButton$ | async\"\n (click)=\"startDossier()\"\n >\n {{ 'Start Dossier' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n", styles: [".dossier-list-tabs cds-tab{display:none}\n"], dependencies: [{ kind: "directive", type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$1.SearchFieldsComponent, selector: "valtimo-search-fields", inputs: ["loading", "searchFields", "documentDefinitionName", "setValuesSubject$", "defaultValues", "inputDisabled"], outputs: ["doSearch"] }, { kind: "directive", type: i4.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i4.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i3$1.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm"], outputs: ["confirmEvent", "cancelEvent"] }, { kind: "component", type: i4.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i4.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive"], outputs: ["selected"] }, { kind: "component", type: i3$1.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "header", "initialSortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: i3$1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title"] }, { kind: "component", type: DossierBulkAssignModalComponent, selector: "valtimo-dossier-bulk-assign-modal", inputs: ["documentIds", "open"], outputs: ["closeEvent"] }, { kind: "component", type: DossierListActionsComponent, selector: "valtimo-dossier-list-actions", inputs: ["loading"], outputs: ["formFlowComplete"] }, { kind: "pipe", type: i5$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
3454
+ }
3455
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListComponent, decorators: [{
3456
+ type: Component,
3457
+ args: [{ selector: 'valtimo-dossier-list', providers: [
3458
+ DossierListService,
3459
+ DossierColumnService,
3460
+ DossierListAssigneeService,
3461
+ DossierParameterService,
3462
+ DossierListPaginationService,
3463
+ DossierListSearchService,
3464
+ ], template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n fields: fields$ | async,\n documentItems: documentItems$ | async,\n noResultsMessage: noResultsMessage$ | async,\n searchFields: searchFields$ | async,\n schema: schema$ | async,\n showAssignModal: showAssignModal$ | async,\n selectedDocumentIds: selectedDocumentIds$ | async,\n loaded:\n !loadingFields &&\n !loadingPagination &&\n !loadingSearchFields &&\n !loadingAssigneeFilter &&\n !loadingDocumentItems\n } as obs\"\n>\n <div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-dossier-list-actions\n [loading]=\"!obs.loaded\"\n (formFlowComplete)=\"forceRefresh()\"\n ></valtimo-dossier-list-actions>\n <ng-container *ngTemplateOutlet=\"searchFields; context: {obs: obs}\"></ng-container>\n\n <ng-container *ngIf=\"obs.loaded; else loading\">\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"bulkAssignModal; context: {obs: obs}\"></ng-container>\n\n <ng-container *ngTemplateOutlet=\"changePageModal\"></ng-container>\n\n <ng-container *ngTemplateOutlet=\"changeTabModal\"></ng-container>\n</ng-container>\n\n<ng-template #searchFields let-obs=\"obs\">\n <div class=\"mb-3\">\n <valtimo-search-fields\n [searchFields]=\"obs.searchFields\"\n (doSearch)=\"search($event)\"\n [documentDefinitionName]=\"documentDefinitionName$ | async\"\n [defaultValues]=\"searchFieldValues$ | async\"\n [inputDisabled]=\"!obs.loaded\"\n ></valtimo-search-fields>\n </div>\n</ng-template>\n\n<ng-template #list let-obs=\"obs\">\n <valtimo-carbon-list\n [fields]=\"obs.fields\"\n [header]=\"false\"\n [initialSortState]=\"pagination.sort\"\n [items]=\"obs.documentItems\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"dossierList\"\n [showSelectionColumn]=\"canHaveAssignee\"\n [tableTranslations]=\"tableTranslations\"\n (paginationClicked)=\"pageChange($event)\"\n (paginationSet)=\"pageSizeChange($event)\"\n (rowClicked)=\"rowClick($event)\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <ng-container carbonToolbarActions>\n <button cdsButton=\"primary\" (click)=\"showAssignModal()\">\n {{ 'dossier.bulkAssign.assign' | translate }}\n </button>\n </ng-container>\n\n <div carbonToolbarContent>\n <ng-container *ngTemplateOutlet=\"dossierListActions\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"obs.noResultsMessage.isSearchResult ? null : dossierListActions\"\n [description]=\"obs.noResultsMessage.description | translate\"\n [title]=\"obs.noResultsMessage.title | translate\"\n ></valtimo-no-results>\n\n <div tabs *ngIf=\"canHaveAssignee\">\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n </div>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #tabs>\n <ng-container *ngIf=\"assigneeFilter$ | async as assigneeFilter\">\n <cds-tabs\n *ngIf=\"!visibleDossierTabs; else configuredTabs\"\n type=\"contained\"\n data-carbon-theme=\"g10\"\n class=\"dossier-list-tabs\"\n >\n <cds-tab\n *ngFor=\"let tab of defaultTabs; trackBy: trackByIndex\"\n [active]=\"assigneeFilter === tab\"\n heading=\"{{ 'dossier.tabs.' + tab | translate }}\"\n [id]=\"tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n </ng-container>\n</ng-template>\n\n<ng-template #configuredTabs>\n <ng-container *ngIf=\"assigneeFilter$ | async as assigneeFilter\">\n <cds-tabs type=\"contained\" class=\"dossier-list-tabs\">\n <cds-tab\n *ngFor=\"let tab of visibleDossierTabs; trackBy: trackByIndex\"\n [active]=\"assigneeFilter === tab\"\n heading=\"{{ 'dossier.tabs.' + tab | translate }}\"\n [id]=\"tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n </ng-container>\n</ng-template>\n\n<ng-template #loading\n ><valtimo-carbon-list [loading]=\"true\">\n <div tabs *ngIf=\"canHaveAssignee\">\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n </div> </valtimo-carbon-list\n></ng-template>\n\n<ng-template #bulkAssignModal let-obs=\"obs\">\n <valtimo-dossier-bulk-assign-modal\n [documentIds]=\"obs.selectedDocumentIds\"\n [open]=\"obs.showAssignModal\"\n (closeEvent)=\"onCloseEvent($event, obs.selectedDocumentIds)\"\n ></valtimo-dossier-bulk-assign-modal>\n</ng-template>\n\n<ng-template #changePageModal>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"dossier.changePageModal.confirm\"\n contentTranslationKey=\"dossier.changePageModal.content\"\n [outputOnConfirm]=\"paginationChange$ | async\"\n [showModalSubject$]=\"showChangePageModal$\"\n titleTranslationKey=\"dossier.changePageModal.title\"\n (confirmEvent)=\"onChangePageConfirm($event)\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #changeTabModal>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"dossier.changeTabModal.confirm\"\n contentTranslationKey=\"dossier.changeTabModal.content\"\n [outputOnConfirm]=\"tabChange$ | async\"\n [showModalSubject$]=\"showChangeTabModal$\"\n titleTranslationKey=\"dossier.changeTabModal.title\"\n (cancelEvent)=\"onChangeTabCancel()\"\n (confirmEvent)=\"onChangeTabConfirm($event)\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #dossierListActions>\n <button\n cdsButton=\"primary\"\n [disabled]=\"listActionsComponent?.disableStartDossierButton$ | async\"\n (click)=\"startDossier()\"\n >\n {{ 'Start Dossier' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n", styles: [".dossier-list-tabs cds-tab{display:none}\n"] }]
3465
+ }], ctorParameters: function () { return [{ type: DossierListAssigneeService }, { type: i3$1.BreadcrumbService }, { type: DossierBulkAssignService }, { type: DossierColumnService }, { type: i1.ConfigService }, { type: i2$1.DocumentService }, { type: DossierListService }, { type: i3$1.PageTitleService }, { type: DossierListPaginationService }, { type: DossierParameterService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: DossierListSearchService }, { type: i6.TranslateService }, { type: i7.PermissionService }]; }, propDecorators: { carbonList: [{
3466
+ type: ViewChild,
3467
+ args: [CarbonListComponent]
3468
+ }], listActionsComponent: [{
3469
+ type: ViewChild,
3470
+ args: [DossierListActionsComponent]
3471
+ }], tabsComponent: [{
3472
+ type: ViewChild,
3473
+ args: [Tabs]
3474
+ }] } });
3475
+
3476
+ /*
3477
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
3478
+ *
3479
+ * Licensed under EUPL, Version 1.2 (the "License");
3480
+ * you may not use this file except in compliance with the License.
3481
+ * You may obtain a copy of the License at
3482
+ *
3483
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3484
+ *
3485
+ * Unless required by applicable law or agreed to in writing, software
3486
+ * distributed under the License is distributed on an "AS IS" basis,
3487
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3488
+ * See the License for the specific language governing permissions and
3489
+ * limitations under the License.
3490
+ */
3491
+ moment.locale(localStorage.getItem('langKey') || '');
3492
+ class DossierUpdateComponent {
3493
+ constructor(taskService, documentService, route, toastr, location, dossierService) {
3494
+ this.taskService = taskService;
3495
+ this.documentService = documentService;
3496
+ this.route = route;
3497
+ this.toastr = toastr;
3498
+ this.location = location;
3499
+ this.customDefinitions = {};
3500
+ const snapshot = this.route.snapshot.paramMap;
3501
+ this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
3502
+ this.documentId = snapshot.get('documentId') || '';
3503
+ this.taskId = snapshot.get('taskId') || '';
3504
+ this.implementationDefinitions = dossierService.getImplementationEnvironmentDefinitions(this.documentDefinitionName);
3505
+ this.loadDocumentDefinition(this.documentDefinitionName);
3506
+ this.loadDocument(this.documentId);
3507
+ }
3508
+ ngOnInit() {
3509
+ this.getTask(this.taskId);
3510
+ if (this.implementationDefinitions.definitions.detail.summary) {
3511
+ this.customDefinitions = this.implementationDefinitions.definitions.detail.summary;
3512
+ }
3513
+ }
3514
+ loadDocumentDefinition(name) {
3515
+ this.documentService.getDocumentDefinition(name).subscribe(definition => {
3516
+ this.schema = definition.schema;
3517
+ });
3518
+ }
3519
+ loadDocument(id) {
3520
+ this.documentService.getDocument(id).subscribe(document => {
3521
+ this.document = document;
3522
+ });
3523
+ }
3524
+ getTask(id) {
3525
+ this.taskService.getTask(id).subscribe(task => {
3526
+ this.task = task;
3527
+ this.task.task.created = moment(this.task.task.created).format('DD MMM YYYY HH:mm');
3528
+ this.page = {
3529
+ title: this.task.task.name,
3530
+ subtitle: `Created ${moment(this.task.task.created).fromNow()}`,
3531
+ };
3532
+ });
3533
+ }
3534
+ reset() {
3535
+ this.loadDocument(this.documentId);
3536
+ }
3537
+ back() {
3538
+ this.location.back();
3539
+ }
3540
+ save() {
3541
+ const document = {
3542
+ documentId: this.document.id,
3543
+ content: this.document.content,
3544
+ versionBasedOn: this.document.version,
3545
+ };
3546
+ this.documentService.modifyDocument(document).subscribe(result => {
3547
+ this.document = result.document;
3548
+ this.toastr.success('Document aangepast');
3549
+ this.location.back();
3550
+ });
3551
+ }
3552
+ submit(data) {
3553
+ // merge document content with formdata
3554
+ const mergedData = Object.assign({}, this.document.content, data);
3555
+ const documentData = {
3556
+ request: {
3557
+ documentId: this.document.id,
3558
+ content: mergedData,
3559
+ versionBasedOn: this.document.version,
3560
+ },
3561
+ taskId: this.task.task.id,
3562
+ };
3563
+ this.documentService.modifyDocumentAndCompleteTask(documentData).subscribe(result => {
3564
+ this.toastr.success(this.task.task.name + ' has successfully been completed');
3565
+ this.location.back();
3566
+ });
3567
+ }
3568
+ returnZero() {
3569
+ return 0;
3570
+ }
3571
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierUpdateComponent, deps: [{ token: i3.TaskService }, { token: i2$1.DocumentService }, { token: i1$1.ActivatedRoute }, { token: i3$3.ToastrService }, { token: i5$1.Location }, { token: DossierService }], target: i0.ɵɵFactoryTarget.Component }); }
3572
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierUpdateComponent, selector: "valtimo-dossier-update", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget [title]=\"page?.title\" [subtitle]=\"page?.subtitle\" [divider]=\"true\">\n <div class=\"card-body\">\n <!--view with custom definitions-->\n <div *ngIf=\"this.customDefinitions\">\n <div\n class=\"mb-4\"\n *ngFor=\"let definition of this.customDefinitions | keyvalue: returnZero\"\n ></div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-sm-12\">\n <div class=\"text-right\">\n <button\n class=\"btn btn-space btn-default float-left\"\n type=\"button\"\n (click)=\"back()\"\n id=\"back-button\"\n >\n Back\n </button>\n <button\n class=\"btn btn-space btn-secondary\"\n type=\"button\"\n (click)=\"reset()\"\n id=\"reset-button\"\n >\n Reset\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n type=\"button\"\n (click)=\"save()\"\n id=\"save-button\"\n >\n Save\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n type=\"submit\"\n (click)=\"submit({})\"\n id=\"submit-button\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <valtimo-camunda-form\n *ngIf=\"task?.formFields && !this.customDefinitions\"\n (submitted)=\"submit($event)\"\n [formFields]=\"task.formFields\"\n [componentName]=\"task.formLocation\"\n ></valtimo-camunda-form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: i3$1.CamundaFormComponent, selector: "valtimo-camunda-form", inputs: ["componentName", "formFields"], outputs: ["submitted"] }, { kind: "pipe", type: i5$1.KeyValuePipe, name: "keyvalue" }] }); }
3573
+ }
3574
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierUpdateComponent, decorators: [{
3575
+ type: Component,
3576
+ args: [{ selector: 'valtimo-dossier-update', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget [title]=\"page?.title\" [subtitle]=\"page?.subtitle\" [divider]=\"true\">\n <div class=\"card-body\">\n <!--view with custom definitions-->\n <div *ngIf=\"this.customDefinitions\">\n <div\n class=\"mb-4\"\n *ngFor=\"let definition of this.customDefinitions | keyvalue: returnZero\"\n ></div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-sm-12\">\n <div class=\"text-right\">\n <button\n class=\"btn btn-space btn-default float-left\"\n type=\"button\"\n (click)=\"back()\"\n id=\"back-button\"\n >\n Back\n </button>\n <button\n class=\"btn btn-space btn-secondary\"\n type=\"button\"\n (click)=\"reset()\"\n id=\"reset-button\"\n >\n Reset\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n type=\"button\"\n (click)=\"save()\"\n id=\"save-button\"\n >\n Save\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n type=\"submit\"\n (click)=\"submit({})\"\n id=\"submit-button\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <valtimo-camunda-form\n *ngIf=\"task?.formFields && !this.customDefinitions\"\n (submitted)=\"submit($event)\"\n [formFields]=\"task.formFields\"\n [componentName]=\"task.formLocation\"\n ></valtimo-camunda-form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n" }]
3577
+ }], ctorParameters: function () { return [{ type: i3.TaskService }, { type: i2$1.DocumentService }, { type: i1$1.ActivatedRoute }, { type: i3$3.ToastrService }, { type: i5$1.Location }, { type: DossierService }]; } });
3578
+
3579
+ /*
3580
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
3581
+ *
3582
+ * Licensed under EUPL, Version 1.2 (the "License");
3583
+ * you may not use this file except in compliance with the License.
3584
+ * You may obtain a copy of the License at
3585
+ *
3586
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3587
+ *
3588
+ * Unless required by applicable law or agreed to in writing, software
3589
+ * distributed under the License is distributed on an "AS IS" basis,
3590
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3591
+ * See the License for the specific language governing permissions and
3592
+ * limitations under the License.
3593
+ */
3594
+ const routes = [
3595
+ {
3596
+ path: 'dossiers/:documentDefinitionName',
3597
+ component: DossierListComponent,
3598
+ canActivate: [AuthGuardService],
3599
+ data: { title: 'Dossiers', roles: [ROLE_USER], customPageTitle: true },
3600
+ },
3601
+ {
3602
+ path: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
3603
+ component: DossierDetailComponent,
3604
+ canActivate: [AuthGuardService],
3605
+ data: {
3606
+ title: 'Dossier details',
3607
+ parentPath: 'dossiers/:documentDefinitionName',
3608
+ roles: [ROLE_USER],
3609
+ },
3610
+ },
3611
+ {
3612
+ path: 'dossiers/:documentDefinitionName/document/:documentId',
3613
+ component: DossierDetailComponent,
3614
+ canActivate: [AuthGuardService],
3615
+ data: {
3616
+ title: 'Dossier details',
3617
+ parentPath: 'dossiers/:documentDefinitionName',
3618
+ roles: [ROLE_USER],
3619
+ },
3620
+ },
3621
+ {
3622
+ path: 'dossiers/:documentDefinitionName/document/:documentId/:tab/tasks/:taskId',
3623
+ component: DossierUpdateComponent,
3624
+ canActivate: [AuthGuardService],
3625
+ data: {
3626
+ title: 'Task details',
3627
+ parentPath: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
3628
+ roles: [ROLE_USER],
3629
+ },
3630
+ },
3631
+ ];
3632
+ class DossierRoutingModule {
3633
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3634
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DossierRoutingModule, imports: [CommonModule, i1$1.RouterModule], exports: [RouterModule] }); }
3635
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
3636
+ }
3637
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierRoutingModule, decorators: [{
3638
+ type: NgModule,
3639
+ args: [{
3640
+ imports: [CommonModule, RouterModule.forChild(routes)],
3641
+ exports: [RouterModule],
3642
+ }]
3643
+ }] });
3644
+
3645
+ /*
3646
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
3647
+ *
3648
+ * Licensed under EUPL, Version 1.2 (the "License");
3649
+ * you may not use this file except in compliance with the License.
3650
+ * You may obtain a copy of the License at
3651
+ *
3652
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3653
+ *
3654
+ * Unless required by applicable law or agreed to in writing, software
3655
+ * distributed under the License is distributed on an "AS IS" basis,
3656
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3657
+ * See the License for the specific language governing permissions and
3658
+ * limitations under the License.
3659
+ */
3660
+ class TabTranslatePipeModule {
3661
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabTranslatePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3662
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TabTranslatePipeModule, declarations: [TabTranslatePipe], imports: [TranslateModule], exports: [TabTranslatePipe] }); }
3663
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabTranslatePipeModule, imports: [TranslateModule] }); }
3664
+ }
3665
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabTranslatePipeModule, decorators: [{
3666
+ type: NgModule,
3667
+ args: [{
3668
+ imports: [TranslateModule],
3669
+ declarations: [TabTranslatePipe],
3670
+ exports: [TabTranslatePipe],
3671
+ }]
3672
+ }] });
3673
+
3674
+ /*
3675
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
3676
+ *
3677
+ * Licensed under EUPL, Version 1.2 (the "License");
3678
+ * you may not use this file except in compliance with the License.
3679
+ * You may obtain a copy of the License at
3680
+ *
3681
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3682
+ *
3683
+ * Unless required by applicable law or agreed to in writing, software
3684
+ * distributed under the License is distributed on an "AS IS" basis,
3685
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3686
+ * See the License for the specific language governing permissions and
3687
+ * limitations under the License.
3688
+ */
3689
+
3690
+ /*
3691
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
3692
+ *
3693
+ * Licensed under EUPL, Version 1.2 (the "License");
3694
+ * you may not use this file except in compliance with the License.
3695
+ * You may obtain a copy of the License at
3696
+ *
3697
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3698
+ *
3699
+ * Unless required by applicable law or agreed to in writing, software
3700
+ * distributed under the License is distributed on an "AS IS" basis,
3701
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3702
+ * See the License for the specific language governing permissions and
3703
+ * limitations under the License.
3704
+ */
3705
+
3706
+ /*
3707
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
3708
+ *
3709
+ * Licensed under EUPL, Version 1.2 (the "License");
3710
+ * you may not use this file except in compliance with the License.
3711
+ * You may obtain a copy of the License at
3712
+ *
3713
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3714
+ *
3715
+ * Unless required by applicable law or agreed to in writing, software
3716
+ * distributed under the License is distributed on an "AS IS" basis,
3717
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3718
+ * See the License for the specific language governing permissions and
3719
+ * limitations under the License.
3720
+ */
3721
+ class DossierModule {
3722
+ static forRoot(tabsFactory) {
3723
+ return {
3724
+ ngModule: DossierModule,
3725
+ providers: [
3726
+ DossierService,
3727
+ DossierBulkAssignService,
3728
+ {
3729
+ provide: TAB_MAP,
3730
+ useFactory: tabsFactory,
3731
+ },
3732
+ ],
3733
+ };
3734
+ }
3735
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3736
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DossierModule, declarations: [DossierBulkAssignModalComponent,
3737
+ DossierListComponent,
3738
+ DossierListActionsComponent,
3739
+ DossierDetailComponent,
3740
+ DossierDetailTabSummaryComponent,
3741
+ DossierDetailTabProgressComponent,
3742
+ DossierDetailTabAuditComponent,
3743
+ DossierDetailTabDocumentsComponent,
3744
+ DossierDetailTabContactMomentsComponent,
3745
+ DossierDetailTabZaakobjectenComponent,
3746
+ DossierDetailTabNotesComponent,
3747
+ DossierUpdateComponent,
3748
+ DossierProcessStartModalComponent,
3749
+ DossierSupportingProcessStartModalComponent,
3750
+ DossierDetailTabObjectTypeComponent,
3751
+ DossierDetailTabDocumentenApiDocumentsComponent,
3752
+ DossierDetailTabS3DocumentsComponent,
3753
+ DossierAssignUserComponent,
3754
+ NoteModalComponent,
3755
+ DossierDetailTabFormioComponent], imports: [CommonModule,
3756
+ DossierRoutingModule,
3757
+ ListModule,
3758
+ WidgetModule,
3759
+ BpmnJsDiagramModule,
3760
+ TimelineModule,
3761
+ CamundaFormModule,
3762
+ ProcessModule,
3763
+ FilterSidebarModule,
3764
+ NgbButtonsModule,
3765
+ DataListModule,
3766
+ FormsModule,
3767
+ ReactiveFormsModule,
3768
+ FormModule,
3769
+ FormIoModule,
3770
+ ModalModule,
3771
+ SpinnerModule, i6.TranslateModule, TaskModule,
3772
+ ModalModule,
3773
+ NgbTooltipModule,
3774
+ UploaderModule,
3775
+ DropzoneModule,
3776
+ NgbPaginationModule,
3777
+ ConfigModule,
3778
+ SelectModule,
3779
+ InputLabelModule,
3780
+ ParagraphModule,
3781
+ TableModule,
3782
+ VModalModule,
3783
+ TitleModule,
3784
+ ButtonModule,
3785
+ DocumentenApiMetadataModalModule,
3786
+ SearchableDropdownSelectModule,
3787
+ SearchFieldsModule,
3788
+ PageModule,
3789
+ FormModule,
3790
+ InputModule,
3791
+ FormModule$1,
3792
+ NgbModule,
3793
+ LoadingModule,
3794
+ ButtonModule$1,
3795
+ IconModule,
3796
+ FormLinkModule,
3797
+ ModalModule$1,
3798
+ SelectModule$1,
3799
+ ConfirmationModalModule,
3800
+ DropdownModule,
3801
+ TabsModule,
3802
+ ComboBoxModule,
3803
+ TabTranslatePipeModule,
3804
+ CarbonListModule,
3805
+ IsArrayPipe], exports: [DossierListComponent, DossierDetailComponent] }); }
3806
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierModule, imports: [CommonModule,
3807
+ DossierRoutingModule,
3808
+ ListModule,
3809
+ WidgetModule,
3810
+ BpmnJsDiagramModule,
3811
+ TimelineModule,
3812
+ CamundaFormModule,
3813
+ ProcessModule,
3814
+ FilterSidebarModule,
3815
+ NgbButtonsModule,
3816
+ DataListModule,
3817
+ FormsModule,
3818
+ ReactiveFormsModule,
3819
+ FormModule,
3820
+ FormIoModule,
3821
+ ModalModule,
3822
+ SpinnerModule,
3823
+ TranslateModule.forRoot({
3824
+ loader: {
3825
+ provide: TranslateLoader,
3826
+ useFactory: HttpLoaderFactory,
3827
+ deps: [HttpClient],
3828
+ },
3829
+ }),
3830
+ TaskModule,
3831
+ ModalModule,
3832
+ NgbTooltipModule,
3833
+ UploaderModule,
3834
+ DropzoneModule,
3835
+ NgbPaginationModule,
3836
+ ConfigModule,
3837
+ SelectModule,
3838
+ InputLabelModule,
3839
+ ParagraphModule,
3840
+ TableModule,
3841
+ VModalModule,
3842
+ TitleModule,
3843
+ ButtonModule,
3844
+ DocumentenApiMetadataModalModule,
3845
+ SearchableDropdownSelectModule,
3846
+ SearchFieldsModule,
3847
+ PageModule,
3848
+ FormModule,
3849
+ InputModule,
3850
+ FormModule$1,
3851
+ NgbModule,
3852
+ LoadingModule,
3853
+ ButtonModule$1,
3854
+ IconModule,
3855
+ FormLinkModule,
3856
+ ModalModule$1,
3857
+ SelectModule$1,
3858
+ ConfirmationModalModule,
3859
+ DropdownModule,
3860
+ TabsModule,
3861
+ ComboBoxModule,
3862
+ TabTranslatePipeModule,
3863
+ CarbonListModule] }); }
3864
+ }
3865
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierModule, decorators: [{
3866
+ type: NgModule,
3867
+ args: [{
3868
+ declarations: [
3869
+ DossierBulkAssignModalComponent,
3870
+ DossierListComponent,
3871
+ DossierListActionsComponent,
3872
+ DossierDetailComponent,
3873
+ DossierDetailTabSummaryComponent,
3874
+ DossierDetailTabProgressComponent,
3875
+ DossierDetailTabAuditComponent,
3876
+ DossierDetailTabDocumentsComponent,
3877
+ DossierDetailTabContactMomentsComponent,
3878
+ DossierDetailTabZaakobjectenComponent,
3879
+ DossierDetailTabNotesComponent,
3880
+ DossierUpdateComponent,
3881
+ DossierProcessStartModalComponent,
3882
+ DossierSupportingProcessStartModalComponent,
3883
+ DossierDetailTabObjectTypeComponent,
3884
+ DossierDetailTabDocumentenApiDocumentsComponent,
3885
+ DossierDetailTabS3DocumentsComponent,
3886
+ DossierAssignUserComponent,
3887
+ NoteModalComponent,
3888
+ DossierDetailTabFormioComponent,
3889
+ ],
3890
+ imports: [
3891
+ CommonModule,
3892
+ DossierRoutingModule,
3893
+ ListModule,
3894
+ WidgetModule,
3895
+ BpmnJsDiagramModule,
3896
+ TimelineModule,
3897
+ CamundaFormModule,
3898
+ ProcessModule,
3899
+ FilterSidebarModule,
3900
+ NgbButtonsModule,
3901
+ DataListModule,
3902
+ FormsModule,
3903
+ ReactiveFormsModule,
3904
+ FormModule,
3905
+ FormIoModule,
3906
+ ModalModule,
3907
+ SpinnerModule,
3908
+ TranslateModule.forRoot({
3909
+ loader: {
3910
+ provide: TranslateLoader,
3911
+ useFactory: HttpLoaderFactory,
3912
+ deps: [HttpClient],
3913
+ },
3914
+ }),
3915
+ TaskModule,
3916
+ ModalModule,
3917
+ NgbTooltipModule,
3918
+ UploaderModule,
3919
+ DropzoneModule,
3920
+ NgbPaginationModule,
3921
+ ConfigModule,
3922
+ SelectModule,
3923
+ InputLabelModule,
3924
+ ParagraphModule,
3925
+ TableModule,
3926
+ VModalModule,
3927
+ TitleModule,
3928
+ ButtonModule,
3929
+ DocumentenApiMetadataModalModule,
3930
+ SearchableDropdownSelectModule,
3931
+ SearchFieldsModule,
3932
+ PageModule,
3933
+ FormModule,
3934
+ InputModule,
3935
+ FormModule$1,
3936
+ NgbModule,
3937
+ LoadingModule,
3938
+ ButtonModule$1,
3939
+ IconModule,
3940
+ FormLinkModule,
3941
+ ModalModule$1,
3942
+ SelectModule$1,
3943
+ ConfirmationModalModule,
3944
+ DropdownModule,
3945
+ TabsModule,
3946
+ ComboBoxModule,
3947
+ TabTranslatePipeModule,
3948
+ CarbonListModule,
3949
+ IsArrayPipe,
3950
+ ],
3951
+ exports: [DossierListComponent, DossierDetailComponent],
3952
+ }]
3953
+ }] });
3954
+
3955
+ /*
3956
+ * Copyright 2015-2023 Ritense BV, the Netherlands.
3957
+ *
3958
+ * Licensed under EUPL, Version 1.2 (the "License");
3959
+ * you may not use this file except in compliance with the License.
3960
+ * You may obtain a copy of the License at
3961
+ *
3962
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3963
+ *
3964
+ * Unless required by applicable law or agreed to in writing, software
3965
+ * distributed under the License is distributed on an "AS IS" basis,
3966
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3967
+ * See the License for the specific language governing permissions and
3968
+ * limitations under the License.
3969
+ */
3970
+ /*
3971
+ * Public API Surface of dossier
3972
+ */
3973
+
3974
+ /**
3975
+ * Generated bundle index. Do not edit.
3976
+ */
3977
+
3978
+ export { ApiTabType, CASE_TAB_TOKEN, DEFAULT_TABS, DEFAULT_TAB_COMPONENTS, DefaultTabs, DossierBulkAssignModalComponent, DossierBulkAssignService, DossierColumnService, DossierDetailComponent, DossierDetailTabAuditComponent, DossierDetailTabContactMomentsComponent, DossierDetailTabDocumentsComponent, DossierDetailTabNotesComponent, DossierDetailTabProgressComponent, DossierDetailTabSummaryComponent, DossierDetailTabZaakobjectenComponent, DossierListAssigneeService, DossierListComponent, DossierListPaginationService, DossierListSearchService, DossierListService, DossierModule, DossierParameterService, DossierService, DossierTabApiService, DossierTabService, TAB_MAP, TabImpl, TabLoaderImpl, ZaakobjectenService };
3979
+ //# sourceMappingURL=valtimo-dossier.mjs.map