@valtimo/dossier 4.15.3-next-main.14 → 4.15.3-next-main.15

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 +1622 -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 +86 -86
  6. package/esm2015/lib/dossier-detail/tab/audit/audit.component.js +78 -78
  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 +100 -100
  9. package/esm2015/lib/dossier-detail/tab/progress/progress.component.js +46 -46
  10. package/esm2015/lib/dossier-detail/tab/summary/summary.component.js +123 -123
  11. package/esm2015/lib/dossier-detail-tab-enum.js +23 -23
  12. package/esm2015/lib/dossier-list/dossier-list.component.js +211 -211
  13. package/esm2015/lib/dossier-process-start-modal/dossier-process-start-modal.component.js +121 -121
  14. package/esm2015/lib/dossier-routing.module.js +56 -56
  15. package/esm2015/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.js +116 -116
  16. package/esm2015/lib/dossier-update/dossier-update.component.js +120 -120
  17. package/esm2015/lib/dossier.config.js +28 -28
  18. package/esm2015/lib/dossier.module.js +123 -123
  19. package/esm2015/lib/dossier.service.js +49 -49
  20. package/esm2015/lib/tab.service.js +43 -43
  21. package/esm2015/public_api.js +30 -30
  22. package/esm2015/valtimo-dossier.js +8 -8
  23. package/fesm2015/valtimo-dossier.js +1285 -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 +38 -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,1328 @@ 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.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 },] }]
162
162
  };
163
163
 
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 }
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 }
208
208
  ];
209
209
 
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',] }]
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',] }]
410
410
  };
411
411
 
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',] }]
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',] }]
525
525
  };
526
526
 
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 }
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 }
569
569
  ];
570
570
 
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 }]
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 }]
642
642
  };
643
643
 
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 }
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 }
736
736
  ];
737
737
 
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]
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]
759
759
  ]);
760
760
 
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,] }] }
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,] }] }
798
798
  ];
799
799
 
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 }]
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 }]
906
906
  };
907
907
 
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',] }]
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',] }]
984
984
  };
