@valtimo/dossier 4.15.3-next-main.14 → 4.16.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 (42) hide show
  1. package/bundles/valtimo-dossier.umd.js +368 -147
  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 +3 -3
  7. package/esm2015/lib/dossier-detail/tab/contact-moments/contact-moments.component.js +56 -16
  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 +1 -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 +14 -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 +2 -1
  24. package/esm2015/valtimo-dossier.js +1 -1
  25. package/fesm2015/valtimo-dossier.js +306 -99
  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 +1 -1
  29. package/lib/dossier-detail/tab/contact-moments/contact-moments.component.d.ts +23 -8
  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-list/dossier-list.component.d.ts +1 -2
  34. package/lib/dossier-process-start-modal/dossier-process-start-modal.component.d.ts +2 -3
  35. package/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.d.ts +2 -3
  36. package/lib/dossier.service.d.ts +2 -2
  37. package/lib/models/index.d.ts +1 -0
  38. package/lib/models/tabs.model.d.ts +50 -0
  39. package/lib/tab.service.d.ts +1 -1
  40. package/package.json +1 -1
  41. package/public_api.d.ts +1 -0
  42. package/valtimo-dossier.metadata.json +1 -1
@@ -5,25 +5,146 @@ import { TranslateService, TranslateModule, TranslateLoader } from '@ngx-transla
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, ConfigModule } 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';
20
+ import { switchMap, map, take } from 'rxjs/operators';
22
21
  import { ContactMomentService } from '@valtimo/contact-moment';
