@valtimo/dossier 4.15.3-next-main.16 → 4.17.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 (48) hide show
  1. package/bundles/valtimo-dossier.umd.js +1820 -1675
  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 +92 -92
  6. package/esm2015/lib/dossier-detail/tab/audit/audit.component.js +79 -79
  7. package/esm2015/lib/dossier-detail/tab/contact-moments/contact-moments.component.js +90 -91
  8. package/esm2015/lib/dossier-detail/tab/documents/documents.component.js +122 -119
  9. package/esm2015/lib/dossier-detail/tab/progress/progress.component.js +49 -49
  10. package/esm2015/lib/dossier-detail/tab/summary/summary.component.js +126 -126
  11. package/esm2015/lib/dossier-detail-tab-enum.js +24 -24
  12. package/esm2015/lib/dossier-list/dossier-list.component.js +216 -216
  13. package/esm2015/lib/dossier-process-start-modal/dossier-process-start-modal.component.js +130 -131
  14. package/esm2015/lib/dossier-routing.module.js +58 -58
  15. package/esm2015/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.js +125 -126
  16. package/esm2015/lib/dossier-update/dossier-update.component.js +121 -121
  17. package/esm2015/lib/dossier.config.js +29 -29
  18. package/esm2015/lib/dossier.module.js +121 -121
  19. package/esm2015/lib/dossier.service.js +53 -53
  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 +44 -44
  23. package/esm2015/public_api.js +32 -31
  24. package/esm2015/valtimo-dossier.js +9 -9
  25. package/fesm2015/valtimo-dossier.js +1457 -1333
  26. package/fesm2015/valtimo-dossier.js.map +1 -1
  27. package/lib/dossier-detail/dossier-detail.component.d.ts +34 -34
  28. package/lib/dossier-detail/tab/audit/audit.component.d.ts +21 -21
  29. package/lib/dossier-detail/tab/contact-moments/contact-moments.component.d.ts +26 -27
  30. package/lib/dossier-detail/tab/documents/documents.component.d.ts +43 -44
  31. package/lib/dossier-detail/tab/progress/progress.component.d.ts +14 -14
  32. package/lib/dossier-detail/tab/summary/summary.component.d.ts +37 -37
  33. package/lib/dossier-detail-tab-enum.d.ts +7 -7
  34. package/lib/dossier-list/dossier-list.component.d.ts +64 -65
  35. package/lib/dossier-process-start-modal/dossier-process-start-modal.component.d.ts +36 -37
  36. package/lib/dossier-routing.module.d.ts +2 -2
  37. package/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.d.ts +34 -35
  38. package/lib/dossier-update/dossier-update.component.d.ts +33 -33
  39. package/lib/dossier.config.d.ts +3 -3
  40. package/lib/dossier.module.d.ts +5 -5
  41. package/lib/dossier.service.d.ts +10 -10
  42. package/lib/models/index.d.ts +1 -0
  43. package/lib/models/tabs.model.d.ts +50 -0
  44. package/lib/tab.service.d.ts +7 -7
  45. package/package.json +1 -1
  46. package/public_api.d.ts +13 -12
  47. package/valtimo-dossier.d.ts +8 -8
  48. package/valtimo-dossier.metadata.json +1 -1
