@valtimo/dossier 4.15.2-next-main.15 → 4.15.3-next-main.16

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 (44) hide show
  1. package/bundles/valtimo-dossier.umd.js +1672 -1596
  2. package/bundles/valtimo-dossier.umd.js.map +1 -1
  3. package/bundles/valtimo-dossier.umd.min.js +2 -2
  4. package/bundles/valtimo-dossier.umd.min.js.map +1 -1
  5. package/esm2015/lib/dossier-detail/dossier-detail.component.js +92 -87
  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 +91 -50
  8. package/esm2015/lib/dossier-detail/tab/documents/documents.component.js +119 -101
  9. package/esm2015/lib/dossier-detail/tab/progress/progress.component.js +49 -47
  10. package/esm2015/lib/dossier-detail/tab/summary/summary.component.js +126 -124
  11. package/esm2015/lib/dossier-detail-tab-enum.js +24 -24
  12. package/esm2015/lib/dossier-list/dossier-list.component.js +216 -212
  13. package/esm2015/lib/dossier-process-start-modal/dossier-process-start-modal.component.js +131 -122
  14. package/esm2015/lib/dossier-routing.module.js +58 -57
  15. package/esm2015/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.js +126 -117
  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 -124
  19. package/esm2015/lib/dossier.service.js +53 -50
  20. package/esm2015/lib/tab.service.js +44 -44
  21. package/esm2015/public_api.js +31 -31
  22. package/esm2015/valtimo-dossier.js +9 -9
  23. package/fesm2015/valtimo-dossier.js +1332 -1249
  24. package/fesm2015/valtimo-dossier.js.map +1 -1
  25. package/lib/dossier-detail/dossier-detail.component.d.ts +34 -34
  26. package/lib/dossier-detail/tab/audit/audit.component.d.ts +21 -21
  27. package/lib/dossier-detail/tab/contact-moments/contact-moments.component.d.ts +27 -11
  28. package/lib/dossier-detail/tab/documents/documents.component.d.ts +44 -38
  29. package/lib/dossier-detail/tab/progress/progress.component.d.ts +14 -14
  30. package/lib/dossier-detail/tab/summary/summary.component.d.ts +37 -37
  31. package/lib/dossier-detail-tab-enum.d.ts +7 -7
  32. package/lib/dossier-list/dossier-list.component.d.ts +65 -65
  33. package/lib/dossier-process-start-modal/dossier-process-start-modal.component.d.ts +37 -37
  34. package/lib/dossier-routing.module.d.ts +2 -2
  35. package/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.d.ts +35 -35
  36. package/lib/dossier-update/dossier-update.component.d.ts +33 -33
  37. package/lib/dossier.config.d.ts +3 -3
  38. package/lib/dossier.module.d.ts +5 -5
  39. package/lib/dossier.service.d.ts +10 -10
  40. package/lib/tab.service.d.ts +7 -7
  41. package/package.json +1 -1
  42. package/public_api.d.ts +12 -12
  43. package/valtimo-dossier.d.ts +8 -8
  44. package/valtimo-dossier.metadata.json +1 -1
@@ -7,7 +7,7 @@ import * as moment_ from 'moment';
7
7
  import { combineLatest, BehaviorSubject, noop } from 'rxjs';
8
8
  import { FormioOptionsImpl, TimelineItemImpl, TabImpl, TabLoaderImpl, ROLE_USER, HttpLoaderFactory } from '@valtimo/contract';
9
9
  import { ProcessService, ProcessModule } from '@valtimo/process';
10
- import { ListModule, WidgetModule, BpmnJsDiagramModule, TimelineModule, CamundaFormModule, FilterSidebarModule, DataListModule, FormIoModule, ModalModule, SpinnerModule, UploaderModule, DropzoneModule } from '@valtimo/components';
10
+ import { AlertService, ListModule, WidgetModule, BpmnJsDiagramModule, TimelineModule, CamundaFormModule, FilterSidebarModule, DataListModule, FormIoModule, ModalModule, SpinnerModule, UploaderModule, DropzoneModule } from '@valtimo/components';
11
11
  import { FormLinkService } from '@valtimo/form-link';
12
12
  import { NGXLogger } from 'ngx-logger';
13
13
  import { UserProviderService, AuthGuardService } from '@valtimo/security';
@@ -18,1292 +18,1375 @@ import { FormService, FormModule } from '@valtimo/form';
18
18
  import { NgxSpinnerService } from 'ngx-spinner';
19
19
  import { ToastrService } from 'ngx-toastr';
20
20
  import { UploadProviderService, DownloadService } from '@valtimo/resource';
21
- import { switchMap } from 'rxjs/operators';
21
+ import { switchMap, map, take } from 'rxjs/operators';
22
22
  import { ContactMomentService } from '@valtimo/contact-moment';
23
23
  import { NgbButtonsModule, NgbTooltipModule, NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap';
24
24
  import { FormsModule } from '@angular/forms';
25
25
  import { HttpClient } from '@angular/common/http';
26
26
 
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";
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";
49
49
  })(DefaultTabs || (DefaultTabs = {}));
50
50
 
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.getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
82
- .subscribe(formDefinition => {
83
- this.formAssociation = formDefinition.formAssociation;
84
- const className = this.formAssociation.formLink.className.split('.');
85
- const linkType = className[className.length - 1];
86
- switch (linkType) {
87
- case 'BpmnElementFormIdLink':
88
- this.formDefinition = formDefinition;
89
- this.modal.show();
90
- break;
91
- case 'BpmnElementUrlLink':
92
- const url = this.router.serializeUrl(this.router.createUrlTree([formDefinition.formAssociation.formLink.url]));
93
- window.open(url, '_blank');
94
- break;
95
- case 'BpmnElementAngularStateUrlLink':
96
- this.router.navigate([formDefinition.formAssociation.formLink.url]);
97
- break;
98
- default:
99
- this.logger.fatal('Unsupported class name');
100
- }
101
- }, errors => {
102
- this.modal.show();
103
- });
104
- }
105
- gotoFormLinkScreen() {
106
- this.modal.hide();
107
- this.router.navigate(['form-links'], { queryParams: { process: this.processDefinitionKey } });
108
- }
109
- get modalTitle() {
110
- return `Start - ${this.processName}`;
111
- }
112
- openModal(processDocumentDefinition) {
113
- this.processDefinitionKey = processDocumentDefinition.id.processDefinitionKey;
114
- this.documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
115
- this.processName = processDocumentDefinition.processName;
116
- this.options = new FormioOptionsImpl();
117
- this.options.disableAlerts = true;
118
- const formioBeforeSubmit = function (submission, callback) {
119
- callback(null, submission);
120
- };
121
- this.options.setHooks(formioBeforeSubmit);
122
- this.loadFormDefinition();
123
- }
124
- onSubmit(submission) {
125
- this.formioSubmission = submission;
126
- this.formLinkService.onSubmit(this.processDefinitionKey, this.formAssociation.formLink.id, submission.data).subscribe((formSubmissionResult) => {
127
- this.modal.hide();
128
- this.router.navigate(['dossiers', this.documentDefinitionName, 'document', formSubmissionResult.documentId, 'summary']);
129
- }, errors => {
130
- this.form.showErrors(errors);
131
- });
132
- }
133
- isUserAdmin() {
134
- this.userProviderService.getUserSubject().subscribe((userIdentity) => {
135
- this.isAdmin = userIdentity.roles.includes('ROLE_ADMIN');
136
- }, error => {
137
- this.logger.error('Failed to retrieve user identity', error);
138
- this.isAdmin = false;
139
- });
140
- }
141
- }
142
- DossierProcessStartModalComponent.decorators = [
143
- { type: Component, args: [{
144
- selector: 'valtimo-dossier-process-start-modal',
145
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal #processStartModal elementId=\"processStartModal\" [title]=\"modalTitle\">\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io #form [form]=\"formDefinition\"\n [options]=\"options\"\n (submit)=\"onSubmit($event)\">\n </valtimo-form-io>\n </div>\n <div body *ngIf=\"!formDefinition && isAdmin\">\n <div class=\"bg-warning text-black mb-0 p-3 text-center\" [translate]=\"'formManagement.noFormDefinitionFoundAdmin'\">\n </div>\n <div class=\"mb-0 mt-4 p-3 text-center\">\n <button class=\"btn btn-secondary btn-space\" type=\"button\"\n (click)=\"gotoFormLinkScreen();\"\n id=\"form-link-button\">{{'formManagement.gotoFormLinksButton' | translate}}\n </button>\n </div>\n </div>\n <div body *ngIf=\"!formDefinition && !isAdmin\">\n <div class=\"bg-warning text-black mb-0 p-3 text-center\" [translate]=\"'formManagement.noFormDefinitionFoundUser'\">\n </div>\n </div>\n</valtimo-modal>\n",
146
- encapsulation: ViewEncapsulation.None,
147
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#processStartModal .formio-component-submit{text-align:right}"]
148
- },] }
149
- ];
150
- DossierProcessStartModalComponent.ctorParameters = () => [
151
- { type: ActivatedRoute },
152
- { type: Router },
153
- { type: ProcessService },
154
- { type: DocumentService },
155
- { type: FormLinkService },
156
- { type: UserProviderService },
157
- { type: NGXLogger }
158
- ];
159
- DossierProcessStartModalComponent.propDecorators = {
160
- form: [{ type: ViewChild, args: ['form', { static: false },] }],
161
- modal: [{ type: ViewChild, args: ['processStartModal', { static: false },] }]
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 },] }]
162
171
  };