23
22
  import { NgbButtonsModule, NgbTooltipModule, NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap';
24
23
  import { FormsModule } from '@angular/forms';
25
24
  import { HttpClient } from '@angular/common/http';
26
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
+
27
148
  /*
28
149
  * Copyright 2015-2020 Ritense BV, the Netherlands.
29
150
  *
@@ -78,7 +199,8 @@ class DossierProcessStartModalComponent {
78
199
  }
79
200
  loadFormDefinition() {
80
201
  this.formDefinition = null;
81
- this.formLinkService.getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
202
+ this.formLinkService
203
+ .getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
82
204
  .subscribe(formDefinition => {
83
205
  this.formAssociation = formDefinition.formAssociation;
84
206
  const className = this.formAssociation.formLink.className.split('.');
@@ -123,15 +245,23 @@ class DossierProcessStartModalComponent {
123
245
  }
124
246
  onSubmit(submission) {
125
247
  this.formioSubmission = submission;
126
- 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) => {
127
251
  this.modal.hide();
128
- 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
+ ]);
129
259
  }, errors => {
130
260
  this.form.showErrors(errors);
131
261
  });
132
262
  }
133
263
  isUserAdmin() {
134
- this.userProviderService.getUserSubject().subscribe((userIdentity) => {
264
+ this.userProviderService.getUserSubject().subscribe(userIdentity => {
135
265
  this.isAdmin = userIdentity.roles.includes('ROLE_ADMIN');
136
266
  }, error => {
137
267
  this.logger.error('Failed to retrieve user identity', error);
@@ -142,7 +272,7 @@ class DossierProcessStartModalComponent {
142
272
  DossierProcessStartModalComponent.decorators = [
143
273
  { type: Component, args: [{
144
274
  selector: 'valtimo-dossier-process-start-modal',
145
- 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",
146
276
  encapsulation: ViewEncapsulation.None,
147
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}"]
148
278
  },] }
@@ -193,14 +323,17 @@ class DossierService {
193
323
  const defaultColumn = columns.find(column => column.default);
194
324
  return {
195
325
  isSorting: false,
196
- state: { name: defaultColumn ? defaultColumn.propertyName : columns[0].propertyName, direction: 'DESC' }
326
+ state: {
327
+ name: defaultColumn ? defaultColumn.propertyName : columns[0].propertyName,
328
+ direction: 'DESC',
329
+ },
197
330
  };
198
331
  }
199
332
  }
200
333
  DossierService.ɵprov = ɵɵdefineInjectable({ factory: function DossierService_Factory() { return new DossierService(ɵɵinject(ConfigService)); }, token: DossierService, providedIn: "root" });
201
334
  DossierService.decorators = [
202
335
  { type: Injectable, args: [{
203
- providedIn: 'root'
336
+ providedIn: 'root',
204
337
  },] }
205
338
  ];
206
339
  DossierService.ctorParameters = () => [
@@ -242,7 +375,7 @@ class DossierListComponent {
242
375
  page: 1,
243
376
  size: 10,
244
377
  maxPaginationItemSize: 5,
245
- sort: undefined
378
+ sort: undefined,
246
379
  };
247
380
  this.selectedProcessDocumentDefinition = null;
248
381
  this.modalListenerAdded = false;
@@ -313,8 +446,8 @@ class DossierListComponent {
313
446
  this.processDefinitionListFields = [
314
447
  {
315
448
  key: 'processName',
316
- label: 'Proces'
317
- }
449
+ label: 'Proces',
450
+ },
318
451
  ];
319
452
  });
320
453
  }
@@ -323,7 +456,9 @@ class DossierListComponent {
323
456
  return new DocumentSearchRequestImpl(json.definitionName, this.pagination.page - 1, this.pagination.size, json.sequence, json.createdBy, json.globalSearchFilter, json.sort);
324
457
  }
325
458
  buildDocumentSearchRequest() {
326
- 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);
327
462
  }
328
463
  storeSearch(documentSearchRequest) {
329
464
  localStorage.setItem(this.getCachedKey(), JSON.stringify(documentSearchRequest));
@@ -338,7 +473,9 @@ class DossierListComponent {
338
473
  return 'list-search-' + this.documentDefinitionName;
339
474
  }
340
475
  rowClick(document) {
341
- 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
+ ]);
342
479
  }
343
480
  startDossier() {
344
481
  if (this.processDocumentDefinitions.length > 1) {
@@ -394,7 +531,7 @@ class DossierListComponent {
394
531
  DossierListComponent.decorators = [
395
532
  { type: Component, args: [{
396
533
  selector: 'valtimo-dossier-list',
397
- 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",
398
535
  styles: [""]
399
536
  },] }
400
537
  ];
@@ -468,7 +605,9 @@ class DossierDetailTabSummaryComponent {
468
605
  });
469
606
  }
470
607
  loadProcessDocumentInstances(documentId) {
471
- this.documentService.findProcessDocumentInstances(documentId).subscribe(processDocumentInstances => {
608
+ this.documentService
609
+ .findProcessDocumentInstances(documentId)
610
+ .subscribe(processDocumentInstances => {
472
611
  this.processDocumentInstances = processDocumentInstances;
473
612
  this.processDocumentInstances.forEach(instance => {
474
613
  this.loadProcessInstanceTasks(instance.id.processInstanceId);
@@ -504,7 +643,7 @@ class DossierDetailTabSummaryComponent {
504
643
  DossierDetailTabSummaryComponent.decorators = [
505
644
  { type: Component, args: [{
506
645
  selector: 'valtimo-dossier-detail-tab-summary',
507
- 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",
508
647
  encapsulation: ViewEncapsulation.None,
509
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}"]
510
649
  },] }
@@ -547,7 +686,9 @@ class DossierDetailTabProgressComponent {
547
686
  this.documentId = snapshot.get('documentId') || '';
548
687
  }
549
688
  ngOnInit() {
550
- this.documentService.findProcessDocumentInstances(this.documentId).subscribe(processDocumentInstances => {
689
+ this.documentService
690
+ .findProcessDocumentInstances(this.documentId)
691
+ .subscribe(processDocumentInstances => {
551
692
  this.processDocumentInstances = processDocumentInstances;
552
693
  this.selectedProcessInstanceId = processDocumentInstances[0].id.processInstanceId;
553
694
  });
@@ -559,7 +700,7 @@ class DossierDetailTabProgressComponent {
559
700
  DossierDetailTabProgressComponent.decorators = [
560
701
  { type: Component, args: [{
561
702
  selector: 'valtimo-dossier-detail-tab-progress',
562
- 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",
563
704
  styles: [".full-height-tab-content{height:calc(100vh - 380px);width:100%}"]
564
705
  },] }
565
706
  ];
@@ -628,7 +769,7 @@ class DossierDetailTabAuditComponent {
628
769
  DossierDetailTabAuditComponent.decorators = [
629
770
  { type: Component, args: [{
630
771
  selector: 'valtimo-dossier-detail-tab-audit',
631
- 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>{{ 'list.currentPage' | translate: {current: pagination.number, total: pagination.totalPages} }}</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)\"></ngb-pagination>\n </div>\n</div>\n",
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",
632
773
  styles: [".audit-pagination{border-top:1px solid #dee2e6;margin:0 -1.923rem -1.923rem!important}"]
633
774
  },] }
634
775
  ];
@@ -657,30 +798,44 @@ DossierDetailTabAuditComponent.propDecorators = {
657
798
  * limitations under the License.
658
799
  */
659
800
  class DossierDetailTabDocumentsComponent {
660
- constructor(route, documentService, toastrService, uploadProviderService, downloadService) {
801
+ constructor(route, documentService, toastrService, uploadProviderService, downloadService, translateService, configService) {
802
+ var _a, _b;
661
803
  this.route = route;
662
804
  this.documentService = documentService;
663
805
  this.toastrService = toastrService;
664
806
  this.uploadProviderService = uploadProviderService;
665
807
  this.downloadService = downloadService;
666
- 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
+ }));
667
822
  this.fields = [
668
823
  { key: 'fileName', label: 'File name' },
669
824
  { key: 'sizeInBytes', label: 'Size in bytes' },
670
825
  { key: 'createdOn', label: 'Created on', viewType: 'date' },
671
- { key: 'createdBy', label: 'Created by' }
826
+ { key: 'createdBy', label: 'Created by' },
672
827
  ];
673
828
  this.actions = [
674
829
  {
675
830
  columnName: '',
676
831
  iconClass: 'fas fa-external-link-alt',
677
- callback: this.downloadDocument.bind(this)
832
+ callback: this.downloadDocument.bind(this),
678
833
  },
679
834
  {
680
835
  columnName: '',
681
836
  iconClass: 'fas fa-trash-alt',
682
- callback: this.removeRelatedFile.bind(this)
683
- }
837
+ callback: this.removeRelatedFile.bind(this),
838
+ },
684
839
  ];
