@valtimo/dossier-management 4.23.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/esm2020/lib/dossier-management-connect-modal/dossier-management-connect-modal.component.mjs +92 -0
  2. package/esm2020/lib/dossier-management-detail/dossier-management-detail.component.mjs +102 -0
  3. package/esm2020/lib/dossier-management-list/dossier-management-list.component.mjs +76 -0
  4. package/esm2020/lib/dossier-management-remove-modal/dossier-management-remove-modal.component.mjs +57 -0
  5. package/esm2020/lib/dossier-management-roles/dossier-management-roles.component.mjs +97 -0
  6. package/esm2020/lib/dossier-management-routing.module.mjs +51 -0
  7. package/esm2020/lib/dossier-management-upload/dossier-management-upload.component.mjs +157 -0
  8. package/esm2020/lib/dossier-management.module.mjs +90 -0
  9. package/esm2020/public-api.mjs +21 -0
  10. package/esm2020/valtimo-dossier-management.mjs +5 -0
  11. package/fesm2015/valtimo-dossier-management.mjs +691 -0
  12. package/fesm2015/valtimo-dossier-management.mjs.map +1 -0
  13. package/fesm2020/valtimo-dossier-management.mjs +691 -0
  14. package/fesm2020/valtimo-dossier-management.mjs.map +1 -0
  15. package/lib/dossier-management-connect-modal/dossier-management-connect-modal.component.d.ts +4 -0
  16. package/lib/dossier-management-connect-modal/dossier-management-connect-modal.component.d.ts.map +1 -0
  17. package/lib/dossier-management-detail/dossier-management-detail.component.d.ts +4 -0
  18. package/lib/dossier-management-detail/dossier-management-detail.component.d.ts.map +1 -0
  19. package/lib/dossier-management-list/dossier-management-list.component.d.ts +4 -0
  20. package/lib/dossier-management-list/dossier-management-list.component.d.ts.map +1 -0
  21. package/lib/dossier-management-remove-modal/dossier-management-remove-modal.component.d.ts +4 -0
  22. package/lib/dossier-management-remove-modal/dossier-management-remove-modal.component.d.ts.map +1 -0
  23. package/lib/dossier-management-roles/dossier-management-roles.component.d.ts +5 -1
  24. package/lib/dossier-management-roles/dossier-management-roles.component.d.ts.map +1 -0
  25. package/lib/dossier-management-routing.module.d.ts +6 -0
  26. package/lib/dossier-management-routing.module.d.ts.map +1 -0
  27. package/lib/dossier-management-upload/dossier-management-upload.component.d.ts +4 -0
  28. package/lib/dossier-management-upload/dossier-management-upload.component.d.ts.map +1 -0
  29. package/lib/dossier-management.module.d.ts +18 -0
  30. package/lib/dossier-management.module.d.ts.map +1 -0
  31. package/package.json +22 -10
  32. package/public-api.d.ts +1 -0
  33. package/public-api.d.ts.map +1 -0
  34. package/valtimo-dossier-management.d.ts +2 -6
  35. package/valtimo-dossier-management.d.ts.map +1 -0
  36. package/bundles/valtimo-dossier-management.umd.js +0 -708
  37. package/bundles/valtimo-dossier-management.umd.js.map +0 -1
  38. package/bundles/valtimo-dossier-management.umd.min.js +0 -2
  39. package/bundles/valtimo-dossier-management.umd.min.js.map +0 -1
  40. package/esm2015/lib/dossier-management-connect-modal/dossier-management-connect-modal.component.js +0 -92
  41. package/esm2015/lib/dossier-management-detail/dossier-management-detail.component.js +0 -99
  42. package/esm2015/lib/dossier-management-list/dossier-management-list.component.js +0 -78
  43. package/esm2015/lib/dossier-management-remove-modal/dossier-management-remove-modal.component.js +0 -63
  44. package/esm2015/lib/dossier-management-roles/dossier-management-roles.component.js +0 -103
  45. package/esm2015/lib/dossier-management-routing.module.js +0 -47
  46. package/esm2015/lib/dossier-management-upload/dossier-management-upload.component.js +0 -158
  47. package/esm2015/lib/dossier-management.module.js +0 -59
  48. package/esm2015/public-api.js +0 -21
  49. package/esm2015/valtimo-dossier-management.js +0 -11
  50. package/fesm2015/valtimo-dossier-management.js +0 -682
  51. package/fesm2015/valtimo-dossier-management.js.map +0 -1
  52. package/valtimo-dossier-management.metadata.json +0 -1