163
172
 
164
- /*
165
- * Copyright 2015-2020 Ritense BV, the Netherlands.
166
- *
167
- * Licensed under EUPL, Version 1.2 (the "License");
168
- * you may not use this file except in compliance with the License.
169
- * You may obtain a copy of the License at
170
- *
171
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
172
- *
173
- * Unless required by applicable law or agreed to in writing, software
174
- * distributed under the License is distributed on an "AS IS" basis,
175
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
176
- * See the License for the specific language governing permissions and
177
- * limitations under the License.
178
- */
179
- class DossierService {
180
- constructor(configService) {
181
- this.configService = configService;
182
- this.definitions = configService.config.definitions;
183
- }
184
- getImplementationEnvironmentDefinitions(name) {
185
- return this.definitions.dossiers.find(definition => definition.name === name);
186
- }
187
- getDefinitionColumns(definitionNameId) {
188
- const config = this.configService.config;
189
- const customDefinitionTable = config.customDefinitionTables[definitionNameId];
190
- return customDefinitionTable || config.defaultDefinitionTable;
191
- }
192
- getInitialSortState(columns) {
193
- const defaultColumn = columns.find(column => column.default);
194
- return {
195
- isSorting: false,
196
- state: { name: defaultColumn ? defaultColumn.propertyName : columns[0].propertyName, direction: 'DESC' }
197
- };
198
- }
199
- }
200
- DossierService.ɵprov = ɵɵdefineInjectable({ factory: function DossierService_Factory() { return new DossierService(ɵɵinject(ConfigService)); }, token: DossierService, providedIn: "root" });
201
- DossierService.decorators = [
202
- { type: Injectable, args: [{
203
- providedIn: 'root'
204
- },] }
205
- ];
206
- DossierService.ctorParameters = () => [
207
- { type: ConfigService }
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 }
208
220
  ];
209
221
 
