@valtimo/dossier 4.15.2-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 +1623 -1580
  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 +87 -87
  6. package/esm2015/lib/dossier-detail/tab/audit/audit.component.js +79 -64
  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 +124 -120
  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 +1289 -1236
  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 -15
  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
@@ -1,5 +1,5 @@
1
1
  import { __rest } from 'tslib';
2
- import { Component, ViewEncapsulation, ViewChild, ɵɵdefineInjectable, ɵɵinject, Injectable, ElementRef, Renderer2, InjectionToken, Inject, EventEmitter, Output, ComponentFactoryResolver, ViewContainerRef, NgModule, ANALYZE_FOR_ENTRY_COMPONENTS } from '@angular/core';
2
+ import { Component, ViewEncapsulation, ViewChild, ɵɵdefineInjectable, ɵɵinject, Injectable, ElementRef, Renderer2, EventEmitter, Output, InjectionToken, Inject, ComponentFactoryResolver, ViewContainerRef, NgModule, ANALYZE_FOR_ENTRY_COMPONENTS } from '@angular/core';
3
3
  import { ActivatedRoute, Router, NavigationEnd, RouterModule } from '@angular/router';
4
4
  import { TranslateService, TranslateModule, TranslateLoader } from '@ngx-translate/core';
5
5
  import { DocumentService, DocumentSearchRequestImpl } from '@valtimo/document';
@@ -7,1286 +7,1339 @@ 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';
14
- import { ConfigService } from '@valtimo/config';
14
+ import { ConfigService, ConfigModule } from '@valtimo/config';
15
15
  import { Location, CommonModule } from '@angular/common';
16
16
  import { TaskService, TaskModule } from '@valtimo/task';
17
17
  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
- import { NgbButtonsModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
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.spinnerService.show('auditSpinner');
595
- const snapshot = this.route.snapshot.paramMap;
596
- this.documentId = snapshot.get('documentId') || '';
597
- }
598
- static getTranslationKey(auditEvent) {
599
- const classNameArray = auditEvent.className.split('.');
600
- const eventName = classNameArray[classNameArray.length - 1];
601
- return 'events.' + eventName;
602
- }
603
- ngOnInit() {
604
- this.documentService.getAuditLog(this.documentId).subscribe(page => {
605
- const timelineItems = [];
606
- page.content.forEach(auditRecord => {
607
- const occurredOn = moment$2(auditRecord.metaData.occurredOn);
608
- const fromNow = occurredOn.fromNow();
609
- timelineItems.push(new TimelineItemImpl(occurredOn.format('DD MMM YYYY'), occurredOn.format('HH:mm'), auditRecord.metaData.user, fromNow, DossierDetailTabAuditComponent.getTranslationKey(auditRecord.auditEvent), auditRecord.auditEvent));
610
- });
611
- this.timelineItems = timelineItems;
612
- this.spinnerService.hide('auditSpinner');
613
- });
614
- }
615
- }
616
- DossierDetailTabAuditComponent.decorators = [
617
- { type: Component, args: [{
618
- selector: 'valtimo-dossier-detail-tab-audit',
619
- 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",
620
- styles: [""]
621
- },] }
622
- ];
623
- DossierDetailTabAuditComponent.ctorParameters = () => [
624
- { type: ActivatedRoute },
625
- { type: DocumentService },
626
- { type: NgxSpinnerService }
627
- ];
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
+ };
628
643
 