985
985
 
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
- ];
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, alertService, translateService) {
1005
+ this.contactMomentService = contactMomentService;
1006
+ this.alertService = alertService;
1007
+ this.translateService = translateService;
1008
+ this.refetchContactMoments$ = new BehaviorSubject('');
1009
+ this.contactMoments$ = this.refetchContactMoments$.pipe(switchMap(() => this.contactMomentService.getContactMoments()), map((contactMoments) => contactMoments.map(contactMoment => {
1010
+ const registratieDatum = moment$3(contactMoment.registratiedatum);
1011
+ return new TimelineItemImpl(registratieDatum.format('DD MMM YYYY'), registratieDatum.format('HH:mm'), contactMoment.medewerkerIdentificatie.achternaam, contactMoment.kanaal, contactMoment.tekst, null);
1012
+ })));
1013
+ this.text$ = new BehaviorSubject('');
1014
+ this.channel$ = new BehaviorSubject('MAIL');
1015
+ this.requestData$ = combineLatest([this.text$, this.channel$]);
1016
+ this.valid$ = this.requestData$.pipe(map(([text, channel]) => !!(text && channel)));
1017
+ this.disabled$ = new BehaviorSubject(false);
1018
+ }
1019
+ textChange(text) {
1020
+ this.text$.next(text);
1021
+ }
1022
+ buttonClick() {
1023
+ this.modal.show();
1024
+ }
1025
+ saveNote() {
1026
+ this.disable();
1027
+ this.requestData$.pipe(take(1)).subscribe(([text, channel]) => {
1028
+ this.contactMomentService.saveContactMoment({ kanaal: channel, tekst: text }).subscribe(() => {
1029
+ this.alertService.success(this.translateService.instant('dossier.contactMoments.saveSuccess'));
1030
+ this.enable();
1031
+ this.clear();
1032
+ this.modal.hide();
1033
+ this.refetchContactMoments();
1034
+ }, () => {
1035
+ this.enable();
1036
+ });
1037
+ });
1038
+ }
1039
+ disable() {
1040
+ this.disabled$.next(true);
1041
+ }
1042
+ enable() {
1043
+ this.disabled$.next(false);
1044
+ }
1045
+ clear() {
1046
+ this.text$.next('');
1047
+ }
1048
+ refetchContactMoments() {
1049
+ this.refetchContactMoments$.next('');
1050
+ }
1051
+ }
1052
+ DossierDetailTabContactMomentsComponent.decorators = [
1053
+ { type: Component, args: [{
1054
+ selector: 'valtimo-dossier-detail-tab-contact-moments',
1055
+ 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",
1056
+ 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}"]
1057
+ },] }
1058
+ ];
1059
+ DossierDetailTabContactMomentsComponent.ctorParameters = () => [
1060
+ { type: ContactMomentService },
1061
+ { type: AlertService },
1062
+ { type: TranslateService }
1063
+ ];
1064
+ DossierDetailTabContactMomentsComponent.propDecorators = {
1065
+ modal: [{ type: ViewChild, args: ['contactMomentsNoteModal',] }]
1066
+ };
1031
1067
 
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 }
1068
+ /*
1069
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1070
+ *
1071
+ * Licensed under EUPL, Version 1.2 (the "License");
1072
+ * you may not use this file except in compliance with the License.
1073
+ * You may obtain a copy of the License at
1074
+ *
1075
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1076
+ *
1077
+ * Unless required by applicable law or agreed to in writing, software
1078
+ * distributed under the License is distributed on an "AS IS" basis,
1079
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1080
+ * See the License for the specific language governing permissions and
1081
+ * limitations under the License.
1082
+ */
1083
+ const moment$4 = moment_;
1084
+ moment$4.locale(localStorage.getItem('langKey') || '');
1085
+ class DossierUpdateComponent {
1086
+ constructor(taskService, documentService, route, toastr, location, dossierService) {
1087
+ this.taskService = taskService;
1088
+ this.documentService = documentService;
1089
+ this.route = route;
1090
+ this.toastr = toastr;
1091
+ this.location = location;
1092
+ this.customDefinitions = {};
1093
+ const snapshot = this.route.snapshot.paramMap;
1094
+ this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
1095
+ this.documentId = snapshot.get('documentId') || '';
1096
+ this.taskId = snapshot.get('taskId') || '';
1097
+ this.implementationDefinitions = dossierService.getImplementationEnvironmentDefinitions(this.documentDefinitionName);
1098
+ this.loadDocumentDefinition(this.documentDefinitionName);
1099
+ this.loadDocument(this.documentId);
1100
+ }
1101
+ ngOnInit() {
1102
+ this.getTask(this.taskId);
1103
+ if (this.implementationDefinitions.definitions.detail.summary) {
1104
+ this.customDefinitions = this.implementationDefinitions.definitions.detail.summary;
1105
+ }
1106
+ }
1107
+ loadDocumentDefinition(name) {
1108
+ this.documentService.getDocumentDefinition(name).subscribe(definition => {
1109
+ this.schema = definition.schema;
1110
+ });
1111
+ }
1112
+ loadDocument(id) {
1113
+ this.documentService.getDocument(id).subscribe(document => {
1114
+ this.document = document;
1115
+ });
1116
+ }
1117
+ getTask(id) {
1118
+ this.taskService.getTask(id).subscribe(task => {
1119
+ this.task = task;
1120
+ this.task.task.created = moment$4(this.task.task.created).format('DD MMM YYYY HH:mm');
1121
+ this.page = {
1122
+ title: this.task.task.name,
1123
+ subtitle: `Created ${moment$4(this.task.task.created).fromNow()}`
1124
+ };
1125
+ });
1126
+ }
1127
+ reset() {
1128
+ this.loadDocument(this.documentId);
1129
+ }
1130
+ back() {
1131
+ this.location.back();
1132
+ }
1133
+ save() {
1134
+ const document = {
1135
+ documentId: this.document.id,
1136
+ content: this.document.content,
1137
+ versionBasedOn: this.document.version
1138
+ };
1139
+ this.documentService.modifyDocument(document).subscribe(result => {
1140
+ this.document = result.document;
1141
+ this.toastr.success('Document aangepast');
1142
+ this.location.back();
1143
+ });
1144
+ }
1145
+ submit(data) {
1146
+ // merge document content with formdata
1147
+ const mergedData = Object.assign({}, this.document.content, data);
1148
+ const documentData = {
1149
+ request: {
1150
+ documentId: this.document.id,
1151
+ content: mergedData,
1152
+ versionBasedOn: this.document.version
1153
+ },
1154
+ taskId: this.task.task.id
1155
+ };
1156
+ this.documentService.modifyDocumentAndCompleteTask(documentData).subscribe(result => {
1157
+ this.toastr.success(this.task.task.name + ' has successfully been completed');
1158
+ this.location.back();
1159
+ });
1160
+ }
1161
+ returnZero() {
1162
+ return 0;
1163
+ }
1164
+ }
1165
+ DossierUpdateComponent.decorators = [
1166
+ { type: Component, args: [{
1167
+ selector: 'valtimo-dossier-update',
1168
+ 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",
1169
+ styles: [""]
1170
+ },] }
1171
+ ];
1172
+ DossierUpdateComponent.ctorParameters = () => [
1173
+ { type: TaskService },
1174
+ { type: DocumentService },
1175
+ { type: ActivatedRoute },
1176
+ { type: ToastrService },
1177
+ { type: Location },
1178
+ { type: DossierService }
1143
1179
  ];