685
840
  this.uploading$ = new BehaviorSubject(false);
686
841
  const snapshot = this.route.snapshot.paramMap;
@@ -688,42 +843,45 @@ class DossierDetailTabDocumentsComponent {
688
843
  this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
689
844
  }
690
845
  ngOnInit() {
691
- this.loadDocuments();
846
+ this.refetchDocuments();
692
847
  }
693
848
  fileSelected(file) {
694
849
  this.uploading$.next(true);
695
- 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(() => {
696
854
  this.toastrService.success('Successfully uploaded document to dossier');
697
- this.loadDocuments();
855
+ this.refetchDocuments();
698
856
  this.uploading$.next(false);
699
857
  }, () => {
700
858
  this.toastrService.error('Failed to upload document to dossier');
701
859
  this.uploading$.next(false);
702
860
  });
703
861
  }
704
- loadDocuments() {
705
- this.documentService.getDocument(this.documentId).subscribe((document) => {
706
- this.relatedFiles = document.relatedFiles;
707
- });
708
- }
709
862
  downloadDocument(relatedFile) {
710
- this.uploadProviderService.getResource(relatedFile.fileId).subscribe((resource) => {
863
+ this.uploadProviderService
864
+ .getResource(relatedFile.fileId)
865
+ .subscribe((resource) => {
711
866
  this.downloadService.downloadFile(resource.url, resource.resource.name);
712
867
  });
713
868
  }
714
869
  removeRelatedFile(relatedFile) {
715
870
  this.documentService.removeResource(this.documentId, relatedFile.fileId).subscribe(() => {
716
871
  this.toastrService.success('Successfully removed document from dossier');
717
- this.loadDocuments();
872
+ this.refetchDocuments();
718
873
  }, () => {
719
874
  this.toastrService.error('Failed to remove document from dossier');
720
875
  });
721
876
  }
877
+ refetchDocuments() {
878
+ this.refetch$.next(null);
879
+ }
722
880
  }
723
881
  DossierDetailTabDocumentsComponent.decorators = [
724
882
  { type: Component, args: [{
725
883
  selector: 'valtimo-dossier-detail-tab-documents',
726
- 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",
727
885
  styles: [""]
728
886
  },] }
729
887
  ];
@@ -732,7 +890,9 @@ DossierDetailTabDocumentsComponent.ctorParameters = () => [
732
890
  { type: DocumentService },
733
891
  { type: ToastrService },
734
892
  { type: UploadProviderService },
735
- { type: DownloadService }
893
+ { type: DownloadService },
894
+ { type: TranslateService },
895
+ { type: ConfigService }
736
896
  ];
737
897
 
738
898
  /*
@@ -755,7 +915,7 @@ const DEFAULT_TABS = new Map([
755
915
  [DefaultTabs.summary, DossierDetailTabSummaryComponent],
756
916
  [DefaultTabs.progress, DossierDetailTabProgressComponent],
757
917
  [DefaultTabs.audit, DossierDetailTabAuditComponent],
758
- [DefaultTabs.documents, DossierDetailTabDocumentsComponent]
918
+ [DefaultTabs.documents, DossierDetailTabDocumentsComponent],
759
919
  ]);
760
920
 
761
921
  /*
@@ -790,7 +950,7 @@ class TabService {
790
950
  TabService.ɵprov = ɵɵdefineInjectable({ factory: function TabService_Factory() { return new TabService(ɵɵinject(TAB_MAP)); }, token: TabService, providedIn: "root" });
791
951
  TabService.decorators = [
792
952
  { type: Injectable, args: [{
793
- providedIn: 'root'
953
+ providedIn: 'root',
794
954
  },] }
795
955
  ];
796
956
  TabService.ctorParameters = () => [
@@ -824,7 +984,8 @@ class DossierSupportingProcessStartModalComponent {
824
984
  }
825
985
  loadFormDefinition() {
826
986
  this.formDefinition = null;
827
- this.formLinkService.getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
987
+ this.formLinkService
988
+ .getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
828
989
  .subscribe(formDefinition => {
829
990
  this.formAssociation = formDefinition.formAssociation;
830
991
  const className = this.formAssociation.formLink.className.split('.');
@@ -834,7 +995,7 @@ class DossierSupportingProcessStartModalComponent {
834
995
  this.formDefinition = formDefinition;
835
996
  this.documentService.getDocument(this.documentId).subscribe(document => {
836
997
  this.submission = {
837
- data: document.content
998
+ data: document.content,
838
999
  };
839
1000
  }, () => noop());
840
1001
  this.modal.show();
@@ -844,7 +1005,12 @@ class DossierSupportingProcessStartModalComponent {
844
1005
  window.open(url, '_blank');
845
1006
  break;
846
1007
  case 'BpmnElementAngularStateUrlLink':
847
- 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
+ });
848
1014
  break;
849
1015
  default:
850
1016
  this.logger.fatal('Unsupported class name');
@@ -871,7 +1037,9 @@ class DossierSupportingProcessStartModalComponent {
871
1037
  }
872
1038
  onSubmit(submission) {
873
1039
  this.formioSubmission = submission;
874
- 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) => {
875
1043
  this.modal.hide();
876
1044
  this.formSubmit.emit();
877
1045
  }, errors => {
@@ -886,7 +1054,7 @@ class DossierSupportingProcessStartModalComponent {
886
1054
  DossierSupportingProcessStartModalComponent.decorators = [
887
1055
  { type: Component, args: [{
888
1056
  selector: 'valtimo-dossier-supporting-process-start-modal',
889
- 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",
890
1058
  encapsulation: ViewEncapsulation.None,
891
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}"]
892
1060
  },] }
@@ -940,7 +1108,9 @@ class DossierDetailComponent {
940
1108
  }
941
1109
  ngOnInit() {
942
1110
  this.tabLoader = new TabLoaderImpl(this.tabService.getTabs(), this.componentFactoryResolver, this.viewContainerRef, this.translateService, this.router, this.location);
943
- this.documentService.getDocumentDefinition(this.documentDefinitionName).subscribe(definition => {
1111
+ this.documentService
1112
+ .getDocumentDefinition(this.documentDefinitionName)
1113
+ .subscribe(definition => {
944
1114
  this.documentDefinitionNameTitle = definition.schema.title;
945
1115
  });
946
1116
  this.initialTabName = this.snapshot.get('tab');
@@ -948,13 +1118,16 @@ class DossierDetailComponent {
948
1118
  this.getAllAssociatedProcessDefinitions();
949
1119
  }
950
1120
  getAllAssociatedProcessDefinitions() {
951
- this.documentService.findProcessDocumentDefinitions(this.documentDefinitionName).subscribe(processDocumentDefinitions => {
952
- this.processDocumentDefinitions = processDocumentDefinitions
953
- .filter(processDocumentDefinition => processDocumentDefinition.startableByUser);
954
- this.processDefinitionListFields = [{
1121
+ this.documentService
1122
+ .findProcessDocumentDefinitions(this.documentDefinitionName)
1123
+ .subscribe(processDocumentDefinitions => {
1124
+ this.processDocumentDefinitions = processDocumentDefinitions.filter(processDocumentDefinition => processDocumentDefinition.startableByUser);
1125
+ this.processDefinitionListFields = [
1126
+ {
955
1127
  key: 'processName',
956
- label: 'Proces'
957
- }];
1128
+ label: 'Proces',
1129
+ },
1130
+ ];
958
1131
  });
959
1132
  }
960
1133
  startProcess(processDocumentDefinition) {
@@ -964,7 +1137,7 @@ class DossierDetailComponent {
964
1137
  DossierDetailComponent.decorators = [
965
1138
  { type: Component, args: [{
966
1139
  selector: 'valtimo-dossier-detail',
967
- 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 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",
968
1141
  styles: [".tab-container{min-height:300px}"]
969
1142
  },] }
970
1143
  ];
@@ -1001,33 +1174,69 @@ DossierDetailComponent.propDecorators = {
1001
1174
  const moment$3 = moment_;
1002
1175
  moment$3.locale(localStorage.getItem('langKey') || '');
1003
1176
  class DossierDetailTabContactMomentsComponent {
1004
- constructor(contactMomentService) {
1177
+ constructor(contactMomentService, alertService, translateService) {
1005
1178
  this.contactMomentService = contactMomentService;
1006
- this.contactMoments = [];
1007
- }
1008
- ngOnInit() {
1009
- this.loadContactMoments();
1010
- }
1011
- loadContactMoments() {
1012
- this.contactMomentService.getContactMoments().subscribe(contactMoments => this.handleContactMomentsResult(contactMoments));
1013
- }
1014
- handleContactMomentsResult(contactMoments) {
1015
- this.contactMoments = contactMoments.map(contactMoment => {
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 => {
1016
1183
  const registratieDatum = moment$3(contactMoment.registratiedatum);
1017
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
+ });
1018
1210
  });
1019
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
+ }
1020
1224
  }
1021
1225
  DossierDetailTabContactMomentsComponent.decorators = [
1022
1226
  { type: Component, args: [{
1023
1227
  selector: 'valtimo-dossier-detail-tab-contact-moments',
1024
- 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 *ngIf=\"contactMoments\">\n <valtimo-timeline [items]=\"contactMoments\"></valtimo-timeline>\n</div>\n\n",
1025
- 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 */"]
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}"]
1026
1230
  },] }