629
- /*
630
- * Copyright 2015-2020 Ritense BV, the Netherlands.
631
- *
632
- * Licensed under EUPL, Version 1.2 (the "License");
633
- * you may not use this file except in compliance with the License.
634
- * You may obtain a copy of the License at
635
- *
636
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
637
- *
638
- * Unless required by applicable law or agreed to in writing, software
639
- * distributed under the License is distributed on an "AS IS" basis,
640
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
641
- * See the License for the specific language governing permissions and
642
- * limitations under the License.
643
- */
644
- class DossierDetailTabDocumentsComponent {
645
- constructor(route, documentService, toastrService, uploadProviderService, downloadService) {
646
- this.route = route;
647
- this.documentService = documentService;
648
- this.toastrService = toastrService;
649
- this.uploadProviderService = uploadProviderService;
650
- this.downloadService = downloadService;
651
- this.relatedFiles = [];
652
- this.fields = [
653
- { key: 'fileName', label: 'File name' },
654
- { key: 'sizeInBytes', label: 'Size in bytes' },
655
- { key: 'createdOn', label: 'Created on', viewType: 'date' },
656
- { key: 'createdBy', label: 'Created by' }
657
- ];
658
- this.actions = [
659
- {
660
- columnName: '',
661
- iconClass: 'fas fa-external-link-alt',
662
- callback: this.downloadDocument.bind(this)
663
- },
664
- {
665
- columnName: '',
666
- iconClass: 'fas fa-trash-alt',
667
- callback: this.removeRelatedFile.bind(this)
668
- }
669
- ];
670
- this.uploading$ = new BehaviorSubject(false);
671
- const snapshot = this.route.snapshot.paramMap;
672
- this.documentId = snapshot.get('documentId') || '';
673
- this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
674
- }
675
- ngOnInit() {
676
- this.loadDocuments();
677
- }
678
- fileSelected(file) {
679
- this.uploading$.next(true);
680
- this.uploadProviderService.uploadFile(file, this.documentDefinitionName).pipe(switchMap((resourceFile) => this.documentService.assignResource(this.documentId, resourceFile.data.resourceId))).subscribe(() => {
681
- this.toastrService.success('Successfully uploaded document to dossier');
682
- this.loadDocuments();
683
- this.uploading$.next(false);
684
- }, () => {
685
- this.toastrService.error('Failed to upload document to dossier');
686
- this.uploading$.next(false);
687
- });
688
- }
689
- loadDocuments() {
690
- this.documentService.getDocument(this.documentId).subscribe((document) => {
691
- this.relatedFiles = document.relatedFiles;
692
- });
693
- }
694
- downloadDocument(relatedFile) {
695
- this.uploadProviderService.getResource(relatedFile.fileId).subscribe((resource) => {
696
- this.downloadService.downloadFile(resource.url, resource.resource.name);
697
- });
698
- }
699
- removeRelatedFile(relatedFile) {
700
- this.documentService.removeResource(this.documentId, relatedFile.fileId).subscribe(() => {
701
- this.toastrService.success('Successfully removed document from dossier');
702
- this.loadDocuments();
703
- }, () => {
704
- this.toastrService.error('Failed to remove document from dossier');
705
- });
706
- }
707
- }
708
- DossierDetailTabDocumentsComponent.decorators = [
709
- { type: Component, args: [{
710
- selector: 'valtimo-dossier-detail-tab-documents',
711
- 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",
712
- styles: [""]
713
- },] }
714
- ];
715
- DossierDetailTabDocumentsComponent.ctorParameters = () => [
716
- { type: ActivatedRoute },
717
- { type: DocumentService },
718
- { type: ToastrService },
719
- { type: UploadProviderService },
720
- { 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 }
721
736
  ];
722
737
 
723
- /*
724
- * Copyright 2015-2020 Ritense BV, the Netherlands.
725
- *
726
- * Licensed under EUPL, Version 1.2 (the "License");
727
- * you may not use this file except in compliance with the License.
728
- * You may obtain a copy of the License at
729
- *
730
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
731
- *
732
- * Unless required by applicable law or agreed to in writing, software
733
- * distributed under the License is distributed on an "AS IS" basis,
734
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
735
- * See the License for the specific language governing permissions and
736
- * limitations under the License.
737
- */
738
- const TAB_MAP = new InjectionToken('TabMap');
739
- const DEFAULT_TABS = new Map([
740
- [DefaultTabs.summary, DossierDetailTabSummaryComponent],
741
- [DefaultTabs.progress, DossierDetailTabProgressComponent],
742
- [DefaultTabs.audit, DossierDetailTabAuditComponent],
743
- [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]
744
759
  ]);
745
760
 
746
- /*
747
- * Copyright 2015-2020 Ritense BV, the Netherlands.
748
- *
749
- * Licensed under EUPL, Version 1.2 (the "License");
750
- * you may not use this file except in compliance with the License.
751
- * You may obtain a copy of the License at
752
- *
753
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
754
- *
755
- * Unless required by applicable law or agreed to in writing, software
756
- * distributed under the License is distributed on an "AS IS" basis,
757
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
758
- * See the License for the specific language governing permissions and
759
- * limitations under the License.
760
- */
761
- class TabService {
762
- constructor(tabMap = DEFAULT_TABS) {
763
- this.tabs = [];
764
- this.tabMap = tabMap;
765
- let i = 0;
766
- this.tabMap.forEach((component, name, map) => {
767
- this.tabs.push(new TabImpl(name, i, component));
768
- i++;
769
- });
770
- }
771
- getTabs() {
772
- return this.tabs;
773
- }
774
- }
775
- TabService.ɵprov = ɵɵdefineInjectable({ factory: function TabService_Factory() { return new TabService(ɵɵinject(TAB_MAP)); }, token: TabService, providedIn: "root" });
776
- TabService.decorators = [
777
- { type: Injectable, args: [{
778
- providedIn: 'root'
779
- },] }
780
- ];
781
- TabService.ctorParameters = () => [
782
- { 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,] }] }
783
798
  ];
