@valtimo/dossier 4.15.2 → 4.16.0-next-main.19

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 (43) hide show
  1. package/bundles/valtimo-dossier.umd.js +413 -123
  2. package/bundles/valtimo-dossier.umd.js.map +1 -1
  3. package/bundles/valtimo-dossier.umd.min.js +1 -15
  4. package/bundles/valtimo-dossier.umd.min.js.map +1 -1
  5. package/esm2015/lib/dossier-detail/dossier-detail.component.js +16 -11
  6. package/esm2015/lib/dossier-detail/tab/audit/audit.component.js +21 -6
  7. package/esm2015/lib/dossier-detail/tab/contact-moments/contact-moments.component.js +90 -0
  8. package/esm2015/lib/dossier-detail/tab/documents/documents.component.js +42 -21
  9. package/esm2015/lib/dossier-detail/tab/progress/progress.component.js +5 -3
  10. package/esm2015/lib/dossier-detail/tab/summary/summary.component.js +7 -5
  11. package/esm2015/lib/dossier-detail-tab-enum.js +2 -1
  12. package/esm2015/lib/dossier-list/dossier-list.component.js +12 -8
  13. package/esm2015/lib/dossier-process-start-modal/dossier-process-start-modal.component.js +16 -8
  14. package/esm2015/lib/dossier-routing.module.js +13 -12
  15. package/esm2015/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.js +16 -8
  16. package/esm2015/lib/dossier-update/dossier-update.component.js +6 -6
  17. package/esm2015/lib/dossier.config.js +2 -2
  18. package/esm2015/lib/dossier.module.js +21 -17
  19. package/esm2015/lib/dossier.service.js +6 -3
  20. package/esm2015/lib/models/index.js +19 -0
  21. package/esm2015/lib/models/tabs.model.js +104 -0
  22. package/esm2015/lib/tab.service.js +3 -3
  23. package/esm2015/public_api.js +3 -1
  24. package/esm2015/valtimo-dossier.js +1 -1
  25. package/fesm2015/valtimo-dossier.js +365 -91
  26. package/fesm2015/valtimo-dossier.js.map +1 -1
  27. package/lib/dossier-detail/dossier-detail.component.d.ts +2 -2
  28. package/lib/dossier-detail/tab/audit/audit.component.d.ts +8 -2
  29. package/lib/dossier-detail/tab/contact-moments/contact-moments.component.d.ts +26 -0
  30. package/lib/dossier-detail/tab/documents/documents.component.d.ts +11 -6
  31. package/lib/dossier-detail/tab/progress/progress.component.d.ts +1 -1
  32. package/lib/dossier-detail/tab/summary/summary.component.d.ts +3 -3
  33. package/lib/dossier-detail-tab-enum.d.ts +2 -1
  34. package/lib/dossier-list/dossier-list.component.d.ts +1 -2
  35. package/lib/dossier-process-start-modal/dossier-process-start-modal.component.d.ts +2 -3
  36. package/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.d.ts +2 -3
  37. package/lib/dossier.service.d.ts +2 -2
  38. package/lib/models/index.d.ts +1 -0
  39. package/lib/models/tabs.model.d.ts +50 -0
  40. package/lib/tab.service.d.ts +1 -1
  41. package/package.json +1 -4
  42. package/public_api.d.ts +2 -0
  43. package/valtimo-dossier.metadata.json +1 -1
@@ -1,28 +1,150 @@
1
1
  import { __rest } from 'tslib';
2
- import { Component, ViewEncapsulation, ViewChild, ɵɵdefineInjectable, ɵɵinject, Injectable, ElementRef, Renderer2, InjectionToken, Inject, EventEmitter, Output, ComponentFactoryResolver, ViewContainerRef, NgModule, ANALYZE_FOR_ENTRY_COMPONENTS } from '@angular/core';
2
+ import { Component, ViewEncapsulation, ViewChild, ɵɵdefineInjectable, ɵɵinject, Injectable, ElementRef, Renderer2, EventEmitter, Output, InjectionToken, Inject, ComponentFactoryResolver, ViewContainerRef, NgModule, ANALYZE_FOR_ENTRY_COMPONENTS } from '@angular/core';
3
3
  import { ActivatedRoute, Router, NavigationEnd, RouterModule } from '@angular/router';
4
4
  import { TranslateService, TranslateModule, TranslateLoader } from '@ngx-translate/core';
5
5
  import { DocumentService, DocumentSearchRequestImpl } from '@valtimo/document';
6
6
  import * as moment_ from 'moment';
7
7
  import { combineLatest, BehaviorSubject, noop } from 'rxjs';
8
- import { FormioOptionsImpl, TimelineItemImpl, TabImpl, TabLoaderImpl, ROLE_USER, HttpLoaderFactory } from '@valtimo/contract';
9
8
  import { ProcessService, ProcessModule } from '@valtimo/process';
10
- import { ListModule, WidgetModule, BpmnJsDiagramModule, TimelineModule, CamundaFormModule, FilterSidebarModule, DataListModule, FormIoModule, ModalModule, SpinnerModule, UploaderModule, DropzoneModule } from '@valtimo/components';
9
+ import { FormioOptionsImpl, TimelineItemImpl, AlertService, ListModule, WidgetModule, BpmnJsDiagramModule, TimelineModule, CamundaFormModule, FilterSidebarModule, DataListModule, FormIoModule, ModalModule, SpinnerModule, UploaderModule, DropzoneModule } from '@valtimo/components';
11
10
  import { FormLinkService } from '@valtimo/form-link';
12
11
  import { NGXLogger } from 'ngx-logger';
13
12
  import { UserProviderService, AuthGuardService } from '@valtimo/security';
14
- import { ConfigService } from '@valtimo/config';
13
+ import { ConfigService, ROLE_USER, HttpLoaderFactory, ConfigModule } from '@valtimo/config';
15
14
  import { Location, CommonModule } from '@angular/common';
16
15
  import { TaskService, TaskModule } from '@valtimo/task';
17
16
  import { FormService, FormModule } from '@valtimo/form';
18
17
  import { NgxSpinnerService } from 'ngx-spinner';
19
18
  import { ToastrService } from 'ngx-toastr';
20
19
  import { UploadProviderService, DownloadService } from '@valtimo/resource';