1027
1231
  ];
1028
1232
  DossierDetailTabContactMomentsComponent.ctorParameters = () => [
1029
- { type: ContactMomentService }
1233
+ { type: ContactMomentService },
1234
+ { type: AlertService },
1235
+ { type: TranslateService }
1030
1236
  ];
1237
+ DossierDetailTabContactMomentsComponent.propDecorators = {
1238
+ modal: [{ type: ViewChild, args: ['contactMomentsNoteModal',] }]
1239
+ };
1031
1240
 
1032
1241
  /*
1033
1242
  * Copyright 2015-2020 Ritense BV, the Netherlands.
@@ -1084,7 +1293,7 @@ class DossierUpdateComponent {
1084
1293
  this.task.task.created = moment$4(this.task.task.created).format('DD MMM YYYY HH:mm');
1085
1294
  this.page = {
1086
1295
  title: this.task.task.name,
1087
- subtitle: `Created ${moment$4(this.task.task.created).fromNow()}`
1296
+ subtitle: `Created ${moment$4(this.task.task.created).fromNow()}`,
1088
1297
  };
1089
1298
  });
1090
1299
  }
@@ -1098,7 +1307,7 @@ class DossierUpdateComponent {
1098
1307
  const document = {
1099
1308
  documentId: this.document.id,
1100
1309
  content: this.document.content,
1101
- versionBasedOn: this.document.version
1310
+ versionBasedOn: this.document.version,
1102
1311
  };
1103
1312
  this.documentService.modifyDocument(document).subscribe(result => {
1104
1313
  this.document = result.document;
@@ -1113,9 +1322,9 @@ class DossierUpdateComponent {
1113
1322
  request: {
1114
1323
  documentId: this.document.id,
1115
1324
  content: mergedData,
1116
- versionBasedOn: this.document.version
1325
+ versionBasedOn: this.document.version,
1117
1326
  },
1118
- taskId: this.task.task.id
1327
+ taskId: this.task.task.id,
1119
1328
  };
1120
1329
  this.documentService.modifyDocumentAndCompleteTask(documentData).subscribe(result => {
1121
1330
  this.toastr.success(this.task.task.name + ' has successfully been completed');
@@ -1129,7 +1338,7 @@ class DossierUpdateComponent {
1129
1338
  DossierUpdateComponent.decorators = [
1130
1339
  { type: Component, args: [{
1131
1340
  selector: 'valtimo-dossier-update',
1132
- 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",
1133
1342
  styles: [""]
1134
1343
  },] }
1135
1344
  ];
@@ -1157,36 +1366,37 @@ DossierUpdateComponent.ctorParameters = () => [
1157
1366
  * See the License for the specific language governing permissions and
1158
1367
  * limitations under the License.
1159
1368
  */