784
799
 
785
- /*
786
- * Copyright 2015-2020 Ritense BV, the Netherlands.
787
- *
788
- * Licensed under EUPL, Version 1.2 (the "License");
789
- * you may not use this file except in compliance with the License.
790
- * You may obtain a copy of the License at
791
- *
792
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
793
- *
794
- * Unless required by applicable law or agreed to in writing, software
795
- * distributed under the License is distributed on an "AS IS" basis,
796
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
797
- * See the License for the specific language governing permissions and
798
- * limitations under the License.
799
- */
800
- class DossierSupportingProcessStartModalComponent {
801
- constructor(route, router, processService, documentService, formLinkService, logger) {
802
- this.route = route;
803
- this.router = router;
804
- this.processService = processService;
805
- this.documentService = documentService;
806
- this.formLinkService = formLinkService;
807
- this.logger = logger;
808
- this.formSubmit = new EventEmitter();
809
- }
810
- loadFormDefinition() {
811
- this.formDefinition = null;
812
- this.formLinkService.getStartEventFormDefinitionByProcessDefinitionKey(this.processDefinitionKey)
813
- .subscribe(formDefinition => {
814
- this.formAssociation = formDefinition.formAssociation;
815
- const className = this.formAssociation.formLink.className.split('.');
816
- const linkType = className[className.length - 1];
817
- switch (linkType) {
818
- case 'BpmnElementFormIdLink':
819
- this.formDefinition = formDefinition;
820
- this.documentService.getDocument(this.documentId).subscribe(document => {
821
- this.submission = {
822
- data: document.content
823
- };
824
- }, () => noop());
825
- this.modal.show();
826
- break;
827
- case 'BpmnElementUrlLink':
828
- const url = this.router.serializeUrl(this.router.createUrlTree([formDefinition.formAssociation.formLink.url]));
829
- window.open(url, '_blank');
830
- break;
831
- case 'BpmnElementAngularStateUrlLink':
832
- this.router.navigate([formDefinition.formAssociation.formLink.url]);
833
- break;
834
- default:
835
- this.logger.fatal('Unsupported class name');
836
- }
837
- }, errors => {
838
- this.modal.show();
839
- });
840
- }
841
- get modalTitle() {
842
- return `Start - ${this.processName}`;
843
- }
844
- openModal(processDocumentDefinition, documentId) {
845
- this.documentId = documentId;
846
- this.documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
847
- this.processDefinitionKey = processDocumentDefinition.id.processDefinitionKey;
848
- this.processName = processDocumentDefinition.processName;
849
- this.options = new FormioOptionsImpl();
850
- this.options.disableAlerts = true;
851
- const formioBeforeSubmit = function (submission, callback) {
852
- callback(null, submission);
853
- };
854
- this.options.setHooks(formioBeforeSubmit);
855
- this.loadFormDefinition();
856
- }
857
- onSubmit(submission) {
858
- this.formioSubmission = submission;
859
- this.formLinkService.onSubmit(this.processDefinitionKey, this.formAssociation.formLink.id, submission.data, this.documentId).subscribe((formSubmissionResult) => {
860
- this.modal.hide();
861
- this.formSubmit.emit();
862
- }, errors => {
863
- this.form.showErrors(errors);
864
- });
865
- }
866
- gotoFormLinkScreen() {
867
- this.modal.hide();
868
- this.router.navigate(['form-links'], { queryParams: { process: this.processDefinitionKey } });
869
- }
870
- }
871
- DossierSupportingProcessStartModalComponent.decorators = [
872
- { type: Component, args: [{
873
- selector: 'valtimo-dossier-supporting-process-start-modal',
874
- 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",
875
- encapsulation: ViewEncapsulation.None,
876
- 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}"]
877
- },] }
878
- ];
879
- DossierSupportingProcessStartModalComponent.ctorParameters = () => [
880
- { type: ActivatedRoute },
881
- { type: Router },
882
- { type: ProcessService },
883
- { type: DocumentService },
884
- { type: FormLinkService },
885
- { type: NGXLogger }
886
- ];
887
- DossierSupportingProcessStartModalComponent.propDecorators = {
888
- form: [{ type: ViewChild, args: ['form', { static: false },] }],
889
- modal: [{ type: ViewChild, args: ['supportingProcessStartModal', { static: false },] }],
890
- 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 }]
891
906
  };