1144
1180
 
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
- },] }
1181
+ /*
1182
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1183
+ *
1184
+ * Licensed under EUPL, Version 1.2 (the "License");
1185
+ * you may not use this file except in compliance with the License.
1186
+ * You may obtain a copy of the License at
1187
+ *
1188
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1189
+ *
1190
+ * Unless required by applicable law or agreed to in writing, software
1191
+ * distributed under the License is distributed on an "AS IS" basis,
1192
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1193
+ * See the License for the specific language governing permissions and
1194
+ * limitations under the License.
1195
+ */
1196
+ 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] };
1197
+ const routes = [
1198
+ {
1199
+ path: 'dossiers/:documentDefinitionName',
1200
+ component: DossierListComponent,
1201
+ canActivate: [AuthGuardService],
1202
+ data: ɵ0
1203
+ },
1204
+ {
1205
+ path: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
1206
+ component: DossierDetailComponent,
1207
+ canActivate: [AuthGuardService],
1208
+ data: ɵ1
1209
+ },
1210
+ {
1211
+ path: 'dossiers/:documentDefinitionName/document/:documentId/:tab/tasks/:taskId',
1212
+ component: DossierUpdateComponent,
1213
+ canActivate: [AuthGuardService],
1214
+ data: ɵ2
1215
+ }
1216
+ ];
1217
+ class DossierRoutingModule {
1218
+ }
1219
+ DossierRoutingModule.decorators = [
1220
+ { type: NgModule, args: [{
1221
+ imports: [
1222
+ CommonModule,
1223
+ RouterModule.forChild(routes),
1224
+ ],
1225
+ exports: [RouterModule]
1226
+ },] }
1191
1227
  ];