210
- /*
211
- * Copyright 2015-2020 Ritense BV, the Netherlands.
212
- *
213
- * Licensed under EUPL, Version 1.2 (the "License");
214
- * you may not use this file except in compliance with the License.
215
- * You may obtain a copy of the License at
216
- *
217
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
218
- *
219
- * Unless required by applicable law or agreed to in writing, software
220
- * distributed under the License is distributed on an "AS IS" basis,
221
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
222
- * See the License for the specific language governing permissions and
223
- * limitations under the License.
224
- */
225
- const moment = moment_;
226
- moment.locale(localStorage.getItem('langKey') || '');
227
- class DossierListComponent {
228
- constructor(route, router, documentService, translateService, dossierService) {
229
- this.route = route;
230
- this.router = router;
231
- this.documentService = documentService;
232
- this.translateService = translateService;
233
- this.dossierService = dossierService;
234
- this.documentDefinitionName = '';
235
- this.showCreateDocument = false;
236
- this.items = [];
237
- this.fields = [];
238
- this.processDefinitionListFields = [];
239
- this.processDocumentDefinitions = [];
240
- this.pagination = {
241
- collectionSize: 0,
242
- page: 1,
243
- size: 10,
244
- maxPaginationItemSize: 5,
245
- sort: undefined
246
- };
247
- this.selectedProcessDocumentDefinition = null;
248
- this.modalListenerAdded = false;
249
- }
250
- ngOnInit() {
251
- this.doInit();
252
- this.routeEvent(this.router);
253
- this.modalListenerAdded = false;
254
- }
255
- ngOnDestroy() {
256
- this.routerSubscription.unsubscribe();
257
- this.translationSubscription.unsubscribe();
258
- }
259
- paginationSet() {
260
- this.getData();
261
- }
262
- routeEvent(router) {
263
- this.routerSubscription = router.events.subscribe(e => {
264
- if (e instanceof NavigationEnd) {
265
- this.doInit();
266
- this.getData();
267
- }
268
- });
269
- }
270
- doInit() {
271
- const documentDefinitionName = this.route.snapshot.paramMap.get('documentDefinitionName') || '';
272
- const columns = this.dossierService.getDefinitionColumns(documentDefinitionName);
273
- this.documentDefinitionName = documentDefinitionName;
274
- this.initialSortState = this.dossierService.getInitialSortState(columns);
275
- this.openTranslationSubscription(columns);
276
- }
277
- openTranslationSubscription(columns) {
278
- this.translationSubscription = combineLatest(columns.map(column => this.translateService.stream(`fieldLabels.${column.translationKey}`))).subscribe(labels => {
279
- this.fields = columns.map((column, index) => (Object.assign({ key: column.propertyName, label: labels[index], sortable: column.sortable }, (column.viewType && { viewType: column.viewType }))));
280
- });
281
- }
282
- getData() {
283
- this.findDocumentDefinition(this.documentDefinitionName);
284
- if (this.hasCachedSearchRequest()) {
285
- const documentSearchRequest = this.getCachedSearch();
286
- this.globalSearchFilter = documentSearchRequest.globalSearchFilter;
287
- this.sequence = documentSearchRequest.sequence;
288
- this.createdBy = documentSearchRequest.createdBy;
289
- this.findDocuments(documentSearchRequest);
290
- }
291
- else {
292
- this.doSearch();
293
- }
294
- this.getAllAssociatedProcessDefinitions();
295
- }
296
- doSearch() {
297
- const documentSearchRequest = this.buildDocumentSearchRequest();
298
- this.findDocuments(documentSearchRequest);
299
- }
300
- findDocuments(documentSearchRequest) {
301
- return this.documentService.getDocuments(documentSearchRequest).subscribe(documents => {
302
- this.documents = documents;
303
- this.transformDocuments(this.documents.content);
304
- this.pagination.collectionSize = this.documents.totalElements;
305
- this.storeSearch(documentSearchRequest);
306
- });
307
- }
308
- getAllAssociatedProcessDefinitions() {
309
- this.documentService
310
- .findProcessDocumentDefinitions(this.documentDefinitionName)
311
- .subscribe(processDocumentDefinitions => {
312
- this.processDocumentDefinitions = processDocumentDefinitions.filter(processDocumentDefinition => processDocumentDefinition.canInitializeDocument);
313
- this.processDefinitionListFields = [
314
- {
315
- key: 'processName',
316
- label: 'Proces'
317
- }
318
- ];
319
- });
320
- }
321
- getCachedSearch() {
322
- const json = JSON.parse(this.getCachedDocumentSearchRequest());
323
- return new DocumentSearchRequestImpl(json.definitionName, this.pagination.page - 1, this.pagination.size, json.sequence, json.createdBy, json.globalSearchFilter, json.sort);
324
- }
325
- buildDocumentSearchRequest() {
326
- return new DocumentSearchRequestImpl(this.documentDefinitionName, this.pagination.page - 1, this.pagination.size, this.sequence, this.createdBy, this.globalSearchFilter, this.pagination.sort && this.pagination.sort.isSorting ? this.pagination.sort : this.initialSortState);
327
- }
328
- storeSearch(documentSearchRequest) {
329
- localStorage.setItem(this.getCachedKey(), JSON.stringify(documentSearchRequest));
330
- }
331
- getCachedDocumentSearchRequest() {
332
- return localStorage.getItem(this.getCachedKey()) || '';
333
- }
334
- hasCachedSearchRequest() {
335
- return localStorage.getItem(this.getCachedKey()) !== null;
336
- }
337
- getCachedKey() {
338
- return 'list-search-' + this.documentDefinitionName;
339
- }
340
- rowClick(document) {
341
- this.router.navigate([`/dossiers/${this.documentDefinitionName}/document/${document.id}/${DefaultTabs.summary}`]);
342
- }
343
- startDossier() {
344
- if (this.processDocumentDefinitions.length > 1) {
345
- $('#startProcess').modal('show');
346
- }
347
- else {
348
- this.selectedProcessDocumentDefinition = this.processDocumentDefinitions[0];
349
- this.showStartProcessModal();
350
- }
351
- }
352
- showStartProcessModal() {
353
- if (this.selectedProcessDocumentDefinition !== null) {
354
- this.processStart.openModal(this.selectedProcessDocumentDefinition);
355
- this.selectedProcessDocumentDefinition = null;
356
- }
357
- }
358
- selectProcess(processDocumentDefinition) {
359
- const modal = $('#startProcess');
360
- if (!this.modalListenerAdded) {
361
- modal.on('hidden.bs.modal', this.showStartProcessModal.bind(this));
362
- this.modalListenerAdded = true;
363
- }
364
- this.selectedProcessDocumentDefinition = processDocumentDefinition;
365
- modal.modal('hide');
366
- }
367
- findDocumentDefinition(documentDefinitionName) {
368
- this.documentService.getDocumentDefinition(documentDefinitionName).subscribe(definition => {
369
- this.schema = definition.schema;
370
- });
371
- }
372
- transformDocuments(documentsContent) {
373
- this.items = documentsContent.map(document => {
374
- const { content } = document, others = __rest(document, ["content"]);
375
- return Object.assign(Object.assign({}, content), others);
376
- });
377
- }
378
- paginationClicked(page) {
379
- this.pagination.page = page;
380
- this.doSearch();
381
- }
382
- sortChanged(sortState) {
383
- this.pagination.sort = sortState;
384
- this.doSearch();
385
- }
386
- getInitialSortState() {
387
- if (this.hasCachedSearchRequest()) {
388
- const cachedRequest = JSON.parse(this.getCachedDocumentSearchRequest());
389
- return cachedRequest.sort ? cachedRequest.sort : this.initialSortState;
390
- }
391
- return this.initialSortState;
392
- }
393
- }
394
- DossierListComponent.decorators = [
395
- { type: Component, args: [{
396
- selector: 'valtimo-dossier-list',
397
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngTemplateOutlet=\"sidebar\"></ng-container>\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <div>\n <div class=\"text-right mt-m3px mb-3\">\n <button\n type=\"button\"\n class=\"btn btn-space btn-primary mr-0\"\n (click)=\"startDossier()\"\n [ngbTooltip]=\"processDocumentDefinitions.length === 0 ? 'No action' : null\"\n placement=\"bottom\"\n [disabled]=\"processDocumentDefinitions.length === 0\"\n >\n {{ 'Start Dossier' | translate }}\n </button>\n </div>\n\n <div\n class=\"modal fade\"\n id=\"startProcess\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-labelledby=\"startProcessLabel\"\n aria-hidden=\"true\"\n >\n <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h3 class=\"modal-title\" id=\"startProcessLabel\">{{ 'dashboard.startProcess.title' | translate }}</h3>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"table-responsive\">\n <table class=\"table m-0\">\n <tr\n *ngFor=\"let processDocumentDefinition of processDocumentDefinitions\"\n (click)=\"selectProcess(processDocumentDefinition)\"\n style=\"cursor: pointer\"\n >\n <td>{{ processDocumentDefinition.processName }}</td>\n </tr>\n </table>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">\n {{ 'cta.close' | translate }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-list\n [items]=\"items\"\n [fields]=\"fields\"\n (rowClicked)=\"rowClick($event)\"\n [pagination]=\"pagination\"\n [viewMode]=\"true\"\n [header]=\"true\"\n paginationIdentifier=\"dossierList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet()\"\n [initialSortState]=\"getInitialSortState()\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">\n {{ schema?.title }}\n <sup class=\"ml-1 badge badge-pill badge-primary\">{{ documents?.content.length || 0 }}</sup>\n </h3>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n </div>\n <valtimo-dossier-process-start-modal #processStartModal></valtimo-dossier-process-start-modal>\n</div>\n\n<ng-template #sidebar>\n <valtimo-filter-sidebar>\n <h4 class=\"title\">Search</h4>\n <div class=\"mb-4\">\n <input\n type=\"text\"\n class=\"form-control\"\n placeholder=\"{{ 'dossier.forms.globalSearchPlaceHolder' | translate }}\"\n [(ngModel)]=\"globalSearchFilter\"\n (blur)=\"doSearch()\"\n (keyup.enter)=\"doSearch()\"\n />\n </div>\n\n <div class=\"mb-4\">\n <input\n type=\"number\"\n class=\"form-control\"\n placeholder=\"{{ 'dossier.forms.referenceNumberPlaceHolder' | translate }}\"\n [(ngModel)]=\"sequence\"\n (blur)=\"doSearch()\"\n (keyup.enter)=\"doSearch()\"\n />\n </div>\n </valtimo-filter-sidebar>\n</ng-template>\n",
398
- styles: [""]
399
- },] }
400
- ];
401
- DossierListComponent.ctorParameters = () => [
402
- { type: ActivatedRoute },
403
- { type: Router },
404
- { type: DocumentService },
405
- { type: TranslateService },
406
- { type: DossierService }
407
- ];
408
- DossierListComponent.propDecorators = {
409
- processStart: [{ type: ViewChild, args: ['processStartModal',] }]
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',] }]
410
426
  };
411
427
 
412
- /*
413
- * Copyright 2015-2020 Ritense BV, the Netherlands.
414
- *
415
- * Licensed under EUPL, Version 1.2 (the "License");
416
- * you may not use this file except in compliance with the License.
417
- * You may obtain a copy of the License at
418
- *
419
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
420
- *
421
- * Unless required by applicable law or agreed to in writing, software
422
- * distributed under the License is distributed on an "AS IS" basis,
423
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
424
- * See the License for the specific language governing permissions and
425
- * limitations under the License.
426
- */
427
- const moment$1 = moment_;
428
- moment$1.locale(localStorage.getItem('langKey') || '');
429
- moment$1.defaultFormat = 'DD MMM YYYY HH:mm';
430
- class DossierDetailTabSummaryComponent {
431
- constructor(router, documentService, taskService, processService, el, renderer, route, formService, userProviderService) {
432
- this.router = router;
433
- this.documentService = documentService;
434
- this.taskService = taskService;
435
- this.processService = processService;
436
- this.el = el;
437
- this.renderer = renderer;
438
- this.route = route;
439
- this.formService = formService;
440
- this.userProviderService = userProviderService;
441
- this.processDocumentInstances = [];
442
- this.tasks = [];
443
- this.formDefinition = null;
444
- this.roles = [];
445
- this.snapshot = this.route.snapshot.paramMap;
446
- this.documentDefinitionName = this.snapshot.get('documentDefinitionName') || '';
447
- this.documentId = this.snapshot.get('documentId') || '';
448
- this.options = new FormioOptionsImpl();
449
- this.options.disableAlerts = true;
450
- }
451
- ngOnInit() {
452
- this.moment = moment$1;
453
- this.init();
454
- }
455
- init() {
456
- this.documentService.getDocument(this.documentId).subscribe(document => {
457
- this.document = document;
458
- });
459
- this.formService
460
- .getFormDefinitionByNamePreFilled(`${this.documentDefinitionName}.summary`, this.documentId)
461
- .subscribe(formDefinition => {
462
- this.formDefinition = formDefinition;
463
- });
464
- this.userProviderService.getUserSubject().subscribe(user => {
465
- this.roles = user.roles;
466
- this.tasks = [];
467
- this.loadProcessDocumentInstances(this.documentId);
468
- });
469
- }
470
- loadProcessDocumentInstances(documentId) {
471
- this.documentService.findProcessDocumentInstances(documentId).subscribe(processDocumentInstances => {
472
- this.processDocumentInstances = processDocumentInstances;
473
- this.processDocumentInstances.forEach(instance => {
474
- this.loadProcessInstanceTasks(instance.id.processInstanceId);
475
- });
476
- });
477
- }
478
- loadProcessInstanceTasks(processInstanceId) {
479
- this.processService.getProcessInstanceTasks(processInstanceId).subscribe(tasks => {
480
- tasks.forEach(task => {
481
- task.createdUnix = this.moment(task.created).unix();
482
- task.created = this.moment(task.created).format('DD MMM YYYY HH:mm');
483
- task.isLocked = () => {
484
- let locked = true;
485
- for (const link of task.identityLinks) {
486
- if (link.type === 'candidate' && link.groupId) {
487
- if (this.roles.includes(link.groupId)) {
488
- locked = false;
489
- break;
490
- }
491
- }
492
- }
493
- return locked;
494
- };
495
- });
496
- this.tasks = this.tasks.concat(tasks);
497
- this.tasks.sort((t1, t2) => t2.createdUnix - t1.createdUnix);
498
- });
499
- }
500
- rowTaskClick(task) {
501
- this.taskDetail.openTaskDetails(task);
502
- }
503
- }
504
- DossierDetailTabSummaryComponent.decorators = [
505
- { type: Component, args: [{
506
- selector: 'valtimo-dossier-detail-tab-summary',
507
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"container-fluid\">\n <div class=\"row py-4\">\n <div class=\"col-sm-12 col-md-8 col-xl-9\">\n <div *ngIf=\"document\">\n <div *ngIf=\"formDefinition\" class=\"summaryForm\">\n <div class=\"mb-4\">\n <valtimo-form-io [form]=\"formDefinition\" [options]=\"options\"></valtimo-form-io>\n </div>\n </div>\n </div>\n </div>\n\n <!--Current user tasks right side-->\n <div class=\"col-sm-12 col-md-4 col-xl-3\">\n <h4 class=\"user-tasks-title\">User tasks</h4>\n <ng-container *ngIf=\"!tasks.length\">\n <valtimo-widget>\n <div class=\"p-3\">\n <img class=\"float-left\" src=\"assets/audit-2.png\" height=\"25\" />\n <span class=\"float-right\">{{ 'summary.userTasksDoneState' | translate }}</span>\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </ng-container>\n <ng-container *ngFor=\"let task of tasks\">\n <valtimo-widget>\n <div class=\"p-3 clickable hoverable\" (click)=\"rowTaskClick(task)\" *ngIf=\"!task.isLocked()\">\n <span class=\"float-right badge badge-pill badge-primary\">Open</span>\n <strong>{{ task.name }}</strong>\n <div>Created {{ task.created }}</div>\n </div>\n <div class=\"p-3 hoverable\" *ngIf=\"task.isLocked()\">\n <span class=\"float-right badge badge-pill badge-secondary bg-grey\"\n ngbTooltip=\"{{ 'summary.taskLocked' | translate }}\">\n <i class=\"icon mdi mdi-lock\"></i>\n </span>\n <strong>{{ task.name }}</strong>\n <div>Created {{ task.created }}</div>\n </div>\n </valtimo-widget>\n </ng-container>\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"init()\"\n (assignmentOfTaskChanged)=\"init()\"\n ></valtimo-task-detail-modal>\n </div>\n </div>\n</div>\n",
508
- encapsulation: ViewEncapsulation.None,
509
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.hoverable:hover{background-color:#eee}.summaryForm .formio-component{margin-bottom:0!important}.summaryForm .formio-component div[ref=element] .form-control{background-color:#fff;border:0;font-size:13px;height:24px!important;margin:0;padding:0!important}.summaryForm .formio-field div[ref=element] .form-control{font-weight:400}.summaryForm .formio-value div[ref=element] .form-control{font-weight:700}.user-tasks-title{color:#000;font-weight:400;height:20px;margin-bottom:12px;margin-top:0}"]
510
- },] }
511
- ];
512
- DossierDetailTabSummaryComponent.ctorParameters = () => [
513
- { type: Router },
514
- { type: DocumentService },
515
- { type: TaskService },
516
- { type: ProcessService },
517
- { type: ElementRef },
518
- { type: Renderer2 },
519
- { type: ActivatedRoute },
520
- { type: FormService },
521
- { type: UserProviderService }
522
- ];
523
- DossierDetailTabSummaryComponent.propDecorators = {
524
- taskDetail: [{ type: ViewChild, args: ['taskDetail',] }]
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',] }]
525
543
  };
526
544
 
527
- /*
528
- * Copyright 2015-2020 Ritense BV, the Netherlands.
529
- *
530
- * Licensed under EUPL, Version 1.2 (the "License");
531
- * you may not use this file except in compliance with the License.
532
- * You may obtain a copy of the License at
533
- *
534
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
535
- *
536
- * Unless required by applicable law or agreed to in writing, software
537
- * distributed under the License is distributed on an "AS IS" basis,
538
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
539
- * See the License for the specific language governing permissions and
540
- * limitations under the License.
541
- */
542
- class DossierDetailTabProgressComponent {
543
- constructor(route, documentService) {
544
- this.route = route;
545
- this.documentService = documentService;
546
- const snapshot = this.route.snapshot.paramMap;
547
- this.documentId = snapshot.get('documentId') || '';
548
- }
549
- ngOnInit() {
550
- this.documentService.findProcessDocumentInstances(this.documentId).subscribe(processDocumentInstances => {
551
- this.processDocumentInstances = processDocumentInstances;
552
- this.selectedProcessInstanceId = processDocumentInstances[0].id.processInstanceId;
553
- });
554
- }
555
- loadProcessInstance(processInstanceId) {
556
- this.selectedProcessInstanceId = processInstanceId;
557
- }
558
- }
559
- DossierDetailTabProgressComponent.decorators = [
560
- { type: Component, args: [{
561
- selector: 'valtimo-dossier-detail-tab-progress',
562
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"full-height-tab-content\" *ngIf=\"processDocumentInstances\">\n <div class=\"col-3\">\n <label><strong>Process</strong></label><br/>\n <select class=\"form-control\" (change)=\"loadProcessInstance($event.target.value)\">\n <option *ngFor=\"let processDocumentInstance of processDocumentInstances\"\n [value]=\"processDocumentInstance.id.processInstanceId\"\n [selected]=\"selectedProcessInstanceId === processDocumentInstance.id.processInstanceId\">\n {{ processDocumentInstance.processName }}\n </option>\n </select>\n </div>\n <valtimo-process-diagram [processInstanceId]=\"selectedProcessInstanceId\"></valtimo-process-diagram>\n</div>\n",
563
- styles: [".full-height-tab-content{height:calc(100vh - 380px);width:100%}"]
564
- },] }
565
- ];
566
- DossierDetailTabProgressComponent.ctorParameters = () => [
567
- { type: ActivatedRoute },
568
- { type: DocumentService }
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 }
569
589
  ];
570
590
 
571
- /*
572
- * Copyright 2015-2020 Ritense BV, the Netherlands.
573
- *
574
- * Licensed under EUPL, Version 1.2 (the "License");
575
- * you may not use this file except in compliance with the License.
576
- * You may obtain a copy of the License at
577
- *
578
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
579
- *
580
- * Unless required by applicable law or agreed to in writing, software
581
- * distributed under the License is distributed on an "AS IS" basis,
582
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
583
- * See the License for the specific language governing permissions and
584
- * limitations under the License.
585
- */
586
- const moment$2 = moment_;
587
- moment$2.locale(localStorage.getItem('langKey') || '');
588
- moment$2.defaultFormat = 'DD MMM YYYY HH:mm';
589
- class DossierDetailTabAuditComponent {
590
- constructor(route, documentService, spinnerService) {
591
- this.route = route;
592
- this.documentService = documentService;
593
- this.spinnerService = spinnerService;
594
- this.paginationClicked = new EventEmitter();
595
- this.defaultAuditPage = 0;
596
- this.spinnerService.show('auditSpinner');
597
- const snapshot = this.route.snapshot.paramMap;
598
- this.documentId = snapshot.get('documentId') || '';
599
- }
600
- static getTranslationKey(auditEvent) {
601
- const classNameArray = auditEvent.className.split('.');
602
- const eventName = classNameArray[classNameArray.length - 1];
603
- return 'events.' + eventName;
604
- }
605
- ngOnInit() {
606
- this.loadAuditPage(this.defaultAuditPage);
607
- }
608
- loadAuditPage(pageNumber) {
609
- this.documentService.getAuditLog(this.documentId, pageNumber).subscribe(page => {
610
- const timelineItems = [];
611
- page.content.forEach(auditRecord => {
612
- const occurredOn = moment$2(auditRecord.metaData.occurredOn);
613
- const fromNow = occurredOn.fromNow();
614
- timelineItems.push(new TimelineItemImpl(occurredOn.format('DD MMM YYYY'), occurredOn.format('HH:mm'), auditRecord.metaData.user, fromNow, DossierDetailTabAuditComponent.getTranslationKey(auditRecord.auditEvent), auditRecord.auditEvent));
615
- });
616
- this.timelineItems = timelineItems;
617
- this.spinnerService.hide('auditSpinner');
618
- this.pagination = page;
619
- this.pagination.number += 1;
620
- });
621
- }
622
- onChangePagination(page) {
623
- this.paginationClicked.emit(page);
624
- this.currentAuditPage = page - 1;
625
- this.loadAuditPage(this.currentAuditPage);
626
- }
627
- }
628
- DossierDetailTabAuditComponent.decorators = [
629
- { type: Component, args: [{
630
- selector: 'valtimo-dossier-detail-tab-audit',
631
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngIf=\"timelineItems\">\n <valtimo-timeline [items]=\"timelineItems\"></valtimo-timeline>\n</div>\n<valtimo-spinner\n [useBootstrapSpinner]=\"false\"\n name=\"auditSpinner\"\n bdColor=\"rgba(125, 125, 125, 0.35)\"\n color=\"#264251\"\n type=\"square-jelly-box\"\n>\n</valtimo-spinner>\n<div\n class=\"pagination-holder audit-pagination bg-light px-4 pt-4 pb-2 overflow-auto row mr-0 ml-0\"\n *ngIf=\"pagination && pagination.totalElements > pagination.size\"\n>\n <div class=\"float-left page-count col-4\">\n <strong>{{ 'list.currentPage' | translate: {current: pagination.number, total: pagination.totalPages} }}</strong>\n <br />\n {{\n pagination.totalElements === 1\n ? ('list.showingResult' | translate: {number: pagination.content.length})\n : ('list.showingResults'\n | translate: {number: pagination.content.length, total: pagination.totalElements})\n }}\n </div>\n <div class=\"col-8\">\n <ngb-pagination\n *ngIf=\"pagination.totalElements > pagination.size\"\n class=\"float-right\"\n [collectionSize]=\"pagination.totalElements\"\n [(page)]=\"pagination.number\"\n [pageSize]=\"pagination.size\"\n [maxSize]=\"pagination.size\"\n [rotate]=\"true\"\n (pageChange)=\"onChangePagination(pagination.number)\"></ngb-pagination>\n </div>\n</div>\n",
632
- styles: [".audit-pagination{border-top:1px solid #dee2e6;margin:0 -1.923rem -1.923rem!important}"]
633
- },] }
634
- ];
635
- DossierDetailTabAuditComponent.ctorParameters = () => [
636
- { type: ActivatedRoute },
637
- { type: DocumentService },
638
- { type: NgxSpinnerService }
639
- ];
640
- DossierDetailTabAuditComponent.propDecorators = {
641
- paginationClicked: [{ type: Output }]
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 }]
642
662
  };