892
907
 
893
- /*
894
- * Copyright 2015-2020 Ritense BV, the Netherlands.
895
- *
896
- * Licensed under EUPL, Version 1.2 (the "License");
897
- * you may not use this file except in compliance with the License.
898
- * You may obtain a copy of the License at
899
- *
900
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
901
- *
902
- * Unless required by applicable law or agreed to in writing, software
903
- * distributed under the License is distributed on an "AS IS" basis,
904
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
905
- * See the License for the specific language governing permissions and
906
- * limitations under the License.
907
- */
908
- class DossierDetailComponent {
909
- constructor(componentFactoryResolver, translateService, documentService, processService, route, router, location, tabService) {
910
- this.componentFactoryResolver = componentFactoryResolver;
911
- this.translateService = translateService;
912
- this.documentService = documentService;
913
- this.processService = processService;
914
- this.route = route;
915
- this.router = router;
916
- this.location = location;
917
- this.tabService = tabService;
918
- this.document = null;
919
- this.tabLoader = null;
920
- this.processDefinitionListFields = [];
921
- this.processDocumentDefinitions = [];
922
- this.snapshot = this.route.snapshot.paramMap;
923
- this.documentDefinitionName = this.snapshot.get('documentDefinitionName') || '';
924
- this.documentId = this.snapshot.get('documentId') || '';
925
- }
926
- ngOnInit() {
927
- this.tabLoader = new TabLoaderImpl(this.tabService.getTabs(), this.componentFactoryResolver, this.viewContainerRef, this.translateService, this.router, this.location);
928
- this.documentService.getDocumentDefinition(this.documentDefinitionName).subscribe(definition => {
929
- this.documentDefinitionNameTitle = definition.schema.title;
930
- });
931
- this.initialTabName = this.snapshot.get('tab');
932
- this.tabLoader.initial(this.initialTabName);
933
- this.getAllAssociatedProcessDefinitions();
934
- }
935
- getAllAssociatedProcessDefinitions() {
936
- this.documentService.findProcessDocumentDefinitions(this.documentDefinitionName).subscribe(processDocumentDefinitions => {
937
- this.processDocumentDefinitions = processDocumentDefinitions
938
- .filter(processDocumentDefinition => processDocumentDefinition.startableByUser);
939
- this.processDefinitionListFields = [{
940
- key: 'processName',
941
- label: 'Proces'
942
- }];
943
- });
944
- }
945
- startProcess(processDocumentDefinition) {
946
- this.supportingProcessStart.openModal(processDocumentDefinition, this.documentId);
947
- }
948
- }
949
- DossierDetailComponent.decorators = [
950
- { type: Component, args: [{
951
- selector: 'valtimo-dossier-detail',
952
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div class=\"card-header bg-light card-header-divider pb-5\">\n {{ documentDefinitionNameTitle }}\n <div class=\"float-right\">\n <div class=\"dropdown\">\n <button class=\"btn btn-primary dropdown-toggle\" type=\"button\"\n id=\"startProcessDropdown\" placement=\"bottom\"\n [ngbTooltip]=\"processDocumentDefinitions.length === 0 ? 'No action' : null\"\n [disabled]=\"processDocumentDefinitions.length === 0\"\n data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <span>Start</span>\n <i class=\"pl-2 fas fa-caret-down\"></i>\n </button>\n <div class=\"dropdown-menu dropdown-menu-right\" aria-labelledby=\"startProcessDropdown\">\n <button *ngFor=\"let processDocumentDefinition of processDocumentDefinitions\" class=\"dropdown-item p\"\n href=\"#\"\n (click)=\"startProcess(processDocumentDefinition)\">{{processDocumentDefinition.processName}}</button>\n </div>\n </div>\n </div>\n </div>\n <ul class=\"nav nav-tabs\">\n <li class=\"nav-item\" *ngFor=\"let tab of tabLoader.tabs\">\n <a id=\"{{ tab.name }}-tab\" class=\"nav-link clickable\"\n [ngClass]=\"{'active' : tab.isActive()}\"\n data-toggle=\"tab\"\n (click)=\"tabLoader.load(tab)\">\n {{ tabLoader.translateTabName(tab) }}\n </a>\n </li>\n </ul>\n <div class=\"card-body bg-white p-5 position-relative tab-container\">\n <ng-template #tabContainer>Loading...</ng-template>\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </div>\n <valtimo-dossier-supporting-process-start-modal (formSubmit)=\"tabLoader.refreshView()\"\n #supportingProcessStartModal></valtimo-dossier-supporting-process-start-modal>\n </div>\n</div>\n",
953
- styles: [".tab-container{min-height:300px}"]
954
- },] }
955
- ];
956
- DossierDetailComponent.ctorParameters = () => [
957
- { type: ComponentFactoryResolver },
958
- { type: TranslateService },
959
- { type: DocumentService },
960
- { type: ProcessService },
961
- { type: ActivatedRoute },
962
- { type: Router },
963
- { type: Location },
964
- { type: TabService }
965
- ];
966
- DossierDetailComponent.propDecorators = {
967
- viewContainerRef: [{ type: ViewChild, args: ['tabContainer', { read: ViewContainerRef, static: true },] }],
968
- 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',] }]
969
984
  };