1160
- 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
+ };
1161
1374
  const routes = [
1162
1375
  {
1163
1376
  path: 'dossiers/:documentDefinitionName',
1164
1377
  component: DossierListComponent,
1165
1378
  canActivate: [AuthGuardService],
1166
- data: ɵ0
1379
+ data: ɵ0,
1167
1380
  },
1168
1381
  {
1169
1382
  path: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
1170
1383
  component: DossierDetailComponent,
1171
1384
  canActivate: [AuthGuardService],
1172
- data: ɵ1
1385
+ data: ɵ1,
1173
1386
  },
1174
1387
  {
1175
1388
  path: 'dossiers/:documentDefinitionName/document/:documentId/:tab/tasks/:taskId',
1176
1389
  component: DossierUpdateComponent,
1177
1390
  canActivate: [AuthGuardService],
1178
- data: ɵ2
1179
- }
1391
+ data: ɵ2,
1392
+ },
1180
1393
  ];
1181
1394
  class DossierRoutingModule {
1182
1395
  }
1183
1396
  DossierRoutingModule.decorators = [
1184
1397
  { type: NgModule, args: [{
1185
- imports: [
1186
- CommonModule,
1187
- RouterModule.forChild(routes),
1188
- ],
1189
- exports: [RouterModule]
1398
+ imports: [CommonModule, RouterModule.forChild(routes)],
1399
+ exports: [RouterModule],
1190
1400
  },] }
1191
1401
  ];