643
663
 
644
- /*
645
- * Copyright 2015-2020 Ritense BV, the Netherlands.
646
- *
647
- * Licensed under EUPL, Version 1.2 (the "License");
648
- * you may not use this file except in compliance with the License.
649
- * You may obtain a copy of the License at
650
- *
651
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
652
- *
653
- * Unless required by applicable law or agreed to in writing, software
654
- * distributed under the License is distributed on an "AS IS" basis,
655
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
656
- * See the License for the specific language governing permissions and
657
- * limitations under the License.
658
- */
659
- class DossierDetailTabDocumentsComponent {
660
- constructor(route, documentService, toastrService, uploadProviderService, downloadService) {
661
- this.route = route;
662
- this.documentService = documentService;
663
- this.toastrService = toastrService;
664
- this.uploadProviderService = uploadProviderService;
665
- this.downloadService = downloadService;
666
- this.relatedFiles = [];
667
- this.fields = [
668
- { key: 'fileName', label: 'File name' },
669
- { key: 'sizeInBytes', label: 'Size in bytes' },
670
- { key: 'createdOn', label: 'Created on', viewType: 'date' },
671
- { key: 'createdBy', label: 'Created by' }
672
- ];
673
- this.actions = [
674
- {
675
- columnName: '',
676
- iconClass: 'fas fa-external-link-alt',
677
- callback: this.downloadDocument.bind(this)
678
- },
679
- {
680
- columnName: '',
681
- iconClass: 'fas fa-trash-alt',
682
- callback: this.removeRelatedFile.bind(this)
683
- }
684
- ];
685
- this.uploading$ = new BehaviorSubject(false);
686
- const snapshot = this.route.snapshot.paramMap;
687
- this.documentId = snapshot.get('documentId') || '';
688
- this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
689
- }
690
- ngOnInit() {
691
- this.loadDocuments();
692
- }
693
- fileSelected(file) {
694
- this.uploading$.next(true);
695
- this.uploadProviderService.uploadFile(file, this.documentDefinitionName).pipe(switchMap((resourceFile) => this.documentService.assignResource(this.documentId, resourceFile.data.resourceId))).subscribe(() => {
696
- this.toastrService.success('Successfully uploaded document to dossier');
697
- this.loadDocuments();
698
- this.uploading$.next(false);
699
- }, () => {
700
- this.toastrService.error('Failed to upload document to dossier');
701
- this.uploading$.next(false);
702
- });
703
- }
704
- loadDocuments() {
705
- this.documentService.getDocument(this.documentId).subscribe((document) => {
706
- this.relatedFiles = document.relatedFiles;
707
- });
708
- }
709
- downloadDocument(relatedFile) {
710
- this.uploadProviderService.getResource(relatedFile.fileId).subscribe((resource) => {
711
- this.downloadService.downloadFile(resource.url, resource.resource.name);
712
- });
713
- }
714
- removeRelatedFile(relatedFile) {
715
- this.documentService.removeResource(this.documentId, relatedFile.fileId).subscribe(() => {
716
- this.toastrService.success('Successfully removed document from dossier');
717
- this.loadDocuments();
718
- }, () => {
719
- this.toastrService.error('Failed to remove document from dossier');
720
- });
721
- }
722
- }
723
- DossierDetailTabDocumentsComponent.decorators = [
724
- { type: Component, args: [{
725
- selector: 'valtimo-dossier-detail-tab-documents',
726
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-dropzone\n (fileSelected)=\"fileSelected($event)\"\n [acceptedFiles]=\"null\"\n [hideFilePreview]=\"true\"\n [hideTitle]=\"true\"\n [maxFileSize]=\"5\"\n [showMaxFileSize]=\"false\"\n [camera]=\"false\"\n [uploading]=\"uploading$ | async\"\n></valtimo-dropzone>\n\n<valtimo-widget>\n <valtimo-list\n [fields]=\"fields\"\n [items]=\"relatedFiles\"\n [header]=\"true\"\n [isSearchable]=\"true\"\n [viewMode]=\"true\"\n [actions]=\"actions\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{'Related documents' | translate}}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all documents in this dossier' | translate }}</h5>\n </div>\n </valtimo-list>\n</valtimo-widget>\n",
727
- styles: [""]
728
- },] }
729
- ];
730
- DossierDetailTabDocumentsComponent.ctorParameters = () => [
731
- { type: ActivatedRoute },
732
- { type: DocumentService },
733
- { type: ToastrService },
734
- { type: UploadProviderService },
735
- { type: DownloadService }
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 }
736
772
  ];