1192
1228
 
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
- },] }
1229
+ /*
1230
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1231
+ *
1232
+ * Licensed under EUPL, Version 1.2 (the "License");
1233
+ * you may not use this file except in compliance with the License.
1234
+ * You may obtain a copy of the License at
1235
+ *
1236
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1237
+ *
1238
+ * Unless required by applicable law or agreed to in writing, software
1239
+ * distributed under the License is distributed on an "AS IS" basis,
1240
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1241
+ * See the License for the specific language governing permissions and
1242
+ * limitations under the License.
1243
+ */
1244
+ const ɵ0$1 = HttpLoaderFactory;
1245
+ class DossierModule {
1246
+ static forRoot(tabsFactory) {
1247
+ return {
1248
+ ngModule: DossierModule,
1249
+ providers: [
1250
+ DossierService,
1251
+ TabService,
1252
+ {
1253
+ provide: TAB_MAP,
1254
+ useFactory: tabsFactory
1255
+ },
1256
+ {
1257
+ provide: ANALYZE_FOR_ENTRY_COMPONENTS,
1258
+ useValue: Array.from(tabsFactory().values()),
1259
+ multi: true
1260
+ }
1261
+ ]
1262
+ };
1263
+ }
1264
+ }
1265
+ DossierModule.decorators = [
1266
+ { type: NgModule, args: [{
1267
+ declarations: [
1268
+ DossierListComponent,
1269
+ DossierDetailComponent,
1270
+ DossierDetailTabSummaryComponent,
1271
+ DossierDetailTabProgressComponent,
1272
+ DossierDetailTabAuditComponent,
1273
+ DossierDetailTabDocumentsComponent,
1274
+ DossierDetailTabContactMomentsComponent,
1275
+ DossierUpdateComponent,
1276
+ DossierProcessStartModalComponent,
1277
+ DossierSupportingProcessStartModalComponent
1278
+ ],
1279
+ imports: [
1280
+ CommonModule,
1281
+ DossierRoutingModule,
1282
+ ListModule,
1283
+ WidgetModule,
1284
+ BpmnJsDiagramModule,
1285
+ TimelineModule,
1286
+ CamundaFormModule,
1287
+ ProcessModule,
1288
+ FilterSidebarModule,
1289
+ NgbButtonsModule,
1290
+ DataListModule,
1291
+ FormsModule,
1292
+ FormModule,
1293
+ FormIoModule,
1294
+ ModalModule,
1295
+ SpinnerModule,
1296
+ TranslateModule.forRoot({
1297
+ loader: {
1298
+ provide: TranslateLoader,
1299
+ useFactory: ɵ0$1,
1300
+ deps: [HttpClient]
1301
+ }
1302
+ }),
1303
+ TaskModule,
1304
+ ModalModule,
1305
+ NgbTooltipModule,
1306
+ UploaderModule,
1307
+ DropzoneModule,
1308
+ NgbPaginationModule,
1309
+ ConfigModule
1310
+ ],
1311
+ exports: [
1312
+ DossierListComponent,
1313
+ DossierDetailComponent
1314
+ ],
1315
+ entryComponents: [
1316
+ DossierDetailTabSummaryComponent,
1317
+ DossierDetailTabProgressComponent,
1318
+ DossierDetailTabAuditComponent,
1319
+ DossierDetailTabDocumentsComponent,
1320
+ DossierDetailTabContactMomentsComponent
1321
+ ]
1322
+ },] }
1287
1323
  ];
1288
1324
 
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.
1325
+ /*
1326
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1327
+ *
1328
+ * Licensed under EUPL, Version 1.2 (the "License");
1329
+ * you may not use this file except in compliance with the License.
1330
+ * You may obtain a copy of the License at
1331
+ *
1332
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1333
+ *
1334
+ * Unless required by applicable law or agreed to in writing, software
1335
+ * distributed under the License is distributed on an "AS IS" basis,
1336
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1337
+ * See the License for the specific language governing permissions and
1338
+ * limitations under the License.
1303
1339
  */
1304
1340
 
1305
- /**
1306
- * Generated bundle index. Do not edit.
1341
+ /**
1342
+ * Generated bundle index. Do not edit.
1307
1343
  */
1308
1344
 
1309
1345
  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 };