970
985
 
971
- /*
972
- * Copyright 2015-2021 Ritense BV, the Netherlands.
973
- *
974
- * Licensed under EUPL, Version 1.2 (the "License");
975
- * you may not use this file except in compliance with the License.
976
- * You may obtain a copy of the License at
977
- *
978
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
979
- *
980
- * Unless required by applicable law or agreed to in writing, software
981
- * distributed under the License is distributed on an "AS IS" basis,
982
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
983
- * See the License for the specific language governing permissions and
984
- * limitations under the License.
985
- */
986
- const moment$3 = moment_;
987
- moment$3.locale(localStorage.getItem('langKey') || '');
988
- class DossierDetailTabContactMomentsComponent {
989
- constructor(contactMomentService) {
990
- this.contactMomentService = contactMomentService;
991
- this.contactMoments = [];
992
- }
993
- ngOnInit() {
994
- this.loadContactMoments();
995
- }
996
- loadContactMoments() {
997
- this.contactMomentService.getContactMoments().subscribe(contactMoments => this.handleContactMomentsResult(contactMoments));
998
- }
999
- handleContactMomentsResult(contactMoments) {
1000
- this.contactMoments = contactMoments.map(contactMoment => {
1001
- const registratieDatum = moment$3(contactMoment.registratiedatum);
1002
- return new TimelineItemImpl(registratieDatum.format('DD MMM YYYY'), registratieDatum.format('HH:mm'), contactMoment.medewerkerIdentificatie.achternaam, contactMoment.kanaal, contactMoment.tekst, null);
1003
- });
1004
- }
1005
- }
1006
- DossierDetailTabContactMomentsComponent.decorators = [
1007
- { type: Component, args: [{
1008
- selector: 'valtimo-dossier-detail-tab-contact-moments',
1009
- 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",
1010
- 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 */"]
1011
- },] }
1012
- ];
1013
- DossierDetailTabContactMomentsComponent.ctorParameters = () => [
1014
- { type: ContactMomentService }
1015
- ];
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
+ };
1016
1067
 