737
773
 
738
- /*
739
- * Copyright 2015-2020 Ritense BV, the Netherlands.
740
- *
741
- * Licensed under EUPL, Version 1.2 (the "License");
742
- * you may not use this file except in compliance with the License.
743
- * You may obtain a copy of the License at
744
- *
745
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
746
- *
747
- * Unless required by applicable law or agreed to in writing, software
748
- * distributed under the License is distributed on an "AS IS" basis,
749
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
750
- * See the License for the specific language governing permissions and
751
- * limitations under the License.
752
- */
753
- const TAB_MAP = new InjectionToken('TabMap');
754
- const DEFAULT_TABS = new Map([
755
- [DefaultTabs.summary, DossierDetailTabSummaryComponent],
756
- [DefaultTabs.progress, DossierDetailTabProgressComponent],
757
- [DefaultTabs.audit, DossierDetailTabAuditComponent],
758
- [DefaultTabs.documents, DossierDetailTabDocumentsComponent]
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],
759
795
  ]);
760
796
 
761
- /*
762
- * Copyright 2015-2020 Ritense BV, the Netherlands.
763
- *
764
- * Licensed under EUPL, Version 1.2 (the "License");
765
- * you may not use this file except in compliance with the License.
766
- * You may obtain a copy of the License at
767
- *
768
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
769
- *
770
- * Unless required by applicable law or agreed to in writing, software
771
- * distributed under the License is distributed on an "AS IS" basis,
772
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
773
- * See the License for the specific language governing permissions and
774
- * limitations under the License.
775
- */
776
- class TabService {
777
- constructor(tabMap = DEFAULT_TABS) {
778
- this.tabs = [];
779
- this.tabMap = tabMap;
780
- let i = 0;
781
- this.tabMap.forEach((component, name, map) => {
782
- this.tabs.push(new TabImpl(name, i, component));
783
- i++;
784
- });
785
- }
786
- getTabs() {
787
- return this.tabs;
788
- }
789
- }
790
- TabService.ɵprov = ɵɵdefineInjectable({ factory: function TabService_Factory() { return new TabService(ɵɵinject(TAB_MAP)); }, token: TabService, providedIn: "root" });
791
- TabService.decorators = [
792
- { type: Injectable, args: [{
793
- providedIn: 'root'
794
- },] }
795
- ];
796
- TabService.ctorParameters = () => [
797
- { type: Map, decorators: [{ type: Inject, args: [TAB_MAP,] }] }
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,] }] }
798
834
  ];