@@ -1,682 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { EventEmitter, Component, Output, ViewChild, Input, NgModule } from '@angular/core';
3
- import { FormsModule } from '@angular/forms';
4
- import { TranslateService, TranslateModule } from '@ngx-translate/core';
5
- import { MenuService, AlertService, WidgetModule, DropzoneModule, ListModule, ModalModule, MultiselectDropdownModule } from '@valtimo/components';
6
- import { ROLE_ADMIN, ConfigModule, ExtensionComponent } from '@valtimo/config';
7
- import { DocumentService, DocumentDefinitionCreateRequest } from '@valtimo/document';
8
- import { ProcessService } from '@valtimo/process';
9
- import { ToastrService } from 'ngx-toastr';
10
- import { Router, ActivatedRoute, RouterModule } from '@angular/router';
11
- import { BehaviorSubject, Subject } from 'rxjs';
12
- import { AuthorityService } from '@valtimo/authority';
13
- import { isEqual } from 'lodash';
14
- import * as moment_ from 'moment';
15
- import { AuthGuardService } from '@valtimo/security';
16
- import { switchMap, tap, take } from 'rxjs/operators';
17
- import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
18
-
19
- /*
20
- * Copyright 2015-2020 Ritense BV, the Netherlands.
21
- *
22
- * Licensed under EUPL, Version 1.2 (the "License");
23
- * you may not use this file except in compliance with the License.
24
- * You may obtain a copy of the License at
25
- *
26
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
27
- *
28
- * Unless required by applicable law or agreed to in writing, software
29
- * distributed under the License is distributed on an "AS IS" basis,
30
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
- * See the License for the specific language governing permissions and
32
- * limitations under the License.
33
- */
34
- class DossierManagementConnectModalComponent {
35
- constructor(processService, documentService, toasterService) {
36
- this.processService = processService;
37
- this.documentService = documentService;
38
- this.toasterService = toasterService;
39
- this.documentDefinition = null;
40
- this.newDocumentProcessDefinition = null;
41
- this.newDocumentProcessDefinitionInit = true;
42
- this.newDocumentProcessDefinitionStartableByUser = false;
43
- this.processDocumentDefinitionExists = {};
44
- this.reloadProcessDocumentDefinitions = new EventEmitter();
45
- }
46
- loadProcessDocumentDefinitions() {
47
- this.processDocumentDefinitionExists = {};
48
- this.documentService
49
- .findProcessDocumentDefinitions(this.documentDefinition.id.name)
50
- .subscribe((processDocumentDefinitions) => {
51
- processDocumentDefinitions.forEach((processDocumentDefinition) => {
52
- this.processDocumentDefinitionExists[processDocumentDefinition.id.processDefinitionKey] = true;
53
- });
54
- });
55
- }
56
- loadProcessDefinitions() {
57
- this.processService
58
- .getProcessDefinitions()
59
- .subscribe((processDefinitions) => {
60
- this.processDefinitions = processDefinitions;
61
- });
62
- }
63
- ngOnInit() {
64
- this.loadProcessDefinitions();
65
- }
66
- openModal(dossier) {
67
- this.documentDefinition = dossier;
68
- this.newDocumentProcessDefinition = null;
69
- this.newDocumentProcessDefinitionInit = true;
70
- this.newDocumentProcessDefinitionStartableByUser = false;
71
- this.loadProcessDocumentDefinitions();
72
- this.modal.show();
73
- }
74
- submit() {
75
- const request = {
76
- canInitializeDocument: this.newDocumentProcessDefinitionInit,
77
- startableByUser: this.newDocumentProcessDefinitionStartableByUser,
78
- documentDefinitionName: this.documentDefinition.id.name,
79
- processDefinitionKey: this.newDocumentProcessDefinition.key,
80
- };
81
- this.documentService.createProcessDocumentDefinition(request).subscribe(() => {
82
- this.toasterService.success('Successfully added new process document definition');
83
- this.reloadProcessDocumentDefinitions.emit();
84
- }, err => {
85
- this.toasterService.error('Failed to add new process document definition');
86
- });
87
- }
88
- }
89
- DossierManagementConnectModalComponent.decorators = [
90
- { type: Component, args: [{
91
- selector: 'valtimo-dossier-management-connect-modal',
92
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #dossierConnectModal\n elementId=\"dossierConnectModal\"\n [title]=\"documentDefinition ? documentDefinition.schema.title : 'Document definition'\"\n subtitle=\"Connect document definition to process definition\"\n showFooter=\"true\"\n>\n <div body *ngIf=\"documentDefinition\">\n <p>\n {{ 'Select process definition for document definition' | translate }}\n <strong>{{ documentDefinition.id.name }} *</strong>\n </p>\n <div class=\"input-group mb-3 align-items-center\">\n <select class=\"form-control\" [(ngModel)]=\"newDocumentProcessDefinition\">\n <option [ngValue]=\"null\">{{ 'dossierManagement.selectProcessDef' | translate }}</option>\n <option\n *ngFor=\"let processDefinition of processDefinitions\"\n [disabled]=\"processDocumentDefinitionExists[processDefinition.key]\"\n [ngValue]=\"processDefinition\"\n >\n {{ processDefinition.name }} ({{ processDefinition.key }})\n </option>\n </select>\n </div>\n <p>\n {{ 'Select options for the selected process' | translate }}\n </p>\n <div class=\"input-group mb-3 align-items-center\">\n <label\n class=\"custom-control custom-checkbox custom-control-inline pl-6 mb-0\"\n placement=\"bottom\"\n ngbTooltip=\"{{ 'processCaseConnection.processCreatesCaseTooltip' | translate }}\"\n >\n <input\n class=\"custom-control-input\"\n type=\"checkbox\"\n [(ngModel)]=\"newDocumentProcessDefinitionInit\"\n /><span class=\"custom-control-label custom-control-color\">{{\n 'processCaseConnection.processCreatesCase' | translate\n }}</span>\n </label>\n <label\n class=\"custom-control custom-checkbox custom-control-inline ml-2 pl-6 mb-0\"\n placement=\"bottom\"\n ngbTooltip=\"{{ 'processCaseConnection.startableWithinCaseTooltip' | translate }}\"\n >\n <input\n class=\"custom-control-input\"\n type=\"checkbox\"\n [(ngModel)]=\"newDocumentProcessDefinitionStartableByUser\"\n /><span class=\"custom-control-label custom-control-color\">{{\n 'processCaseConnection.startableWithinCase' | translate\n }}</span>\n </label>\n </div>\n </div>\n <div footer>\n <button\n (click)=\"submit()\"\n class=\"btn btn-primary\"\n data-dismiss=\"modal\"\n [disabled]=\"!newDocumentProcessDefinition\"\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n</valtimo-modal>\n",
93
- 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 */"]
94
- },] }
95
- ];
96
- DossierManagementConnectModalComponent.ctorParameters = () => [
97
- { type: ProcessService },
98
- { type: DocumentService },
99
- { type: ToastrService }
100
- ];
101
- DossierManagementConnectModalComponent.propDecorators = {
102
- reloadProcessDocumentDefinitions: [{ type: Output }],
103
- modal: [{ type: ViewChild, args: ['dossierConnectModal',] }]
104
- };
105
-
106
- /*
107
- * Copyright 2015-2020 Ritense BV, the Netherlands.
108
- *
109
- * Licensed under EUPL, Version 1.2 (the "License");
110
- * you may not use this file except in compliance with the License.
111
- * You may obtain a copy of the License at
112
- *
113
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
114
- *
115
- * Unless required by applicable law or agreed to in writing, software
116
- * distributed under the License is distributed on an "AS IS" basis,
117
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
118
- * See the License for the specific language governing permissions and
119
- * limitations under the License.
120
- */
121
- class DossierManagementRemoveModalComponent {
122
- constructor(documentService, toasterService, router, translateService, menuService) {
123
- this.documentService = documentService;
124
- this.toasterService = toasterService;
125
- this.router = router;
126
- this.translateService = translateService;
127
- this.menuService = menuService;
128
- this.documentDefinition = null;
129
- this.errors = [];
130
- }
131
- openModal(documentDefinition) {
132
- this.documentDefinition = documentDefinition;
133
- this.modal.show();
134
- }
135
- removeDocumentDefinition() {
136
- this.documentService.removeDocumentDefinition(this.documentDefinition.id.name).subscribe(() => {
137
- this.menuService.reload();
138
- this.router.navigate(['/dossier-management']);
139
- this.toasterService.success(this.translateService.instant('remove-document-definition-success'));
140
- }, (result) => {
141
- this.errors = result.errors;
142
- });
143
- }
144
- }
145
- DossierManagementRemoveModalComponent.decorators = [
146
- { type: Component, args: [{
147
- selector: 'valtimo-dossier-management-remove-modal',
148
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #documentDefinitionRemoveModal\n elementId=\"documentDefinitionRemoveModal\"\n [title]=\"documentDefinition ? documentDefinition.schema.title : 'Document definition'\"\n subtitle=\"{{ 'Remove document definition' | translate }}\"\n showFooter=\"true\"\n>\n <div body *ngIf=\"documentDefinition\">\n <div class=\"alert alert-contrast alert-danger mt-2\" role=\"alert\">\n <div class=\"icon\"><span class=\"mdi mdi-alert-triangle\"></span></div>\n <div\n class=\"message\"\n [innerHTML]=\"'remove-document-definition-confirmation' | translate\"\n ></div>\n </div>\n <div *ngIf=\"errors.length > 0\" class=\"alert alert-danger pt-5 pb-5 mb-2\">\n <ol>\n <li *ngFor=\"let error of errors\">\n {{ error }}\n </li>\n </ol>\n </div>\n </div>\n <div footer>\n <button (click)=\"removeDocumentDefinition()\" class=\"btn btn-primary\" data-dismiss=\"modal\">\n {{ 'remove-document-definition-confirmation-button' | translate }}\n </button>\n </div>\n</valtimo-modal>\n",
149
- 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 */"]
150
- },] }
151
- ];
152
- DossierManagementRemoveModalComponent.ctorParameters = () => [
153
- { type: DocumentService },
154
- { type: ToastrService },
155
- { type: Router },
156
- { type: TranslateService },
157
- { type: MenuService }
158
- ];
159
- DossierManagementRemoveModalComponent.propDecorators = {
160
- modal: [{ type: ViewChild, args: ['documentDefinitionRemoveModal',] }]
161
- };
162
-
163
- /*
164
- * Copyright 2015-2022 Ritense BV, the Netherlands.
165
- *
166
- * Licensed under EUPL, Version 1.2 (the "License");
167
- * you may not use this file except in compliance with the License.
168
- * You may obtain a copy of the License at
169
- *
170
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
171
- *
172
- * Unless required by applicable law or agreed to in writing, software
173
- * distributed under the License is distributed on an "AS IS" basis,
174
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
175
- * See the License for the specific language governing permissions and
176
- * limitations under the License.
177
- */
178
- class DossierManagementRolesComponent {
179
- constructor(authorityService, documentService, alertService, translateService) {
180
- this.authorityService = authorityService;
181
- this.documentService = documentService;
182
- this.alertService = alertService;
183
- this.translateService = translateService;
184
- this.dropdownSettings = {
185
- singleSelection: false,
186
- idField: 'name',
187
- textField: 'name',
188
- selectAllText: 'Select All',
189
- unSelectAllText: 'UnSelect All',
190
- itemsShowLimit: 3,
191
- enableCheckAll: true,
192
- allowSearchFilter: true,
193
- };
194
- this.roles = new BehaviorSubject(undefined);
195
- this.preSelectedItems = new BehaviorSubject(undefined);
196
- }
197
- ngOnInit() {
198
- this.loadAllRoles();
199
- }
200
- loadAllRoles() {
201
- this.authorityService.query().subscribe(result => {
202
- this.roles.next(result.body);
203
- this.loadDocumentRoles();
204
- });
205
- }
206
- loadDocumentRoles() {
207
- if (this.documentDefinitionName) {
208
- this.documentService.getDocumentRoles(this.documentDefinitionName).subscribe(result => {
209
- this.preSelectedItems.next(result);
210
- }, err => {
211
- this.alertService.warning(this.translateService.instant('dossierManagement.roles.messages.unsuccessfullyRetrievedRoles'));
212
- });
213
- }
214
- }
215
- onSelectedItems(data) {
216
- const roles = this.returnArrayOfString(data);
217
- if (isEqual(roles, this.preSelectedItems.value)) {
218
- return;
219
- }
220
- this.documentService.modifyDocumentRoles(this.documentDefinitionName, roles).subscribe(() => {
221
- this.alertService.success(this.translateService.instant('dossierManagement.roles.messages.successfullyStored'));
222
- this.preSelectedItems.next(roles);
223
- }, err => {
224
- this.alertService.error(this.translateService.instant('dossierManagement.roles.messages.unsuccessfullyStored'));
225
- });
226
- }
227
- /**
228
- * The data could be either an array of string (i.e. ["ROLE_ADMIN", "ROLE_DEVELOPER"]
229
- * or an array of object with name parameters (i.e. [{"name": "ROLE_ADMIN"},{"name":"ROLE_DEVELOPER}]
230
- *
231
- * This method will always make sure an array of strings is returned
232
- */
233
- returnArrayOfString(data) {
234
- return data.map(el => {
235
- if (typeof el === 'string') {
236
- return el;
237
- }
238
- return el.name;
239
- });
240
- }
241
- }
242
- DossierManagementRolesComponent.decorators = [
243
- { type: Component, args: [{
244
- selector: 'valtimo-dossier-management-roles',
245
- template: "<!--\n ~ Copyright 2015-2022 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<!--<h2 class=\"mb-4 mt-6\">{{ 'connectorManagement.extension.title' | translate }}</h2>-->\n<h2 class=\"mb-4 mt-6\">{{ 'dossierManagement.roles.rolesTitle' | translate }}</h2>\n<p class=\"card-text\">{{ 'dossierManagement.roles.rolesDescription' | translate }}</p>\n\n<valtimo-multiselect-dropdown\n [items]=\"roles | async\"\n [selectedItems]=\"preSelectedItems | async\"\n [dropdownSettings]=\"dropdownSettings\"\n [placeHolder]=\"'dossierManagement.roles.rolesPlaceHolder' | translate\"\n (itemsSelected)=\"onSelectedItems($event)\"\n></valtimo-multiselect-dropdown>\n",
246
- styles: [""]
247
- },] }
248
- ];
249
- DossierManagementRolesComponent.ctorParameters = () => [
250
- { type: AuthorityService },
251
- { type: DocumentService },
252
- { type: AlertService },
253
- { type: TranslateService }
254
- ];
255
- DossierManagementRolesComponent.propDecorators = {
256
- documentDefinitionName: [{ type: Input }]
257
- };
258
-
259
- /*
260
- * Copyright 2015-2020 Ritense BV, the Netherlands.
261
- *
262
- * Licensed under EUPL, Version 1.2 (the "License");
263
- * you may not use this file except in compliance with the License.
264
- * You may obtain a copy of the License at
265
- *
266
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
267
- *
268
- * Unless required by applicable law or agreed to in writing, software
269
- * distributed under the License is distributed on an "AS IS" basis,
270
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
271
- * See the License for the specific language governing permissions and
272
- * limitations under the License.
273
- */
274
- class DossierManagementDetailComponent {
275
- constructor(documentService, route, alertService) {
276
- this.documentService = documentService;
277
- this.route = route;
278
- this.alertService = alertService;
279
- this.documentDefinitionName = null;
280
- this.documentDefinition = null;
281
- this.processDocumentDefinitions = [];
282
- this.documentDefinitionName = this.route.snapshot.paramMap.get('name');
283
- }
284
- ngOnInit() {
285
- this.loadDocumentDefinition();
286
- this.loadProcessDocumentDefinitions();
287
- }
288
- loadProcessDocumentDefinitions() {
289
- this.documentService
290
- .findProcessDocumentDefinitions(this.documentDefinitionName)
291
- .subscribe((processDocumentDefinitions) => {
292
- this.processDocumentDefinitions = processDocumentDefinitions;
293
- });
294
- }
295
- loadDocumentDefinition() {
296
- this.documentService
297
- .getDocumentDefinition(this.documentDefinitionName)
298
- .subscribe((documentDefinition) => {
299
- this.documentDefinition = documentDefinition;
300
- });
301
- }
302
- openDossierConnectModal() {
303
- this.dossierConnectModal.openModal(this.documentDefinition);
304
- }
305
- openDossierRemoveModal() {
306
- this.dossierRemoveModal.openModal(this.documentDefinition);
307
- }
308
- deleteProcessDocumentDefinition(processDocumentDefinition) {
309
- this.documentService
310
- .deleteProcessDocumentDefinition({
311
- documentDefinitionName: processDocumentDefinition.id.documentDefinitionId.name,
312
- processDefinitionKey: processDocumentDefinition.id.processDefinitionKey,
313
- canInitializeDocument: processDocumentDefinition.canInitializeDocument,
314
- startableByUser: processDocumentDefinition.startableByUser,
315
- })
316
- .subscribe(() => {
317
- this.alertService.success('Successfully deleted process document definition');
318
- this.loadProcessDocumentDefinitions();
319
- }, () => {
320
- this.alertService.error('Failed to delete process document definition');
321
- });
322
- }
323
- downloadDefinition() {
324
- const definition = this.documentDefinition;
325
- const dataString = 'data:text/json;charset=utf-8,' +
326
- encodeURIComponent(JSON.stringify(definition.schema, null, 2));
327
- const downloadAnchorElement = document.getElementById('downloadAnchorElement');
328
- downloadAnchorElement.setAttribute('href', dataString);
329
- downloadAnchorElement.setAttribute('download', `${definition.id.name}-v${definition.id.version}.json`);
330
- downloadAnchorElement.click();
331
- }
332
- }
333
- DossierManagementDetailComponent.decorators = [
334
- { type: Component, args: [{
335
- selector: 'valtimo-dossier-management-detail',
336
- 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 pt-0\">\n <div class=\"container-fluid\">\n <div *ngIf=\"documentDefinition\" class=\"btn-group mt-m3px mb-3 float-right\">\n <button class=\"btn btn-primary btn-space\" (click)=\"downloadDefinition()\">\n <i class=\"icon mdi mdi-download mr-1\"></i>\n {{ 'Download document definition' | translate }}\n </button>\n <a id=\"downloadAnchorElement\" style=\"display: none\"></a>\n <button\n *ngIf=\"!this.documentDefinition.readOnly\"\n class=\"btn btn-secondary btn-space mr-0\"\n (click)=\"openDossierRemoveModal()\"\n >\n <i class=\"icon mdi mdi-delete mr-1\"></i>\n {{ 'Remove document definition' | translate }}\n </button>\n </div>\n <div class=\"clearfix\"></div>\n <valtimo-widget *ngIf=\"documentDefinition\">\n <div class=\"bg-light dossier-header\">\n <h3 class=\"dossier-title\">\n {{ documentDefinition.schema.title }}\n <div *ngIf=\"documentDefinition.readOnly\" class=\"pull-right\">\n <span class=\"badge badge-pill badge-info increase-size\">{{\n 'dossierManagement.readonly' | translate\n }}</span>\n </div>\n </h3>\n </div>\n <div class=\"row bg-white mt-5 mb-2 pl-2 pr-2\">\n <div class=\"col-5\">\n <h2>{{ 'document definition' | translate }}</h2>\n </div>\n <div class=\"col-5 offset-2\">\n <h2>{{ 'dossierManagement.connectedProcesses' | translate }}</h2>\n </div>\n </div>\n <div class=\"row bg-white mb-5 pb-4 pl-2 pr-2\">\n <div class=\"col-5 bg-red\">\n <textarea class=\"w-100 dossier-schema\" rows=\"25\" disabled\n >{{ documentDefinition | json }}\n </textarea>\n </div>\n <div class=\"col-5 offset-2 bg-blue\">\n <div\n class=\"input-group mb-5\"\n *ngFor=\"let processDocumentDefinition of processDocumentDefinitions\"\n >\n <div class=\"input-group-prepend w-75\">\n <button\n class=\"btn btn-danger\"\n (click)=\"deleteProcessDocumentDefinition(processDocumentDefinition)\"\n data-toggle=\"tooltip\"\n data-placement=\"left\"\n title=\"Delete this connected process\"\n >\n <i class=\"icon mdi mdi-delete mr-1\"></i>\n </button>\n <input\n class=\"form-control\"\n [value]=\"\n processDocumentDefinition.processName\n ? processDocumentDefinition.processName\n : '' + ' (' + processDocumentDefinition.id.processDefinitionKey + ')'\n \"\n type=\"text\"\n disabled\n />\n </div>\n <div class=\"row mb-2 mt-2\">\n <label\n class=\"custom-control custom-checkbox custom-control-inline pl-6 mr-5\"\n placement=\"bottom\"\n ngbTooltip=\"{{ 'processCaseConnection.processCreatesCaseTooltip' | translate }}\"\n >\n <input\n class=\"custom-control-input\"\n type=\"checkbox\"\n [checked]=\"processDocumentDefinition.canInitializeDocument\"\n disabled\n /><span class=\"custom-control-label custom-control-color\">{{\n 'processCaseConnection.processCreatesCase' | translate\n }}</span>\n </label>\n <label\n class=\"custom-control custom-checkbox custom-control-inline pl-6\"\n placement=\"bottom\"\n ngbTooltip=\"{{ 'processCaseConnection.startableWithinCaseTooltip' | translate }}\"\n >\n <input\n class=\"custom-control-input\"\n type=\"checkbox\"\n [checked]=\"processDocumentDefinition.startableByUser\"\n disabled\n /><span class=\"custom-control-label custom-control-color\">{{\n 'processCaseConnection.startableWithinCase' | translate\n }}</span>\n </label>\n </div>\n </div>\n <div class=\"text-right mt-5 mb-5\">\n <button class=\"btn btn-primary\" (click)=\"openDossierConnectModal()\">\n <i class=\"icon mdi mdi-plus mr-1\"></i\n >{{ 'dossierManagement.connectProcess' | translate }}\n </button>\n </div>\n <valtimo-dossier-management-roles [documentDefinitionName]=\"documentDefinitionName\">\n </valtimo-dossier-management-roles>\n <valtimo-extension\n module=\"dossier-management\"\n page=\"dossier\"\n section=\"right-panel\"\n ></valtimo-extension>\n </div>\n </div>\n </valtimo-widget>\n\n <valtimo-dossier-management-connect-modal\n #dossierConnectModal\n (reloadProcessDocumentDefinitions)=\"loadProcessDocumentDefinitions()\"\n ></valtimo-dossier-management-connect-modal>\n <valtimo-dossier-management-remove-modal\n #dossierRemoveModal\n ></valtimo-dossier-management-remove-modal>\n </div>\n</div>\n",
337
- 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 */.dossier-header{border-bottom:1px solid #dee2e6;height:80px;padding-left:18px;padding-right:18px;padding-top:21px}.dossier-title{margin-bottom:7px;margin-top:0}.row{margin:0}.dossier-schema{resize:none}"]
338
- },] }
339
- ];
340
- DossierManagementDetailComponent.ctorParameters = () => [
341
- { type: DocumentService },
342
- { type: ActivatedRoute },
343
- { type: AlertService }
344
- ];
345
- DossierManagementDetailComponent.propDecorators = {
346
- dossierConnectModal: [{ type: ViewChild, args: ['dossierConnectModal',] }],
347
- dossierRemoveModal: [{ type: ViewChild, args: ['dossierRemoveModal',] }],
348
- documentRoles: [{ type: ViewChild, args: ['documentRoles',] }]
349
- };
350
-
351
- /*
352
- * Copyright 2015-2020 Ritense BV, the Netherlands.
353
- *
354
- * Licensed under EUPL, Version 1.2 (the "License");
355
- * you may not use this file except in compliance with the License.
356
- * You may obtain a copy of the License at
357
- *
358
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
359
- *
360
- * Unless required by applicable law or agreed to in writing, software
361
- * distributed under the License is distributed on an "AS IS" basis,
362
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
363
- * See the License for the specific language governing permissions and
364
- * limitations under the License.
365
- */
366
- const moment = moment_;
367
- moment.locale(localStorage.getItem('langKey') || '');
368
- class DossierManagementListComponent {
369
- constructor(documentService, router) {
370
- this.documentService = documentService;
371
- this.router = router;
372
- this.dossiers = [];
373
- this.pagination = {
374
- collectionSize: 0,
375
- page: 1,
376
- size: 10,
377
- maxPaginationItemSize: 5,
378
- };
379
- this.pageParam = 0;
380
- this.dossierFields = [
381
- { key: 'schema.title', label: 'Title' },
382
- { key: 'createdOn', label: 'Created On' },
383
- { key: 'readOnly', label: 'Read-only' },
384
- ];
385
- this.showModal$ = new BehaviorSubject(false);
386
- }
387
- paginationClicked(page) {
388
- this.pageParam = page - 1;
389
- this.getDocumentDefinitions();
390
- }
391
- paginationSet() {
392
- this.getDocumentDefinitions();
393
- }
394
- redirectToDetails(documentDefinition) {
395
- this.router.navigate(['/dossier-management/dossier', documentDefinition.id.name]);
396
- }
397
- getDocumentDefinitions() {
398
- this.documentService
399
- .queryDefinitions({ filteredOnRole: false, page: this.pageParam, size: this.pagination.size })
400
- .subscribe((documentDefinitionPage) => {
401
- this.pagination.collectionSize = documentDefinitionPage.totalElements;
402
- this.dossiers = documentDefinitionPage.content;
403
- this.dossiers.map((dossier) => {
404
- dossier.createdOn = moment(dossier.createdOn).format('DD MMM YYYY HH:mm');
405
- });
406
- });
407
- }
408
- showModal() {
409
- this.showModal$.next(true);
410
- }
411
- }
412
- DossierManagementListComponent.decorators = [
413
- { type: Component, args: [{
414
- selector: 'valtimo-dossier-management-list',
415
- 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 pt-0\">\n <div class=\"container-fluid\">\n <div class=\"btn-group mt-m3px mb-3 float-right\">\n <button class=\"btn btn-secondary btn-space mr-0\" (click)=\"showModal()\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload document definition' | translate }}\n </button>\n </div>\n <div class=\"clearfix\"></div>\n <valtimo-widget>\n <valtimo-list\n [items]=\"dossiers\"\n [fields]=\"dossierFields\"\n [header]=\"true\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"dossierManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet()\"\n (rowClicked)=\"redirectToDetails($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Dossiers' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Dossiers' | translate }}</h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n</div>\n\n<valtimo-dossier-management-upload\n [show$]=\"showModal$\"\n (definitionUploaded)=\"paginationSet()\"\n></valtimo-dossier-management-upload>\n",
416
- 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 */"]
417
- },] }
418
- ];
419
- DossierManagementListComponent.ctorParameters = () => [
420
- { type: DocumentService },
421
- { type: Router }
422
- ];
423
-
424
- /*
425
- * Copyright 2015-2020 Ritense BV, the Netherlands.
426
- *
427
- * Licensed under EUPL, Version 1.2 (the "License");
428
- * you may not use this file except in compliance with the License.
429
- * You may obtain a copy of the License at
430
- *
431
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
432
- *
433
- * Unless required by applicable law or agreed to in writing, software
434
- * distributed under the License is distributed on an "AS IS" basis,
435
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
436
- * See the License for the specific language governing permissions and
437
- * limitations under the License.
438
- */
439
- const ɵ0 = { title: 'Dossiers', roles: [ROLE_ADMIN] }, ɵ1 = { title: 'Dossier details', roles: [ROLE_ADMIN] };
440
- const routes = [
441
- {
442
- path: 'dossier-management',
443
- component: DossierManagementListComponent,
444
- canActivate: [AuthGuardService],
445
- data: ɵ0,
446
- },
447
- {
448
- path: 'dossier-management/dossier/:name',
449
- component: DossierManagementDetailComponent,
450
- canActivate: [AuthGuardService],
451
- data: ɵ1,
452
- },
453
- ];
454
- class DossierManagementRoutingModule {
455
- }
456
- DossierManagementRoutingModule.decorators = [
457
- { type: NgModule, args: [{
458
- imports: [RouterModule.forRoot(routes)],
459
- exports: [RouterModule],
460
- declarations: [],
461
- },] }
462
- ];
463
-
464
- /*
465
- * Copyright 2015-2020 Ritense BV, the Netherlands.
466
- *
467
- * Licensed under EUPL, Version 1.2 (the "License");
468
- * you may not use this file except in compliance with the License.
469
- * You may obtain a copy of the License at
470
- *
471
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
472
- *
473
- * Unless required by applicable law or agreed to in writing, software
474
- * distributed under the License is distributed on an "AS IS" basis,
475
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
476
- * See the License for the specific language governing permissions and
477
- * limitations under the License.
478
- */
479
- class DossierManagementUploadComponent {
480
- constructor(documentService, translateService, menuService) {
481
- this.documentService = documentService;
482
- this.translateService = translateService;
483
- this.menuService = menuService;
484
- this.definitionUploaded = new EventEmitter();
485
- this.clear$ = new Subject();
486
- this.jsonString$ = new BehaviorSubject('');
487
- this.error$ = new BehaviorSubject('');
488
- this.disabled$ = new BehaviorSubject(false);
489
- this.file$ = new BehaviorSubject(undefined);
490
- }
491
- ngAfterViewInit() {
492
- this.openShowSubscription();
493
- this.openFileSubscription();
494
- }
495
- ngOnDestroy() {
496
- this.showSubscription.unsubscribe();
497
- this.fileSubscription.unsubscribe();
498
- this.closeErrorSubscription();
499
- }
500
- setFile(file) {
501
- this.clearError();
502
- this.file$.next(file);
503
- }
504
- uploadDefinition() {
505
- this.disable();
506
- this.jsonString$
507
- .pipe(switchMap(jsonString => this.documentService
508
- .createDocumentDefinition(new DocumentDefinitionCreateRequest(jsonString))
509
- .pipe(tap(
510
- // success
511
- () => {
512
- this.closeErrorSubscription();
513
- this.clearError();
514
- this.enable();
515
- this.hideModal();
516
- this.menuService.reload();
517
- this.definitionUploaded.emit();
518
- },
519
- // error
520
- () => {
521
- this.openErrorSubscription('dropzone.error.invalidDocDef');
522
- this.enable();
523
- }))), take(1))
524
- .subscribe();
525
- }
526
- openErrorSubscription(errorCode) {
527
- this.closeErrorSubscription();
528
- this.errorSubscription = this.translateService.stream(errorCode).subscribe(error => {
529
- this.error$.next(error);
530
- });
531
- }
532
- closeErrorSubscription() {
533
- if (this.errorSubscription) {
534
- this.errorSubscription.unsubscribe();
535
- }
536
- }
537
- clearError() {
538
- this.error$.next('');
539
- }
540
- openFileSubscription() {
541
- this.fileSubscription = this.file$.subscribe(file => {
542
- if (file) {
543
- const reader = new FileReader();
544
- reader.onloadend = () => {
545
- const result = reader.result.toString();
546
- if (this.stringIsValidJson(result)) {
547
- this.jsonString$.next(result);
548
- }
549
- };
550
- reader.readAsText(file);
551
- }
552
- else {
553
- this.clearJsonString();
554
- }
555
- });
556
- }
557
- openShowSubscription() {
558
- this.showSubscription = this.show$.subscribe(show => {
559
- if (show) {
560
- this.showModal();
561
- }
562
- else {
563
- this.hideModal();
564
- }
565
- this.clearJsonString();
566
- this.clearError();
567
- this.clearDropzone();
568
- });
569
- }
570
- clearJsonString() {
571
- this.jsonString$.next('');
572
- }
573
- clearDropzone() {
574
- this.clear$.next();
575
- }
576
- showModal() {
577
- this.modal.show();
578
- }
579
- hideModal() {
580
- this.modal.hide();
581
- }
582
- stringIsValidJson(string) {
583
- try {
584
- JSON.parse(string);
585
- }
586
- catch (e) {
587
- return false;
588
- }
589
- return true;
590
- }
591
- disable() {
592
- this.disabled$.next(true);
593
- }
594
- enable() {
595
- this.disabled$.next(false);
596
- }
597
- }
598
- DossierManagementUploadComponent.decorators = [
599
- { type: Component, args: [{
600
- selector: 'valtimo-dossier-management-upload',
601
- template: "<valtimo-modal\n #uploadDefinitionModal\n [title]=\"'Upload document definition' | translate\"\n showFooter=\"true\"\n>\n <div class=\"mt-2\" body>\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.jsonDocDef' | translate\"\n [externalError$]=\"error$\"\n ></valtimo-dropzone>\n </div>\n <div footer>\n <ng-container *ngIf=\"(jsonString$ | async) && !(error$ | async); else pleaseSelect\">\n <button [disabled]=\"disabled$ | async\" class=\"btn btn-primary\" (click)=\"uploadDefinition()\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n </ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #pleaseSelect>\n <button class=\"btn btn-primary\" [disabled]=\"true\">\n {{ 'Select a document definition' | translate }}\n </button>\n</ng-template>\n",
602
- styles: [""]
603
- },] }
604
- ];
605
- DossierManagementUploadComponent.ctorParameters = () => [
606
- { type: DocumentService },
607
- { type: TranslateService },
608
- { type: MenuService }
609
- ];
610
- DossierManagementUploadComponent.propDecorators = {
611
- show$: [{ type: Input }],
612
- definitionUploaded: [{ type: Output }],
613
- modal: [{ type: ViewChild, args: ['uploadDefinitionModal',] }]
614
- };
615
-
616
- /*
617
- * Copyright 2015-2020 Ritense BV, the Netherlands.
618
- *
619
- * Licensed under EUPL, Version 1.2 (the "License");
620
- * you may not use this file except in compliance with the License.
621
- * You may obtain a copy of the License at
622
- *
623
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
624
- *
625
- * Unless required by applicable law or agreed to in writing, software
626
- * distributed under the License is distributed on an "AS IS" basis,
627
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
628
- * See the License for the specific language governing permissions and
629
- * limitations under the License.
630
- */
631
- class DossierManagementModule {
632
- }
633
- DossierManagementModule.decorators = [
634
- { type: NgModule, args: [{
635
- declarations: [
636
- DossierManagementListComponent,
637
- DossierManagementDetailComponent,
638
- DossierManagementConnectModalComponent,
639
- DossierManagementRemoveModalComponent,
640
- DossierManagementUploadComponent,
641
- DossierManagementRolesComponent,
642
- ],
643
- imports: [
644
- CommonModule,
645
- WidgetModule,
646
- DropzoneModule,
647
- ListModule,
648
- DossierManagementRoutingModule,
649
- FormsModule,
650
- TranslateModule,
651
- ModalModule,
652
- ConfigModule,
653
- NgbTooltipModule,
654
- MultiselectDropdownModule,
655
- ],
656
- exports: [],
657
- entryComponents: [ExtensionComponent],
658
- },] }
659
- ];
660
-
661
- /*
662
- * Copyright 2015-2020 Ritense BV, the Netherlands.
663
- *
664
- * Licensed under EUPL, Version 1.2 (the "License");
665
- * you may not use this file except in compliance with the License.
666
- * You may obtain a copy of the License at
667
- *
668
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
669
- *
670
- * Unless required by applicable law or agreed to in writing, software
671
- * distributed under the License is distributed on an "AS IS" basis,
672
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
673
- * See the License for the specific language governing permissions and
674
- * limitations under the License.
675
- */
676
-
677
- /**
678
- * Generated bundle index. Do not edit.
679
- */
680
-
681
- export { DossierManagementListComponent, DossierManagementModule, DossierManagementDetailComponent as ɵa, DossierManagementConnectModalComponent as ɵb, DossierManagementRemoveModalComponent as ɵc, DossierManagementUploadComponent as ɵd, DossierManagementRolesComponent as ɵe, DossierManagementRoutingModule as ɵf };
682
- //# sourceMappingURL=valtimo-dossier-management.js.map