21
- import { switchMap } from 'rxjs/operators';
22
- import { NgbButtonsModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
20
+ import { switchMap, map, take } from 'rxjs/operators';
21
+ import { ContactMomentService } from '@valtimo/contact-moment';
22
+ import { NgbButtonsModule, NgbTooltipModule, NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap';
23
23
  import { FormsModule } from '@angular/forms';
24
24
  import { HttpClient } from '@angular/common/http';
25
25
 
26
+ /*
27
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
28
+ *
29
+ * Licensed under EUPL, Version 1.2 (the "License");
30
+ * you may not use this file except in compliance with the License.
31
+ * You may obtain a copy of the License at
32
+ *
33
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
34
+ *
35
+ * Unless required by applicable law or agreed to in writing, software
36
+ * distributed under the License is distributed on an "AS IS" basis,
37
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
38
+ * See the License for the specific language governing permissions and
39
+ * limitations under the License.
40
+ */
41
+ class TabLoaderImpl {
42
+ constructor(tabs, componentFactoryResolver, viewContainerRef, translateService, router, location) {
43
+ this._tabs = null;
44
+ this._componentFactoryResolver = null;
45
+ this._viewContainerRef = null;
46
+ this._activeComponent = null;
47
+ this._activeTab = null;
48
+ this._translateService = null;
49
+ this._tabs = tabs;
50
+ this._componentFactoryResolver = componentFactoryResolver;
51
+ this._viewContainerRef = viewContainerRef;
52
+ this._translateService = translateService;
53
+ this._router = router;
54
+ this._location = location;
55
+ }
56
+ initial(tabName) {
57
+ let initialTab;
58
+ if (tabName) {
59
+ initialTab = this._tabs.find(tab => tab.name === tabName);
60
+ }
61
+ else {
62
+ initialTab = this._tabs[0] || null;
63
+ }
64
+ this.load(initialTab);
65
+ }
66
+ load(newTab) {
67
+ if (newTab !== this._activeTab) {
68
+ this._tabs.forEach(tab => tab.deactivate());
69
+ this.replaceView(newTab);
70
+ this.replaceUrlState(newTab);
71
+ this.setActive(newTab);
72
+ }
73
+ }
74
+ refreshView() {
75
+ this.replaceView(this._activeTab);
76
+ }
77
+ replaceView(tab) {
78
+ const componentFactory = this._componentFactoryResolver.resolveComponentFactory(tab.component);
79
+ this._viewContainerRef.clear();
80
+ if (this._activeTab !== null) {
81
+ this._activeComponent.destroy();
82
+ }
83
+ this._activeComponent = this._viewContainerRef.createComponent(componentFactory);
84
+ }
85
+ replaceUrlState(tab) {
86
+ const currentUrl = this._router.url;
87
+ const urlParts = currentUrl.split('/');
88
+ urlParts.splice(urlParts.length - 1, 1, tab.name);
89
+ const newUrl = urlParts.join('/');
90
+ this._location.replaceState(newUrl);
91
+ }
92
+ setActive(tab) {
93
+ tab.activate();
94
+ this._activeTab = tab;
95
+ }
96
+ get tabs() {
97
+ return this._tabs;
98
+ }
99
+ translateTabName(tab) {
100
+ return this._translateService.instant('dossier.tabs.' + tab.name);
101
+ }
102
+ }
103
+ class TabImpl {
104
+ constructor(name, sequence, component) {
105
+ this._active = false;
106
+ this._name = name;
107
+ this._sequence = sequence;
108
+ this._component = component;
109
+ }
110
+ get name() {
111
+ return this._name;
112
+ }
113
+ get sequence() {
114
+ return this._sequence;
115
+ }
116
+ get component() {
117
+ return this._component;
118
+ }
119
+ activate() {
120
+ this._active = true;
121
+ }
122
+ deactivate() {
123
+ this._active = false;
124
+ }
125
+ isActive() {
126
+ return this._active;
127
+ }
128
+ }
129
+
130
+ /*
131
+ *
132
+ * * Copyright 2015-2020 Ritense BV, the Netherlands.
133
+ * *
134
+ * * Licensed under EUPL, Version 1.2 (the "License");
135
+ * * you may not use this file except in compliance with the License.
136
+ * * You may obtain a copy of the License at
137
+ * *
138
+ * * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
139
+ * *
140
+ * * Unless required by applicable law or agreed to in writing, software
141
+ * * distributed under the License is distributed on an "AS IS" basis,
142
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
143
+ * * See the License for the specific language governing permissions and
144
+ * * limitations under the License.
145
+ *
146
+ */
147
+
26
148
  /*
27
149
  * Copyright 2015-2020 Ritense BV, the Netherlands.
28
150
  *
@@ -44,6 +166,7 @@ var DefaultTabs;
44
166
  DefaultTabs["progress"] = "progress";
45
167
  DefaultTabs["audit"] = "audit";
46
168
  DefaultTabs["documents"] = "documents";
169
+ DefaultTabs["contactMoments"] = "contact-moments";
47
170
  })(DefaultTabs || (DefaultTabs = {}));
48
171
 
49
172
  /*
@@ -76,7 +199,8 @@ class DossierProcessStartModalComponent {
76
199
  }
77
200
  loadFormDefinition() {
78
201
  this.formDefinition = null;
79
- this.formLinkService.getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
202
+ this.formLinkService
203
+ .getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
80
204
  .subscribe(formDefinition => {
81
205
  this.formAssociation = formDefinition.formAssociation;
82
206
  const className = this.formAssociation.formLink.className.split('.');
@@ -121,15 +245,23 @@ class DossierProcessStartModalComponent {
121
245
  }
122
246
  onSubmit(submission) {
123
247
  this.formioSubmission = submission;
124
- this.formLinkService.onSubmit(this.processDefinitionKey, this.formAssociation.formLink.id, submission.data).subscribe((formSubmissionResult) => {
248
+ this.formLinkService
249
+ .onSubmit(this.processDefinitionKey, this.formAssociation.formLink.id, submission.data)
250
+ .subscribe((formSubmissionResult) => {
125
251
  this.modal.hide();
126
- this.router.navigate(['dossiers', this.documentDefinitionName, 'document', formSubmissionResult.documentId, 'summary']);
252
+ this.router.navigate([
253
+ 'dossiers',
254
+ this.documentDefinitionName,
255
+ 'document',
256
+ formSubmissionResult.documentId,
257
+ 'summary',
258
+ ]);
127
259
  }, errors => {
128
260
  this.form.showErrors(errors);
129
261
  });
130
262
  }
131
263
  isUserAdmin() {
132
- this.userProviderService.getUserSubject().subscribe((userIdentity) => {
264
+ this.userProviderService.getUserSubject().subscribe(userIdentity => {
133
265
  this.isAdmin = userIdentity.roles.includes('ROLE_ADMIN');
134
266
  }, error => {
135
267
  this.logger.error('Failed to retrieve user identity', error);
@@ -140,7 +272,7 @@ class DossierProcessStartModalComponent {
140
272
  DossierProcessStartModalComponent.decorators = [
141
273
  { type: Component, args: [{
142
274
  selector: 'valtimo-dossier-process-start-modal',
143
- template: "<!--\n ~ Copyright 2015-2020 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\"\n [options]=\"options\"\n (submit)=\"onSubmit($event)\">\n </valtimo-form-io>\n </div>\n <div body *ngIf=\"!formDefinition && isAdmin\">\n <div class=\"bg-warning text-black mb-0 p-3 text-center\" [translate]=\"'formManagement.noFormDefinitionFoundAdmin'\">\n </div>\n <div class=\"mb-0 mt-4 p-3 text-center\">\n <button class=\"btn btn-secondary btn-space\" type=\"button\"\n (click)=\"gotoFormLinkScreen();\"\n id=\"form-link-button\">{{'formManagement.gotoFormLinksButton' | translate}}\n </button>\n </div>\n </div>\n <div body *ngIf=\"!formDefinition && !isAdmin\">\n <div class=\"bg-warning text-black mb-0 p-3 text-center\" [translate]=\"'formManagement.noFormDefinitionFoundUser'\">\n </div>\n </div>\n</valtimo-modal>\n",
275
+ template: "<!--\n ~ Copyright 2015-2020 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=\"!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 class=\"btn btn-secondary btn-space\"\n type=\"button\"\n (click)=\"gotoFormLinkScreen()\"\n id=\"form-link-button\"\n >\n {{ 'formManagement.gotoFormLinksButton' | translate }}\n </button>\n </div>\n </div>\n <div body *ngIf=\"!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",
144
276
  encapsulation: ViewEncapsulation.None,
145
277
  styles: ["/*!\n * Copyright 2015-2020 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}"]
146
278
  },] }
@@ -191,14 +323,17 @@ class DossierService {
191
323
  const defaultColumn = columns.find(column => column.default);
192
324
  return {
193
325
  isSorting: false,
194
- state: { name: defaultColumn ? defaultColumn.propertyName : columns[0].propertyName, direction: 'DESC' }
326
+ state: {
327
+ name: defaultColumn ? defaultColumn.propertyName : columns[0].propertyName,
328
+ direction: 'DESC',
329
+ },
195
330
  };
196
331
  }
197
332
  }
198
333
  DossierService.ɵprov = ɵɵdefineInjectable({ factory: function DossierService_Factory() { return new DossierService(ɵɵinject(ConfigService)); }, token: DossierService, providedIn: "root" });
199
334
  DossierService.decorators = [
200
335
  { type: Injectable, args: [{
201
- providedIn: 'root'
336
+ providedIn: 'root',
202
337
  },] }
203
338
  ];
204
339
  DossierService.ctorParameters = () => [
@@ -240,7 +375,7 @@ class DossierListComponent {
240
375
  page: 1,
241
376
  size: 10,
242
377
  maxPaginationItemSize: 5,
243
- sort: undefined
378
+ sort: undefined,
244
379
  };
245
380
  this.selectedProcessDocumentDefinition = null;
246
381
  this.modalListenerAdded = false;
@@ -311,8 +446,8 @@ class DossierListComponent {
311
446
  this.processDefinitionListFields = [
312
447
  {
313
448
  key: 'processName',
314
- label: 'Proces'
315
- }
449
+ label: 'Proces',
450
+ },
316
451
  ];
317
452
  });
318
453
  }
@@ -321,7 +456,9 @@ class DossierListComponent {
321
456
  return new DocumentSearchRequestImpl(json.definitionName, this.pagination.page - 1, this.pagination.size, json.sequence, json.createdBy, json.globalSearchFilter, json.sort);
322
457
  }
323
458
  buildDocumentSearchRequest() {
324
- return new DocumentSearchRequestImpl(this.documentDefinitionName, this.pagination.page - 1, this.pagination.size, this.sequence, this.createdBy, this.globalSearchFilter, this.pagination.sort && this.pagination.sort.isSorting ? this.pagination.sort : this.initialSortState);
459
+ return new DocumentSearchRequestImpl(this.documentDefinitionName, this.pagination.page - 1, this.pagination.size, this.sequence, this.createdBy, this.globalSearchFilter, this.pagination.sort && this.pagination.sort.isSorting
460
+ ? this.pagination.sort
461
+ : this.initialSortState);
325
462
  }
326
463
  storeSearch(documentSearchRequest) {
327
464
  localStorage.setItem(this.getCachedKey(), JSON.stringify(documentSearchRequest));
@@ -336,7 +473,9 @@ class DossierListComponent {
336
473
  return 'list-search-' + this.documentDefinitionName;
337
474
  }
338
475
  rowClick(document) {
339
- this.router.navigate([`/dossiers/${this.documentDefinitionName}/document/${document.id}/${DefaultTabs.summary}`]);
476
+ this.router.navigate([
477
+ `/dossiers/${this.documentDefinitionName}/document/${document.id}/${DefaultTabs.summary}`,
478
+ ]);
340
479
  }
341
480
  startDossier() {
342
481
  if (this.processDocumentDefinitions.length > 1) {
@@ -392,7 +531,7 @@ class DossierListComponent {
392
531
  DossierListComponent.decorators = [
393
532
  { type: Component, args: [{
394
533
  selector: 'valtimo-dossier-list',
395
- template: "<!--\n ~ Copyright 2015-2020 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 *ngTemplateOutlet=\"sidebar\"></ng-container>\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <div>\n <div class=\"text-right mt-m3px mb-3\">\n <button\n type=\"button\"\n class=\"btn btn-space btn-primary mr-0\"\n (click)=\"startDossier()\"\n [ngbTooltip]=\"processDocumentDefinitions.length === 0 ? 'No action' : null\"\n placement=\"bottom\"\n [disabled]=\"processDocumentDefinitions.length === 0\"\n >\n {{ 'Start Dossier' | translate }}\n </button>\n </div>\n\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\">{{ 'dashboard.startProcess.title' | translate }}</h3>\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 processDocumentDefinitions\"\n (click)=\"selectProcess(processDocumentDefinition)\"\n style=\"cursor: pointer\"\n >\n <td>{{ processDocumentDefinition.processName }}</td>\n </tr>\n </table>\n </div>\n </div>\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 <valtimo-widget>\n <valtimo-list\n [items]=\"items\"\n [fields]=\"fields\"\n (rowClicked)=\"rowClick($event)\"\n [pagination]=\"pagination\"\n [viewMode]=\"true\"\n [header]=\"true\"\n paginationIdentifier=\"dossierList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet()\"\n [initialSortState]=\"getInitialSortState()\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">\n {{ schema?.title }}\n <sup class=\"ml-1 badge badge-pill badge-primary\">{{ documents?.content.length || 0 }}</sup>\n </h3>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n </div>\n <valtimo-dossier-process-start-modal #processStartModal></valtimo-dossier-process-start-modal>\n</div>\n\n<ng-template #sidebar>\n <valtimo-filter-sidebar>\n <h4 class=\"title\">Search</h4>\n <div class=\"mb-4\">\n <input\n type=\"text\"\n class=\"form-control\"\n placeholder=\"{{ 'dossier.forms.globalSearchPlaceHolder' | translate }}\"\n [(ngModel)]=\"globalSearchFilter\"\n (blur)=\"doSearch()\"\n (keyup.enter)=\"doSearch()\"\n />\n </div>\n\n <div class=\"mb-4\">\n <input\n type=\"number\"\n class=\"form-control\"\n placeholder=\"{{ 'dossier.forms.referenceNumberPlaceHolder' | translate }}\"\n [(ngModel)]=\"sequence\"\n (blur)=\"doSearch()\"\n (keyup.enter)=\"doSearch()\"\n />\n </div>\n </valtimo-filter-sidebar>\n</ng-template>\n",
534
+ template: "<!--\n ~ Copyright 2015-2020 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 *ngTemplateOutlet=\"sidebar\"></ng-container>\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <div>\n <div class=\"text-right mt-m3px mb-3\">\n <button\n type=\"button\"\n class=\"btn btn-space btn-primary mr-0\"\n (click)=\"startDossier()\"\n [ngbTooltip]=\"processDocumentDefinitions.length === 0 ? 'No action' : null\"\n placement=\"bottom\"\n [disabled]=\"processDocumentDefinitions.length === 0\"\n >\n {{ 'Start Dossier' | translate }}\n </button>\n </div>\n\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 <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 processDocumentDefinitions\"\n (click)=\"selectProcess(processDocumentDefinition)\"\n style=\"cursor: pointer\"\n >\n <td>{{ processDocumentDefinition.processName }}</td>\n </tr>\n </table>\n </div>\n </div>\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 <valtimo-widget>\n <valtimo-list\n [items]=\"items\"\n [fields]=\"fields\"\n (rowClicked)=\"rowClick($event)\"\n [pagination]=\"pagination\"\n [viewMode]=\"true\"\n [header]=\"true\"\n paginationIdentifier=\"dossierList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet()\"\n [initialSortState]=\"getInitialSortState()\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">\n {{ schema?.title }}\n <sup class=\"ml-1 badge badge-pill badge-primary\">{{\n documents?.content.length || 0\n }}</sup>\n </h3>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n </div>\n <valtimo-dossier-process-start-modal #processStartModal></valtimo-dossier-process-start-modal>\n</div>\n\n<ng-template #sidebar>\n <valtimo-filter-sidebar>\n <h4 class=\"title\">Search</h4>\n <div class=\"mb-4\">\n <input\n type=\"text\"\n class=\"form-control\"\n placeholder=\"{{ 'dossier.forms.globalSearchPlaceHolder' | translate }}\"\n [(ngModel)]=\"globalSearchFilter\"\n (blur)=\"doSearch()\"\n (keyup.enter)=\"doSearch()\"\n />\n </div>\n\n <div class=\"mb-4\">\n <input\n type=\"number\"\n class=\"form-control\"\n placeholder=\"{{ 'dossier.forms.referenceNumberPlaceHolder' | translate }}\"\n [(ngModel)]=\"sequence\"\n (blur)=\"doSearch()\"\n (keyup.enter)=\"doSearch()\"\n />\n </div>\n </valtimo-filter-sidebar>\n</ng-template>\n",
396
535
  styles: [""]
397
536
  },] }
398
537
  ];
@@ -466,7 +605,9 @@ class DossierDetailTabSummaryComponent {
466
605
  });
467
606
  }
468
607
  loadProcessDocumentInstances(documentId) {
469
- this.documentService.findProcessDocumentInstances(documentId).subscribe(processDocumentInstances => {
608
+ this.documentService
609
+ .findProcessDocumentInstances(documentId)
610
+ .subscribe(processDocumentInstances => {
470
611
  this.processDocumentInstances = processDocumentInstances;
471
612
  this.processDocumentInstances.forEach(instance => {
472
613
  this.loadProcessInstanceTasks(instance.id.processInstanceId);
@@ -502,7 +643,7 @@ class DossierDetailTabSummaryComponent {
502
643
  DossierDetailTabSummaryComponent.decorators = [
503
644
  { type: Component, args: [{
504
645
  selector: 'valtimo-dossier-detail-tab-summary',
505
- template: "<!--\n ~ Copyright 2015-2020 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 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\">User tasks</h4>\n <ng-container *ngIf=\"!tasks.length\">\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 <ng-container *ngFor=\"let task of tasks\">\n <valtimo-widget>\n <div class=\"p-3 clickable hoverable\" (click)=\"rowTaskClick(task)\" *ngIf=\"!task.isLocked()\">\n <span class=\"float-right badge badge-pill badge-primary\">Open</span>\n <strong>{{ task.name }}</strong>\n <div>Created {{ task.created }}</div>\n </div>\n <div class=\"p-3 hoverable\" *ngIf=\"task.isLocked()\">\n <span class=\"float-right badge badge-pill badge-secondary bg-grey\"\n ngbTooltip=\"{{ 'summary.taskLocked' | translate }}\">\n <i class=\"icon mdi mdi-lock\"></i>\n </span>\n <strong>{{ task.name }}</strong>\n <div>Created {{ task.created }}</div>\n </div>\n </valtimo-widget>\n </ng-container>\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",
646
+ template: "<!--\n ~ Copyright 2015-2020 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 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\">User tasks</h4>\n <ng-container *ngIf=\"!tasks.length\">\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 <ng-container *ngFor=\"let task of tasks\">\n <valtimo-widget>\n <div\n class=\"p-3 clickable hoverable\"\n (click)=\"rowTaskClick(task)\"\n *ngIf=\"!task.isLocked()\"\n >\n <span class=\"float-right badge badge-pill badge-primary\">Open</span>\n <strong>{{ task.name }}</strong>\n <div>Created {{ 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>Created {{ task.created }}</div>\n </div>\n </valtimo-widget>\n </ng-container>\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",
506
647
  encapsulation: ViewEncapsulation.None,
507
648
  styles: ["/*!\n * Copyright 2015-2020 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{background-color:#fff;border:0;font-size:13px;height:24px!important;margin:0;padding:0!important}.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{color:#000;font-weight:400;height:20px;margin-bottom:12px;margin-top:0}"]
508
649
  },] }
@@ -545,7 +686,9 @@ class DossierDetailTabProgressComponent {
545
686
  this.documentId = snapshot.get('documentId') || '';
546
687
  }
547
688
  ngOnInit() {
548
- this.documentService.findProcessDocumentInstances(this.documentId).subscribe(processDocumentInstances => {
689
+ this.documentService
690
+ .findProcessDocumentInstances(this.documentId)
691
+ .subscribe(processDocumentInstances => {
549
692
  this.processDocumentInstances = processDocumentInstances;
550
693
  this.selectedProcessInstanceId = processDocumentInstances[0].id.processInstanceId;
551
694
  });
@@ -557,7 +700,7 @@ class DossierDetailTabProgressComponent {
557
700
  DossierDetailTabProgressComponent.decorators = [
558
701
  { type: Component, args: [{
559
702
  selector: 'valtimo-dossier-detail-tab-progress',
560
- template: "<!--\n ~ Copyright 2015-2020 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=\"full-height-tab-content\" *ngIf=\"processDocumentInstances\">\n <div class=\"col-3\">\n <label><strong>Process</strong></label><br/>\n <select class=\"form-control\" (change)=\"loadProcessInstance($event.target.value)\">\n <option *ngFor=\"let processDocumentInstance of processDocumentInstances\"\n [value]=\"processDocumentInstance.id.processInstanceId\"\n [selected]=\"selectedProcessInstanceId === processDocumentInstance.id.processInstanceId\">\n {{ processDocumentInstance.processName }}\n </option>\n </select>\n </div>\n <valtimo-process-diagram [processInstanceId]=\"selectedProcessInstanceId\"></valtimo-process-diagram>\n</div>\n",
703
+ template: "<!--\n ~ Copyright 2015-2020 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=\"full-height-tab-content\" *ngIf=\"processDocumentInstances\">\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",
561
704
  styles: [".full-height-tab-content{height:calc(100vh - 380px);width:100%}"]
562
705
  },] }
563
706
  ];
@@ -589,6 +732,8 @@ class DossierDetailTabAuditComponent {
589
732
  this.route = route;
590
733
  this.documentService = documentService;
591
734
  this.spinnerService = spinnerService;
735
+ this.paginationClicked = new EventEmitter();
736
+ this.defaultAuditPage = 0;
592
737
  this.spinnerService.show('auditSpinner');
593
738
  const snapshot = this.route.snapshot.paramMap;
594
739
  this.documentId = snapshot.get('documentId') || '';
@@ -599,7 +744,10 @@ class DossierDetailTabAuditComponent {
599
744
  return 'events.' + eventName;
600
745
  }
601
746
  ngOnInit() {
602
- this.documentService.getAuditLog(this.documentId).subscribe(page => {
747
+ this.loadAuditPage(this.defaultAuditPage);
748
+ }
749
+ loadAuditPage(pageNumber) {
750
+ this.documentService.getAuditLog(this.documentId, pageNumber).subscribe(page => {
603
751
  const timelineItems = [];
604
752
  page.content.forEach(auditRecord => {
605
753
  const occurredOn = moment$2(auditRecord.metaData.occurredOn);
@@ -608,14 +756,21 @@ class DossierDetailTabAuditComponent {
608
756
  });
609
757
  this.timelineItems = timelineItems;
610
758
  this.spinnerService.hide('auditSpinner');
759
+ this.pagination = page;
760
+ this.pagination.number += 1;
611
761
  });
612
762
  }
763
+ onChangePagination(page) {
764
+ this.paginationClicked.emit(page);
765
+ this.currentAuditPage = page - 1;
766
+ this.loadAuditPage(this.currentAuditPage);
767
+ }
613
768
  }
614
769
  DossierDetailTabAuditComponent.decorators = [
615
770
  { type: Component, args: [{
616
771
  selector: 'valtimo-dossier-detail-tab-audit',
617
- template: "<!--\n ~ Copyright 2015-2020 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",
618
- styles: [""]
772
+ template: "<!--\n ~ Copyright 2015-2020 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",
773
+ styles: [".audit-pagination{border-top:1px solid #dee2e6;margin:0 -1.923rem -1.923rem!important}"]
619
774
  },] }
620
775
  ];
621
776
  DossierDetailTabAuditComponent.ctorParameters = () => [
@@ -623,6 +778,9 @@ DossierDetailTabAuditComponent.ctorParameters = () => [
623
778
  { type: DocumentService },
624
779
  { type: NgxSpinnerService }
625
780
  ];
781
+ DossierDetailTabAuditComponent.propDecorators = {
782
+ paginationClicked: [{ type: Output }]
783
+ };
626
784
 
627
785
  /*
628
786
  * Copyright 2015-2020 Ritense BV, the Netherlands.
@@ -640,30 +798,44 @@ DossierDetailTabAuditComponent.ctorParameters = () => [
640
798
  * limitations under the License.
641
799
  */
642
800
  class DossierDetailTabDocumentsComponent {
643
- constructor(route, documentService, toastrService, uploadProviderService, downloadService) {
801
+ constructor(route, documentService, toastrService, uploadProviderService, downloadService, translateService, configService) {
802
+ var _a, _b;
644
803
  this.route = route;
645
804
  this.documentService = documentService;
646
805
  this.toastrService = toastrService;
647
806
  this.uploadProviderService = uploadProviderService;
648
807
  this.downloadService = downloadService;
649
- this.relatedFiles = [];
808
+ this.translateService = translateService;
809
+ this.configService = configService;
810
+ this.maxFileSize = ((_b = (_a = this.configService) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.caseFileSizeUploadLimitMB) || 5;
811
+ this.refetch$ = new BehaviorSubject(null);
812
+ this.relatedFiles$ = this.refetch$.pipe(switchMap(() => combineLatest([
813
+ this.documentService.getDocument(this.documentId),
814
+ this.translateService.stream('key'),
815
+ ])), map(([document]) => {
816
+ const relatedFiles = (document === null || document === void 0 ? void 0 : document.relatedFiles) || [];
817
+ const translatedFiles = relatedFiles.map(file => {
818
+ return Object.assign(Object.assign({}, file), { createdBy: file.createdBy || this.translateService.instant('list.automaticallyGenerated') });
819
+ });
820
+ return translatedFiles || [];
821
+ }));
650
822
  this.fields = [
651
823
  { key: 'fileName', label: 'File name' },
652
824
  { key: 'sizeInBytes', label: 'Size in bytes' },
653
825
  { key: 'createdOn', label: 'Created on', viewType: 'date' },
654
- { key: 'createdBy', label: 'Created by' }
826
+ { key: 'createdBy', label: 'Created by' },
655
827
  ];
656
828
  this.actions = [
657
829
  {
658
830
  columnName: '',
659
831
  iconClass: 'fas fa-external-link-alt',
660
- callback: this.downloadDocument.bind(this)
832
+ callback: this.downloadDocument.bind(this),
661
833
  },
662
834
  {
663
835
  columnName: '',
664
836
  iconClass: 'fas fa-trash-alt',
665
- callback: this.removeRelatedFile.bind(this)
666
- }
837
+ callback: this.removeRelatedFile.bind(this),
838
+ },
667
839
  ];
668
840
  this.uploading$ = new BehaviorSubject(false);
669
841
  const snapshot = this.route.snapshot.paramMap;
@@ -671,42 +843,45 @@ class DossierDetailTabDocumentsComponent {
671
843
  this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
672
844
  }
673
845
  ngOnInit() {
674
- this.loadDocuments();
846
+ this.refetchDocuments();
675
847
  }
676
848
  fileSelected(file) {
677
849
  this.uploading$.next(true);
678
- this.uploadProviderService.uploadFile(file, this.documentDefinitionName).pipe(switchMap((resourceFile) => this.documentService.assignResource(this.documentId, resourceFile.data.resourceId))).subscribe(() => {
850
+ this.uploadProviderService
851
+ .uploadFile(file, this.documentDefinitionName)
852
+ .pipe(switchMap(resourceFile => this.documentService.assignResource(this.documentId, resourceFile.data.resourceId)))
853
+ .subscribe(() => {
679
854
  this.toastrService.success('Successfully uploaded document to dossier');
680
- this.loadDocuments();
855
+ this.refetchDocuments();
681
856
  this.uploading$.next(false);
682
857
  }, () => {
683
858
  this.toastrService.error('Failed to upload document to dossier');
684
859
  this.uploading$.next(false);
685
860
  });
686
861
  }
687
- loadDocuments() {
688
- this.documentService.getDocument(this.documentId).subscribe((document) => {
689
- this.relatedFiles = document.relatedFiles;
690
- });
691
- }
692
862
  downloadDocument(relatedFile) {
693
- this.uploadProviderService.getResource(relatedFile.fileId).subscribe((resource) => {
863
+ this.uploadProviderService
864
+ .getResource(relatedFile.fileId)
865
+ .subscribe((resource) => {
694
866
  this.downloadService.downloadFile(resource.url, resource.resource.name);
695
867
  });
696
868
  }
697
869
  removeRelatedFile(relatedFile) {
698
870
  this.documentService.removeResource(this.documentId, relatedFile.fileId).subscribe(() => {
699
871
  this.toastrService.success('Successfully removed document from dossier');
700
- this.loadDocuments();
872
+ this.refetchDocuments();
701
873
  }, () => {
702
874
  this.toastrService.error('Failed to remove document from dossier');
703
875
  });
704
876
  }
877
+ refetchDocuments() {
878
+ this.refetch$.next(null);
879
+ }
705
880
  }
706
881
  DossierDetailTabDocumentsComponent.decorators = [
707
882
  { type: Component, args: [{
708
883
  selector: 'valtimo-dossier-detail-tab-documents',
709
- template: "<!--\n ~ Copyright 2015-2020 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]=\"null\"\n [hideFilePreview]=\"true\"\n [hideTitle]=\"true\"\n [maxFileSize]=\"5\"\n [showMaxFileSize]=\"false\"\n [camera]=\"false\"\n [uploading]=\"uploading$ | async\"\n></valtimo-dropzone>\n\n<valtimo-widget>\n <valtimo-list\n [fields]=\"fields\"\n [items]=\"relatedFiles\"\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\">{{ 'Overview of all documents in this dossier' | translate }}</h5>\n </div>\n </valtimo-list>\n</valtimo-widget>\n",
884
+ template: "<!--\n ~ Copyright 2015-2020 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]=\"null\"\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",
710
885
  styles: [""]
711
886
  },] }
712
887
  ];
@@ -715,7 +890,9 @@ DossierDetailTabDocumentsComponent.ctorParameters = () => [
715
890
  { type: DocumentService },
716
891
  { type: ToastrService },
717
892
  { type: UploadProviderService },
718
- { type: DownloadService }
893
+ { type: DownloadService },
894
+ { type: TranslateService },
895
+ { type: ConfigService }
719
896
  ];
720
897
 
721
898
  /*
@@ -738,7 +915,7 @@ const DEFAULT_TABS = new Map([
738
915
  [DefaultTabs.summary, DossierDetailTabSummaryComponent],
739
916
  [DefaultTabs.progress, DossierDetailTabProgressComponent],
740
917
  [DefaultTabs.audit, DossierDetailTabAuditComponent],
741
- [DefaultTabs.documents, DossierDetailTabDocumentsComponent]
918
+ [DefaultTabs.documents, DossierDetailTabDocumentsComponent],
742
919
  ]);
743
920
 
744
921
  /*
@@ -773,7 +950,7 @@ class TabService {
773
950
  TabService.ɵprov = ɵɵdefineInjectable({ factory: function TabService_Factory() { return new TabService(ɵɵinject(TAB_MAP)); }, token: TabService, providedIn: "root" });
774
951
  TabService.decorators = [
775
952
  { type: Injectable, args: [{
776
- providedIn: 'root'
953
+ providedIn: 'root',
777
954
  },] }
778
955
  ];
779
956
  TabService.ctorParameters = () => [
@@ -807,7 +984,8 @@ class DossierSupportingProcessStartModalComponent {
807
984
  }
808
985
  loadFormDefinition() {
809
986
  this.formDefinition = null;
810
- this.formLinkService.getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
987
+ this.formLinkService
988
+ .getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
811
989
  .subscribe(formDefinition => {
812
990
  this.formAssociation = formDefinition.formAssociation;
813
991
  const className = this.formAssociation.formLink.className.split('.');
@@ -817,7 +995,7 @@ class DossierSupportingProcessStartModalComponent {
817
995
  this.formDefinition = formDefinition;
818
996
  this.documentService.getDocument(this.documentId).subscribe(document => {
819
997
  this.submission = {
820
- data: document.content
998
+ data: document.content,
821
999
  };
822
1000
  }, () => noop());
823
1001
  this.modal.show();
@@ -827,7 +1005,12 @@ class DossierSupportingProcessStartModalComponent {
827
1005
  window.open(url, '_blank');
828
1006
  break;
829
1007
  case 'BpmnElementAngularStateUrlLink':
830
- this.router.navigate([formDefinition.formAssociation.formLink.url]);
1008
+ this.route.params.pipe(take(1)).subscribe(params => {
1009
+ const documentId = params === null || params === void 0 ? void 0 : params.documentId;
1010
+ this.router.navigate([formDefinition.formAssociation.formLink.url], {
1011
+ state: Object.assign({}, (documentId && { documentId })),
1012
+ });
1013
+ });
831
1014
  break;
832
1015
  default:
833
1016
  this.logger.fatal('Unsupported class name');
@@ -854,7 +1037,9 @@ class DossierSupportingProcessStartModalComponent {
854
1037
  }
855
1038
  onSubmit(submission) {
856
1039
  this.formioSubmission = submission;
857
- this.formLinkService.onSubmit(this.processDefinitionKey, this.formAssociation.formLink.id, submission.data, this.documentId).subscribe((formSubmissionResult) => {
1040
+ this.formLinkService
1041
+ .onSubmit(this.processDefinitionKey, this.formAssociation.formLink.id, submission.data, this.documentId)
1042
+ .subscribe((formSubmissionResult) => {
858
1043
  this.modal.hide();
859
1044
  this.formSubmit.emit();
860
1045
  }, errors => {
@@ -869,7 +1054,7 @@ class DossierSupportingProcessStartModalComponent {
869
1054
  DossierSupportingProcessStartModalComponent.decorators = [
870
1055
  { type: Component, args: [{
871
1056
  selector: 'valtimo-dossier-supporting-process-start-modal',
872
- template: "<!--\n ~ Copyright 2015-2020 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 #supportingProcessStartModal elementId=\"supportingProcessStartModal\" [title]=\"modalTitle\">\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io #form\n [submission]=\"submission\"\n [form]=\"formDefinition\"\n [options]=\"options\"\n (submit)=\"onSubmit($event)\">\n </valtimo-form-io>\n </div>\n <div body *ngIf=\"!formDefinition\">\n <div class=\"bg-warning text-black mb-0 p-3 text-center\" [translate]=\"'formManagement.noFormDefinitionFound'\">\n </div>\n <div class=\"mb-0 mt-4 p-3 text-center\">\n <button class=\"btn btn-secondary btn-space\" type=\"button\"\n (click)=\"gotoFormLinkScreen();\"\n id=\"form-link-button\">{{'formManagement.gotoFormLinksButton' | translate}}\n </button>\n </div>\n </div>\n</valtimo-modal>\n",
1057
+ template: "<!--\n ~ Copyright 2015-2020 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]=\"modalTitle\"\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=\"!formDefinition\">\n <div\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'formManagement.noFormDefinitionFound'\"\n ></div>\n <div class=\"mb-0 mt-4 p-3 text-center\">\n <button\n class=\"btn btn-secondary btn-space\"\n type=\"button\"\n (click)=\"gotoFormLinkScreen()\"\n id=\"form-link-button\"\n >\n {{ 'formManagement.gotoFormLinksButton' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n",
873
1058
  encapsulation: ViewEncapsulation.None,
874
1059
  styles: ["/*!\n * Copyright 2015-2020 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}"]
875
1060
  },] }
@@ -923,7 +1108,9 @@ class DossierDetailComponent {
923
1108
  }
924
1109
  ngOnInit() {
925
1110
  this.tabLoader = new TabLoaderImpl(this.tabService.getTabs(), this.componentFactoryResolver, this.viewContainerRef, this.translateService, this.router, this.location);
926
- this.documentService.getDocumentDefinition(this.documentDefinitionName).subscribe(definition => {
1111
+ this.documentService
1112
+ .getDocumentDefinition(this.documentDefinitionName)
1113
+ .subscribe(definition => {
927
1114
  this.documentDefinitionNameTitle = definition.schema.title;
928
1115
  });
929
1116
  this.initialTabName = this.snapshot.get('tab');
@@ -931,13 +1118,16 @@ class DossierDetailComponent {
931
1118
  this.getAllAssociatedProcessDefinitions();
932
1119
  }
933
1120
  getAllAssociatedProcessDefinitions() {
934
- this.documentService.findProcessDocumentDefinitions(this.documentDefinitionName).subscribe(processDocumentDefinitions => {
935
- this.processDocumentDefinitions = processDocumentDefinitions
936
- .filter(processDocumentDefinition => processDocumentDefinition.startableByUser);
937
- this.processDefinitionListFields = [{
1121
+ this.documentService
1122
+ .findProcessDocumentDefinitions(this.documentDefinitionName)
1123
+ .subscribe(processDocumentDefinitions => {
1124
+ this.processDocumentDefinitions = processDocumentDefinitions.filter(processDocumentDefinition => processDocumentDefinition.startableByUser);
1125
+ this.processDefinitionListFields = [
1126
+ {
938
1127
  key: 'processName',
939
- label: 'Proces'
940
- }];
1128
+ label: 'Proces',
1129
+ },
1130
+ ];
941
1131
  });
942
1132
  }
943
1133
  startProcess(processDocumentDefinition) {
@@ -947,7 +1137,7 @@ class DossierDetailComponent {
947
1137
  DossierDetailComponent.decorators = [
948
1138
  { type: Component, args: [{
949
1139
  selector: 'valtimo-dossier-detail',
950
- template: "<!--\n ~ Copyright 2015-2020 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>\n <div class=\"card-header bg-light card-header-divider pb-5\">\n {{ documentDefinitionNameTitle }}\n <div class=\"float-right\">\n <div class=\"dropdown\">\n <button class=\"btn btn-primary dropdown-toggle\" type=\"button\"\n id=\"startProcessDropdown\" placement=\"bottom\"\n [ngbTooltip]=\"processDocumentDefinitions.length === 0 ? 'No action' : null\"\n [disabled]=\"processDocumentDefinitions.length === 0\"\n data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <span>Start</span>\n <i class=\"pl-2 fas fa-caret-down\"></i>\n </button>\n <div class=\"dropdown-menu dropdown-menu-right\" aria-labelledby=\"startProcessDropdown\">\n <button *ngFor=\"let processDocumentDefinition of processDocumentDefinitions\" class=\"dropdown-item p\"\n href=\"#\"\n (click)=\"startProcess(processDocumentDefinition)\">{{processDocumentDefinition.processName}}</button>\n </div>\n </div>\n </div>\n </div>\n <ul class=\"nav nav-tabs\">\n <li class=\"nav-item\" *ngFor=\"let tab of tabLoader.tabs\">\n <a id=\"{{ tab.name }}-tab\" class=\"nav-link clickable\"\n [ngClass]=\"{'active' : tab.isActive()}\"\n data-toggle=\"tab\"\n (click)=\"tabLoader.load(tab)\">\n {{ tabLoader.translateTabName(tab) }}\n </a>\n </li>\n </ul>\n <div class=\"card-body bg-white p-5 position-relative tab-container\">\n <ng-template #tabContainer>Loading...</ng-template>\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </div>\n <valtimo-dossier-supporting-process-start-modal (formSubmit)=\"tabLoader.refreshView()\"\n #supportingProcessStartModal></valtimo-dossier-supporting-process-start-modal>\n </div>\n</div>\n",
1140
+ template: "<!--\n ~ Copyright 2015-2020 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>\n <div class=\"card-header bg-light card-header-divider pb-5\">\n {{ documentDefinitionNameTitle }}\n <div class=\"btn-group mt-m3px mb-3 float-right\">\n <valtimo-extension\n module=\"dossier\"\n page=\"dossier-detail\"\n section=\"card-header\"\n ></valtimo-extension>\n <div class=\"dropdown\">\n <button\n class=\"btn btn-primary dropdown-toggle\"\n type=\"button\"\n id=\"startProcessDropdown\"\n placement=\"bottom\"\n [ngbTooltip]=\"processDocumentDefinitions.length === 0 ? 'No action' : null\"\n [disabled]=\"processDocumentDefinitions.length === 0\"\n data-toggle=\"dropdown\"\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n >\n <span>Start</span>\n <i class=\"pl-2 fas fa-caret-down\"></i>\n </button>\n <div class=\"dropdown-menu dropdown-menu-right\" aria-labelledby=\"startProcessDropdown\">\n <button\n *ngFor=\"let processDocumentDefinition of processDocumentDefinitions\"\n class=\"dropdown-item p\"\n href=\"#\"\n (click)=\"startProcess(processDocumentDefinition)\"\n >\n {{ processDocumentDefinition.processName }}\n </button>\n </div>\n </div>\n </div>\n </div>\n <ul class=\"nav nav-tabs\">\n <li class=\"nav-item\" *ngFor=\"let tab of tabLoader.tabs\">\n <a\n id=\"{{ tab.name }}-tab\"\n class=\"nav-link clickable\"\n [ngClass]=\"{active: tab.isActive()}\"\n data-toggle=\"tab\"\n (click)=\"tabLoader.load(tab)\"\n >\n {{ tabLoader.translateTabName(tab) }}\n </a>\n </li>\n </ul>\n <div class=\"card-body bg-white p-5 position-relative tab-container\">\n <ng-template #tabContainer>Loading...</ng-template>\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </div>\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",
951
1141
  styles: [".tab-container{min-height:300px}"]
952
1142
  },] }
953
1143
  ];
@@ -967,7 +1157,7 @@ DossierDetailComponent.propDecorators = {
967
1157
  };
968
1158
 
969
1159
  /*
970
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1160
+ * Copyright 2015-2021 Ritense BV, the Netherlands.
971
1161
  *
972
1162
  * Licensed under EUPL, Version 1.2 (the "License");
973
1163
  * you may not use this file except in compliance with the License.
@@ -983,6 +1173,88 @@ DossierDetailComponent.propDecorators = {
983
1173
  */
984
1174
  const moment$3 = moment_;
985
1175
  moment$3.locale(localStorage.getItem('langKey') || '');
1176
+ class DossierDetailTabContactMomentsComponent {
1177
+ constructor(contactMomentService, alertService, translateService) {
1178
+ this.contactMomentService = contactMomentService;
1179
+ this.alertService = alertService;
1180
+ this.translateService = translateService;
1181
+ this.refetchContactMoments$ = new BehaviorSubject('');
1182
+ this.contactMoments$ = this.refetchContactMoments$.pipe(switchMap(() => this.contactMomentService.getContactMoments()), map(contactMoments => contactMoments.map(contactMoment => {
1183
+ const registratieDatum = moment$3(contactMoment.registratiedatum);
1184
+ return new TimelineItemImpl(registratieDatum.format('DD MMM YYYY'), registratieDatum.format('HH:mm'), contactMoment.medewerkerIdentificatie.achternaam, contactMoment.kanaal, contactMoment.tekst, null);
1185
+ })));
1186
+ this.text$ = new BehaviorSubject('');
1187
+ this.channel$ = new BehaviorSubject('MAIL');
1188
+ this.requestData$ = combineLatest([this.text$, this.channel$]);
1189
+ this.valid$ = this.requestData$.pipe(map(([text, channel]) => !!(text && channel)));
1190
+ this.disabled$ = new BehaviorSubject(false);
1191
+ }
1192
+ textChange(text) {
1193
+ this.text$.next(text);
1194
+ }
1195
+ buttonClick() {
1196
+ this.modal.show();
1197
+ }
1198
+ saveNote() {
1199
+ this.disable();
1200
+ this.requestData$.pipe(take(1)).subscribe(([text, channel]) => {
1201
+ this.contactMomentService.saveContactMoment({ kanaal: channel, tekst: text }).subscribe(() => {
1202
+ this.alertService.success(this.translateService.instant('dossier.contactMoments.saveSuccess'));
1203
+ this.enable();
1204
+ this.clear();
1205
+ this.modal.hide();
1206
+ this.refetchContactMoments();
1207
+ }, () => {
1208
+ this.enable();
1209
+ });
1210
+ });
1211
+ }
1212
+ disable() {
1213
+ this.disabled$.next(true);
1214
+ }
1215
+ enable() {
1216
+ this.disabled$.next(false);
1217
+ }
1218
+ clear() {
1219
+ this.text$.next('');
1220
+ }
1221
+ refetchContactMoments() {
1222
+ this.refetchContactMoments$.next('');
1223
+ }
1224
+ }
1225
+ DossierDetailTabContactMomentsComponent.decorators = [
1226
+ { type: Component, args: [{
1227
+ selector: 'valtimo-dossier-detail-tab-contact-moments',
1228
+ template: "<!--\n ~ Copyright 2015-2021 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-calendar-note\"></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",
1229
+ styles: ["/*!\n * Copyright 2015-2021 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{align-self:flex-end;display:inline}"]
1230
+ },] }
1231
+ ];
1232
+ DossierDetailTabContactMomentsComponent.ctorParameters = () => [
1233
+ { type: ContactMomentService },
1234
+ { type: AlertService },
1235
+ { type: TranslateService }
1236
+ ];
1237
+ DossierDetailTabContactMomentsComponent.propDecorators = {
1238
+ modal: [{ type: ViewChild, args: ['contactMomentsNoteModal',] }]
1239
+ };
1240
+
1241
+ /*
1242
+ * Copyright 2015-2020 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
+ const moment$4 = moment_;
1257
+ moment$4.locale(localStorage.getItem('langKey') || '');
986
1258
  class DossierUpdateComponent {
987
1259
  constructor(taskService, documentService, route, toastr, location, dossierService) {
988
1260
  this.taskService = taskService;
@@ -1018,10 +1290,10 @@ class DossierUpdateComponent {
1018
1290
  getTask(id) {
1019
1291
  this.taskService.getTask(id).subscribe(task => {
1020
1292
  this.task = task;
1021
- this.task.task.created = moment$3(this.task.task.created).format('DD MMM YYYY HH:mm');
1293
+ this.task.task.created = moment$4(this.task.task.created).format('DD MMM YYYY HH:mm');
1022
1294
  this.page = {
1023
1295
  title: this.task.task.name,
1024
- subtitle: `Created ${moment$3(this.task.task.created).fromNow()}`
1296
+ subtitle: `Created ${moment$4(this.task.task.created).fromNow()}`,
1025
1297
  };
1026
1298
  });
1027
1299
  }
@@ -1035,7 +1307,7 @@ class DossierUpdateComponent {
1035
1307
  const document = {
1036
1308
  documentId: this.document.id,
1037
1309
  content: this.document.content,
1038
- versionBasedOn: this.document.version
1310
+ versionBasedOn: this.document.version,
1039
1311
  };
1040
1312
  this.documentService.modifyDocument(document).subscribe(result => {
1041
1313
  this.document = result.document;
@@ -1050,9 +1322,9 @@ class DossierUpdateComponent {
1050
1322
  request: {
1051
1323
  documentId: this.document.id,
1052
1324
  content: mergedData,
1053
- versionBasedOn: this.document.version
1325
+ versionBasedOn: this.document.version,
1054
1326
  },
1055
- taskId: this.task.task.id
1327
+ taskId: this.task.task.id,
1056
1328
  };
1057
1329
  this.documentService.modifyDocumentAndCompleteTask(documentData).subscribe(result => {
1058
1330
  this.toastr.success(this.task.task.name + ' has successfully been completed');
@@ -1066,7 +1338,7 @@ class DossierUpdateComponent {
1066
1338
  DossierUpdateComponent.decorators = [
1067
1339
  { type: Component, args: [{
1068
1340
  selector: 'valtimo-dossier-update',
1069
- template: "<!--\n ~ Copyright 2015-2020 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\n <!--view with custom definitions-->\n <div *ngIf=\"this.customDefinitions\">\n <div class=\"mb-4\" *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 class=\"btn btn-space btn-default float-left\" type=\"button\" (click)=\"back()\" id=\"back-button\">Back</button>\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\" id=\"reset-button\">Reset</button>\n <button class=\"btn btn-space btn-primary\" type=\"button\" (click)=\"save()\" id=\"save-button\">Save</button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" (click)=\"submit({})\" id=\"submit-button\">Submit</button>\n </div>\n </div>\n </div>\n </div>\n\n <valtimo-camunda-form *ngIf=\"task?.formFields && !this.customDefinitions\"\n (submitted)=\"submit($event)\"\n [formFields]=\"task.formFields\"\n [componentName]=\"task.formLocation\"></valtimo-camunda-form>\n\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n",
1341
+ template: "<!--\n ~ Copyright 2015-2020 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",
1070
1342
  styles: [""]
1071
1343
  },] }
1072
1344
  ];
@@ -1094,36 +1366,37 @@ DossierUpdateComponent.ctorParameters = () => [
1094
1366
  * See the License for the specific language governing permissions and
1095
1367
  * limitations under the License.
1096
1368
  */
1097
- const ɵ0 = { title: 'Dossiers', roles: [ROLE_USER] }, ɵ1 = { title: 'Dossiers', parentPath: 'dossiers/:documentDefinitionName', roles: [ROLE_USER] }, ɵ2 = { title: 'Task details', parentPath: 'dossiers/:documentDefinitionName/document/:documentId/:tab', roles: [ROLE_USER] };
1369
+ const ɵ0 = { title: 'Dossiers', roles: [ROLE_USER] }, ɵ1 = { title: 'Dossiers', parentPath: 'dossiers/:documentDefinitionName', roles: [ROLE_USER] }, ɵ2 = {
1370
+ title: 'Task details',
1371
+ parentPath: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
1372
+ roles: [ROLE_USER],
1373
+ };
1098
1374
  const routes = [
1099
1375
  {
1100
1376
  path: 'dossiers/:documentDefinitionName',
1101
1377
  component: DossierListComponent,
1102
1378
  canActivate: [AuthGuardService],
1103
- data: ɵ0
1379
+ data: ɵ0,
1104
1380
  },
1105
1381
  {
1106
1382
  path: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
1107
1383
  component: DossierDetailComponent,
1108
1384
  canActivate: [AuthGuardService],
1109
- data: ɵ1
1385
+ data: ɵ1,
1110
1386
  },
1111
1387
  {
1112
1388
  path: 'dossiers/:documentDefinitionName/document/:documentId/:tab/tasks/:taskId',
1113
1389
  component: DossierUpdateComponent,
1114
1390
  canActivate: [AuthGuardService],
1115
- data: ɵ2
1116
- }
1391
+ data: ɵ2,
1392
+ },
1117
1393
  ];
1118
1394
  class DossierRoutingModule {
1119
1395
  }
1120
1396
  DossierRoutingModule.decorators = [
1121
1397
  { type: NgModule, args: [{
1122
- imports: [
1123
- CommonModule,
1124
- RouterModule.forChild(routes),
1125
- ],
1126
- exports: [RouterModule]
1398
+ imports: [CommonModule, RouterModule.forChild(routes)],
1399
+ exports: [RouterModule],
1127
1400
  },] }
1128
1401
  ];
1129
1402
 
@@ -1152,14 +1425,14 @@ class DossierModule {
1152
1425
  TabService,
1153
1426
  {
1154
1427
  provide: TAB_MAP,
1155
- useFactory: tabsFactory
1428
+ useFactory: tabsFactory,
1156
1429
  },
1157
1430
  {
1158
1431
  provide: ANALYZE_FOR_ENTRY_COMPONENTS,
1159
1432
  useValue: Array.from(tabsFactory().values()),
1160
- multi: true
1161
- }
1162
- ]
1433
+ multi: true,
1434
+ },
1435
+ ],
1163
1436
  };
1164
1437
  }
1165
1438
  }
@@ -1172,9 +1445,10 @@ DossierModule.decorators = [
1172
1445
  DossierDetailTabProgressComponent,
1173
1446
  DossierDetailTabAuditComponent,
1174
1447
  DossierDetailTabDocumentsComponent,
1448
+ DossierDetailTabContactMomentsComponent,
1175
1449
  DossierUpdateComponent,
1176
1450
  DossierProcessStartModalComponent,
1177
- DossierSupportingProcessStartModalComponent
1451
+ DossierSupportingProcessStartModalComponent,
1178
1452
  ],
1179
1453
  imports: [
1180
1454
  CommonModule,
@@ -1197,25 +1471,25 @@ DossierModule.decorators = [
1197
1471
  loader: {
1198
1472
  provide: TranslateLoader,
1199
1473
  useFactory: ɵ0$1,
1200
- deps: [HttpClient]
1201
- }
1474
+ deps: [HttpClient],
1475
+ },
1202
1476
  }),
1203
1477
  TaskModule,
1204
1478
  ModalModule,
1205
1479
  NgbTooltipModule,
1206
1480
  UploaderModule,
1207
- DropzoneModule
1208
- ],
1209
- exports: [
1210
- DossierListComponent,
1211
- DossierDetailComponent
1481
+ DropzoneModule,
1482
+ NgbPaginationModule,
1483
+ ConfigModule,
1212
1484
  ],