@@ -5,13 +5,12 @@ 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 { AlertService, 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';
@@ -24,1370 +23,1495 @@ import { NgbButtonsModule, NgbTooltipModule, NgbPaginationModule } from '@ng-boo
24
23
  import { FormsModule } from '@angular/forms';
25
24
  import { HttpClient } from '@angular/common/http';
26
25
 
27
- /*
28
- * Copyright 2015-2020 Ritense BV, the Netherlands.
29
- *
30
- * Licensed under EUPL, Version 1.2 (the "License");
31
- * you may not use this file except in compliance with the License.
32
- * You may obtain a copy of the License at
33
- *
34
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
35
- *
36
- * Unless required by applicable law or agreed to in writing, software
37
- * distributed under the License is distributed on an "AS IS" basis,
38
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39
- * See the License for the specific language governing permissions and
40
- * limitations under the License.
41
- */
42
- var DefaultTabs;
43
- (function (DefaultTabs) {
44
- DefaultTabs["summary"] = "summary";
45
- DefaultTabs["progress"] = "progress";
46
- DefaultTabs["audit"] = "audit";
47
- DefaultTabs["documents"] = "documents";
48
- DefaultTabs["contactMoments"] = "contact-moments";
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
+
148
+ /*
149
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
150
+ *
151
+ * Licensed under EUPL, Version 1.2 (the "License");
152
+ * you may not use this file except in compliance with the License.
153
+ * You may obtain a copy of the License at
154
+ *
155
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
156
+ *
157
+ * Unless required by applicable law or agreed to in writing, software
158
+ * distributed under the License is distributed on an "AS IS" basis,
159
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
160
+ * See the License for the specific language governing permissions and
161
+ * limitations under the License.
162
+ */
163
+ var DefaultTabs;
164
+ (function (DefaultTabs) {
165
+ DefaultTabs["summary"] = "summary";
166
+ DefaultTabs["progress"] = "progress";
167
+ DefaultTabs["audit"] = "audit";
168
+ DefaultTabs["documents"] = "documents";
169
+ DefaultTabs["contactMoments"] = "contact-moments";
49
170
  })(DefaultTabs || (DefaultTabs = {}));
50
171
 
51
- /*
52
- * Copyright 2015-2020 Ritense BV, the Netherlands.
53
- *
54
- * Licensed under EUPL, Version 1.2 (the "License");
55
- * you may not use this file except in compliance with the License.
56
- * You may obtain a copy of the License at
57
- *
58
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
59
- *
60
- * Unless required by applicable law or agreed to in writing, software
61
- * distributed under the License is distributed on an "AS IS" basis,
62
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
63
- * See the License for the specific language governing permissions and
64
- * limitations under the License.
65
- */
66
- class DossierProcessStartModalComponent {
67
- constructor(route, router, processService, documentService, formLinkService, userProviderService, logger) {
68
- this.route = route;
69
- this.router = router;
70
- this.processService = processService;
71
- this.documentService = documentService;
72
- this.formLinkService = formLinkService;
73
- this.userProviderService = userProviderService;
74
- this.logger = logger;
75
- }
76
- ngOnInit() {
77
- this.isUserAdmin();
78
- }
79
- loadFormDefinition() {
80
- this.formDefinition = null;
81
- this.formLinkService
82
- .getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
83
- .subscribe(formDefinition => {
84
- this.formAssociation = formDefinition.formAssociation;
85
- const className = this.formAssociation.formLink.className.split('.');
86
- const linkType = className[className.length - 1];
87
- switch (linkType) {
88
- case 'BpmnElementFormIdLink':
89
- this.formDefinition = formDefinition;
90
- this.modal.show();
91
- break;
92
- case 'BpmnElementUrlLink':
93
- const url = this.router.serializeUrl(this.router.createUrlTree([formDefinition.formAssociation.formLink.url]));
94
- window.open(url, '_blank');
95
- break;
96
- case 'BpmnElementAngularStateUrlLink':
97
- this.router.navigate([formDefinition.formAssociation.formLink.url]);
98
- break;
99
- default:
100
- this.logger.fatal('Unsupported class name');
101
- }
102
- }, errors => {
103
- this.modal.show();
104
- });
105
- }
106
- gotoFormLinkScreen() {
107
- this.modal.hide();
108
- this.router.navigate(['form-links'], { queryParams: { process: this.processDefinitionKey } });
109
- }
110
- get modalTitle() {
111
- return `Start - ${this.processName}`;
112
- }
113
- openModal(processDocumentDefinition) {
114
- this.processDefinitionKey = processDocumentDefinition.id.processDefinitionKey;
115
- this.documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
116
- this.processName = processDocumentDefinition.processName;
117
- this.options = new FormioOptionsImpl();
118
- this.options.disableAlerts = true;
119
- const formioBeforeSubmit = function (submission, callback) {
120
- callback(null, submission);
121
- };
122
- this.options.setHooks(formioBeforeSubmit);
123
- this.loadFormDefinition();
124
- }
125
- onSubmit(submission) {
126
- this.formioSubmission = submission;
127
- this.formLinkService
128
- .onSubmit(this.processDefinitionKey, this.formAssociation.formLink.id, submission.data)
129
- .subscribe((formSubmissionResult) => {
130
- this.modal.hide();
131
- this.router.navigate([
132
- 'dossiers',
133
- this.documentDefinitionName,
134
- 'document',
135
- formSubmissionResult.documentId,
136
- 'summary',
137
- ]);
138
- }, errors => {
139
- this.form.showErrors(errors);
140
- });
141
- }
142
- isUserAdmin() {
143
- this.userProviderService.getUserSubject().subscribe(userIdentity => {
144
- this.isAdmin = userIdentity.roles.includes('ROLE_ADMIN');
145
- }, error => {
146
- this.logger.error('Failed to retrieve user identity', error);
147
- this.isAdmin = false;
148
- });
149
- }
150
- }
151
- DossierProcessStartModalComponent.decorators = [
152
- { type: Component, args: [{
153
- selector: 'valtimo-dossier-process-start-modal',
154
- 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",
155
- encapsulation: ViewEncapsulation.None,
156
- 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}"]
157
- },] }
158
- ];
159
- DossierProcessStartModalComponent.ctorParameters = () => [
160
- { type: ActivatedRoute },
161
- { type: Router },
162
- { type: ProcessService },
163
- { type: DocumentService },
164
- { type: FormLinkService },
165
- { type: UserProviderService },
166
- { type: NGXLogger }
167
- ];
168
- DossierProcessStartModalComponent.propDecorators = {
169
- form: [{ type: ViewChild, args: ['form', { static: false },] }],
170
- modal: [{ type: ViewChild, args: ['processStartModal', { static: false },] }]
172
+ /*
173
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
174
+ *
175
+ * Licensed under EUPL, Version 1.2 (the "License");
176
+ * you may not use this file except in compliance with the License.
177
+ * You may obtain a copy of the License at
178
+ *
179
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
180
+ *
181
+ * Unless required by applicable law or agreed to in writing, software
182
+ * distributed under the License is distributed on an "AS IS" basis,
183
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
184
+ * See the License for the specific language governing permissions and
185
+ * limitations under the License.
186
+ */
187
+ class DossierProcessStartModalComponent {
188
+ constructor(route, router, processService, documentService, formLinkService, userProviderService, logger) {
189
+ this.route = route;
190
+ this.router = router;
191
+ this.processService = processService;
192
+ this.documentService = documentService;
193
+ this.formLinkService = formLinkService;
194
+ this.userProviderService = userProviderService;
195
+ this.logger = logger;
196
+ }
197
+ ngOnInit() {
198
+ this.isUserAdmin();
199
+ }
200
+ loadFormDefinition() {
201
+ this.formDefinition = null;
202
+ this.formLinkService
203
+ .getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
204
+ .subscribe(formDefinition => {
205
+ this.formAssociation = formDefinition.formAssociation;
206
+ const className = this.formAssociation.formLink.className.split('.');
207
+ const linkType = className[className.length - 1];
208
+ switch (linkType) {
209
+ case 'BpmnElementFormIdLink':
210
+ this.formDefinition = formDefinition;
211
+ this.modal.show();
212
+ break;
213
+ case 'BpmnElementUrlLink':
214
+ const url = this.router.serializeUrl(this.router.createUrlTree([formDefinition.formAssociation.formLink.url]));
215
+ window.open(url, '_blank');
216
+ break;
217
+ case 'BpmnElementAngularStateUrlLink':
218
+ this.router.navigate([formDefinition.formAssociation.formLink.url]);
219
+ break;
220
+ default:
221
+ this.logger.fatal('Unsupported class name');
222
+ }
223
+ }, errors => {
224
+ this.modal.show();
225
+ });
226
+ }
227
+ gotoFormLinkScreen() {
228
+ this.modal.hide();
229
+ this.router.navigate(['form-links'], { queryParams: { process: this.processDefinitionKey } });
230
+ }
231
+ get modalTitle() {
232
+ return `Start - ${this.processName}`;
233
+ }
234
+ openModal(processDocumentDefinition) {
235
+ this.processDefinitionKey = processDocumentDefinition.id.processDefinitionKey;
236
+ this.documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
237
+ this.processName = processDocumentDefinition.processName;
238
+ this.options = new FormioOptionsImpl();
239
+ this.options.disableAlerts = true;
240
+ const formioBeforeSubmit = function (submission, callback) {
241
+ callback(null, submission);
242
+ };
243
+ this.options.setHooks(formioBeforeSubmit);
244
+ this.loadFormDefinition();
245
+ }
246
+ onSubmit(submission) {
247
+ this.formioSubmission = submission;
248
+ this.formLinkService
249
+ .onSubmit(this.processDefinitionKey, this.formAssociation.formLink.id, submission.data)
250
+ .subscribe((formSubmissionResult) => {
251
+ this.modal.hide();
252
+ this.router.navigate([
253
+ 'dossiers',
254
+ this.documentDefinitionName,
255
+ 'document',
256
+ formSubmissionResult.documentId,
257
+ 'summary',
258
+ ]);
259
+ }, errors => {
260
+ this.form.showErrors(errors);
261
+ });
262
+ }
263
+ isUserAdmin() {
264
+ this.userProviderService.getUserSubject().subscribe(userIdentity => {
265
+ this.isAdmin = userIdentity.roles.includes('ROLE_ADMIN');
266
+ }, error => {
267
+ this.logger.error('Failed to retrieve user identity', error);
268
+ this.isAdmin = false;
269
+ });
270
+ }
271
+ }
272
+ DossierProcessStartModalComponent.decorators = [
273
+ { type: Component, args: [{
274
+ selector: 'valtimo-dossier-process-start-modal',
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",
276
+ encapsulation: ViewEncapsulation.None,
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}"]
278
+ },] }
279
+ ];
280
+ DossierProcessStartModalComponent.ctorParameters = () => [
281
+ { type: ActivatedRoute },
282
+ { type: Router },
283
+ { type: ProcessService },
284
+ { type: DocumentService },
285
+ { type: FormLinkService },
286
+ { type: UserProviderService },
287
+ { type: NGXLogger }
288
+ ];
289
+ DossierProcessStartModalComponent.propDecorators = {
290
+ form: [{ type: ViewChild, args: ['form', { static: false },] }],
291
+ modal: [{ type: ViewChild, args: ['processStartModal', { static: false },] }]
171
292
  };
172
293
 
173
- /*
174
- * Copyright 2015-2020 Ritense BV, the Netherlands.
175
- *
176
- * Licensed under EUPL, Version 1.2 (the "License");
177
- * you may not use this file except in compliance with the License.
178
- * You may obtain a copy of the License at
179
- *
180
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
181
- *
182
- * Unless required by applicable law or agreed to in writing, software
183
- * distributed under the License is distributed on an "AS IS" basis,
184
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
185
- * See the License for the specific language governing permissions and
186
- * limitations under the License.
187
- */
188
- class DossierService {
189
- constructor(configService) {
190
- this.configService = configService;
191
- this.definitions = configService.config.definitions;
192
- }
193
- getImplementationEnvironmentDefinitions(name) {
194
- return this.definitions.dossiers.find(definition => definition.name === name);
195
- }
196
- getDefinitionColumns(definitionNameId) {
197
- const config = this.configService.config;
198
- const customDefinitionTable = config.customDefinitionTables[definitionNameId];
199
- return customDefinitionTable || config.defaultDefinitionTable;
200
- }
201
- getInitialSortState(columns) {
202
- const defaultColumn = columns.find(column => column.default);
203
- return {
204
- isSorting: false,
205
- state: {
206
- name: defaultColumn ? defaultColumn.propertyName : columns[0].propertyName,
207
- direction: 'DESC',
208
- },
209
- };
210
- }
211
- }
212
- DossierService.ɵprov = ɵɵdefineInjectable({ factory: function DossierService_Factory() { return new DossierService(ɵɵinject(ConfigService)); }, token: DossierService, providedIn: "root" });
213
- DossierService.decorators = [
214
- { type: Injectable, args: [{
215
- providedIn: 'root',
216
- },] }
217
- ];
218
- DossierService.ctorParameters = () => [
219
- { type: ConfigService }
294
+ /*
295
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
296
+ *
297
+ * Licensed under EUPL, Version 1.2 (the "License");
298
+ * you may not use this file except in compliance with the License.
299
+ * You may obtain a copy of the License at
300
+ *
301
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
302
+ *
303
+ * Unless required by applicable law or agreed to in writing, software
304
+ * distributed under the License is distributed on an "AS IS" basis,
305
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
306
+ * See the License for the specific language governing permissions and
307
+ * limitations under the License.
308
+ */
309
+ class DossierService {
310
+ constructor(configService) {
311
+ this.configService = configService;
312
+ this.definitions = configService.config.definitions;
313
+ }
314
+ getImplementationEnvironmentDefinitions(name) {
315
+ return this.definitions.dossiers.find(definition => definition.name === name);
316
+ }
317
+ getDefinitionColumns(definitionNameId) {
318
+ const config = this.configService.config;
319
+ const customDefinitionTable = config.customDefinitionTables[definitionNameId];
320
+ return customDefinitionTable || config.defaultDefinitionTable;
321
+ }
322
+ getInitialSortState(columns) {
323
+ const defaultColumn = columns.find(column => column.default);
324
+ return {
325
+ isSorting: false,
326
+ state: {
327
+ name: defaultColumn ? defaultColumn.propertyName : columns[0].propertyName,
328
+ direction: 'DESC',
329
+ },
330
+ };
331
+ }
332
+ }
333
+ DossierService.ɵprov = ɵɵdefineInjectable({ factory: function DossierService_Factory() { return new DossierService(ɵɵinject(ConfigService)); }, token: DossierService, providedIn: "root" });
334
+ DossierService.decorators = [
335
+ { type: Injectable, args: [{
336
+ providedIn: 'root',
337
+ },] }
338
+ ];
339
+ DossierService.ctorParameters = () => [
340
+ { type: ConfigService }
220
341
  ];
221
342
 
222
- /*
223
- * Copyright 2015-2020 Ritense BV, the Netherlands.
224
- *
225
- * Licensed under EUPL, Version 1.2 (the "License");
226
- * you may not use this file except in compliance with the License.
227
- * You may obtain a copy of the License at
228
- *
229
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
230
- *
231
- * Unless required by applicable law or agreed to in writing, software
232
- * distributed under the License is distributed on an "AS IS" basis,
233
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
234
- * See the License for the specific language governing permissions and
235
- * limitations under the License.
236
- */
237
- const moment = moment_;
238
- moment.locale(localStorage.getItem('langKey') || '');
239
- class DossierListComponent {
240
- constructor(route, router, documentService, translateService, dossierService) {
241
- this.route = route;
242
- this.router = router;
243
- this.documentService = documentService;
244
- this.translateService = translateService;
245
- this.dossierService = dossierService;
246
- this.documentDefinitionName = '';
247
- this.showCreateDocument = false;
248
- this.items = [];
249
- this.fields = [];
250
- this.processDefinitionListFields = [];
251
- this.processDocumentDefinitions = [];
252
- this.pagination = {
253
- collectionSize: 0,
254
- page: 1,
255
- size: 10,
256
- maxPaginationItemSize: 5,
257
- sort: undefined,
258
- };
259
- this.selectedProcessDocumentDefinition = null;
260
- this.modalListenerAdded = false;
261
- }
262
- ngOnInit() {
263
- this.doInit();
264
- this.routeEvent(this.router);
265
- this.modalListenerAdded = false;
266
- }
267
- ngOnDestroy() {
268
- this.routerSubscription.unsubscribe();
269
- this.translationSubscription.unsubscribe();
270
- }
271
- paginationSet() {
272
- this.getData();
273
- }
274
- routeEvent(router) {
275
- this.routerSubscription = router.events.subscribe(e => {
276
- if (e instanceof NavigationEnd) {
277
- this.doInit();
278
- this.getData();
279
- }
280
- });
281
- }
282
- doInit() {
283
- const documentDefinitionName = this.route.snapshot.paramMap.get('documentDefinitionName') || '';
284
- const columns = this.dossierService.getDefinitionColumns(documentDefinitionName);
285
- this.documentDefinitionName = documentDefinitionName;
286
- this.initialSortState = this.dossierService.getInitialSortState(columns);
287
- this.openTranslationSubscription(columns);
288
- }
289
- openTranslationSubscription(columns) {
290
- this.translationSubscription = combineLatest(columns.map(column => this.translateService.stream(`fieldLabels.${column.translationKey}`))).subscribe(labels => {
291
- this.fields = columns.map((column, index) => (Object.assign({ key: column.propertyName, label: labels[index], sortable: column.sortable }, (column.viewType && { viewType: column.viewType }))));
292
- });
293
- }
294
- getData() {
295
- this.findDocumentDefinition(this.documentDefinitionName);
296
- if (this.hasCachedSearchRequest()) {
297
- const documentSearchRequest = this.getCachedSearch();
298
- this.globalSearchFilter = documentSearchRequest.globalSearchFilter;
299
- this.sequence = documentSearchRequest.sequence;
300
- this.createdBy = documentSearchRequest.createdBy;
301
- this.findDocuments(documentSearchRequest);
302
- }
303
- else {
304
- this.doSearch();
305
- }
306
- this.getAllAssociatedProcessDefinitions();
307
- }
308
- doSearch() {
309
- const documentSearchRequest = this.buildDocumentSearchRequest();
310
- this.findDocuments(documentSearchRequest);
311
- }
312
- findDocuments(documentSearchRequest) {
313
- return this.documentService.getDocuments(documentSearchRequest).subscribe(documents => {
314
- this.documents = documents;
315
- this.transformDocuments(this.documents.content);
316
- this.pagination.collectionSize = this.documents.totalElements;
317
- this.storeSearch(documentSearchRequest);
318
- });
319
- }
320
- getAllAssociatedProcessDefinitions() {
321
- this.documentService
322
- .findProcessDocumentDefinitions(this.documentDefinitionName)
323
- .subscribe(processDocumentDefinitions => {
324
- this.processDocumentDefinitions = processDocumentDefinitions.filter(processDocumentDefinition => processDocumentDefinition.canInitializeDocument);
325
- this.processDefinitionListFields = [
326
- {
327
- key: 'processName',
328
- label: 'Proces',
329
- },
330
- ];
331
- });
332
- }
333
- getCachedSearch() {
334
- const json = JSON.parse(this.getCachedDocumentSearchRequest());
335
- return new DocumentSearchRequestImpl(json.definitionName, this.pagination.page - 1, this.pagination.size, json.sequence, json.createdBy, json.globalSearchFilter, json.sort);
336
- }
337
- buildDocumentSearchRequest() {
338
- 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
339
- ? this.pagination.sort
340
- : this.initialSortState);
341
- }
342
- storeSearch(documentSearchRequest) {
343
- localStorage.setItem(this.getCachedKey(), JSON.stringify(documentSearchRequest));
344
- }
345
- getCachedDocumentSearchRequest() {
346
- return localStorage.getItem(this.getCachedKey()) || '';
347
- }
348
- hasCachedSearchRequest() {
349
- return localStorage.getItem(this.getCachedKey()) !== null;
350
- }
351
- getCachedKey() {
352
- return 'list-search-' + this.documentDefinitionName;
353
- }
354
- rowClick(document) {
355
- this.router.navigate([
356
- `/dossiers/${this.documentDefinitionName}/document/${document.id}/${DefaultTabs.summary}`,
357
- ]);
358
- }
359
- startDossier() {
360
- if (this.processDocumentDefinitions.length > 1) {
361
- $('#startProcess').modal('show');
362
- }
363
- else {
364
- this.selectedProcessDocumentDefinition = this.processDocumentDefinitions[0];
365
- this.showStartProcessModal();
366
- }
367
- }
368
- showStartProcessModal() {
369
- if (this.selectedProcessDocumentDefinition !== null) {
370
- this.processStart.openModal(this.selectedProcessDocumentDefinition);
371
- this.selectedProcessDocumentDefinition = null;
372
- }
373
- }
374
- selectProcess(processDocumentDefinition) {
375
- const modal = $('#startProcess');
376
- if (!this.modalListenerAdded) {
377
- modal.on('hidden.bs.modal', this.showStartProcessModal.bind(this));
378
- this.modalListenerAdded = true;
379
- }
380
- this.selectedProcessDocumentDefinition = processDocumentDefinition;
381
- modal.modal('hide');
382
- }
383
- findDocumentDefinition(documentDefinitionName) {
384
- this.documentService.getDocumentDefinition(documentDefinitionName).subscribe(definition => {
385
- this.schema = definition.schema;
386
- });
387
- }
388
- transformDocuments(documentsContent) {
389
- this.items = documentsContent.map(document => {
390
- const { content } = document, others = __rest(document, ["content"]);
391
- return Object.assign(Object.assign({}, content), others);
392
- });
393
- }
394
- paginationClicked(page) {
395
- this.pagination.page = page;
396
- this.doSearch();
397
- }
398
- sortChanged(sortState) {
399
- this.pagination.sort = sortState;
400
- this.doSearch();
401
- }
402
- getInitialSortState() {
403
- if (this.hasCachedSearchRequest()) {
404
- const cachedRequest = JSON.parse(this.getCachedDocumentSearchRequest());
405
- return cachedRequest.sort ? cachedRequest.sort : this.initialSortState;
406
- }
407
- return this.initialSortState;
408
- }
409
- }
410
- DossierListComponent.decorators = [
411
- { type: Component, args: [{
412
- selector: 'valtimo-dossier-list',
413
- 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",
414
- styles: [""]
415
- },] }
416
- ];
417
- DossierListComponent.ctorParameters = () => [
418
- { type: ActivatedRoute },
419
- { type: Router },
420
- { type: DocumentService },
421
- { type: TranslateService },
422
- { type: DossierService }
423
- ];
424
- DossierListComponent.propDecorators = {
425
- processStart: [{ type: ViewChild, args: ['processStartModal',] }]
343
+ /*
344
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
345
+ *
346
+ * Licensed under EUPL, Version 1.2 (the "License");
347
+ * you may not use this file except in compliance with the License.
348
+ * You may obtain a copy of the License at
349
+ *
350
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
351
+ *
352
+ * Unless required by applicable law or agreed to in writing, software
353
+ * distributed under the License is distributed on an "AS IS" basis,
354
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
355
+ * See the License for the specific language governing permissions and
356
+ * limitations under the License.
357
+ */
358
+ const moment = moment_;
359
+ moment.locale(localStorage.getItem('langKey') || '');
360
+ class DossierListComponent {
361
+ constructor(route, router, documentService, translateService, dossierService) {
362
+ this.route = route;
363
+ this.router = router;
364
+ this.documentService = documentService;
365
+ this.translateService = translateService;
366
+ this.dossierService = dossierService;
367
+ this.documentDefinitionName = '';
368
+ this.showCreateDocument = false;
369
+ this.items = [];
370
+ this.fields = [];
371
+ this.processDefinitionListFields = [];
372
+ this.processDocumentDefinitions = [];
373
+ this.pagination = {
374
+ collectionSize: 0,
375
+ page: 1,
376
+ size: 10,
377
+ maxPaginationItemSize: 5,
378
+ sort: undefined,
379
+ };
380
+ this.selectedProcessDocumentDefinition = null;
381
+ this.modalListenerAdded = false;
382
+ }
383
+ ngOnInit() {
384
+ this.doInit();
385
+ this.routeEvent(this.router);
386
+ this.modalListenerAdded = false;
387
+ }
388
+ ngOnDestroy() {
389
+ this.routerSubscription.unsubscribe();
390
+ this.translationSubscription.unsubscribe();
391
+ }
392
+ paginationSet() {
393
+ this.getData();
394
+ }
395
+ routeEvent(router) {
396
+ this.routerSubscription = router.events.subscribe(e => {
397
+ if (e instanceof NavigationEnd) {
398
+ this.doInit();
399
+ this.getData();
400
+ }
401
+ });
402
+ }
403
+ doInit() {
404
+ const documentDefinitionName = this.route.snapshot.paramMap.get('documentDefinitionName') || '';
405
+ const columns = this.dossierService.getDefinitionColumns(documentDefinitionName);
406
+ this.documentDefinitionName = documentDefinitionName;
407
+ this.initialSortState = this.dossierService.getInitialSortState(columns);
408
+ this.openTranslationSubscription(columns);
409
+ }
410
+ openTranslationSubscription(columns) {
411
+ this.translationSubscription = combineLatest(columns.map(column => this.translateService.stream(`fieldLabels.${column.translationKey}`))).subscribe(labels => {
412
+ this.fields = columns.map((column, index) => (Object.assign({ key: column.propertyName, label: labels[index], sortable: column.sortable }, (column.viewType && { viewType: column.viewType }))));
413
+ });
414
+ }
415
+ getData() {
416
+ this.findDocumentDefinition(this.documentDefinitionName);
417
+ if (this.hasCachedSearchRequest()) {
418
+ const documentSearchRequest = this.getCachedSearch();
419
+ this.globalSearchFilter = documentSearchRequest.globalSearchFilter;
420
+ this.sequence = documentSearchRequest.sequence;
421
+ this.createdBy = documentSearchRequest.createdBy;
422
+ this.findDocuments(documentSearchRequest);
423
+ }
424
+ else {
425
+ this.doSearch();
426
+ }
427
+ this.getAllAssociatedProcessDefinitions();
428
+ }
429
+ doSearch() {
430
+ const documentSearchRequest = this.buildDocumentSearchRequest();
431
+ this.findDocuments(documentSearchRequest);
432
+ }
433
+ findDocuments(documentSearchRequest) {
434
+ return this.documentService.getDocuments(documentSearchRequest).subscribe(documents => {
435
+ this.documents = documents;
436
+ this.transformDocuments(this.documents.content);
437
+ this.pagination.collectionSize = this.documents.totalElements;
438
+ this.storeSearch(documentSearchRequest);
439
+ });
440
+ }
441
+ getAllAssociatedProcessDefinitions() {
442
+ this.documentService
443
+ .findProcessDocumentDefinitions(this.documentDefinitionName)
444
+ .subscribe(processDocumentDefinitions => {
445
+ this.processDocumentDefinitions = processDocumentDefinitions.filter(processDocumentDefinition => processDocumentDefinition.canInitializeDocument);
446
+ this.processDefinitionListFields = [
447
+ {
448
+ key: 'processName',
449
+ label: 'Proces',
450
+ },
451
+ ];
452
+ });
453
+ }
454
+ getCachedSearch() {
455
+ const json = JSON.parse(this.getCachedDocumentSearchRequest());
456
+ return new DocumentSearchRequestImpl(json.definitionName, this.pagination.page - 1, this.pagination.size, json.sequence, json.createdBy, json.globalSearchFilter, json.sort);
457
+ }
458
+ buildDocumentSearchRequest() {
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);
462
+ }
463
+ storeSearch(documentSearchRequest) {
464
+ localStorage.setItem(this.getCachedKey(), JSON.stringify(documentSearchRequest));
465
+ }
466
+ getCachedDocumentSearchRequest() {
467
+ return localStorage.getItem(this.getCachedKey()) || '';
468
+ }
469
+ hasCachedSearchRequest() {
470
+ return localStorage.getItem(this.getCachedKey()) !== null;
471
+ }
472
+ getCachedKey() {
473
+ return 'list-search-' + this.documentDefinitionName;
474
+ }
475
+ rowClick(document) {
476
+ this.router.navigate([
477
+ `/dossiers/${this.documentDefinitionName}/document/${document.id}/${DefaultTabs.summary}`,
478
+ ]);
479
+ }
480
+ startDossier() {
481
+ if (this.processDocumentDefinitions.length > 1) {
482
+ $('#startProcess').modal('show');
483
+ }
484
+ else {
485
+ this.selectedProcessDocumentDefinition = this.processDocumentDefinitions[0];
486
+ this.showStartProcessModal();
487
+ }
488
+ }
489
+ showStartProcessModal() {
490
+ if (this.selectedProcessDocumentDefinition !== null) {
491
+ this.processStart.openModal(this.selectedProcessDocumentDefinition);
492
+ this.selectedProcessDocumentDefinition = null;
493
+ }
494
+ }
495
+ selectProcess(processDocumentDefinition) {
496
+ const modal = $('#startProcess');
497
+ if (!this.modalListenerAdded) {
498
+ modal.on('hidden.bs.modal', this.showStartProcessModal.bind(this));
499
+ this.modalListenerAdded = true;
500
+ }
501
+ this.selectedProcessDocumentDefinition = processDocumentDefinition;
502
+ modal.modal('hide');
503
+ }
504
+ findDocumentDefinition(documentDefinitionName) {
505
+ this.documentService.getDocumentDefinition(documentDefinitionName).subscribe(definition => {
506
+ this.schema = definition.schema;
507
+ });
508
+ }
509
+ transformDocuments(documentsContent) {
510
+ this.items = documentsContent.map(document => {
511
+ const { content } = document, others = __rest(document, ["content"]);
512
+ return Object.assign(Object.assign({}, content), others);
513
+ });
514
+ }
515
+ paginationClicked(page) {
516
+ this.pagination.page = page;
517
+ this.doSearch();
518
+ }
519
+ sortChanged(sortState) {
520
+ this.pagination.sort = sortState;
521
+ this.doSearch();
522
+ }
523
+ getInitialSortState() {
524
+ if (this.hasCachedSearchRequest()) {
525
+ const cachedRequest = JSON.parse(this.getCachedDocumentSearchRequest());
526
+ return cachedRequest.sort ? cachedRequest.sort : this.initialSortState;
527
+ }
528
+ return this.initialSortState;
529
+ }
530
+ }
531
+ DossierListComponent.decorators = [
532
+ { type: Component, args: [{
533
+ selector: 'valtimo-dossier-list',
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",
535
+ styles: [""]
536
+ },] }
537
+ ];
538
+ DossierListComponent.ctorParameters = () => [
539
+ { type: ActivatedRoute },
540
+ { type: Router },
541
+ { type: DocumentService },
542
+ { type: TranslateService },
543
+ { type: DossierService }
544
+ ];
545
+ DossierListComponent.propDecorators = {
546
+ processStart: [{ type: ViewChild, args: ['processStartModal',] }]
426
547
  };
427
548
 
428
- /*
429
- * Copyright 2015-2020 Ritense BV, the Netherlands.
430
- *
431
- * Licensed under EUPL, Version 1.2 (the "License");
432
- * you may not use this file except in compliance with the License.
433
- * You may obtain a copy of the License at
434
- *
435
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
436
- *
437
- * Unless required by applicable law or agreed to in writing, software
438
- * distributed under the License is distributed on an "AS IS" basis,
439
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
440
- * See the License for the specific language governing permissions and
441
- * limitations under the License.
442
- */
443
- const moment$1 = moment_;
444
- moment$1.locale(localStorage.getItem('langKey') || '');
445
- moment$1.defaultFormat = 'DD MMM YYYY HH:mm';
446
- class DossierDetailTabSummaryComponent {
447
- constructor(router, documentService, taskService, processService, el, renderer, route, formService, userProviderService) {
448
- this.router = router;
449
- this.documentService = documentService;
450
- this.taskService = taskService;
451
- this.processService = processService;
452
- this.el = el;
453
- this.renderer = renderer;
454
- this.route = route;
455
- this.formService = formService;
456
- this.userProviderService = userProviderService;
457
- this.processDocumentInstances = [];
458
- this.tasks = [];
459
- this.formDefinition = null;
460
- this.roles = [];
461
- this.snapshot = this.route.snapshot.paramMap;
462
- this.documentDefinitionName = this.snapshot.get('documentDefinitionName') || '';
463
- this.documentId = this.snapshot.get('documentId') || '';
464
- this.options = new FormioOptionsImpl();
465
- this.options.disableAlerts = true;
466
- }
467
- ngOnInit() {
468
- this.moment = moment$1;
469
- this.init();
470
- }
471
- init() {
472
- this.documentService.getDocument(this.documentId).subscribe(document => {
473
- this.document = document;
474
- });
475
- this.formService
476
- .getFormDefinitionByNamePreFilled(`${this.documentDefinitionName}.summary`, this.documentId)
477
- .subscribe(formDefinition => {
478
- this.formDefinition = formDefinition;
479
- });
480
- this.userProviderService.getUserSubject().subscribe(user => {
481
- this.roles = user.roles;
482
- this.tasks = [];
483
- this.loadProcessDocumentInstances(this.documentId);
484
- });
485
- }
486
- loadProcessDocumentInstances(documentId) {
487
- this.documentService
488
- .findProcessDocumentInstances(documentId)
489
- .subscribe(processDocumentInstances => {
490
- this.processDocumentInstances = processDocumentInstances;
491
- this.processDocumentInstances.forEach(instance => {
492
- this.loadProcessInstanceTasks(instance.id.processInstanceId);
493
- });
494
- });
495
- }
496
- loadProcessInstanceTasks(processInstanceId) {
497
- this.processService.getProcessInstanceTasks(processInstanceId).subscribe(tasks => {
498
- tasks.forEach(task => {
499
- task.createdUnix = this.moment(task.created).unix();
500
- task.created = this.moment(task.created).format('DD MMM YYYY HH:mm');
501
- task.isLocked = () => {
502
- let locked = true;
503
- for (const link of task.identityLinks) {
504
- if (link.type === 'candidate' && link.groupId) {
505
- if (this.roles.includes(link.groupId)) {
506
- locked = false;
507
- break;
508
- }
509
- }
510
- }
511
- return locked;
512
- };
513
- });
514
- this.tasks = this.tasks.concat(tasks);
515
- this.tasks.sort((t1, t2) => t2.createdUnix - t1.createdUnix);
516
- });
517
- }
518
- rowTaskClick(task) {
519
- this.taskDetail.openTaskDetails(task);
520
- }
521
- }
522
- DossierDetailTabSummaryComponent.decorators = [
523
- { type: Component, args: [{
524
- selector: 'valtimo-dossier-detail-tab-summary',
525
- 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",
526
- encapsulation: ViewEncapsulation.None,
527
- 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}"]
528
- },] }
529
- ];
530
- DossierDetailTabSummaryComponent.ctorParameters = () => [
531
- { type: Router },
532
- { type: DocumentService },
533
- { type: TaskService },
534
- { type: ProcessService },
535
- { type: ElementRef },
536
- { type: Renderer2 },
537
- { type: ActivatedRoute },
538
- { type: FormService },
539
- { type: UserProviderService }
540
- ];
541
- DossierDetailTabSummaryComponent.propDecorators = {
542
- taskDetail: [{ type: ViewChild, args: ['taskDetail',] }]
549
+ /*
550
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
551
+ *
552
+ * Licensed under EUPL, Version 1.2 (the "License");
553
+ * you may not use this file except in compliance with the License.
554
+ * You may obtain a copy of the License at
555
+ *
556
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
557
+ *
558
+ * Unless required by applicable law or agreed to in writing, software
559
+ * distributed under the License is distributed on an "AS IS" basis,
560
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
561
+ * See the License for the specific language governing permissions and
562
+ * limitations under the License.
563
+ */
564
+ const moment$1 = moment_;
565
+ moment$1.locale(localStorage.getItem('langKey') || '');
566
+ moment$1.defaultFormat = 'DD MMM YYYY HH:mm';
567
+ class DossierDetailTabSummaryComponent {
568
+ constructor(router, documentService, taskService, processService, el, renderer, route, formService, userProviderService) {
569
+ this.router = router;
570
+ this.documentService = documentService;
571
+ this.taskService = taskService;
572
+ this.processService = processService;
573
+ this.el = el;
574
+ this.renderer = renderer;
575
+ this.route = route;
576
+ this.formService = formService;
577
+ this.userProviderService = userProviderService;
578
+ this.processDocumentInstances = [];
579
+ this.tasks = [];
580
+ this.formDefinition = null;
581
+ this.roles = [];
582
+ this.snapshot = this.route.snapshot.paramMap;
583
+ this.documentDefinitionName = this.snapshot.get('documentDefinitionName') || '';
584
+ this.documentId = this.snapshot.get('documentId') || '';
585
+ this.options = new FormioOptionsImpl();
586
+ this.options.disableAlerts = true;
587
+ }
588
+ ngOnInit() {
589
+ this.moment = moment$1;
590
+ this.init();
591
+ }
592
+ init() {
593
+ this.documentService.getDocument(this.documentId).subscribe(document => {
594
+ this.document = document;
595
+ });
596
+ this.formService
597
+ .getFormDefinitionByNamePreFilled(`${this.documentDefinitionName}.summary`, this.documentId)
598
+ .subscribe(formDefinition => {
599
+ this.formDefinition = formDefinition;
600
+ });
601
+ this.userProviderService.getUserSubject().subscribe(user => {
602
+ this.roles = user.roles;
603
+ this.tasks = [];
604
+ this.loadProcessDocumentInstances(this.documentId);
605
+ });
606
+ }
607
+ loadProcessDocumentInstances(documentId) {
608
+ this.documentService
609
+ .findProcessDocumentInstances(documentId)
610
+ .subscribe(processDocumentInstances => {
611
+ this.processDocumentInstances = processDocumentInstances;
612
+ this.processDocumentInstances.forEach(instance => {
613
+ this.loadProcessInstanceTasks(instance.id.processInstanceId);
614
+ });
615
+ });
616
+ }
617
+ loadProcessInstanceTasks(processInstanceId) {
618
+ this.processService.getProcessInstanceTasks(processInstanceId).subscribe(tasks => {
619
+ tasks.forEach(task => {
620
+ task.createdUnix = this.moment(task.created).unix();
621
+ task.created = this.moment(task.created).format('DD MMM YYYY HH:mm');
622
+ task.isLocked = () => {
623
+ let locked = true;
624
+ for (const link of task.identityLinks) {
625
+ if (link.type === 'candidate' && link.groupId) {
626
+ if (this.roles.includes(link.groupId)) {
627
+ locked = false;
628
+ break;
629
+ }
630
+ }
631
+ }
632
+ return locked;
633
+ };
634
+ });
635
+ this.tasks = this.tasks.concat(tasks);
636
+ this.tasks.sort((t1, t2) => t2.createdUnix - t1.createdUnix);
637
+ });
638
+ }
639
+ rowTaskClick(task) {
640
+ this.taskDetail.openTaskDetails(task);
641
+ }
642
+ }
643
+ DossierDetailTabSummaryComponent.decorators = [
644
+ { type: Component, args: [{
645
+ selector: 'valtimo-dossier-detail-tab-summary',
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",
647
+ encapsulation: ViewEncapsulation.None,
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}"]
649
+ },] }
650
+ ];
651
+ DossierDetailTabSummaryComponent.ctorParameters = () => [
652
+ { type: Router },
653
+ { type: DocumentService },
654
+ { type: TaskService },
655
+ { type: ProcessService },
656
+ { type: ElementRef },
657
+ { type: Renderer2 },
658
+ { type: ActivatedRoute },
659
+ { type: FormService },
660
+ { type: UserProviderService }
661
+ ];
662
+ DossierDetailTabSummaryComponent.propDecorators = {
663
+ taskDetail: [{ type: ViewChild, args: ['taskDetail',] }]
543
664
  };
544
665
 
545
- /*
546
- * Copyright 2015-2020 Ritense BV, the Netherlands.
547
- *
548
- * Licensed under EUPL, Version 1.2 (the "License");
549
- * you may not use this file except in compliance with the License.
550
- * You may obtain a copy of the License at
551
- *
552
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
553
- *
554
- * Unless required by applicable law or agreed to in writing, software
555
- * distributed under the License is distributed on an "AS IS" basis,
556
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
557
- * See the License for the specific language governing permissions and
558
- * limitations under the License.
559
- */
560
- class DossierDetailTabProgressComponent {
561
- constructor(route, documentService) {
562
- this.route = route;
563
- this.documentService = documentService;
564
- const snapshot = this.route.snapshot.paramMap;
565
- this.documentId = snapshot.get('documentId') || '';
566
- }
567
- ngOnInit() {
568
- this.documentService
569
- .findProcessDocumentInstances(this.documentId)
570
- .subscribe(processDocumentInstances => {
571
- this.processDocumentInstances = processDocumentInstances;
572
- this.selectedProcessInstanceId = processDocumentInstances[0].id.processInstanceId;
573
- });
574
- }
575
- loadProcessInstance(processInstanceId) {
576
- this.selectedProcessInstanceId = processInstanceId;
577
- }
578
- }
579
- DossierDetailTabProgressComponent.decorators = [
580
- { type: Component, args: [{
581
- selector: 'valtimo-dossier-detail-tab-progress',
582
- 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",
583
- styles: [".full-height-tab-content{height:calc(100vh - 380px);width:100%}"]
584
- },] }
585
- ];
586
- DossierDetailTabProgressComponent.ctorParameters = () => [
587
- { type: ActivatedRoute },
588
- { type: DocumentService }
666
+ /*
667
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
668
+ *
669
+ * Licensed under EUPL, Version 1.2 (the "License");
670
+ * you may not use this file except in compliance with the License.
671
+ * You may obtain a copy of the License at
672
+ *
673
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
674
+ *
675
+ * Unless required by applicable law or agreed to in writing, software
676
+ * distributed under the License is distributed on an "AS IS" basis,
677
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
678
+ * See the License for the specific language governing permissions and
679
+ * limitations under the License.
680
+ */
681
+ class DossierDetailTabProgressComponent {
682
+ constructor(route, documentService) {
683
+ this.route = route;
684
+ this.documentService = documentService;
685
+ const snapshot = this.route.snapshot.paramMap;
686
+ this.documentId = snapshot.get('documentId') || '';
687
+ }
688
+ ngOnInit() {
689
+ this.documentService
690
+ .findProcessDocumentInstances(this.documentId)
691
+ .subscribe(processDocumentInstances => {
692
+ this.processDocumentInstances = processDocumentInstances;
693
+ this.selectedProcessInstanceId = processDocumentInstances[0].id.processInstanceId;
694
+ });
695
+ }
696
+ loadProcessInstance(processInstanceId) {
697
+ this.selectedProcessInstanceId = processInstanceId;
698
+ }
699
+ }
700
+ DossierDetailTabProgressComponent.decorators = [
701
+ { type: Component, args: [{
702
+ selector: 'valtimo-dossier-detail-tab-progress',
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",
704
+ styles: [".full-height-tab-content{height:calc(100vh - 380px);width:100%}"]
705
+ },] }
706
+ ];
707
+ DossierDetailTabProgressComponent.ctorParameters = () => [
708
+ { type: ActivatedRoute },
709
+ { type: DocumentService }
589
710
  ];
590
711
 
591
- /*
592
- * Copyright 2015-2020 Ritense BV, the Netherlands.
593
- *
594
- * Licensed under EUPL, Version 1.2 (the "License");
595
- * you may not use this file except in compliance with the License.
596
- * You may obtain a copy of the License at
597
- *
598
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
599
- *
600
- * Unless required by applicable law or agreed to in writing, software
601
- * distributed under the License is distributed on an "AS IS" basis,
602
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
603
- * See the License for the specific language governing permissions and
604
- * limitations under the License.
605
- */
606
- const moment$2 = moment_;
607
- moment$2.locale(localStorage.getItem('langKey') || '');
608
- moment$2.defaultFormat = 'DD MMM YYYY HH:mm';
609
- class DossierDetailTabAuditComponent {
610
- constructor(route, documentService, spinnerService) {
611
- this.route = route;
612
- this.documentService = documentService;
613
- this.spinnerService = spinnerService;
614
- this.paginationClicked = new EventEmitter();
615
- this.defaultAuditPage = 0;
616
- this.spinnerService.show('auditSpinner');
617
- const snapshot = this.route.snapshot.paramMap;
618
- this.documentId = snapshot.get('documentId') || '';
619
- }
620
- static getTranslationKey(auditEvent) {
621
- const classNameArray = auditEvent.className.split('.');
622
- const eventName = classNameArray[classNameArray.length - 1];
623
- return 'events.' + eventName;
624
- }
625
- ngOnInit() {
626
- this.loadAuditPage(this.defaultAuditPage);
627
- }
628
- loadAuditPage(pageNumber) {
629
- this.documentService.getAuditLog(this.documentId, pageNumber).subscribe(page => {
630
- const timelineItems = [];
631
- page.content.forEach(auditRecord => {
632
- const occurredOn = moment$2(auditRecord.metaData.occurredOn);
633
- const fromNow = occurredOn.fromNow();
634
- timelineItems.push(new TimelineItemImpl(occurredOn.format('DD MMM YYYY'), occurredOn.format('HH:mm'), auditRecord.metaData.user, fromNow, DossierDetailTabAuditComponent.getTranslationKey(auditRecord.auditEvent), auditRecord.auditEvent));
635
- });
636
- this.timelineItems = timelineItems;
637
- this.spinnerService.hide('auditSpinner');
638
- this.pagination = page;
639
- this.pagination.number += 1;
640
- });
641
- }
642
- onChangePagination(page) {
643
- this.paginationClicked.emit(page);
644
- this.currentAuditPage = page - 1;
645
- this.loadAuditPage(this.currentAuditPage);
646
- }
647
- }
648
- DossierDetailTabAuditComponent.decorators = [
649
- { type: Component, args: [{
650
- selector: 'valtimo-dossier-detail-tab-audit',
651
- 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",
652
- styles: [".audit-pagination{border-top:1px solid #dee2e6;margin:0 -1.923rem -1.923rem!important}"]
653
- },] }
654
- ];
655
- DossierDetailTabAuditComponent.ctorParameters = () => [
656
- { type: ActivatedRoute },
657
- { type: DocumentService },
658
- { type: NgxSpinnerService }
659
- ];
660
- DossierDetailTabAuditComponent.propDecorators = {
661
- paginationClicked: [{ type: Output }]
712
+ /*
713
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
714
+ *
715
+ * Licensed under EUPL, Version 1.2 (the "License");
716
+ * you may not use this file except in compliance with the License.
717
+ * You may obtain a copy of the License at
718
+ *
719
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
720
+ *
721
+ * Unless required by applicable law or agreed to in writing, software
722
+ * distributed under the License is distributed on an "AS IS" basis,
723
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
724
+ * See the License for the specific language governing permissions and
725
+ * limitations under the License.
726
+ */
727
+ const moment$2 = moment_;
728
+ moment$2.locale(localStorage.getItem('langKey') || '');
729
+ moment$2.defaultFormat = 'DD MMM YYYY HH:mm';
730
+ class DossierDetailTabAuditComponent {
731
+ constructor(route, documentService, spinnerService) {
732
+ this.route = route;
733
+ this.documentService = documentService;
734
+ this.spinnerService = spinnerService;
735
+ this.paginationClicked = new EventEmitter();
736
+ this.defaultAuditPage = 0;
737
+ this.spinnerService.show('auditSpinner');
738
+ const snapshot = this.route.snapshot.paramMap;
739
+ this.documentId = snapshot.get('documentId') || '';
740
+ }
741
+ static getTranslationKey(auditEvent) {
742
+ const classNameArray = auditEvent.className.split('.');
743
+ const eventName = classNameArray[classNameArray.length - 1];
744
+ return 'events.' + eventName;
745
+ }
746
+ ngOnInit() {
747
+ this.loadAuditPage(this.defaultAuditPage);
748
+ }
749
+ loadAuditPage(pageNumber) {
750
+ this.documentService.getAuditLog(this.documentId, pageNumber).subscribe(page => {
751
+ const timelineItems = [];
752
+ page.content.forEach(auditRecord => {
753
+ const occurredOn = moment$2(auditRecord.metaData.occurredOn);
754
+ const fromNow = occurredOn.fromNow();
755
+ timelineItems.push(new TimelineItemImpl(occurredOn.format('DD MMM YYYY'), occurredOn.format('HH:mm'), auditRecord.metaData.user, fromNow, DossierDetailTabAuditComponent.getTranslationKey(auditRecord.auditEvent), auditRecord.auditEvent));
756
+ });
757
+ this.timelineItems = timelineItems;
758
+ this.spinnerService.hide('auditSpinner');
759
+ this.pagination = page;
760
+ this.pagination.number += 1;
761
+ });
762
+ }
763
+ onChangePagination(page) {
764
+ this.paginationClicked.emit(page);
765
+ this.currentAuditPage = page - 1;
766
+ this.loadAuditPage(this.currentAuditPage);
767
+ }
768
+ }
769
+ DossierDetailTabAuditComponent.decorators = [
770
+ { type: Component, args: [{
771
+ selector: 'valtimo-dossier-detail-tab-audit',
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}"]
774
+ },] }
775
+ ];
776
+ DossierDetailTabAuditComponent.ctorParameters = () => [
777
+ { type: ActivatedRoute },
778
+ { type: DocumentService },
779
+ { type: NgxSpinnerService }
780
+ ];
781
+ DossierDetailTabAuditComponent.propDecorators = {
782
+ paginationClicked: [{ type: Output }]
662
783
  };
663
784
 
664
- /*
665
- * Copyright 2015-2020 Ritense BV, the Netherlands.
666
- *
667
- * Licensed under EUPL, Version 1.2 (the "License");
668
- * you may not use this file except in compliance with the License.
669
- * You may obtain a copy of the License at
670
- *
671
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
672
- *
673
- * Unless required by applicable law or agreed to in writing, software
674
- * distributed under the License is distributed on an "AS IS" basis,
675
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
676
- * See the License for the specific language governing permissions and
677
- * limitations under the License.
678
- */
679
- class DossierDetailTabDocumentsComponent {
680
- constructor(route, documentService, toastrService, uploadProviderService, downloadService, translateService, configService) {
681
- var _a, _b;
682
- this.route = route;
683
- this.documentService = documentService;
684
- this.toastrService = toastrService;
685
- this.uploadProviderService = uploadProviderService;
686
- this.downloadService = downloadService;
687
- this.translateService = translateService;
688
- this.configService = configService;
689
- this.maxFileSize = ((_b = (_a = this.configService) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.caseFileSizeUploadLimitMB) || 5;
690
- this.refetch$ = new BehaviorSubject(null);
691
- this.relatedFiles$ = this.refetch$.pipe(switchMap(() => combineLatest([this.documentService.getDocument(this.documentId), this.translateService.stream('key')])), map(([document]) => {
692
- const relatedFiles = (document === null || document === void 0 ? void 0 : document.relatedFiles) || [];
693
- const translatedFiles = relatedFiles.map(file => {
694
- return Object.assign(Object.assign({}, file), { createdBy: file.createdBy || this.translateService.instant('list.automaticallyGenerated') });
695
- });
696
- return translatedFiles || [];
697
- }));
698
- this.fields = [
699
- { key: 'fileName', label: 'File name' },
700
- { key: 'sizeInBytes', label: 'Size in bytes' },
701
- { key: 'createdOn', label: 'Created on', viewType: 'date' },
702
- { key: 'createdBy', label: 'Created by' },
703
- ];
704
- this.actions = [
705
- {
706
- columnName: '',
707
- iconClass: 'fas fa-external-link-alt',
708
- callback: this.downloadDocument.bind(this),
709
- },
710
- {
711
- columnName: '',
712
- iconClass: 'fas fa-trash-alt',
713
- callback: this.removeRelatedFile.bind(this),
714
- },
715
- ];
716
- this.uploading$ = new BehaviorSubject(false);
717
- const snapshot = this.route.snapshot.paramMap;
718
- this.documentId = snapshot.get('documentId') || '';
719
- this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
720
- }
721
- ngOnInit() {
722
- this.refetchDocuments();
723
- }
724
- fileSelected(file) {
725
- this.uploading$.next(true);
726
- this.uploadProviderService
727
- .uploadFile(file, this.documentDefinitionName)
728
- .pipe(switchMap(resourceFile => this.documentService.assignResource(this.documentId, resourceFile.data.resourceId)))
729
- .subscribe(() => {
730
- this.toastrService.success('Successfully uploaded document to dossier');
731
- this.refetchDocuments();
732
- this.uploading$.next(false);
733
- }, () => {
734
- this.toastrService.error('Failed to upload document to dossier');
735
- this.uploading$.next(false);
736
- });
737
- }
738
- downloadDocument(relatedFile) {
739
- this.uploadProviderService
740
- .getResource(relatedFile.fileId)
741
- .subscribe((resource) => {
742
- this.downloadService.downloadFile(resource.url, resource.resource.name);
743
- });
744
- }
745
- removeRelatedFile(relatedFile) {
746
- this.documentService.removeResource(this.documentId, relatedFile.fileId).subscribe(() => {
747
- this.toastrService.success('Successfully removed document from dossier');
748
- this.refetchDocuments();
749
- }, () => {
750
- this.toastrService.error('Failed to remove document from dossier');
751
- });
752
- }
753
- refetchDocuments() {
754
- this.refetch$.next(null);
755
- }
756
- }
757
- DossierDetailTabDocumentsComponent.decorators = [
758
- { type: Component, args: [{
759
- selector: 'valtimo-dossier-detail-tab-documents',
760
- 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",
761
- styles: [""]
762
- },] }
763
- ];
764
- DossierDetailTabDocumentsComponent.ctorParameters = () => [
765
- { type: ActivatedRoute },
766
- { type: DocumentService },
767
- { type: ToastrService },
768
- { type: UploadProviderService },
769
- { type: DownloadService },
770
- { type: TranslateService },
771
- { type: ConfigService }
785
+ /*
786
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
787
+ *
788
+ * Licensed under EUPL, Version 1.2 (the "License");
789
+ * you may not use this file except in compliance with the License.
790
+ * You may obtain a copy of the License at
791
+ *
792
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
793
+ *
794
+ * Unless required by applicable law or agreed to in writing, software
795
+ * distributed under the License is distributed on an "AS IS" basis,
796
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
797
+ * See the License for the specific language governing permissions and
798
+ * limitations under the License.
799
+ */
800
+ class DossierDetailTabDocumentsComponent {
801
+ constructor(route, documentService, toastrService, uploadProviderService, downloadService, translateService, configService) {
802
+ var _a, _b;
803
+ this.route = route;
804
+ this.documentService = documentService;
805
+ this.toastrService = toastrService;
806
+ this.uploadProviderService = uploadProviderService;
807
+ this.downloadService = downloadService;
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
+ }));
822
+ this.fields = [
823
+ { key: 'fileName', label: 'File name' },
824
+ { key: 'sizeInBytes', label: 'Size in bytes' },
825
+ { key: 'createdOn', label: 'Created on', viewType: 'date' },
826
+ { key: 'createdBy', label: 'Created by' },
827
+ ];
828
+ this.actions = [
829
+ {
830
+ columnName: '',
831
+ iconClass: 'fas fa-external-link-alt',
832
+ callback: this.downloadDocument.bind(this),
833
+ },
834
+ {
835
+ columnName: '',
836
+ iconClass: 'fas fa-trash-alt',
837
+ callback: this.removeRelatedFile.bind(this),
838
+ },
839
+ ];
840
+ this.uploading$ = new BehaviorSubject(false);
841
+ const snapshot = this.route.snapshot.paramMap;
842
+ this.documentId = snapshot.get('documentId') || '';
843
+ this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
844
+ }
845
+ ngOnInit() {
846
+ this.refetchDocuments();
847
+ }
848
+ fileSelected(file) {
849
+ this.uploading$.next(true);
850
+ this.uploadProviderService
851
+ .uploadFile(file, this.documentDefinitionName)
852
+ .pipe(switchMap(resourceFile => this.documentService.assignResource(this.documentId, resourceFile.data.resourceId)))
853
+ .subscribe(() => {
854
+ this.toastrService.success('Successfully uploaded document to dossier');
855
+ this.refetchDocuments();
856
+ this.uploading$.next(false);
857
+ }, () => {
858
+ this.toastrService.error('Failed to upload document to dossier');
859
+ this.uploading$.next(false);
860
+ });
861
+ }
862
+ downloadDocument(relatedFile) {
863
+ this.uploadProviderService
864
+ .getResource(relatedFile.fileId)
865
+ .subscribe((resource) => {
866
+ this.downloadService.downloadFile(resource.url, resource.resource.name);
867
+ });
868
+ }
869
+ removeRelatedFile(relatedFile) {
870
+ this.documentService.removeResource(this.documentId, relatedFile.fileId).subscribe(() => {
871
+ this.toastrService.success('Successfully removed document from dossier');
872
+ this.refetchDocuments();
873
+ }, () => {
874
+ this.toastrService.error('Failed to remove document from dossier');
875
+ });
876
+ }
877
+ refetchDocuments() {
878
+ this.refetch$.next(null);
879
+ }
880
+ }
881
+ DossierDetailTabDocumentsComponent.decorators = [
882
+ { type: Component, args: [{
883
+ selector: 'valtimo-dossier-detail-tab-documents',
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",
885
+ styles: [""]
886
+ },] }
887
+ ];
888
+ DossierDetailTabDocumentsComponent.ctorParameters = () => [
889
+ { type: ActivatedRoute },
890
+ { type: DocumentService },
891
+ { type: ToastrService },
892
+ { type: UploadProviderService },
893
+ { type: DownloadService },
894
+ { type: TranslateService },
895
+ { type: ConfigService }
772
896
  ];
773
897
 
774
- /*
775
- * Copyright 2015-2020 Ritense BV, the Netherlands.
776
- *
777
- * Licensed under EUPL, Version 1.2 (the "License");
778
- * you may not use this file except in compliance with the License.
779
- * You may obtain a copy of the License at
780
- *
781
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
782
- *
783
- * Unless required by applicable law or agreed to in writing, software
784
- * distributed under the License is distributed on an "AS IS" basis,
785
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
786
- * See the License for the specific language governing permissions and
787
- * limitations under the License.
788
- */
789
- const TAB_MAP = new InjectionToken('TabMap');
790
- const DEFAULT_TABS = new Map([
791
- [DefaultTabs.summary, DossierDetailTabSummaryComponent],
792
- [DefaultTabs.progress, DossierDetailTabProgressComponent],
793
- [DefaultTabs.audit, DossierDetailTabAuditComponent],
794
- [DefaultTabs.documents, DossierDetailTabDocumentsComponent],
898
+ /*
899
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
900
+ *
901
+ * Licensed under EUPL, Version 1.2 (the "License");
902
+ * you may not use this file except in compliance with the License.
903
+ * You may obtain a copy of the License at
904
+ *
905
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
906
+ *
907
+ * Unless required by applicable law or agreed to in writing, software
908
+ * distributed under the License is distributed on an "AS IS" basis,
909
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
910
+ * See the License for the specific language governing permissions and
911
+ * limitations under the License.
912
+ */
913
+ const TAB_MAP = new InjectionToken('TabMap');
914
+ const DEFAULT_TABS = new Map([
915
+ [DefaultTabs.summary, DossierDetailTabSummaryComponent],
916
+ [DefaultTabs.progress, DossierDetailTabProgressComponent],
917
+ [DefaultTabs.audit, DossierDetailTabAuditComponent],
918
+ [DefaultTabs.documents, DossierDetailTabDocumentsComponent],
795
919
  ]);
796
920
 
797
- /*
798
- * Copyright 2015-2020 Ritense BV, the Netherlands.
799
- *
800
- * Licensed under EUPL, Version 1.2 (the "License");
801
- * you may not use this file except in compliance with the License.
802
- * You may obtain a copy of the License at
803
- *
804
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
805
- *
806
- * Unless required by applicable law or agreed to in writing, software
807
- * distributed under the License is distributed on an "AS IS" basis,
808
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
809
- * See the License for the specific language governing permissions and
810
- * limitations under the License.
811
- */
812
- class TabService {
813
- constructor(tabMap = DEFAULT_TABS) {
814
- this.tabs = [];
815
- this.tabMap = tabMap;
816
- let i = 0;
817
- this.tabMap.forEach((component, name, map) => {
818
- this.tabs.push(new TabImpl(name, i, component));
819
- i++;
820
- });
821
- }
822
- getTabs() {
823
- return this.tabs;
824
- }
825
- }
826
- TabService.ɵprov = ɵɵdefineInjectable({ factory: function TabService_Factory() { return new TabService(ɵɵinject(TAB_MAP)); }, token: TabService, providedIn: "root" });
827
- TabService.decorators = [
828
- { type: Injectable, args: [{
829
- providedIn: 'root',
830
- },] }
831
- ];
832
- TabService.ctorParameters = () => [
833
- { type: Map, decorators: [{ type: Inject, args: [TAB_MAP,] }] }
921
+ /*
922
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
923
+ *
924
+ * Licensed under EUPL, Version 1.2 (the "License");
925
+ * you may not use this file except in compliance with the License.
926
+ * You may obtain a copy of the License at
927
+ *
928
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
929
+ *
930
+ * Unless required by applicable law or agreed to in writing, software
931
+ * distributed under the License is distributed on an "AS IS" basis,
932
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
933
+ * See the License for the specific language governing permissions and
934
+ * limitations under the License.
935
+ */
936
+ class TabService {
937
+ constructor(tabMap = DEFAULT_TABS) {
938
+ this.tabs = [];
939
+ this.tabMap = tabMap;
940
+ let i = 0;
941
+ this.tabMap.forEach((component, name, map) => {
942
+ this.tabs.push(new TabImpl(name, i, component));
943
+ i++;
944
+ });
945
+ }
946
+ getTabs() {
947
+ return this.tabs;
948
+ }
949
+ }
950
+ TabService.ɵprov = ɵɵdefineInjectable({ factory: function TabService_Factory() { return new TabService(ɵɵinject(TAB_MAP)); }, token: TabService, providedIn: "root" });
951
+ TabService.decorators = [
952
+ { type: Injectable, args: [{
953
+ providedIn: 'root',
954
+ },] }
955
+ ];
956
+ TabService.ctorParameters = () => [
957
+ { type: Map, decorators: [{ type: Inject, args: [TAB_MAP,] }] }
834
958
  ];
835
959
 
836
- /*
837
- * Copyright 2015-2020 Ritense BV, the Netherlands.
838
- *
839
- * Licensed under EUPL, Version 1.2 (the "License");
840
- * you may not use this file except in compliance with the License.
841
- * You may obtain a copy of the License at
842
- *
843
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
844
- *
845
- * Unless required by applicable law or agreed to in writing, software
846
- * distributed under the License is distributed on an "AS IS" basis,
847
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
848
- * See the License for the specific language governing permissions and
849
- * limitations under the License.
850
- */
851
- class DossierSupportingProcessStartModalComponent {
852
- constructor(route, router, processService, documentService, formLinkService, logger) {
853
- this.route = route;
854
- this.router = router;
855
- this.processService = processService;
856
- this.documentService = documentService;
857
- this.formLinkService = formLinkService;
858
- this.logger = logger;
859
- this.formSubmit = new EventEmitter();
860
- }
861
- loadFormDefinition() {
862
- this.formDefinition = null;
863
- this.formLinkService
864
- .getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
865
- .subscribe(formDefinition => {
866
- this.formAssociation = formDefinition.formAssociation;
867
- const className = this.formAssociation.formLink.className.split('.');
868
- const linkType = className[className.length - 1];
869
- switch (linkType) {
870
- case 'BpmnElementFormIdLink':
871
- this.formDefinition = formDefinition;
872
- this.documentService.getDocument(this.documentId).subscribe(document => {
873
- this.submission = {
874
- data: document.content,
875
- };
876
- }, () => noop());
877
- this.modal.show();
878
- break;
879
- case 'BpmnElementUrlLink':
880
- const url = this.router.serializeUrl(this.router.createUrlTree([formDefinition.formAssociation.formLink.url]));
881
- window.open(url, '_blank');
882
- break;
883
- case 'BpmnElementAngularStateUrlLink':
884
- this.route.params.pipe(take(1)).subscribe(params => {
885
- const documentId = params === null || params === void 0 ? void 0 : params.documentId;
886
- this.router.navigate([formDefinition.formAssociation.formLink.url], {
887
- state: Object.assign({}, (documentId && { documentId })),
888
- });
889
- });
890
- break;
891
- default:
892
- this.logger.fatal('Unsupported class name');
893
- }
894
- }, errors => {
895
- this.modal.show();
896
- });
897
- }
898
- get modalTitle() {
899
- return `Start - ${this.processName}`;
900
- }
901
- openModal(processDocumentDefinition, documentId) {
902
- this.documentId = documentId;
903
- this.documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
904
- this.processDefinitionKey = processDocumentDefinition.id.processDefinitionKey;
905
- this.processName = processDocumentDefinition.processName;
906
- this.options = new FormioOptionsImpl();
907
- this.options.disableAlerts = true;
908
- const formioBeforeSubmit = function (submission, callback) {
909
- callback(null, submission);
910
- };
911
- this.options.setHooks(formioBeforeSubmit);
912
- this.loadFormDefinition();
913
- }
914
- onSubmit(submission) {
915
- this.formioSubmission = submission;
916
- this.formLinkService
917
- .onSubmit(this.processDefinitionKey, this.formAssociation.formLink.id, submission.data, this.documentId)
918
- .subscribe((formSubmissionResult) => {
919
- this.modal.hide();
920
- this.formSubmit.emit();
921
- }, errors => {
922
- this.form.showErrors(errors);
923
- });
924
- }
925
- gotoFormLinkScreen() {
926
- this.modal.hide();
927
- this.router.navigate(['form-links'], { queryParams: { process: this.processDefinitionKey } });
928
- }
929
- }
930
- DossierSupportingProcessStartModalComponent.decorators = [
931
- { type: Component, args: [{
932
- selector: 'valtimo-dossier-supporting-process-start-modal',
933
- 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",
934
- encapsulation: ViewEncapsulation.None,
935
- 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}"]
936
- },] }
937
- ];
938
- DossierSupportingProcessStartModalComponent.ctorParameters = () => [
939
- { type: ActivatedRoute },
940
- { type: Router },
941
- { type: ProcessService },
942
- { type: DocumentService },
943
- { type: FormLinkService },
944
- { type: NGXLogger }
945
- ];
946
- DossierSupportingProcessStartModalComponent.propDecorators = {
947
- form: [{ type: ViewChild, args: ['form', { static: false },] }],
948
- modal: [{ type: ViewChild, args: ['supportingProcessStartModal', { static: false },] }],
949
- formSubmit: [{ type: Output }]
960
+ /*
961
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
962
+ *
963
+ * Licensed under EUPL, Version 1.2 (the "License");
964
+ * you may not use this file except in compliance with the License.
965
+ * You may obtain a copy of the License at
966
+ *
967
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
968
+ *
969
+ * Unless required by applicable law or agreed to in writing, software
970
+ * distributed under the License is distributed on an "AS IS" basis,
971
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
972
+ * See the License for the specific language governing permissions and
973
+ * limitations under the License.
974
+ */
975
+ class DossierSupportingProcessStartModalComponent {
976
+ constructor(route, router, processService, documentService, formLinkService, logger) {
977
+ this.route = route;
978
+ this.router = router;
979
+ this.processService = processService;
980
+ this.documentService = documentService;
981
+ this.formLinkService = formLinkService;
982
+ this.logger = logger;
983
+ this.formSubmit = new EventEmitter();
984
+ }
985
+ loadFormDefinition() {
986
+ this.formDefinition = null;
987
+ this.formLinkService
988
+ .getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
989
+ .subscribe(formDefinition => {
990
+ this.formAssociation = formDefinition.formAssociation;
991
+ const className = this.formAssociation.formLink.className.split('.');
992
+ const linkType = className[className.length - 1];
993
+ switch (linkType) {
994
+ case 'BpmnElementFormIdLink':
995
+ this.formDefinition = formDefinition;
996
+ this.documentService.getDocument(this.documentId).subscribe(document => {
997
+ this.submission = {
998
+ data: document.content,
999
+ };
1000
+ }, () => noop());
1001
+ this.modal.show();
1002
+ break;
1003
+ case 'BpmnElementUrlLink':
1004
+ const url = this.router.serializeUrl(this.router.createUrlTree([formDefinition.formAssociation.formLink.url]));
1005
+ window.open(url, '_blank');
1006
+ break;
1007
+ case 'BpmnElementAngularStateUrlLink':
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
+ });
1014
+ break;
1015
+ default:
1016
+ this.logger.fatal('Unsupported class name');
1017
+ }
1018
+ }, errors => {
1019
+ this.modal.show();
1020
+ });
1021
+ }
1022
+ get modalTitle() {
1023
+ return `Start - ${this.processName}`;
1024
+ }
1025
+ openModal(processDocumentDefinition, documentId) {
1026
+ this.documentId = documentId;
1027
+ this.documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
1028
+ this.processDefinitionKey = processDocumentDefinition.id.processDefinitionKey;
1029
+ this.processName = processDocumentDefinition.processName;
1030
+ this.options = new FormioOptionsImpl();
1031
+ this.options.disableAlerts = true;
1032
+ const formioBeforeSubmit = function (submission, callback) {
1033
+ callback(null, submission);
1034
+ };
1035
+ this.options.setHooks(formioBeforeSubmit);
1036
+ this.loadFormDefinition();
1037
+ }
1038
+ onSubmit(submission) {
1039
+ this.formioSubmission = submission;
1040
+ this.formLinkService
1041
+ .onSubmit(this.processDefinitionKey, this.formAssociation.formLink.id, submission.data, this.documentId)
1042
+ .subscribe((formSubmissionResult) => {
1043
+ this.modal.hide();
1044
+ this.formSubmit.emit();
1045
+ }, errors => {
1046
+ this.form.showErrors(errors);
1047
+ });
1048
+ }
1049
+ gotoFormLinkScreen() {
1050
+ this.modal.hide();
1051
+ this.router.navigate(['form-links'], { queryParams: { process: this.processDefinitionKey } });
1052
+ }
1053
+ }
1054
+ DossierSupportingProcessStartModalComponent.decorators = [
1055
+ { type: Component, args: [{
1056
+ selector: 'valtimo-dossier-supporting-process-start-modal',
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",
1058
+ encapsulation: ViewEncapsulation.None,
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}"]
1060
+ },] }
1061
+ ];
1062
+ DossierSupportingProcessStartModalComponent.ctorParameters = () => [
1063
+ { type: ActivatedRoute },
1064
+ { type: Router },
1065
+ { type: ProcessService },
1066
+ { type: DocumentService },
1067
+ { type: FormLinkService },
1068
+ { type: NGXLogger }
1069
+ ];
1070
+ DossierSupportingProcessStartModalComponent.propDecorators = {
1071
+ form: [{ type: ViewChild, args: ['form', { static: false },] }],
1072
+ modal: [{ type: ViewChild, args: ['supportingProcessStartModal', { static: false },] }],
1073
+ formSubmit: [{ type: Output }]
950
1074
  };
951
1075
 
952
- /*
953
- * Copyright 2015-2020 Ritense BV, the Netherlands.
954
- *
955
- * Licensed under EUPL, Version 1.2 (the "License");
956
- * you may not use this file except in compliance with the License.
957
- * You may obtain a copy of the License at
958
- *
959
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
960
- *
961
- * Unless required by applicable law or agreed to in writing, software
962
- * distributed under the License is distributed on an "AS IS" basis,
963
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
964
- * See the License for the specific language governing permissions and
965
- * limitations under the License.
966
- */
967
- class DossierDetailComponent {
968
- constructor(componentFactoryResolver, translateService, documentService, processService, route, router, location, tabService) {
969
- this.componentFactoryResolver = componentFactoryResolver;
970
- this.translateService = translateService;
971
- this.documentService = documentService;
972
- this.processService = processService;
973
- this.route = route;
974
- this.router = router;
975
- this.location = location;
976
- this.tabService = tabService;
977
- this.document = null;
978
- this.tabLoader = null;
979
- this.processDefinitionListFields = [];
980
- this.processDocumentDefinitions = [];
981
- this.snapshot = this.route.snapshot.paramMap;
982
- this.documentDefinitionName = this.snapshot.get('documentDefinitionName') || '';
983
- this.documentId = this.snapshot.get('documentId') || '';
984
- }
985
- ngOnInit() {
986
- this.tabLoader = new TabLoaderImpl(this.tabService.getTabs(), this.componentFactoryResolver, this.viewContainerRef, this.translateService, this.router, this.location);
987
- this.documentService
988
- .getDocumentDefinition(this.documentDefinitionName)
989
- .subscribe(definition => {
990
- this.documentDefinitionNameTitle = definition.schema.title;
991
- });
992
- this.initialTabName = this.snapshot.get('tab');
993
- this.tabLoader.initial(this.initialTabName);
994
- this.getAllAssociatedProcessDefinitions();
995
- }
996
- getAllAssociatedProcessDefinitions() {
997
- this.documentService
998
- .findProcessDocumentDefinitions(this.documentDefinitionName)
999
- .subscribe(processDocumentDefinitions => {
1000
- this.processDocumentDefinitions = processDocumentDefinitions.filter(processDocumentDefinition => processDocumentDefinition.startableByUser);
1001
- this.processDefinitionListFields = [
1002
- {
1003
- key: 'processName',
1004
- label: 'Proces',
1005
- },
1006
- ];
1007
- });
1008
- }
1009
- startProcess(processDocumentDefinition) {
1010
- this.supportingProcessStart.openModal(processDocumentDefinition, this.documentId);
1011
- }
1012
- }
1013
- DossierDetailComponent.decorators = [
1014
- { type: Component, args: [{
1015
- selector: 'valtimo-dossier-detail',
1016
- 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",
1017
- styles: [".tab-container{min-height:300px}"]
1018
- },] }
1019
- ];
1020
- DossierDetailComponent.ctorParameters = () => [
1021
- { type: ComponentFactoryResolver },
1022
- { type: TranslateService },
1023
- { type: DocumentService },
1024
- { type: ProcessService },
1025
- { type: ActivatedRoute },
1026
- { type: Router },
1027
- { type: Location },
1028
- { type: TabService }
1029
- ];
1030
- DossierDetailComponent.propDecorators = {
1031
- viewContainerRef: [{ type: ViewChild, args: ['tabContainer', { read: ViewContainerRef, static: true },] }],
1032
- supportingProcessStart: [{ type: ViewChild, args: ['supportingProcessStartModal',] }]
1076
+ /*
1077
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1078
+ *
1079
+ * Licensed under EUPL, Version 1.2 (the "License");
1080
+ * you may not use this file except in compliance with the License.
1081
+ * You may obtain a copy of the License at
1082
+ *
1083
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1084
+ *
1085
+ * Unless required by applicable law or agreed to in writing, software
1086
+ * distributed under the License is distributed on an "AS IS" basis,
1087
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1088
+ * See the License for the specific language governing permissions and
1089
+ * limitations under the License.
1090
+ */
1091
+ class DossierDetailComponent {
1092
+ constructor(componentFactoryResolver, translateService, documentService, processService, route, router, location, tabService) {
1093
+ this.componentFactoryResolver = componentFactoryResolver;
1094
+ this.translateService = translateService;
1095
+ this.documentService = documentService;
1096
+ this.processService = processService;
1097
+ this.route = route;
1098
+ this.router = router;
1099
+ this.location = location;
1100
+ this.tabService = tabService;
1101
+ this.document = null;
1102
+ this.tabLoader = null;
1103
+ this.processDefinitionListFields = [];
1104
+ this.processDocumentDefinitions = [];
1105
+ this.snapshot = this.route.snapshot.paramMap;
1106
+ this.documentDefinitionName = this.snapshot.get('documentDefinitionName') || '';
1107
+ this.documentId = this.snapshot.get('documentId') || '';
1108
+ }
1109
+ ngOnInit() {
1110
+ this.tabLoader = new TabLoaderImpl(this.tabService.getTabs(), this.componentFactoryResolver, this.viewContainerRef, this.translateService, this.router, this.location);
1111
+ this.documentService
1112
+ .getDocumentDefinition(this.documentDefinitionName)
1113
+ .subscribe(definition => {
1114
+ this.documentDefinitionNameTitle = definition.schema.title;
1115
+ });
1116
+ this.initialTabName = this.snapshot.get('tab');
1117
+ this.tabLoader.initial(this.initialTabName);
1118
+ this.getAllAssociatedProcessDefinitions();
1119
+ }
1120
+ getAllAssociatedProcessDefinitions() {
1121
+ this.documentService
1122
+ .findProcessDocumentDefinitions(this.documentDefinitionName)
1123
+ .subscribe(processDocumentDefinitions => {
1124
+ this.processDocumentDefinitions = processDocumentDefinitions.filter(processDocumentDefinition => processDocumentDefinition.startableByUser);
1125
+ this.processDefinitionListFields = [
1126
+ {
1127
+ key: 'processName',
1128
+ label: 'Proces',
1129
+ },
1130
+ ];
1131
+ });
1132
+ }
1133
+ startProcess(processDocumentDefinition) {
1134
+ this.supportingProcessStart.openModal(processDocumentDefinition, this.documentId);
1135
+ }
1136
+ }
1137
+ DossierDetailComponent.decorators = [
1138
+ { type: Component, args: [{
1139
+ selector: 'valtimo-dossier-detail',
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",
1141
+ styles: [".tab-container{min-height:300px}"]
1142
+ },] }
1143
+ ];
1144
+ DossierDetailComponent.ctorParameters = () => [
1145
+ { type: ComponentFactoryResolver },
1146
+ { type: TranslateService },
1147
+ { type: DocumentService },
1148
+ { type: ProcessService },
1149
+ { type: ActivatedRoute },
1150
+ { type: Router },
1151
+ { type: Location },
1152
+ { type: TabService }
1153
+ ];
1154
+ DossierDetailComponent.propDecorators = {
1155
+ viewContainerRef: [{ type: ViewChild, args: ['tabContainer', { read: ViewContainerRef, static: true },] }],
1156
+ supportingProcessStart: [{ type: ViewChild, args: ['supportingProcessStartModal',] }]
1033
1157
  };
1034
1158
 
1035
- /*
1036
- * Copyright 2015-2021 Ritense BV, the Netherlands.
1037
- *
1038
- * Licensed under EUPL, Version 1.2 (the "License");
1039
- * you may not use this file except in compliance with the License.
1040
- * You may obtain a copy of the License at
1041
- *
1042
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1043
- *
1044
- * Unless required by applicable law or agreed to in writing, software
1045
- * distributed under the License is distributed on an "AS IS" basis,
1046
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1047
- * See the License for the specific language governing permissions and
1048
- * limitations under the License.
1049
- */
1050
- const moment$3 = moment_;
1051
- moment$3.locale(localStorage.getItem('langKey') || '');
1052
- class DossierDetailTabContactMomentsComponent {
1053
- constructor(contactMomentService, alertService, translateService) {
1054
- this.contactMomentService = contactMomentService;
1055
- this.alertService = alertService;
1056
- this.translateService = translateService;
1057
- this.refetchContactMoments$ = new BehaviorSubject('');
1058
- this.contactMoments$ = this.refetchContactMoments$.pipe(switchMap(() => this.contactMomentService.getContactMoments()), map(contactMoments => contactMoments.map(contactMoment => {
1059
- const registratieDatum = moment$3(contactMoment.registratiedatum);
1060
- return new TimelineItemImpl(registratieDatum.format('DD MMM YYYY'), registratieDatum.format('HH:mm'), contactMoment.medewerkerIdentificatie.achternaam, contactMoment.kanaal, contactMoment.tekst, null);
1061
- })));
1062
- this.text$ = new BehaviorSubject('');
1063
- this.channel$ = new BehaviorSubject('MAIL');
1064
- this.requestData$ = combineLatest([this.text$, this.channel$]);
1065
- this.valid$ = this.requestData$.pipe(map(([text, channel]) => !!(text && channel)));
1066
- this.disabled$ = new BehaviorSubject(false);
1067
- }
1068
- textChange(text) {
1069
- this.text$.next(text);
1070
- }
1071
- buttonClick() {
1072
- this.modal.show();
1073
- }
1074
- saveNote() {
1075
- this.disable();
1076
- this.requestData$.pipe(take(1)).subscribe(([text, channel]) => {
1077
- this.contactMomentService.saveContactMoment({ kanaal: channel, tekst: text }).subscribe(() => {
1078
- this.alertService.success(this.translateService.instant('dossier.contactMoments.saveSuccess'));
1079
- this.enable();
1080
- this.clear();
1081
- this.modal.hide();
1082
- this.refetchContactMoments();
1083
- }, () => {
1084
- this.enable();
1085
- });
1086
- });
1087
- }
1088
- disable() {
1089
- this.disabled$.next(true);
1090
- }
1091
- enable() {
1092
- this.disabled$.next(false);
1093
- }
1094
- clear() {
1095
- this.text$.next('');
1096
- }
1097
- refetchContactMoments() {
1098
- this.refetchContactMoments$.next('');
1099
- }
1100
- }
1101
- DossierDetailTabContactMomentsComponent.decorators = [
1102
- { type: Component, args: [{
1103
- selector: 'valtimo-dossier-detail-tab-contact-moments',
1104
- 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",
1105
- 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}"]
1106
- },] }
1107
- ];
1108
- DossierDetailTabContactMomentsComponent.ctorParameters = () => [
1109
- { type: ContactMomentService },
1110
- { type: AlertService },
1111
- { type: TranslateService }
1112
- ];
1113
- DossierDetailTabContactMomentsComponent.propDecorators = {
1114
- modal: [{ type: ViewChild, args: ['contactMomentsNoteModal',] }]
1159
+ /*
1160
+ * Copyright 2015-2021 Ritense BV, the Netherlands.
1161
+ *
1162
+ * Licensed under EUPL, Version 1.2 (the "License");
1163
+ * you may not use this file except in compliance with the License.
1164
+ * You may obtain a copy of the License at
1165
+ *
1166
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1167
+ *
1168
+ * Unless required by applicable law or agreed to in writing, software
1169
+ * distributed under the License is distributed on an "AS IS" basis,
1170
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1171
+ * See the License for the specific language governing permissions and
1172
+ * limitations under the License.
1173
+ */
1174
+ const moment$3 = moment_;
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',] }]
1115
1239
  };
1116
1240
 
1117
- /*
1118
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1119
- *
1120
- * Licensed under EUPL, Version 1.2 (the "License");
1121
- * you may not use this file except in compliance with the License.
1122
- * You may obtain a copy of the License at
1123
- *
1124
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1125
- *
1126
- * Unless required by applicable law or agreed to in writing, software
1127
- * distributed under the License is distributed on an "AS IS" basis,
1128
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1129
- * See the License for the specific language governing permissions and
1130
- * limitations under the License.
1131
- */
1132
- const moment$4 = moment_;
1133
- moment$4.locale(localStorage.getItem('langKey') || '');
1134
- class DossierUpdateComponent {
1135
- constructor(taskService, documentService, route, toastr, location, dossierService) {
1136
- this.taskService = taskService;
1137
- this.documentService = documentService;
1138
- this.route = route;
1139
- this.toastr = toastr;
1140
- this.location = location;
1141
- this.customDefinitions = {};
1142
- const snapshot = this.route.snapshot.paramMap;
1143
- this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
1144
- this.documentId = snapshot.get('documentId') || '';
1145
- this.taskId = snapshot.get('taskId') || '';
1146
- this.implementationDefinitions = dossierService.getImplementationEnvironmentDefinitions(this.documentDefinitionName);
1147
- this.loadDocumentDefinition(this.documentDefinitionName);
1148
- this.loadDocument(this.documentId);
1149
- }
1150
- ngOnInit() {
1151
- this.getTask(this.taskId);
1152
- if (this.implementationDefinitions.definitions.detail.summary) {
1153
- this.customDefinitions = this.implementationDefinitions.definitions.detail.summary;
1154
- }
1155
- }
1156
- loadDocumentDefinition(name) {
1157
- this.documentService.getDocumentDefinition(name).subscribe(definition => {
1158
- this.schema = definition.schema;
1159
- });
1160
- }
1161
- loadDocument(id) {
1162
- this.documentService.getDocument(id).subscribe(document => {
1163
- this.document = document;
1164
- });
1165
- }
1166
- getTask(id) {
1167
- this.taskService.getTask(id).subscribe(task => {
1168
- this.task = task;
1169
- this.task.task.created = moment$4(this.task.task.created).format('DD MMM YYYY HH:mm');
1170
- this.page = {
1171
- title: this.task.task.name,
1172
- subtitle: `Created ${moment$4(this.task.task.created).fromNow()}`,
1173
- };
1174
- });
1175
- }
1176
- reset() {
1177
- this.loadDocument(this.documentId);
1178
- }
1179
- back() {
1180
- this.location.back();
1181
- }
1182
- save() {
1183
- const document = {
1184
- documentId: this.document.id,
1185
- content: this.document.content,
1186
- versionBasedOn: this.document.version,
1187
- };
1188
- this.documentService.modifyDocument(document).subscribe(result => {
1189
- this.document = result.document;
1190
- this.toastr.success('Document aangepast');
1191
- this.location.back();
1192
- });
1193
- }
1194
- submit(data) {
1195
- // merge document content with formdata
1196
- const mergedData = Object.assign({}, this.document.content, data);
1197
- const documentData = {
1198
- request: {
1199
- documentId: this.document.id,
1200
- content: mergedData,
1201
- versionBasedOn: this.document.version,
1202
- },
1203
- taskId: this.task.task.id,
1204
- };
1205
- this.documentService.modifyDocumentAndCompleteTask(documentData).subscribe(result => {
1206
- this.toastr.success(this.task.task.name + ' has successfully been completed');
1207
- this.location.back();
1208
- });
1209
- }
1210
- returnZero() {
1211
- return 0;
1212
- }
1213
- }
1214
- DossierUpdateComponent.decorators = [
1215
- { type: Component, args: [{
1216
- selector: 'valtimo-dossier-update',
1217
- 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",
1218
- styles: [""]
1219
- },] }
1220
- ];
1221
- DossierUpdateComponent.ctorParameters = () => [
1222
- { type: TaskService },
1223
- { type: DocumentService },
1224
- { type: ActivatedRoute },
1225
- { type: ToastrService },
1226
- { type: Location },
1227
- { type: DossierService }
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') || '');
1258
+ class DossierUpdateComponent {
1259
+ constructor(taskService, documentService, route, toastr, location, dossierService) {
1260
+ this.taskService = taskService;
1261
+ this.documentService = documentService;
1262
+ this.route = route;
1263
+ this.toastr = toastr;
1264
+ this.location = location;
1265
+ this.customDefinitions = {};
1266
+ const snapshot = this.route.snapshot.paramMap;
1267
+ this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
1268
+ this.documentId = snapshot.get('documentId') || '';
1269
+ this.taskId = snapshot.get('taskId') || '';
1270
+ this.implementationDefinitions = dossierService.getImplementationEnvironmentDefinitions(this.documentDefinitionName);
1271
+ this.loadDocumentDefinition(this.documentDefinitionName);
1272
+ this.loadDocument(this.documentId);
1273
+ }
1274
+ ngOnInit() {
1275
+ this.getTask(this.taskId);
1276
+ if (this.implementationDefinitions.definitions.detail.summary) {
1277
+ this.customDefinitions = this.implementationDefinitions.definitions.detail.summary;
1278
+ }
1279
+ }
1280
+ loadDocumentDefinition(name) {
1281
+ this.documentService.getDocumentDefinition(name).subscribe(definition => {
1282
+ this.schema = definition.schema;
1283
+ });
1284
+ }
1285
+ loadDocument(id) {
1286
+ this.documentService.getDocument(id).subscribe(document => {
1287
+ this.document = document;
1288
+ });
1289
+ }
1290
+ getTask(id) {
1291
+ this.taskService.getTask(id).subscribe(task => {
1292
+ this.task = task;
1293
+ this.task.task.created = moment$4(this.task.task.created).format('DD MMM YYYY HH:mm');
1294
+ this.page = {
1295
+ title: this.task.task.name,
1296
+ subtitle: `Created ${moment$4(this.task.task.created).fromNow()}`,
1297
+ };
1298
+ });
1299
+ }
1300
+ reset() {
1301
+ this.loadDocument(this.documentId);
1302
+ }
1303
+ back() {
1304
+ this.location.back();
1305
+ }
1306
+ save() {
1307
+ const document = {
1308
+ documentId: this.document.id,
1309
+ content: this.document.content,
1310
+ versionBasedOn: this.document.version,
1311
+ };
1312
+ this.documentService.modifyDocument(document).subscribe(result => {
1313
+ this.document = result.document;
1314
+ this.toastr.success('Document aangepast');
1315
+ this.location.back();
1316
+ });
1317
+ }
1318
+ submit(data) {
1319
+ // merge document content with formdata
1320
+ const mergedData = Object.assign({}, this.document.content, data);
1321
+ const documentData = {
1322
+ request: {
1323
+ documentId: this.document.id,
1324
+ content: mergedData,
1325
+ versionBasedOn: this.document.version,
1326
+ },
1327
+ taskId: this.task.task.id,
1328
+ };
1329
+ this.documentService.modifyDocumentAndCompleteTask(documentData).subscribe(result => {
1330
+ this.toastr.success(this.task.task.name + ' has successfully been completed');
1331
+ this.location.back();
1332
+ });
1333
+ }
1334
+ returnZero() {
1335
+ return 0;
1336
+ }
1337
+ }
1338
+ DossierUpdateComponent.decorators = [
1339
+ { type: Component, args: [{
1340
+ selector: 'valtimo-dossier-update',
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",
1342
+ styles: [""]
1343
+ },] }
1344
+ ];
1345
+ DossierUpdateComponent.ctorParameters = () => [
1346
+ { type: TaskService },
1347
+ { type: DocumentService },
1348
+ { type: ActivatedRoute },
1349
+ { type: ToastrService },
1350
+ { type: Location },
1351
+ { type: DossierService }
1228
1352
  ];
1229
1353
 
1230
- /*
1231
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1232
- *
1233
- * Licensed under EUPL, Version 1.2 (the "License");
1234
- * you may not use this file except in compliance with the License.
1235
- * You may obtain a copy of the License at
1236
- *
1237
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1238
- *
1239
- * Unless required by applicable law or agreed to in writing, software
1240
- * distributed under the License is distributed on an "AS IS" basis,
1241
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1242
- * See the License for the specific language governing permissions and
1243
- * limitations under the License.
1244
- */
1245
- const ɵ0 = { title: 'Dossiers', roles: [ROLE_USER] }, ɵ1 = { title: 'Dossiers', parentPath: 'dossiers/:documentDefinitionName', roles: [ROLE_USER] }, ɵ2 = {
1246
- title: 'Task details',
1247
- parentPath: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
1248
- roles: [ROLE_USER],
1249
- };
1250
- const routes = [
1251
- {
1252
- path: 'dossiers/:documentDefinitionName',
1253
- component: DossierListComponent,
1254
- canActivate: [AuthGuardService],
1255
- data: ɵ0,
1256
- },
1257
- {
1258
- path: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
1259
- component: DossierDetailComponent,
1260
- canActivate: [AuthGuardService],
1261
- data: ɵ1,
1262
- },
1263
- {
1264
- path: 'dossiers/:documentDefinitionName/document/:documentId/:tab/tasks/:taskId',
1265
- component: DossierUpdateComponent,
1266
- canActivate: [AuthGuardService],
1267
- data: ɵ2,
1268
- },
1269
- ];
1270
- class DossierRoutingModule {
1271
- }
1272
- DossierRoutingModule.decorators = [
1273
- { type: NgModule, args: [{
1274
- imports: [CommonModule, RouterModule.forChild(routes)],
1275
- exports: [RouterModule],
1276
- },] }
1354
+ /*
1355
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1356
+ *
1357
+ * Licensed under EUPL, Version 1.2 (the "License");
1358
+ * you may not use this file except in compliance with the License.
1359
+ * You may obtain a copy of the License at
1360
+ *
1361
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1362
+ *
1363
+ * Unless required by applicable law or agreed to in writing, software
1364
+ * distributed under the License is distributed on an "AS IS" basis,
1365
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1366
+ * See the License for the specific language governing permissions and
1367
+ * limitations under the License.
1368
+ */
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
+ };
1374
+ const routes = [
1375
+ {
1376
+ path: 'dossiers/:documentDefinitionName',
1377
+ component: DossierListComponent,
1378
+ canActivate: [AuthGuardService],
1379
+ data: ɵ0,
1380
+ },
1381
+ {
1382
+ path: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
1383
+ component: DossierDetailComponent,
1384
+ canActivate: [AuthGuardService],
1385
+ data: ɵ1,
1386
+ },
1387
+ {
1388
+ path: 'dossiers/:documentDefinitionName/document/:documentId/:tab/tasks/:taskId',
1389
+ component: DossierUpdateComponent,
1390
+ canActivate: [AuthGuardService],
1391
+ data: ɵ2,
1392
+ },
1393
+ ];
1394
+ class DossierRoutingModule {
1395
+ }
1396
+ DossierRoutingModule.decorators = [
1397
+ { type: NgModule, args: [{
1398
+ imports: [CommonModule, RouterModule.forChild(routes)],
1399
+ exports: [RouterModule],
1400
+ },] }
1277
1401
  ];
1278
1402
 
1279
- /*
1280
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1281
- *
1282
- * Licensed under EUPL, Version 1.2 (the "License");
1283
- * you may not use this file except in compliance with the License.
1284
- * You may obtain a copy of the License at
1285
- *
1286
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1287
- *
1288
- * Unless required by applicable law or agreed to in writing, software
1289
- * distributed under the License is distributed on an "AS IS" basis,
1290
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1291
- * See the License for the specific language governing permissions and
1292
- * limitations under the License.
1293
- */
1294
- const ɵ0$1 = HttpLoaderFactory;
1295
- class DossierModule {
1296
- static forRoot(tabsFactory) {
1297
- return {
1298
- ngModule: DossierModule,
1299
- providers: [
1300
- DossierService,
1301
- TabService,
1302
- {
1303
- provide: TAB_MAP,
1304
- useFactory: tabsFactory,
1305
- },
1306
- {
1307
- provide: ANALYZE_FOR_ENTRY_COMPONENTS,
1308
- useValue: Array.from(tabsFactory().values()),
1309
- multi: true,
1310
- },
1311
- ],
1312
- };
1313
- }
1314
- }
1315
- DossierModule.decorators = [
1316
- { type: NgModule, args: [{
1317
- declarations: [
1318
- DossierListComponent,
1319
- DossierDetailComponent,
1320
- DossierDetailTabSummaryComponent,
1321
- DossierDetailTabProgressComponent,
1322
- DossierDetailTabAuditComponent,
1323
- DossierDetailTabDocumentsComponent,
1324
- DossierDetailTabContactMomentsComponent,
1325
- DossierUpdateComponent,
1326
- DossierProcessStartModalComponent,
1327
- DossierSupportingProcessStartModalComponent,
1328
- ],
1329
- imports: [
1330
- CommonModule,
1331
- DossierRoutingModule,
1332
- ListModule,
1333
- WidgetModule,
1334
- BpmnJsDiagramModule,
1335
- TimelineModule,
1336
- CamundaFormModule,
1337
- ProcessModule,
1338
- FilterSidebarModule,
1339
- NgbButtonsModule,
1340
- DataListModule,
1341
- FormsModule,
1342
- FormModule,
1343
- FormIoModule,
1344
- ModalModule,
1345
- SpinnerModule,
1346
- TranslateModule.forRoot({
1347
- loader: {
1348
- provide: TranslateLoader,
1349
- useFactory: ɵ0$1,
1350
- deps: [HttpClient],
1351
- },
1352
- }),
1353
- TaskModule,
1354
- ModalModule,
1355
- NgbTooltipModule,
1356
- UploaderModule,
1357
- DropzoneModule,
1358
- NgbPaginationModule,
1359
- ConfigModule,
1360
- ],
1361
- exports: [DossierListComponent, DossierDetailComponent],
1362
- entryComponents: [
1363
- DossierDetailTabSummaryComponent,
1364
- DossierDetailTabProgressComponent,
1365
- DossierDetailTabAuditComponent,
1366
- DossierDetailTabDocumentsComponent,
1367
- DossierDetailTabContactMomentsComponent,
1368
- ],
1369
- },] }
1403
+ /*
1404
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1405
+ *
1406
+ * Licensed under EUPL, Version 1.2 (the "License");
1407
+ * you may not use this file except in compliance with the License.
1408
+ * You may obtain a copy of the License at
1409
+ *
1410
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1411
+ *
1412
+ * Unless required by applicable law or agreed to in writing, software
1413
+ * distributed under the License is distributed on an "AS IS" basis,
1414
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1415
+ * See the License for the specific language governing permissions and
1416
+ * limitations under the License.
1417
+ */
1418
+ const ɵ0$1 = HttpLoaderFactory;
1419
+ class DossierModule {
1420
+ static forRoot(tabsFactory) {
1421
+ return {
1422
+ ngModule: DossierModule,
1423
+ providers: [
1424
+ DossierService,
1425
+ TabService,
1426
+ {
1427
+ provide: TAB_MAP,
1428
+ useFactory: tabsFactory,
1429
+ },
1430
+ {
1431
+ provide: ANALYZE_FOR_ENTRY_COMPONENTS,
1432
+ useValue: Array.from(tabsFactory().values()),
1433
+ multi: true,
1434
+ },
1435
+ ],
1436
+ };
1437
+ }
1438
+ }
1439
+ DossierModule.decorators = [
1440
+ { type: NgModule, args: [{
1441
+ declarations: [
1442
+ DossierListComponent,
1443
+ DossierDetailComponent,
1444
+ DossierDetailTabSummaryComponent,
1445
+ DossierDetailTabProgressComponent,
1446
+ DossierDetailTabAuditComponent,
1447
+ DossierDetailTabDocumentsComponent,
1448
+ DossierDetailTabContactMomentsComponent,
1449
+ DossierUpdateComponent,
1450
+ DossierProcessStartModalComponent,
1451
+ DossierSupportingProcessStartModalComponent,
1452
+ ],
1453
+ imports: [
1454
+ CommonModule,
1455
+ DossierRoutingModule,
1456
+ ListModule,
1457
+ WidgetModule,
1458
+ BpmnJsDiagramModule,
1459
+ TimelineModule,
1460
+ CamundaFormModule,
1461
+ ProcessModule,
1462
+ FilterSidebarModule,
1463
+ NgbButtonsModule,
1464
+ DataListModule,
1465
+ FormsModule,
1466
+ FormModule,
1467
+ FormIoModule,
1468
+ ModalModule,
1469
+ SpinnerModule,
1470
+ TranslateModule.forRoot({
1471
+ loader: {
1472
+ provide: TranslateLoader,
1473
+ useFactory: ɵ0$1,
1474
+ deps: [HttpClient],
1475
+ },
1476
+ }),
1477
+ TaskModule,
1478
+ ModalModule,
1479
+ NgbTooltipModule,
1480
+ UploaderModule,
1481
+ DropzoneModule,
1482
+ NgbPaginationModule,
1483
+ ConfigModule,
1484
+ ],
1485
+ exports: [DossierListComponent, DossierDetailComponent],
1486
+ entryComponents: [
1487
+ DossierDetailTabSummaryComponent,
1488
+ DossierDetailTabProgressComponent,
1489
+ DossierDetailTabAuditComponent,
1490
+ DossierDetailTabDocumentsComponent,
1491
+ DossierDetailTabContactMomentsComponent,
1492
+ ],
1493
+ },] }
1370
1494
  ];
1371
1495
 
1372
- /*
1373
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1374
- *
1375
- * Licensed under EUPL, Version 1.2 (the "License");
1376
- * you may not use this file except in compliance with the License.
1377
- * You may obtain a copy of the License at
1378
- *
1379
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1380
- *
1381
- * Unless required by applicable law or agreed to in writing, software
1382
- * distributed under the License is distributed on an "AS IS" basis,
1383
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1384
- * See the License for the specific language governing permissions and
1385
- * limitations under the License.
1496
+ /*
1497
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1498
+ *
1499
+ * Licensed under EUPL, Version 1.2 (the "License");
1500
+ * you may not use this file except in compliance with the License.
1501
+ * You may obtain a copy of the License at
1502
+ *
1503
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1504
+ *
1505
+ * Unless required by applicable law or agreed to in writing, software
1506
+ * distributed under the License is distributed on an "AS IS" basis,
1507
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1508
+ * See the License for the specific language governing permissions and
1509
+ * limitations under the License.
1386
1510
  */
1387
1511
 
1388
- /**
1389
- * Generated bundle index. Do not edit.
1512
+ /**
1513
+ * Generated bundle index. Do not edit.
1390
1514
  */
1391
1515
 
1392
- 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 };
1393
1517
  //# sourceMappingURL=valtimo-dossier.js.map