1192
1402
 
@@ -1215,14 +1425,14 @@ class DossierModule {
1215
1425
  TabService,
1216
1426
  {
1217
1427
  provide: TAB_MAP,
1218
- useFactory: tabsFactory
1428
+ useFactory: tabsFactory,
1219
1429
  },
1220
1430
  {
1221
1431
  provide: ANALYZE_FOR_ENTRY_COMPONENTS,
1222
1432
  useValue: Array.from(tabsFactory().values()),
1223
- multi: true
1224
- }
1225
- ]
1433
+ multi: true,
1434
+ },
1435
+ ],
1226
1436
  };
1227
1437
  }
1228
1438
  }
@@ -1238,7 +1448,7 @@ DossierModule.decorators = [
1238
1448
  DossierDetailTabContactMomentsComponent,
1239
1449
  DossierUpdateComponent,
1240
1450
  DossierProcessStartModalComponent,
1241
- DossierSupportingProcessStartModalComponent
1451
+ DossierSupportingProcessStartModalComponent,
1242
1452
  ],
1243
1453
  imports: [
1244
1454
  CommonModule,
@@ -1261,8 +1471,8 @@ DossierModule.decorators = [
1261
1471
  loader: {
1262
1472
  provide: TranslateLoader,
1263
1473
  useFactory: ɵ0$1,
1264
- deps: [HttpClient]
1265
- }
1474
+ deps: [HttpClient],
1475
+ },
1266
1476
  }),