799
835
 
800
- /*
801
- * Copyright 2015-2020 Ritense BV, the Netherlands.
802
- *
803
- * Licensed under EUPL, Version 1.2 (the "License");
804
- * you may not use this file except in compliance with the License.
805
- * You may obtain a copy of the License at
806
- *
807
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
808
- *
809
- * Unless required by applicable law or agreed to in writing, software
810
- * distributed under the License is distributed on an "AS IS" basis,
811
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
812
- * See the License for the specific language governing permissions and
813
- * limitations under the License.
814
- */
815
- class DossierSupportingProcessStartModalComponent {
816
- constructor(route, router, processService, documentService, formLinkService, logger) {
817
- this.route = route;
818
- this.router = router;
819
- this.processService = processService;
820
- this.documentService = documentService;
821
- this.formLinkService = formLinkService;
822
- this.logger = logger;
823
- this.formSubmit = new EventEmitter();
824
- }
825
- loadFormDefinition() {
826
- this.formDefinition = null;
827
- this.formLinkService.getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
828
- .subscribe(formDefinition => {
829
- this.formAssociation = formDefinition.formAssociation;
830
- const className = this.formAssociation.formLink.className.split('.');
831
- const linkType = className[className.length - 1];
832
- switch (linkType) {
833
- case 'BpmnElementFormIdLink':
834
- this.formDefinition = formDefinition;
835
- this.documentService.getDocument(this.documentId).subscribe(document => {
836
- this.submission = {
837
- data: document.content
838
- };
839
- }, () => noop());
840
- this.modal.show();
841
- break;
842
- case 'BpmnElementUrlLink':
843
- const url = this.router.serializeUrl(this.router.createUrlTree([formDefinition.formAssociation.formLink.url]));
844
- window.open(url, '_blank');
845
- break;
846
- case 'BpmnElementAngularStateUrlLink':
847
- this.router.navigate([formDefinition.formAssociation.formLink.url]);
848
- break;
849
- default:
850
- this.logger.fatal('Unsupported class name');
851
- }
852
- }, errors => {
853
- this.modal.show();
854
- });
855
- }
856
- get modalTitle() {
857
- return `Start - ${this.processName}`;
858
- }
859
- openModal(processDocumentDefinition, documentId) {
860
- this.documentId = documentId;
861
- this.documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
862
- this.processDefinitionKey = processDocumentDefinition.id.processDefinitionKey;
863
- this.processName = processDocumentDefinition.processName;
864
- this.options = new FormioOptionsImpl();
865
- this.options.disableAlerts = true;
866
- const formioBeforeSubmit = function (submission, callback) {
867
- callback(null, submission);
868
- };
869
- this.options.setHooks(formioBeforeSubmit);
870
- this.loadFormDefinition();
871
- }
872
- onSubmit(submission) {
873
- this.formioSubmission = submission;
874
- this.formLinkService.onSubmit(this.processDefinitionKey, this.formAssociation.formLink.id, submission.data, this.documentId).subscribe((formSubmissionResult) => {
875
- this.modal.hide();
876
- this.formSubmit.emit();
877
- }, errors => {
878
- this.form.showErrors(errors);
879
- });
880
- }
881
- gotoFormLinkScreen() {
882
- this.modal.hide();
883
- this.router.navigate(['form-links'], { queryParams: { process: this.processDefinitionKey } });
884
- }
885
- }
886
- DossierSupportingProcessStartModalComponent.decorators = [
887
- { type: Component, args: [{
888
- selector: 'valtimo-dossier-supporting-process-start-modal',
889
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal #supportingProcessStartModal elementId=\"supportingProcessStartModal\" [title]=\"modalTitle\">\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io #form\n [submission]=\"submission\"\n [form]=\"formDefinition\"\n [options]=\"options\"\n (submit)=\"onSubmit($event)\">\n </valtimo-form-io>\n </div>\n <div body *ngIf=\"!formDefinition\">\n <div class=\"bg-warning text-black mb-0 p-3 text-center\" [translate]=\"'formManagement.noFormDefinitionFound'\">\n </div>\n <div class=\"mb-0 mt-4 p-3 text-center\">\n <button class=\"btn btn-secondary btn-space\" type=\"button\"\n (click)=\"gotoFormLinkScreen();\"\n id=\"form-link-button\">{{'formManagement.gotoFormLinksButton' | translate}}\n </button>\n </div>\n </div>\n</valtimo-modal>\n",
890
- encapsulation: ViewEncapsulation.None,
891
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#supportingProcessStartModal .formio-component-submit{text-align:right}"]
892
- },] }
893
- ];
894
- DossierSupportingProcessStartModalComponent.ctorParameters = () => [
895
- { type: ActivatedRoute },
896
- { type: Router },
897
- { type: ProcessService },
898
- { type: DocumentService },
899
- { type: FormLinkService },
900
- { type: NGXLogger }
901
- ];
902
- DossierSupportingProcessStartModalComponent.propDecorators = {
903
- form: [{ type: ViewChild, args: ['form', { static: false },] }],
904
- modal: [{ type: ViewChild, args: ['supportingProcessStartModal', { static: false },] }],
905
- formSubmit: [{ type: Output }]
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 }]
906
950
  };
907
951
 