1485
+ exports: [DossierListComponent, DossierDetailComponent],
1213
1486
  entryComponents: [
1214
1487
  DossierDetailTabSummaryComponent,
1215
1488
  DossierDetailTabProgressComponent,
1216
1489
  DossierDetailTabAuditComponent,
1217
- DossierDetailTabDocumentsComponent
1218
- ]
1490
+ DossierDetailTabDocumentsComponent,
1491
+ DossierDetailTabContactMomentsComponent,
1492
+ ],
1219
1493
  },] }
1220
1494
  ];
1221
1495
 
@@ -1239,5 +1513,5 @@ DossierModule.decorators = [
1239
1513
  * Generated bundle index. Do not edit.
1240
1514
  */
1241
1515
 
1242
- export { DEFAULT_TABS, DefaultTabs, DossierDetailComponent, DossierDetailTabAuditComponent, DossierDetailTabDocumentsComponent, DossierDetailTabProgressComponent, DossierDetailTabSummaryComponent, DossierListComponent, DossierModule, DossierService, TAB_MAP, TabService, ɵ0$1 as ɵ0, DossierUpdateComponent as ɵa, DossierProcessStartModalComponent as ɵb, DossierSupportingProcessStartModalComponent as ɵc, DossierRoutingModule as ɵd };
1516
+ export { DEFAULT_TABS, DefaultTabs, DossierDetailComponent, DossierDetailTabAuditComponent, DossierDetailTabContactMomentsComponent, DossierDetailTabDocumentsComponent, DossierDetailTabProgressComponent, DossierDetailTabSummaryComponent, DossierListComponent, DossierModule, DossierService, TAB_MAP, TabImpl, TabLoaderImpl, TabService, ɵ0$1 as ɵ0, DossierUpdateComponent as ɵa, DossierProcessStartModalComponent as ɵb, DossierSupportingProcessStartModalComponent as ɵc, DossierRoutingModule as ɵd };
1243
1517
  //# sourceMappingURL=valtimo-dossier.js.map