1267
1477
  TaskModule,
1268
1478
  ModalModule,
@@ -1270,19 +1480,16 @@ DossierModule.decorators = [
1270
1480
  UploaderModule,
1271
1481
  DropzoneModule,
1272
1482
  NgbPaginationModule,
1273
- ConfigModule
1274
- ],
1275
- exports: [
1276
- DossierListComponent,
1277
- DossierDetailComponent
1483
+ ConfigModule,
1278
1484
  ],
1485
+ exports: [DossierListComponent, DossierDetailComponent],
1279
1486
  entryComponents: [
1280
1487
  DossierDetailTabSummaryComponent,
1281
1488
  DossierDetailTabProgressComponent,
1282
1489
  DossierDetailTabAuditComponent,
1283
1490
  DossierDetailTabDocumentsComponent,
1284
- DossierDetailTabContactMomentsComponent
1285
- ]
1491
+ DossierDetailTabContactMomentsComponent,
1492
+ ],
1286
1493
  },] }
1287
1494
  ];
1288
1495
 
@@ -1306,5 +1513,5 @@ DossierModule.decorators = [
1306
1513
  * Generated bundle index. Do not edit.
1307
1514
  */
1308
1515
 
1309
- export { DEFAULT_TABS, DefaultTabs, DossierDetailComponent, DossierDetailTabAuditComponent, DossierDetailTabContactMomentsComponent, 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 };
1310
1517
  //# sourceMappingURL=valtimo-dossier.js.map