908
- /*
909
- * Copyright 2015-2020 Ritense BV, the Netherlands.
910
- *
911
- * Licensed under EUPL, Version 1.2 (the "License");
912
- * you may not use this file except in compliance with the License.
913
- * You may obtain a copy of the License at
914
- *
915
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
916
- *
917
- * Unless required by applicable law or agreed to in writing, software
918
- * distributed under the License is distributed on an "AS IS" basis,
919
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
920
- * See the License for the specific language governing permissions and
921
- * limitations under the License.
922
- */
923
- class DossierDetailComponent {
924
- constructor(componentFactoryResolver, translateService, documentService, processService, route, router, location, tabService) {
925
- this.componentFactoryResolver = componentFactoryResolver;
926
- this.translateService = translateService;
927
- this.documentService = documentService;
928
- this.processService = processService;
929
- this.route = route;
930
- this.router = router;
931
- this.location = location;
932
- this.tabService = tabService;
933
- this.document = null;
934
- this.tabLoader = null;
935
- this.processDefinitionListFields = [];
936
- this.processDocumentDefinitions = [];
937
- this.snapshot = this.route.snapshot.paramMap;
938
- this.documentDefinitionName = this.snapshot.get('documentDefinitionName') || '';
939
- this.documentId = this.snapshot.get('documentId') || '';
940
- }
941
- ngOnInit() {
942
- this.tabLoader = new TabLoaderImpl(this.tabService.getTabs(), this.componentFactoryResolver, this.viewContainerRef, this.translateService, this.router, this.location);
943
- this.documentService.getDocumentDefinition(this.documentDefinitionName).subscribe(definition => {
944
- this.documentDefinitionNameTitle = definition.schema.title;
945
- });
946
- this.initialTabName = this.snapshot.get('tab');
947
- this.tabLoader.initial(this.initialTabName);
948
- this.getAllAssociatedProcessDefinitions();
949
- }
950
- getAllAssociatedProcessDefinitions() {
951
- this.documentService.findProcessDocumentDefinitions(this.documentDefinitionName).subscribe(processDocumentDefinitions => {
952
- this.processDocumentDefinitions = processDocumentDefinitions
953
- .filter(processDocumentDefinition => processDocumentDefinition.startableByUser);
954
- this.processDefinitionListFields = [{
955
- key: 'processName',
956
- label: 'Proces'
957
- }];
958
- });
959
- }
960
- startProcess(processDocumentDefinition) {
961
- this.supportingProcessStart.openModal(processDocumentDefinition, this.documentId);
962
- }
963
- }
964
- DossierDetailComponent.decorators = [
965
- { type: Component, args: [{
966
- selector: 'valtimo-dossier-detail',
967
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div class=\"card-header bg-light card-header-divider pb-5\">\n {{ documentDefinitionNameTitle }}\n <div class=\"btn-group mt-m3px mb-3 float-right\">\n <valtimo-extension\n module=\"dossier\"\n page=\"dossier-detail\"\n section=\"card-header\"\n ></valtimo-extension>\n <div class=\"dropdown\">\n <button class=\"btn btn-primary dropdown-toggle\" type=\"button\"\n id=\"startProcessDropdown\" placement=\"bottom\"\n [ngbTooltip]=\"processDocumentDefinitions.length === 0 ? 'No action' : null\"\n [disabled]=\"processDocumentDefinitions.length === 0\"\n data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <span>Start</span>\n <i class=\"pl-2 fas fa-caret-down\"></i>\n </button>\n <div class=\"dropdown-menu dropdown-menu-right\" aria-labelledby=\"startProcessDropdown\">\n <button *ngFor=\"let processDocumentDefinition of processDocumentDefinitions\" class=\"dropdown-item p\"\n href=\"#\"\n (click)=\"startProcess(processDocumentDefinition)\">{{processDocumentDefinition.processName}}</button>\n </div>\n </div>\n </div>\n </div>\n <ul class=\"nav nav-tabs\">\n <li class=\"nav-item\" *ngFor=\"let tab of tabLoader.tabs\">\n <a id=\"{{ tab.name }}-tab\" class=\"nav-link clickable\"\n [ngClass]=\"{'active' : tab.isActive()}\"\n data-toggle=\"tab\"\n (click)=\"tabLoader.load(tab)\">\n {{ tabLoader.translateTabName(tab) }}\n </a>\n </li>\n </ul>\n <div class=\"card-body bg-white p-5 position-relative tab-container\">\n <ng-template #tabContainer>Loading...</ng-template>\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </div>\n <valtimo-dossier-supporting-process-start-modal (formSubmit)=\"tabLoader.refreshView()\"\n #supportingProcessStartModal></valtimo-dossier-supporting-process-start-modal>\n </div>\n</div>\n",
968
- styles: [".tab-container{min-height:300px}"]
969
- },] }
970
- ];
971
- DossierDetailComponent.ctorParameters = () => [
972
- { type: ComponentFactoryResolver },
973
- { type: TranslateService },
974
- { type: DocumentService },
975
- { type: ProcessService },
976
- { type: ActivatedRoute },
977
- { type: Router },
978
- { type: Location },
979
- { type: TabService }
980
- ];
981
- DossierDetailComponent.propDecorators = {
982
- viewContainerRef: [{ type: ViewChild, args: ['tabContainer', { read: ViewContainerRef, static: true },] }],
983
- supportingProcessStart: [{ type: ViewChild, args: ['supportingProcessStartModal',] }]
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',] }]
984
1033
  };
985
1034
 
986
- /*
987
- * Copyright 2015-2021 Ritense BV, the Netherlands.
988
- *
989
- * Licensed under EUPL, Version 1.2 (the "License");
990
- * you may not use this file except in compliance with the License.
991
- * You may obtain a copy of the License at
992
- *
993
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
994
- *
995
- * Unless required by applicable law or agreed to in writing, software
996
- * distributed under the License is distributed on an "AS IS" basis,
997
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
998
- * See the License for the specific language governing permissions and
999
- * limitations under the License.
1000
- */
1001
- const moment$3 = moment_;
1002
- moment$3.locale(localStorage.getItem('langKey') || '');
1003
- class DossierDetailTabContactMomentsComponent {
1004
- constructor(contactMomentService) {
1005
- this.contactMomentService = contactMomentService;
1006
- this.contactMoments = [];
1007
- }
1008
- ngOnInit() {
1009
- this.loadContactMoments();
1010
- }
1011
- loadContactMoments() {
1012
- this.contactMomentService.getContactMoments().subscribe(contactMoments => this.handleContactMomentsResult(contactMoments));
1013
- }
1014
- handleContactMomentsResult(contactMoments) {
1015
- this.contactMoments = contactMoments.map(contactMoment => {
1016
- const registratieDatum = moment$3(contactMoment.registratiedatum);
1017
- return new TimelineItemImpl(registratieDatum.format('DD MMM YYYY'), registratieDatum.format('HH:mm'), contactMoment.medewerkerIdentificatie.achternaam, contactMoment.kanaal, contactMoment.tekst, null);
1018
- });
1019
- }
1020
- }
1021
- DossierDetailTabContactMomentsComponent.decorators = [
1022
- { type: Component, args: [{
1023
- selector: 'valtimo-dossier-detail-tab-contact-moments',
1024
- template: "<!--\n ~ Copyright 2015-2021 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngIf=\"contactMoments\">\n <valtimo-timeline [items]=\"contactMoments\"></valtimo-timeline>\n</div>\n\n",
1025
- styles: ["/*!\n * Copyright 2015-2021 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */"]
1026
- },] }
1027
- ];
1028
- DossierDetailTabContactMomentsComponent.ctorParameters = () => [
1029
- { type: ContactMomentService }
1030
- ];
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',] }]
1115
+ };
1031
1116
 
1032
- /*
1033
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1034
- *
1035
- * Licensed under EUPL, Version 1.2 (the "License");
1036
- * you may not use this file except in compliance with the License.
1037
- * You may obtain a copy of the License at
1038
- *
1039
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1040
- *
1041
- * Unless required by applicable law or agreed to in writing, software
1042
- * distributed under the License is distributed on an "AS IS" basis,
1043
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1044
- * See the License for the specific language governing permissions and
1045
- * limitations under the License.
1046
- */
1047
- const moment$4 = moment_;
1048
- moment$4.locale(localStorage.getItem('langKey') || '');
1049
- class DossierUpdateComponent {
1050
- constructor(taskService, documentService, route, toastr, location, dossierService) {
1051
- this.taskService = taskService;
1052
- this.documentService = documentService;
1053
- this.route = route;
1054
- this.toastr = toastr;
1055
- this.location = location;
1056
- this.customDefinitions = {};
1057
- const snapshot = this.route.snapshot.paramMap;
1058
- this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
1059
- this.documentId = snapshot.get('documentId') || '';
1060
- this.taskId = snapshot.get('taskId') || '';
1061
- this.implementationDefinitions = dossierService.getImplementationEnvironmentDefinitions(this.documentDefinitionName);
1062
- this.loadDocumentDefinition(this.documentDefinitionName);
1063
- this.loadDocument(this.documentId);
1064
- }
1065
- ngOnInit() {
1066
- this.getTask(this.taskId);
1067
- if (this.implementationDefinitions.definitions.detail.summary) {
1068
- this.customDefinitions = this.implementationDefinitions.definitions.detail.summary;
1069
- }
1070
- }
1071
- loadDocumentDefinition(name) {
1072
- this.documentService.getDocumentDefinition(name).subscribe(definition => {
1073
- this.schema = definition.schema;
1074
- });
1075
- }
1076
- loadDocument(id) {
1077
- this.documentService.getDocument(id).subscribe(document => {
1078
- this.document = document;
1079
- });
1080
- }
1081
- getTask(id) {
1082
- this.taskService.getTask(id).subscribe(task => {
1083
- this.task = task;
1084
- this.task.task.created = moment$4(this.task.task.created).format('DD MMM YYYY HH:mm');
1085
- this.page = {
1086
- title: this.task.task.name,
1087
- subtitle: `Created ${moment$4(this.task.task.created).fromNow()}`
1088
- };
1089
- });
1090
- }
1091
- reset() {
1092
- this.loadDocument(this.documentId);
1093
- }
1094
- back() {
1095
- this.location.back();
1096
- }
1097
- save() {
1098
- const document = {
1099
- documentId: this.document.id,
1100
- content: this.document.content,
1101
- versionBasedOn: this.document.version
1102
- };
1103
- this.documentService.modifyDocument(document).subscribe(result => {
1104
- this.document = result.document;
1105
- this.toastr.success('Document aangepast');
1106
- this.location.back();
1107
- });
1108
- }
1109
- submit(data) {
1110
- // merge document content with formdata
1111
- const mergedData = Object.assign({}, this.document.content, data);
1112
- const documentData = {
1113
- request: {
1114
- documentId: this.document.id,
1115
- content: mergedData,
1116
- versionBasedOn: this.document.version
1117
- },
1118
- taskId: this.task.task.id
1119
- };
1120
- this.documentService.modifyDocumentAndCompleteTask(documentData).subscribe(result => {
1121
- this.toastr.success(this.task.task.name + ' has successfully been completed');
1122
- this.location.back();
1123
- });
1124
- }
1125
- returnZero() {
1126
- return 0;
1127
- }
1128
- }
1129
- DossierUpdateComponent.decorators = [
1130
- { type: Component, args: [{
1131
- selector: 'valtimo-dossier-update',
1132
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget [title]=\"page?.title\" [subtitle]=\"page?.subtitle\" [divider]=\"true\">\n <div class=\"card-body\">\n\n <!--view with custom definitions-->\n <div *ngIf=\"this.customDefinitions\">\n <div class=\"mb-4\" *ngFor=\"let definition of this.customDefinitions | keyvalue: returnZero\">\n </div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-sm-12\">\n <div class=\"text-right\">\n <button class=\"btn btn-space btn-default float-left\" type=\"button\" (click)=\"back()\" id=\"back-button\">Back</button>\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\" id=\"reset-button\">Reset</button>\n <button class=\"btn btn-space btn-primary\" type=\"button\" (click)=\"save()\" id=\"save-button\">Save</button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" (click)=\"submit({})\" id=\"submit-button\">Submit</button>\n </div>\n </div>\n </div>\n </div>\n\n <valtimo-camunda-form *ngIf=\"task?.formFields && !this.customDefinitions\"\n (submitted)=\"submit($event)\"\n [formFields]=\"task.formFields\"\n [componentName]=\"task.formLocation\"></valtimo-camunda-form>\n\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n",
1133
- styles: [""]
1134
- },] }
1135
- ];
1136
- DossierUpdateComponent.ctorParameters = () => [
1137
- { type: TaskService },
1138
- { type: DocumentService },
1139
- { type: ActivatedRoute },
1140
- { type: ToastrService },
1141
- { type: Location },
1142
- { type: DossierService }
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 }
1143
1228
  ];