1017
- /*
1018
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1019
- *
1020
- * Licensed under EUPL, Version 1.2 (the "License");
1021
- * you may not use this file except in compliance with the License.
1022
- * You may obtain a copy of the License at
1023
- *
1024
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1025
- *
1026
- * Unless required by applicable law or agreed to in writing, software
1027
- * distributed under the License is distributed on an "AS IS" basis,
1028
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1029
- * See the License for the specific language governing permissions and
1030
- * limitations under the License.
1031
- */
1032
- const moment$4 = moment_;
1033
- moment$4.locale(localStorage.getItem('langKey') || '');
1034
- class DossierUpdateComponent {
1035
- constructor(taskService, documentService, route, toastr, location, dossierService) {
1036
- this.taskService = taskService;
1037
- this.documentService = documentService;
1038
- this.route = route;
1039
- this.toastr = toastr;
1040
- this.location = location;
1041
- this.customDefinitions = {};
1042
- const snapshot = this.route.snapshot.paramMap;
1043
- this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
1044
- this.documentId = snapshot.get('documentId') || '';
1045
- this.taskId = snapshot.get('taskId') || '';
1046
- this.implementationDefinitions = dossierService.getImplementationEnvironmentDefinitions(this.documentDefinitionName);
1047
- this.loadDocumentDefinition(this.documentDefinitionName);
1048
- this.loadDocument(this.documentId);
1049
- }
1050
- ngOnInit() {
1051
- this.getTask(this.taskId);
1052
- if (this.implementationDefinitions.definitions.detail.summary) {
1053
- this.customDefinitions = this.implementationDefinitions.definitions.detail.summary;
1054
- }
1055
- }
1056
- loadDocumentDefinition(name) {
1057
- this.documentService.getDocumentDefinition(name).subscribe(definition => {
1058
- this.schema = definition.schema;
1059
- });
1060
- }
1061
- loadDocument(id) {
1062
- this.documentService.getDocument(id).subscribe(document => {
1063
- this.document = document;
1064
- });
1065
- }
1066
- getTask(id) {
1067
- this.taskService.getTask(id).subscribe(task => {
1068
- this.task = task;
1069
- this.task.task.created = moment$4(this.task.task.created).format('DD MMM YYYY HH:mm');
1070
- this.page = {
1071
- title: this.task.task.name,
1072
- subtitle: `Created ${moment$4(this.task.task.created).fromNow()}`
1073
- };
1074
- });
1075
- }
1076
- reset() {
1077
- this.loadDocument(this.documentId);
1078
- }
1079
- back() {
1080
- this.location.back();
1081
- }
1082
- save() {
1083
- const document = {
1084
- documentId: this.document.id,
1085
- content: this.document.content,
1086
- versionBasedOn: this.document.version
1087
- };
1088
- this.documentService.modifyDocument(document).subscribe(result => {
1089
- this.document = result.document;
1090
- this.toastr.success('Document aangepast');
1091
- this.location.back();
1092
- });
1093
- }
1094
- submit(data) {
1095
- // merge document content with formdata
1096
- const mergedData = Object.assign({}, this.document.content, data);
1097
- const documentData = {
1098
- request: {
1099
- documentId: this.document.id,
1100
- content: mergedData,
1101
- versionBasedOn: this.document.version
1102
- },
1103
- taskId: this.task.task.id
1104
- };
1105
- this.documentService.modifyDocumentAndCompleteTask(documentData).subscribe(result => {
1106
- this.toastr.success(this.task.task.name + ' has successfully been completed');
1107
- this.location.back();
1108
- });
1109
- }
1110
- returnZero() {
1111
- return 0;
1112
- }
1113
- }
1114
- DossierUpdateComponent.decorators = [
1115
- { type: Component, args: [{
1116
- selector: 'valtimo-dossier-update',
1117
- 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",
1118
- styles: [""]
1119
- },] }
1120
- ];
1121
- DossierUpdateComponent.ctorParameters = () => [
1122
- { type: TaskService },
1123
- { type: DocumentService },
1124
- { type: ActivatedRoute },
1125
- { type: ToastrService },
1126
- { type: Location },
1127
- { 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 }
1128
1179
  ];
1129
1180
 
1130
- /*
1131
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1132
- *
1133
- * Licensed under EUPL, Version 1.2 (the "License");
1134
- * you may not use this file except in compliance with the License.
1135
- * You may obtain a copy of the License at
1136
- *
1137
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1138
- *
1139
- * Unless required by applicable law or agreed to in writing, software
1140
- * distributed under the License is distributed on an "AS IS" basis,
1141
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1142
- * See the License for the specific language governing permissions and
1143
- * limitations under the License.
1144
- */
1145
- 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] };
1146
- const routes = [
1147
- {
1148
- path: 'dossiers/:documentDefinitionName',
1149
- component: DossierListComponent,
1150
- canActivate: [AuthGuardService],
1151
- data: ɵ0
1152
- },
1153
- {
1154
- path: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
1155
- component: DossierDetailComponent,
1156
- canActivate: [AuthGuardService],
1157
- data: ɵ1
1158
- },
1159
- {
1160
- path: 'dossiers/:documentDefinitionName/document/:documentId/:tab/tasks/:taskId',
1161
- component: DossierUpdateComponent,
1162
- canActivate: [AuthGuardService],
1163
- data: ɵ2
1164
- }
1165
- ];
1166
- class DossierRoutingModule {
1167
- }
1168
- DossierRoutingModule.decorators = [
1169
- { type: NgModule, args: [{
1170
- imports: [
1171
- CommonModule,
1172
- RouterModule.forChild(routes),
1173
- ],
1174
- exports: [RouterModule]
1175
- },] }
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
+ },] }
1176
1227
  ];