1144
1229
 
1145
- /*
1146
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1147
- *
1148
- * Licensed under EUPL, Version 1.2 (the "License");
1149
- * you may not use this file except in compliance with the License.
1150
- * You may obtain a copy of the License at
1151
- *
1152
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1153
- *
1154
- * Unless required by applicable law or agreed to in writing, software
1155
- * distributed under the License is distributed on an "AS IS" basis,
1156
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1157
- * See the License for the specific language governing permissions and
1158
- * limitations under the License.
1159
- */
1160
- const ɵ0 = { title: 'Dossiers', roles: [ROLE_USER] }, ɵ1 = { title: 'Dossiers', parentPath: 'dossiers/:documentDefinitionName', roles: [ROLE_USER] }, ɵ2 = { title: 'Task details', parentPath: 'dossiers/:documentDefinitionName/document/:documentId/:tab', roles: [ROLE_USER] };
1161
- const routes = [
1162
- {
1163
- path: 'dossiers/:documentDefinitionName',
1164
- component: DossierListComponent,
1165
- canActivate: [AuthGuardService],
1166
- data: ɵ0
1167
- },
1168
- {
1169
- path: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
1170
- component: DossierDetailComponent,
1171
- canActivate: [AuthGuardService],
1172
- data: ɵ1
1173
- },
1174
- {
1175
- path: 'dossiers/:documentDefinitionName/document/:documentId/:tab/tasks/:taskId',
1176
- component: DossierUpdateComponent,
1177
- canActivate: [AuthGuardService],
1178
- data: ɵ2
1179
- }
1180
- ];
1181
- class DossierRoutingModule {
1182
- }
1183
- DossierRoutingModule.decorators = [
1184
- { type: NgModule, args: [{
1185
- imports: [
1186
- CommonModule,
1187
- RouterModule.forChild(routes),
1188
- ],
1189
- exports: [RouterModule]
1190
- },] }
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
+ },] }
1191
1277
  ];
1192
1278
 
1193
- /*
1194
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1195
- *
1196
- * Licensed under EUPL, Version 1.2 (the "License");
1197
- * you may not use this file except in compliance with the License.
1198
- * You may obtain a copy of the License at
1199
- *
1200
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1201
- *
1202
- * Unless required by applicable law or agreed to in writing, software
1203
- * distributed under the License is distributed on an "AS IS" basis,
1204
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1205
- * See the License for the specific language governing permissions and
1206
- * limitations under the License.
1207
- */
1208
- const ɵ0$1 = HttpLoaderFactory;
1209
- class DossierModule {
1210
- static forRoot(tabsFactory) {
1211
- return {
1212
- ngModule: DossierModule,
1213
- providers: [
1214
- DossierService,
1215
- TabService,
1216
- {
1217
- provide: TAB_MAP,
1218
- useFactory: tabsFactory
1219
- },
1220
- {
1221
- provide: ANALYZE_FOR_ENTRY_COMPONENTS,
1222
- useValue: Array.from(tabsFactory().values()),
1223
- multi: true
1224
- }
1225
- ]
1226
- };
1227
- }
1228
- }
1229
- DossierModule.decorators = [
1230
- { type: NgModule, args: [{
1231
- declarations: [
1232
- DossierListComponent,
1233
- DossierDetailComponent,
1234
- DossierDetailTabSummaryComponent,
1235
- DossierDetailTabProgressComponent,
1236
- DossierDetailTabAuditComponent,
1237
- DossierDetailTabDocumentsComponent,
1238
- DossierDetailTabContactMomentsComponent,
1239
- DossierUpdateComponent,
1240
- DossierProcessStartModalComponent,
1241
- DossierSupportingProcessStartModalComponent
1242
- ],
1243
- imports: [
1244
- CommonModule,
1245
- DossierRoutingModule,
1246
- ListModule,
1247
- WidgetModule,
1248
- BpmnJsDiagramModule,
1249
- TimelineModule,
1250
- CamundaFormModule,
1251
- ProcessModule,
1252
- FilterSidebarModule,
1253
- NgbButtonsModule,
1254
- DataListModule,
1255
- FormsModule,
1256
- FormModule,
1257
- FormIoModule,
1258
- ModalModule,
1259
- SpinnerModule,
1260
- TranslateModule.forRoot({
1261
- loader: {
1262
- provide: TranslateLoader,
1263
- useFactory: ɵ0$1,
1264
- deps: [HttpClient]
1265
- }
1266
- }),
1267
- TaskModule,
1268
- ModalModule,
1269
- NgbTooltipModule,
1270
- UploaderModule,
1271
- DropzoneModule,
1272
- NgbPaginationModule,
1273
- ConfigModule
1274
- ],
1275
- exports: [
1276
- DossierListComponent,
1277
- DossierDetailComponent
1278
- ],
1279
- entryComponents: [
1280
- DossierDetailTabSummaryComponent,
1281
- DossierDetailTabProgressComponent,
1282
- DossierDetailTabAuditComponent,
1283
- DossierDetailTabDocumentsComponent,
1284
- DossierDetailTabContactMomentsComponent
1285
- ]
1286
- },] }
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
+ },] }
1287
1370
  ];
1288
1371
 
1289
- /*
1290
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1291
- *
1292
- * Licensed under EUPL, Version 1.2 (the "License");
1293
- * you may not use this file except in compliance with the License.
1294
- * You may obtain a copy of the License at
1295
- *
1296
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1297
- *
1298
- * Unless required by applicable law or agreed to in writing, software
1299
- * distributed under the License is distributed on an "AS IS" basis,
1300
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1301
- * See the License for the specific language governing permissions and
1302
- * limitations under the License.
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.
1303
1386
  */
1304
1387
 
1305
- /**
1306
- * Generated bundle index. Do not edit.
1388
+ /**
1389
+ * Generated bundle index. Do not edit.
1307
1390
  */
1308
1391
 
1309
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 };