1177
1228
 
1178
- /*
1179
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1180
- *
1181
- * Licensed under EUPL, Version 1.2 (the "License");
1182
- * you may not use this file except in compliance with the License.
1183
- * You may obtain a copy of the License at
1184
- *
1185
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1186
- *
1187
- * Unless required by applicable law or agreed to in writing, software
1188
- * distributed under the License is distributed on an "AS IS" basis,
1189
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1190
- * See the License for the specific language governing permissions and
1191
- * limitations under the License.
1192
- */
1193
- const ɵ0$1 = HttpLoaderFactory;
1194
- class DossierModule {
1195
- static forRoot(tabsFactory) {
1196
- return {
1197
- ngModule: DossierModule,
1198
- providers: [
1199
- DossierService,
1200
- TabService,
1201
- {
1202
- provide: TAB_MAP,
1203
- useFactory: tabsFactory
1204
- },
1205
- {
1206
- provide: ANALYZE_FOR_ENTRY_COMPONENTS,
1207
- useValue: Array.from(tabsFactory().values()),
1208
- multi: true
1209
- }
1210
- ]
1211
- };
1212
- }
1213
- }
1214
- DossierModule.decorators = [
1215
- { type: NgModule, args: [{
1216
- declarations: [
1217
- DossierListComponent,
1218
- DossierDetailComponent,
1219
- DossierDetailTabSummaryComponent,
1220
- DossierDetailTabProgressComponent,
1221
- DossierDetailTabAuditComponent,
1222
- DossierDetailTabDocumentsComponent,
1223
- DossierDetailTabContactMomentsComponent,
1224
- DossierUpdateComponent,
1225
- DossierProcessStartModalComponent,
1226
- DossierSupportingProcessStartModalComponent
1227
- ],
1228
- imports: [
1229
- CommonModule,
1230
- DossierRoutingModule,
1231
- ListModule,
1232
- WidgetModule,
1233
- BpmnJsDiagramModule,
1234
- TimelineModule,
1235
- CamundaFormModule,
1236
- ProcessModule,
1237
- FilterSidebarModule,
1238
- NgbButtonsModule,
1239
- DataListModule,
1240
- FormsModule,
1241
- FormModule,
1242
- FormIoModule,
1243
- ModalModule,
1244
- SpinnerModule,
1245
- TranslateModule.forRoot({
1246
- loader: {
1247
- provide: TranslateLoader,
1248
- useFactory: ɵ0$1,
1249
- deps: [HttpClient]
1250
- }
1251
- }),
1252
- TaskModule,
1253
- ModalModule,
1254
- NgbTooltipModule,
1255
- UploaderModule,
1256
- DropzoneModule
1257
- ],
1258
- exports: [
1259
- DossierListComponent,
1260
- DossierDetailComponent
1261
- ],
1262
- entryComponents: [
1263
- DossierDetailTabSummaryComponent,
1264
- DossierDetailTabProgressComponent,
1265
- DossierDetailTabAuditComponent,
1266
- DossierDetailTabDocumentsComponent,
1267
- DossierDetailTabContactMomentsComponent
1268
- ]
1269
- },] }
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
+ },] }
1270
1323
  ];
1271
1324
 
1272
- /*
1273
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1274
- *
1275
- * Licensed under EUPL, Version 1.2 (the "License");
1276
- * you may not use this file except in compliance with the License.
1277
- * You may obtain a copy of the License at
1278
- *
1279
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1280
- *
1281
- * Unless required by applicable law or agreed to in writing, software
1282
- * distributed under the License is distributed on an "AS IS" basis,
1283
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1284
- * See the License for the specific language governing permissions and
1285
- * 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.
1286
1339
  */
1287
1340
 
1288
- /**
1289
- * Generated bundle index. Do not edit.
1341
+ /**
1342
+ * Generated bundle index. Do not edit.
1290
1343
  */
1291
1344
 
1292
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 };