@valtimo/dossier-management 4.15.3-next-main.16 → 4.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/valtimo-dossier-management.umd.js +572 -572
- package/bundles/valtimo-dossier-management.umd.js.map +1 -1
- package/bundles/valtimo-dossier-management.umd.min.js +1 -1
- package/bundles/valtimo-dossier-management.umd.min.js.map +1 -1
- package/esm2015/lib/dossier-management-connect-modal/dossier-management-connect-modal.component.js +92 -92
- package/esm2015/lib/dossier-management-detail/dossier-management-detail.component.js +97 -97
- package/esm2015/lib/dossier-management-list/dossier-management-list.component.js +78 -78
- package/esm2015/lib/dossier-management-remove-modal/dossier-management-remove-modal.component.js +63 -63
- package/esm2015/lib/dossier-management-routing.module.js +47 -47
- package/esm2015/lib/dossier-management-upload/dossier-management-upload.component.js +158 -159
- package/esm2015/lib/dossier-management.module.js +56 -56
- package/esm2015/public-api.js +21 -21
- package/esm2015/valtimo-dossier-management.js +10 -10
- package/fesm2015/valtimo-dossier-management.js +547 -548
- package/fesm2015/valtimo-dossier-management.js.map +1 -1
- package/lib/dossier-management-connect-modal/dossier-management-connect-modal.component.d.ts +24 -25
- package/lib/dossier-management-detail/dossier-management-detail.component.d.ts +24 -25
- package/lib/dossier-management-list/dossier-management-list.component.d.ts +26 -27
- package/lib/dossier-management-remove-modal/dossier-management-remove-modal.component.d.ts +18 -19
- package/lib/dossier-management-routing.module.d.ts +2 -2
- package/lib/dossier-management-upload/dossier-management-upload.component.d.ts +38 -38
- package/lib/dossier-management.module.d.ts +2 -2
- package/package.json +1 -1
- package/public-api.d.ts +2 -2
- package/valtimo-dossier-management.d.ts +9 -9
- package/valtimo-dossier-management.metadata.json +1 -1
|
@@ -3,579 +3,578 @@ import { EventEmitter, Component, Output, ViewChild, NgModule, Input } from '@an
|
|
|
3
3
|
import { FormsModule } from '@angular/forms';
|
|
4
4
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
5
5
|
import { MenuService, AlertService, WidgetModule, DropzoneModule, ListModule, ModalModule } from '@valtimo/components';
|
|
6
|
-
import { ConfigModule, ExtensionComponent } from '@valtimo/config';
|
|
7
|
-
import { DocumentService } from '@valtimo/document';
|
|
6
|
+
import { ROLE_ADMIN, ConfigModule, ExtensionComponent } from '@valtimo/config';
|
|
7
|
+
import { DocumentService, DocumentDefinitionCreateRequest } from '@valtimo/document';
|
|
8
8
|
import { ProcessService } from '@valtimo/process';
|
|
9
9
|
import { ToastrService } from 'ngx-toastr';
|
|
10
10
|
import { Router, ActivatedRoute, RouterModule } from '@angular/router';
|
|
11
11
|
import * as moment_ from 'moment';
|
|
12
12
|
import { BehaviorSubject, Subject } from 'rxjs';
|
|
13
13
|
import { AuthGuardService } from '@valtimo/security';
|
|
14
|
-
import { ROLE_ADMIN, DocumentDefinitionCreateRequest } from '@valtimo/contract';
|
|
15
14
|
import { switchMap, tap, take } from 'rxjs/operators';
|
|
16
15
|
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
|
17
16
|
|
|
18
|
-
/*
|
|
19
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
20
|
-
*
|
|
21
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
22
|
-
* you may not use this file except in compliance with the License.
|
|
23
|
-
* You may obtain a copy of the License at
|
|
24
|
-
*
|
|
25
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
26
|
-
*
|
|
27
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
28
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
29
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
30
|
-
* See the License for the specific language governing permissions and
|
|
31
|
-
* limitations under the License.
|
|
32
|
-
*/
|
|
33
|
-
class DossierManagementConnectModalComponent {
|
|
34
|
-
constructor(processService, documentService, toasterService) {
|
|
35
|
-
this.processService = processService;
|
|
36
|
-
this.documentService = documentService;
|
|
37
|
-
this.toasterService = toasterService;
|
|
38
|
-
this.documentDefinition = null;
|
|
39
|
-
this.newDocumentProcessDefinition = null;
|
|
40
|
-
this.newDocumentProcessDefinitionInit = true;
|
|
41
|
-
this.newDocumentProcessDefinitionStartableByUser = false;
|
|
42
|
-
this.processDocumentDefinitionExists = {};
|
|
43
|
-
this.reloadProcessDocumentDefinitions = new EventEmitter();
|
|
44
|
-
}
|
|
45
|
-
loadProcessDocumentDefinitions() {
|
|
46
|
-
this.processDocumentDefinitionExists = {};
|
|
47
|
-
this.documentService
|
|
48
|
-
.findProcessDocumentDefinitions(this.documentDefinition.id.name)
|
|
49
|
-
.subscribe((processDocumentDefinitions) => {
|
|
50
|
-
processDocumentDefinitions.forEach((processDocumentDefinition) => {
|
|
51
|
-
this.processDocumentDefinitionExists[processDocumentDefinition.id.processDefinitionKey] = true;
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
loadProcessDefinitions() {
|
|
56
|
-
this.processService
|
|
57
|
-
.getProcessDefinitions()
|
|
58
|
-
.subscribe((processDefinitions) => {
|
|
59
|
-
this.processDefinitions = processDefinitions;
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
ngOnInit() {
|
|
63
|
-
this.loadProcessDefinitions();
|
|
64
|
-
}
|
|
65
|
-
openModal(dossier) {
|
|
66
|
-
this.documentDefinition = dossier;
|
|
67
|
-
this.newDocumentProcessDefinition = null;
|
|
68
|
-
this.newDocumentProcessDefinitionInit = true;
|
|
69
|
-
this.newDocumentProcessDefinitionStartableByUser = false;
|
|
70
|
-
this.loadProcessDocumentDefinitions();
|
|
71
|
-
this.modal.show();
|
|
72
|
-
}
|
|
73
|
-
submit() {
|
|
74
|
-
const request = {
|
|
75
|
-
canInitializeDocument: this.newDocumentProcessDefinitionInit,
|
|
76
|
-
startableByUser: this.newDocumentProcessDefinitionStartableByUser,
|
|
77
|
-
documentDefinitionName: this.documentDefinition.id.name,
|
|
78
|
-
processDefinitionKey: this.newDocumentProcessDefinition.key,
|
|
79
|
-
};
|
|
80
|
-
this.documentService.createProcessDocumentDefinition(request).subscribe(() => {
|
|
81
|
-
this.toasterService.success('Successfully added new process document definition');
|
|
82
|
-
this.reloadProcessDocumentDefinitions.emit();
|
|
83
|
-
}, err => {
|
|
84
|
-
this.toasterService.error('Failed to add new process document definition');
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
DossierManagementConnectModalComponent.decorators = [
|
|
89
|
-
{ type: Component, args: [{
|
|
90
|
-
selector: 'valtimo-dossier-management-connect-modal',
|
|
91
|
-
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\">Select process definition</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
|
|
92
|
-
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 */"]
|
|
93
|
-
},] }
|
|
94
|
-
];
|
|
95
|
-
DossierManagementConnectModalComponent.ctorParameters = () => [
|
|
96
|
-
{ type: ProcessService },
|
|
97
|
-
{ type: DocumentService },
|
|
98
|
-
{ type: ToastrService }
|
|
99
|
-
];
|
|
100
|
-
DossierManagementConnectModalComponent.propDecorators = {
|
|
101
|
-
reloadProcessDocumentDefinitions: [{ type: Output }],
|
|
102
|
-
modal: [{ type: ViewChild, args: ['dossierConnectModal',] }]
|
|
17
|
+
/*
|
|
18
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
19
|
+
*
|
|
20
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License.
|
|
22
|
+
* You may obtain a copy of the License at
|
|
23
|
+
*
|
|
24
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
28
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
* See the License for the specific language governing permissions and
|
|
30
|
+
* limitations under the License.
|
|
31
|
+
*/
|
|
32
|
+
class DossierManagementConnectModalComponent {
|
|
33
|
+
constructor(processService, documentService, toasterService) {
|
|
34
|
+
this.processService = processService;
|
|
35
|
+
this.documentService = documentService;
|
|
36
|
+
this.toasterService = toasterService;
|
|
37
|
+
this.documentDefinition = null;
|
|
38
|
+
this.newDocumentProcessDefinition = null;
|
|
39
|
+
this.newDocumentProcessDefinitionInit = true;
|
|
40
|
+
this.newDocumentProcessDefinitionStartableByUser = false;
|
|
41
|
+
this.processDocumentDefinitionExists = {};
|
|
42
|
+
this.reloadProcessDocumentDefinitions = new EventEmitter();
|
|
43
|
+
}
|
|
44
|
+
loadProcessDocumentDefinitions() {
|
|
45
|
+
this.processDocumentDefinitionExists = {};
|
|
46
|
+
this.documentService
|
|
47
|
+
.findProcessDocumentDefinitions(this.documentDefinition.id.name)
|
|
48
|
+
.subscribe((processDocumentDefinitions) => {
|
|
49
|
+
processDocumentDefinitions.forEach((processDocumentDefinition) => {
|
|
50
|
+
this.processDocumentDefinitionExists[processDocumentDefinition.id.processDefinitionKey] = true;
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
loadProcessDefinitions() {
|
|
55
|
+
this.processService
|
|
56
|
+
.getProcessDefinitions()
|
|
57
|
+
.subscribe((processDefinitions) => {
|
|
58
|
+
this.processDefinitions = processDefinitions;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
ngOnInit() {
|
|
62
|
+
this.loadProcessDefinitions();
|
|
63
|
+
}
|
|
64
|
+
openModal(dossier) {
|
|
65
|
+
this.documentDefinition = dossier;
|
|
66
|
+
this.newDocumentProcessDefinition = null;
|
|
67
|
+
this.newDocumentProcessDefinitionInit = true;
|
|
68
|
+
this.newDocumentProcessDefinitionStartableByUser = false;
|
|
69
|
+
this.loadProcessDocumentDefinitions();
|
|
70
|
+
this.modal.show();
|
|
71
|
+
}
|
|
72
|
+
submit() {
|
|
73
|
+
const request = {
|
|
74
|
+
canInitializeDocument: this.newDocumentProcessDefinitionInit,
|
|
75
|
+
startableByUser: this.newDocumentProcessDefinitionStartableByUser,
|
|
76
|
+
documentDefinitionName: this.documentDefinition.id.name,
|
|
77
|
+
processDefinitionKey: this.newDocumentProcessDefinition.key,
|
|
78
|
+
};
|
|
79
|
+
this.documentService.createProcessDocumentDefinition(request).subscribe(() => {
|
|
80
|
+
this.toasterService.success('Successfully added new process document definition');
|
|
81
|
+
this.reloadProcessDocumentDefinitions.emit();
|
|
82
|
+
}, err => {
|
|
83
|
+
this.toasterService.error('Failed to add new process document definition');
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
DossierManagementConnectModalComponent.decorators = [
|
|
88
|
+
{ type: Component, args: [{
|
|
89
|
+
selector: 'valtimo-dossier-management-connect-modal',
|
|
90
|
+
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\">Select process definition</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",
|
|
91
|
+
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 */"]
|
|
92
|
+
},] }
|
|
93
|
+
];
|
|
94
|
+
DossierManagementConnectModalComponent.ctorParameters = () => [
|
|
95
|
+
{ type: ProcessService },
|
|
96
|
+
{ type: DocumentService },
|
|
97
|
+
{ type: ToastrService }
|
|
98
|
+
];
|
|
99
|
+
DossierManagementConnectModalComponent.propDecorators = {
|
|
100
|
+
reloadProcessDocumentDefinitions: [{ type: Output }],
|
|
101
|
+
modal: [{ type: ViewChild, args: ['dossierConnectModal',] }]
|
|
103
102
|
};
|
|
104
103
|
|
|
105
|
-
/*
|
|
106
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
107
|
-
*
|
|
108
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
109
|
-
* you may not use this file except in compliance with the License.
|
|
110
|
-
* You may obtain a copy of the License at
|
|
111
|
-
*
|
|
112
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
113
|
-
*
|
|
114
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
115
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
116
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
117
|
-
* See the License for the specific language governing permissions and
|
|
118
|
-
* limitations under the License.
|
|
119
|
-
*/
|
|
120
|
-
class DossierManagementRemoveModalComponent {
|
|
121
|
-
constructor(documentService, toasterService, router, translateService, menuService) {
|
|
122
|
-
this.documentService = documentService;
|
|
123
|
-
this.toasterService = toasterService;
|
|
124
|
-
this.router = router;
|
|
125
|
-
this.translateService = translateService;
|
|
126
|
-
this.menuService = menuService;
|
|
127
|
-
this.documentDefinition = null;
|
|
128
|
-
this.errors = [];
|
|
129
|
-
}
|
|
130
|
-
openModal(documentDefinition) {
|
|
131
|
-
this.documentDefinition = documentDefinition;
|
|
132
|
-
this.modal.show();
|
|
133
|
-
}
|
|
134
|
-
removeDocumentDefinition() {
|
|
135
|
-
this.documentService.removeDocumentDefinition(this.documentDefinition.id.name).subscribe(() => {
|
|
136
|
-
this.menuService.reload();
|
|
137
|
-
this.router.navigate(['/dossier-management']);
|
|
138
|
-
this.toasterService.success(this.translateService.instant('remove-document-definition-success'));
|
|
139
|
-
}, (result) => {
|
|
140
|
-
this.errors = result.errors;
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
DossierManagementRemoveModalComponent.decorators = [
|
|
145
|
-
{ type: Component, args: [{
|
|
146
|
-
selector: 'valtimo-dossier-management-remove-modal',
|
|
147
|
-
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",
|
|
148
|
-
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 */"]
|
|
149
|
-
},] }
|
|
150
|
-
];
|
|
151
|
-
DossierManagementRemoveModalComponent.ctorParameters = () => [
|
|
152
|
-
{ type: DocumentService },
|
|
153
|
-
{ type: ToastrService },
|
|
154
|
-
{ type: Router },
|
|
155
|
-
{ type: TranslateService },
|
|
156
|
-
{ type: MenuService }
|
|
157
|
-
];
|
|
158
|
-
DossierManagementRemoveModalComponent.propDecorators = {
|
|
159
|
-
modal: [{ type: ViewChild, args: ['documentDefinitionRemoveModal',] }]
|
|
104
|
+
/*
|
|
105
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
106
|
+
*
|
|
107
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
108
|
+
* you may not use this file except in compliance with the License.
|
|
109
|
+
* You may obtain a copy of the License at
|
|
110
|
+
*
|
|
111
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
112
|
+
*
|
|
113
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
114
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
115
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
116
|
+
* See the License for the specific language governing permissions and
|
|
117
|
+
* limitations under the License.
|
|
118
|
+
*/
|
|
119
|
+
class DossierManagementRemoveModalComponent {
|
|
120
|
+
constructor(documentService, toasterService, router, translateService, menuService) {
|
|
121
|
+
this.documentService = documentService;
|
|
122
|
+
this.toasterService = toasterService;
|
|
123
|
+
this.router = router;
|
|
124
|
+
this.translateService = translateService;
|
|
125
|
+
this.menuService = menuService;
|
|
126
|
+
this.documentDefinition = null;
|
|
127
|
+
this.errors = [];
|
|
128
|
+
}
|
|
129
|
+
openModal(documentDefinition) {
|
|
130
|
+
this.documentDefinition = documentDefinition;
|
|
131
|
+
this.modal.show();
|
|
132
|
+
}
|
|
133
|
+
removeDocumentDefinition() {
|
|
134
|
+
this.documentService.removeDocumentDefinition(this.documentDefinition.id.name).subscribe(() => {
|
|
135
|
+
this.menuService.reload();
|
|
136
|
+
this.router.navigate(['/dossier-management']);
|
|
137
|
+
this.toasterService.success(this.translateService.instant('remove-document-definition-success'));
|
|
138
|
+
}, (result) => {
|
|
139
|
+
this.errors = result.errors;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
DossierManagementRemoveModalComponent.decorators = [
|
|
144
|
+
{ type: Component, args: [{
|
|
145
|
+
selector: 'valtimo-dossier-management-remove-modal',
|
|
146
|
+
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",
|
|
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 */"]
|
|
148
|
+
},] }
|
|
149
|
+
];
|
|
150
|
+
DossierManagementRemoveModalComponent.ctorParameters = () => [
|
|
151
|
+
{ type: DocumentService },
|
|
152
|
+
{ type: ToastrService },
|
|
153
|
+
{ type: Router },
|
|
154
|
+
{ type: TranslateService },
|
|
155
|
+
{ type: MenuService }
|
|
156
|
+
];
|
|
157
|
+
DossierManagementRemoveModalComponent.propDecorators = {
|
|
158
|
+
modal: [{ type: ViewChild, args: ['documentDefinitionRemoveModal',] }]
|
|
160
159
|
};
|
|
161
160
|
|
|
162
|
-
/*
|
|
163
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
164
|
-
*
|
|
165
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
166
|
-
* you may not use this file except in compliance with the License.
|
|
167
|
-
* You may obtain a copy of the License at
|
|
168
|
-
*
|
|
169
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
170
|
-
*
|
|
171
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
172
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
173
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
174
|
-
* See the License for the specific language governing permissions and
|
|
175
|
-
* limitations under the License.
|
|
176
|
-
*/
|
|
177
|
-
class DossierManagementDetailComponent {
|
|
178
|
-
constructor(documentService, route, alertService) {
|
|
179
|
-
this.documentService = documentService;
|
|
180
|
-
this.route = route;
|
|
181
|
-
this.alertService = alertService;
|
|
182
|
-
this.documentDefinitionName = null;
|
|
183
|
-
this.documentDefinition = null;
|
|
184
|
-
this.processDocumentDefinitions = [];
|
|
185
|
-
this.documentDefinitionName = this.route.snapshot.paramMap.get('name');
|
|
186
|
-
}
|
|
187
|
-
ngOnInit() {
|
|
188
|
-
this.loadDocumentDefinition();
|
|
189
|
-
this.loadProcessDocumentDefinitions();
|
|
190
|
-
}
|
|
191
|
-
loadProcessDocumentDefinitions() {
|
|
192
|
-
this.documentService
|
|
193
|
-
.findProcessDocumentDefinitions(this.documentDefinitionName)
|
|
194
|
-
.subscribe((processDocumentDefinitions) => {
|
|
195
|
-
this.processDocumentDefinitions = processDocumentDefinitions;
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
loadDocumentDefinition() {
|
|
199
|
-
this.documentService
|
|
200
|
-
.getDocumentDefinition(this.documentDefinitionName)
|
|
201
|
-
.subscribe((documentDefinition) => {
|
|
202
|
-
this.documentDefinition = documentDefinition;
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
openDossierConnectModal() {
|
|
206
|
-
this.dossierConnectModal.openModal(this.documentDefinition);
|
|
207
|
-
}
|
|
208
|
-
openDossierRemoveModal() {
|
|
209
|
-
this.dossierRemoveModal.openModal(this.documentDefinition);
|
|
210
|
-
}
|
|
211
|
-
deleteProcessDocumentDefinition(processDocumentDefinition) {
|
|
212
|
-
this.documentService
|
|
213
|
-
.deleteProcessDocumentDefinition({
|
|
214
|
-
documentDefinitionName: processDocumentDefinition.id.documentDefinitionId.name,
|
|
215
|
-
processDefinitionKey: processDocumentDefinition.id.processDefinitionKey,
|
|
216
|
-
canInitializeDocument: processDocumentDefinition.canInitializeDocument,
|
|
217
|
-
startableByUser: processDocumentDefinition.startableByUser,
|
|
218
|
-
})
|
|
219
|
-
.subscribe(() => {
|
|
220
|
-
this.alertService.success('Successfully deleted process document definition');
|
|
221
|
-
this.loadProcessDocumentDefinitions();
|
|
222
|
-
}, () => {
|
|
223
|
-
this.alertService.error('Failed to delete process document definition');
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
downloadDefinition() {
|
|
227
|
-
const definition = this.documentDefinition;
|
|
228
|
-
const dataString = 'data:text/json;charset=utf-8,' +
|
|
229
|
-
encodeURIComponent(JSON.stringify(definition.schema, null, 2));
|
|
230
|
-
const downloadAnchorElement = document.getElementById('downloadAnchorElement');
|
|
231
|
-
downloadAnchorElement.setAttribute('href', dataString);
|
|
232
|
-
downloadAnchorElement.setAttribute('download', `${definition.id.name}-v${definition.id.version}.json`);
|
|
233
|
-
downloadAnchorElement.click();
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
DossierManagementDetailComponent.decorators = [
|
|
237
|
-
{ type: Component, args: [{
|
|
238
|
-
selector: 'valtimo-dossier-management-detail',
|
|
239
|
-
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\"></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\"></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\">Read-only</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>Connected processes</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=\"fa fa-trash\"></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
|
|
240
|
-
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}"]
|
|
241
|
-
},] }
|
|
242
|
-
];
|
|
243
|
-
DossierManagementDetailComponent.ctorParameters = () => [
|
|
244
|
-
{ type: DocumentService },
|
|
245
|
-
{ type: ActivatedRoute },
|
|
246
|
-
{ type: AlertService }
|
|
247
|
-
];
|
|
248
|
-
DossierManagementDetailComponent.propDecorators = {
|
|
249
|
-
dossierConnectModal: [{ type: ViewChild, args: ['dossierConnectModal',] }],
|
|
250
|
-
dossierRemoveModal: [{ type: ViewChild, args: ['dossierRemoveModal',] }]
|
|
161
|
+
/*
|
|
162
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
163
|
+
*
|
|
164
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
165
|
+
* you may not use this file except in compliance with the License.
|
|
166
|
+
* You may obtain a copy of the License at
|
|
167
|
+
*
|
|
168
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
169
|
+
*
|
|
170
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
171
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
172
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
173
|
+
* See the License for the specific language governing permissions and
|
|
174
|
+
* limitations under the License.
|
|
175
|
+
*/
|
|
176
|
+
class DossierManagementDetailComponent {
|
|
177
|
+
constructor(documentService, route, alertService) {
|
|
178
|
+
this.documentService = documentService;
|
|
179
|
+
this.route = route;
|
|
180
|
+
this.alertService = alertService;
|
|
181
|
+
this.documentDefinitionName = null;
|
|
182
|
+
this.documentDefinition = null;
|
|
183
|
+
this.processDocumentDefinitions = [];
|
|
184
|
+
this.documentDefinitionName = this.route.snapshot.paramMap.get('name');
|
|
185
|
+
}
|
|
186
|
+
ngOnInit() {
|
|
187
|
+
this.loadDocumentDefinition();
|
|
188
|
+
this.loadProcessDocumentDefinitions();
|
|
189
|
+
}
|
|
190
|
+
loadProcessDocumentDefinitions() {
|
|
191
|
+
this.documentService
|
|
192
|
+
.findProcessDocumentDefinitions(this.documentDefinitionName)
|
|
193
|
+
.subscribe((processDocumentDefinitions) => {
|
|
194
|
+
this.processDocumentDefinitions = processDocumentDefinitions;
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
loadDocumentDefinition() {
|
|
198
|
+
this.documentService
|
|
199
|
+
.getDocumentDefinition(this.documentDefinitionName)
|
|
200
|
+
.subscribe((documentDefinition) => {
|
|
201
|
+
this.documentDefinition = documentDefinition;
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
openDossierConnectModal() {
|
|
205
|
+
this.dossierConnectModal.openModal(this.documentDefinition);
|
|
206
|
+
}
|
|
207
|
+
openDossierRemoveModal() {
|
|
208
|
+
this.dossierRemoveModal.openModal(this.documentDefinition);
|
|
209
|
+
}
|
|
210
|
+
deleteProcessDocumentDefinition(processDocumentDefinition) {
|
|
211
|
+
this.documentService
|
|
212
|
+
.deleteProcessDocumentDefinition({
|
|
213
|
+
documentDefinitionName: processDocumentDefinition.id.documentDefinitionId.name,
|
|
214
|
+
processDefinitionKey: processDocumentDefinition.id.processDefinitionKey,
|
|
215
|
+
canInitializeDocument: processDocumentDefinition.canInitializeDocument,
|
|
216
|
+
startableByUser: processDocumentDefinition.startableByUser,
|
|
217
|
+
})
|
|
218
|
+
.subscribe(() => {
|
|
219
|
+
this.alertService.success('Successfully deleted process document definition');
|
|
220
|
+
this.loadProcessDocumentDefinitions();
|
|
221
|
+
}, () => {
|
|
222
|
+
this.alertService.error('Failed to delete process document definition');
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
downloadDefinition() {
|
|
226
|
+
const definition = this.documentDefinition;
|
|
227
|
+
const dataString = 'data:text/json;charset=utf-8,' +
|
|
228
|
+
encodeURIComponent(JSON.stringify(definition.schema, null, 2));
|
|
229
|
+
const downloadAnchorElement = document.getElementById('downloadAnchorElement');
|
|
230
|
+
downloadAnchorElement.setAttribute('href', dataString);
|
|
231
|
+
downloadAnchorElement.setAttribute('download', `${definition.id.name}-v${definition.id.version}.json`);
|
|
232
|
+
downloadAnchorElement.click();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
DossierManagementDetailComponent.decorators = [
|
|
236
|
+
{ type: Component, args: [{
|
|
237
|
+
selector: 'valtimo-dossier-management-detail',
|
|
238
|
+
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\"></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\"></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\">Read-only</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>Connected processes</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=\"fa fa-trash\"></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\"></i> Connect process\n </button>\n </div>\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",
|
|
239
|
+
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}"]
|
|
240
|
+
},] }
|
|
241
|
+
];
|
|
242
|
+
DossierManagementDetailComponent.ctorParameters = () => [
|
|
243
|
+
{ type: DocumentService },
|
|
244
|
+
{ type: ActivatedRoute },
|
|
245
|
+
{ type: AlertService }
|
|
246
|
+
];
|
|
247
|
+
DossierManagementDetailComponent.propDecorators = {
|
|
248
|
+
dossierConnectModal: [{ type: ViewChild, args: ['dossierConnectModal',] }],
|
|
249
|
+
dossierRemoveModal: [{ type: ViewChild, args: ['dossierRemoveModal',] }]
|
|
251
250
|
};
|
|
252
251
|
|
|
253
|
-
/*
|
|
254
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
255
|
-
*
|
|
256
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
257
|
-
* you may not use this file except in compliance with the License.
|
|
258
|
-
* You may obtain a copy of the License at
|
|
259
|
-
*
|
|
260
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
261
|
-
*
|
|
262
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
263
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
264
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
265
|
-
* See the License for the specific language governing permissions and
|
|
266
|
-
* limitations under the License.
|
|
267
|
-
*/
|
|
268
|
-
const moment = moment_;
|
|
269
|
-
moment.locale(localStorage.getItem('langKey') || '');
|
|
270
|
-
class DossierManagementListComponent {
|
|
271
|
-
constructor(documentService, router) {
|
|
272
|
-
this.documentService = documentService;
|
|
273
|
-
this.router = router;
|
|
274
|
-
this.dossiers = [];
|
|
275
|
-
this.pagination = {
|
|
276
|
-
collectionSize: 0,
|
|
277
|
-
page: 1,
|
|
278
|
-
size: 10,
|
|
279
|
-
maxPaginationItemSize: 5,
|
|
280
|
-
};
|
|
281
|
-
this.pageParam = 0;
|
|
282
|
-
this.dossierFields = [
|
|
283
|
-
{ key: 'schema.title', label: 'Title' },
|
|
284
|
-
{ key: 'createdOn', label: 'Created On' },
|
|
285
|
-
{ key: 'readOnly', label: 'Read-only' },
|
|
286
|
-
];
|
|
287
|
-
this.showModal$ = new BehaviorSubject(false);
|
|
288
|
-
}
|
|
289
|
-
paginationClicked(page) {
|
|
290
|
-
this.pageParam = page - 1;
|
|
291
|
-
this.getDocumentDefinitions();
|
|
292
|
-
}
|
|
293
|
-
paginationSet() {
|
|
294
|
-
this.getDocumentDefinitions();
|
|
295
|
-
}
|
|
296
|
-
redirectToDetails(documentDefinition) {
|
|
297
|
-
this.router.navigate(['/dossier-management/dossier', documentDefinition.id.name]);
|
|
298
|
-
}
|
|
299
|
-
getDocumentDefinitions() {
|
|
300
|
-
this.documentService
|
|
301
|
-
.queryDefinitions({ page: this.pageParam, size: this.pagination.size })
|
|
302
|
-
.subscribe((documentDefinitionPage) => {
|
|
303
|
-
this.pagination.collectionSize = documentDefinitionPage.totalElements;
|
|
304
|
-
this.dossiers = documentDefinitionPage.content;
|
|
305
|
-
this.dossiers.map((dossier) => {
|
|
306
|
-
dossier.createdOn = moment(dossier.createdOn).format('DD MMM YYYY HH:mm');
|
|
307
|
-
});
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
showModal() {
|
|
311
|
-
this.showModal$.next(true);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
DossierManagementListComponent.decorators = [
|
|
315
|
-
{ type: Component, args: [{
|
|
316
|
-
selector: 'valtimo-dossier-management-list',
|
|
317
|
-
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\"></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",
|
|
318
|
-
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 */"]
|
|
319
|
-
},] }
|
|
320
|
-
];
|
|
321
|
-
DossierManagementListComponent.ctorParameters = () => [
|
|
322
|
-
{ type: DocumentService },
|
|
323
|
-
{ type: Router }
|
|
252
|
+
/*
|
|
253
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
254
|
+
*
|
|
255
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
256
|
+
* you may not use this file except in compliance with the License.
|
|
257
|
+
* You may obtain a copy of the License at
|
|
258
|
+
*
|
|
259
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
260
|
+
*
|
|
261
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
262
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
263
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
264
|
+
* See the License for the specific language governing permissions and
|
|
265
|
+
* limitations under the License.
|
|
266
|
+
*/
|
|
267
|
+
const moment = moment_;
|
|
268
|
+
moment.locale(localStorage.getItem('langKey') || '');
|
|
269
|
+
class DossierManagementListComponent {
|
|
270
|
+
constructor(documentService, router) {
|
|
271
|
+
this.documentService = documentService;
|
|
272
|
+
this.router = router;
|
|
273
|
+
this.dossiers = [];
|
|
274
|
+
this.pagination = {
|
|
275
|
+
collectionSize: 0,
|
|
276
|
+
page: 1,
|
|
277
|
+
size: 10,
|
|
278
|
+
maxPaginationItemSize: 5,
|
|
279
|
+
};
|
|
280
|
+
this.pageParam = 0;
|
|
281
|
+
this.dossierFields = [
|
|
282
|
+
{ key: 'schema.title', label: 'Title' },
|
|
283
|
+
{ key: 'createdOn', label: 'Created On' },
|
|
284
|
+
{ key: 'readOnly', label: 'Read-only' },
|
|
285
|
+
];
|
|
286
|
+
this.showModal$ = new BehaviorSubject(false);
|
|
287
|
+
}
|
|
288
|
+
paginationClicked(page) {
|
|
289
|
+
this.pageParam = page - 1;
|
|
290
|
+
this.getDocumentDefinitions();
|
|
291
|
+
}
|
|
292
|
+
paginationSet() {
|
|
293
|
+
this.getDocumentDefinitions();
|
|
294
|
+
}
|
|
295
|
+
redirectToDetails(documentDefinition) {
|
|
296
|
+
this.router.navigate(['/dossier-management/dossier', documentDefinition.id.name]);
|
|
297
|
+
}
|
|
298
|
+
getDocumentDefinitions() {
|
|
299
|
+
this.documentService
|
|
300
|
+
.queryDefinitions({ page: this.pageParam, size: this.pagination.size })
|
|
301
|
+
.subscribe((documentDefinitionPage) => {
|
|
302
|
+
this.pagination.collectionSize = documentDefinitionPage.totalElements;
|
|
303
|
+
this.dossiers = documentDefinitionPage.content;
|
|
304
|
+
this.dossiers.map((dossier) => {
|
|
305
|
+
dossier.createdOn = moment(dossier.createdOn).format('DD MMM YYYY HH:mm');
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
showModal() {
|
|
310
|
+
this.showModal$.next(true);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
DossierManagementListComponent.decorators = [
|
|
314
|
+
{ type: Component, args: [{
|
|
315
|
+
selector: 'valtimo-dossier-management-list',
|
|
316
|
+
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\"></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",
|
|
317
|
+
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 */"]
|
|
318
|
+
},] }
|
|
319
|
+
];
|
|
320
|
+
DossierManagementListComponent.ctorParameters = () => [
|
|
321
|
+
{ type: DocumentService },
|
|
322
|
+
{ type: Router }
|
|
324
323
|
];
|
|
325
324
|
|
|
326
|
-
/*
|
|
327
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
328
|
-
*
|
|
329
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
330
|
-
* you may not use this file except in compliance with the License.
|
|
331
|
-
* You may obtain a copy of the License at
|
|
332
|
-
*
|
|
333
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
334
|
-
*
|
|
335
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
336
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
337
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
338
|
-
* See the License for the specific language governing permissions and
|
|
339
|
-
* limitations under the License.
|
|
340
|
-
*/
|
|
341
|
-
const ɵ0 = { title: 'Dossiers', roles: [ROLE_ADMIN] }, ɵ1 = { title: 'Dossier details', roles: [ROLE_ADMIN] };
|
|
342
|
-
const routes = [
|
|
343
|
-
{
|
|
344
|
-
path: 'dossier-management',
|
|
345
|
-
component: DossierManagementListComponent,
|
|
346
|
-
canActivate: [AuthGuardService],
|
|
347
|
-
data: ɵ0,
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
path: 'dossier-management/dossier/:name',
|
|
351
|
-
component: DossierManagementDetailComponent,
|
|
352
|
-
canActivate: [AuthGuardService],
|
|
353
|
-
data: ɵ1,
|
|
354
|
-
},
|
|
355
|
-
];
|
|
356
|
-
class DossierManagementRoutingModule {
|
|
357
|
-
}
|
|
358
|
-
DossierManagementRoutingModule.decorators = [
|
|
359
|
-
{ type: NgModule, args: [{
|
|
360
|
-
imports: [RouterModule.forRoot(routes)],
|
|
361
|
-
exports: [RouterModule],
|
|
362
|
-
declarations: [],
|
|
363
|
-
},] }
|
|
325
|
+
/*
|
|
326
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
327
|
+
*
|
|
328
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
329
|
+
* you may not use this file except in compliance with the License.
|
|
330
|
+
* You may obtain a copy of the License at
|
|
331
|
+
*
|
|
332
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
333
|
+
*
|
|
334
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
335
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
336
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
337
|
+
* See the License for the specific language governing permissions and
|
|
338
|
+
* limitations under the License.
|
|
339
|
+
*/
|
|
340
|
+
const ɵ0 = { title: 'Dossiers', roles: [ROLE_ADMIN] }, ɵ1 = { title: 'Dossier details', roles: [ROLE_ADMIN] };
|
|
341
|
+
const routes = [
|
|
342
|
+
{
|
|
343
|
+
path: 'dossier-management',
|
|
344
|
+
component: DossierManagementListComponent,
|
|
345
|
+
canActivate: [AuthGuardService],
|
|
346
|
+
data: ɵ0,
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
path: 'dossier-management/dossier/:name',
|
|
350
|
+
component: DossierManagementDetailComponent,
|
|
351
|
+
canActivate: [AuthGuardService],
|
|
352
|
+
data: ɵ1,
|
|
353
|
+
},
|
|
354
|
+
];
|
|
355
|
+
class DossierManagementRoutingModule {
|
|
356
|
+
}
|
|
357
|
+
DossierManagementRoutingModule.decorators = [
|
|
358
|
+
{ type: NgModule, args: [{
|
|
359
|
+
imports: [RouterModule.forRoot(routes)],
|
|
360
|
+
exports: [RouterModule],
|
|
361
|
+
declarations: [],
|
|
362
|
+
},] }
|
|
364
363
|
];
|
|
365
364
|
|
|
366
|
-
/*
|
|
367
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
368
|
-
*
|
|
369
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
370
|
-
* you may not use this file except in compliance with the License.
|
|
371
|
-
* You may obtain a copy of the License at
|
|
372
|
-
*
|
|
373
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
374
|
-
*
|
|
375
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
376
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
377
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
378
|
-
* See the License for the specific language governing permissions and
|
|
379
|
-
* limitations under the License.
|
|
380
|
-
*/
|
|
381
|
-
class DossierManagementUploadComponent {
|
|
382
|
-
constructor(documentService, translateService, menuService) {
|
|
383
|
-
this.documentService = documentService;
|
|
384
|
-
this.translateService = translateService;
|
|
385
|
-
this.menuService = menuService;
|
|
386
|
-
this.definitionUploaded = new EventEmitter();
|
|
387
|
-
this.clear$ = new Subject();
|
|
388
|
-
this.jsonString$ = new BehaviorSubject('');
|
|
389
|
-
this.error$ = new BehaviorSubject('');
|
|
390
|
-
this.disabled$ = new BehaviorSubject(false);
|
|
391
|
-
this.file$ = new BehaviorSubject(undefined);
|
|
392
|
-
}
|
|
393
|
-
ngAfterViewInit() {
|
|
394
|
-
this.openShowSubscription();
|
|
395
|
-
this.openFileSubscription();
|
|
396
|
-
}
|
|
397
|
-
ngOnDestroy() {
|
|
398
|
-
this.showSubscription.unsubscribe();
|
|
399
|
-
this.fileSubscription.unsubscribe();
|
|
400
|
-
this.closeErrorSubscription();
|
|
401
|
-
}
|
|
402
|
-
setFile(file) {
|
|
403
|
-
this.clearError();
|
|
404
|
-
this.file$.next(file);
|
|
405
|
-
}
|
|
406
|
-
uploadDefinition() {
|
|
407
|
-
this.disable();
|
|
408
|
-
this.jsonString$
|
|
409
|
-
.pipe(switchMap(jsonString => this.documentService
|
|
410
|
-
.createDocumentDefinition(new DocumentDefinitionCreateRequest(jsonString))
|
|
411
|
-
.pipe(tap(
|
|
412
|
-
// success
|
|
413
|
-
() => {
|
|
414
|
-
this.closeErrorSubscription();
|
|
415
|
-
this.clearError();
|
|
416
|
-
this.enable();
|
|
417
|
-
this.hideModal();
|
|
418
|
-
this.menuService.reload();
|
|
419
|
-
this.definitionUploaded.emit();
|
|
420
|
-
},
|
|
421
|
-
// error
|
|
422
|
-
() => {
|
|
423
|
-
this.openErrorSubscription('dropzone.error.invalidDocDef');
|
|
424
|
-
this.enable();
|
|
425
|
-
}))), take(1))
|
|
426
|
-
.subscribe();
|
|
427
|
-
}
|
|
428
|
-
openErrorSubscription(errorCode) {
|
|
429
|
-
this.closeErrorSubscription();
|
|
430
|
-
this.errorSubscription = this.translateService.stream(errorCode).subscribe(error => {
|
|
431
|
-
this.error$.next(error);
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
closeErrorSubscription() {
|
|
435
|
-
if (this.errorSubscription) {
|
|
436
|
-
this.errorSubscription.unsubscribe();
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
clearError() {
|
|
440
|
-
this.error$.next('');
|
|
441
|
-
}
|
|
442
|
-
openFileSubscription() {
|
|
443
|
-
this.fileSubscription = this.file$.subscribe(file => {
|
|
444
|
-
if (file) {
|
|
445
|
-
const reader = new FileReader();
|
|
446
|
-
reader.onloadend = () => {
|
|
447
|
-
const result = reader.result.toString();
|
|
448
|
-
if (this.stringIsValidJson(result)) {
|
|
449
|
-
this.jsonString$.next(result);
|
|
450
|
-
}
|
|
451
|
-
};
|
|
452
|
-
reader.readAsText(file);
|
|
453
|
-
}
|
|
454
|
-
else {
|
|
455
|
-
this.clearJsonString();
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
openShowSubscription() {
|
|
460
|
-
this.showSubscription = this.show$.subscribe(show => {
|
|
461
|
-
if (show) {
|
|
462
|
-
this.showModal();
|
|
463
|
-
}
|
|
464
|
-
else {
|
|
465
|
-
this.hideModal();
|
|
466
|
-
}
|
|
467
|
-
this.clearJsonString();
|
|
468
|
-
this.clearError();
|
|
469
|
-
this.clearDropzone();
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
clearJsonString() {
|
|
473
|
-
this.jsonString$.next('');
|
|
474
|
-
}
|
|
475
|
-
clearDropzone() {
|
|
476
|
-
this.clear$.next();
|
|
477
|
-
}
|
|
478
|
-
showModal() {
|
|
479
|
-
this.modal.show();
|
|
480
|
-
}
|
|
481
|
-
hideModal() {
|
|
482
|
-
this.modal.hide();
|
|
483
|
-
}
|
|
484
|
-
stringIsValidJson(string) {
|
|
485
|
-
try {
|
|
486
|
-
JSON.parse(string);
|
|
487
|
-
}
|
|
488
|
-
catch (e) {
|
|
489
|
-
return false;
|
|
490
|
-
}
|
|
491
|
-
return true;
|
|
492
|
-
}
|
|
493
|
-
disable() {
|
|
494
|
-
this.disabled$.next(true);
|
|
495
|
-
}
|
|
496
|
-
enable() {
|
|
497
|
-
this.disabled$.next(false);
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
DossierManagementUploadComponent.decorators = [
|
|
501
|
-
{ type: Component, args: [{
|
|
502
|
-
selector: 'valtimo-dossier-management-upload',
|
|
503
|
-
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 {{ '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",
|
|
504
|
-
styles: [""]
|
|
505
|
-
},] }
|
|
506
|
-
];
|
|
507
|
-
DossierManagementUploadComponent.ctorParameters = () => [
|
|
508
|
-
{ type: DocumentService },
|
|
509
|
-
{ type: TranslateService },
|
|
510
|
-
{ type: MenuService }
|
|
511
|
-
];
|
|
512
|
-
DossierManagementUploadComponent.propDecorators = {
|
|
513
|
-
show$: [{ type: Input }],
|
|
514
|
-
definitionUploaded: [{ type: Output }],
|
|
515
|
-
modal: [{ type: ViewChild, args: ['uploadDefinitionModal',] }]
|
|
365
|
+
/*
|
|
366
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
367
|
+
*
|
|
368
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
369
|
+
* you may not use this file except in compliance with the License.
|
|
370
|
+
* You may obtain a copy of the License at
|
|
371
|
+
*
|
|
372
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
373
|
+
*
|
|
374
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
375
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
376
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
377
|
+
* See the License for the specific language governing permissions and
|
|
378
|
+
* limitations under the License.
|
|
379
|
+
*/
|
|
380
|
+
class DossierManagementUploadComponent {
|
|
381
|
+
constructor(documentService, translateService, menuService) {
|
|
382
|
+
this.documentService = documentService;
|
|
383
|
+
this.translateService = translateService;
|
|
384
|
+
this.menuService = menuService;
|
|
385
|
+
this.definitionUploaded = new EventEmitter();
|
|
386
|
+
this.clear$ = new Subject();
|
|
387
|
+
this.jsonString$ = new BehaviorSubject('');
|
|
388
|
+
this.error$ = new BehaviorSubject('');
|
|
389
|
+
this.disabled$ = new BehaviorSubject(false);
|
|
390
|
+
this.file$ = new BehaviorSubject(undefined);
|
|
391
|
+
}
|
|
392
|
+
ngAfterViewInit() {
|
|
393
|
+
this.openShowSubscription();
|
|
394
|
+
this.openFileSubscription();
|
|
395
|
+
}
|
|
396
|
+
ngOnDestroy() {
|
|
397
|
+
this.showSubscription.unsubscribe();
|
|
398
|
+
this.fileSubscription.unsubscribe();
|
|
399
|
+
this.closeErrorSubscription();
|
|
400
|
+
}
|
|
401
|
+
setFile(file) {
|
|
402
|
+
this.clearError();
|
|
403
|
+
this.file$.next(file);
|
|
404
|
+
}
|
|
405
|
+
uploadDefinition() {
|
|
406
|
+
this.disable();
|
|
407
|
+
this.jsonString$
|
|
408
|
+
.pipe(switchMap(jsonString => this.documentService
|
|
409
|
+
.createDocumentDefinition(new DocumentDefinitionCreateRequest(jsonString))
|
|
410
|
+
.pipe(tap(
|
|
411
|
+
// success
|
|
412
|
+
() => {
|
|
413
|
+
this.closeErrorSubscription();
|
|
414
|
+
this.clearError();
|
|
415
|
+
this.enable();
|
|
416
|
+
this.hideModal();
|
|
417
|
+
this.menuService.reload();
|
|
418
|
+
this.definitionUploaded.emit();
|
|
419
|
+
},
|
|
420
|
+
// error
|
|
421
|
+
() => {
|
|
422
|
+
this.openErrorSubscription('dropzone.error.invalidDocDef');
|
|
423
|
+
this.enable();
|
|
424
|
+
}))), take(1))
|
|
425
|
+
.subscribe();
|
|
426
|
+
}
|
|
427
|
+
openErrorSubscription(errorCode) {
|
|
428
|
+
this.closeErrorSubscription();
|
|
429
|
+
this.errorSubscription = this.translateService.stream(errorCode).subscribe(error => {
|
|
430
|
+
this.error$.next(error);
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
closeErrorSubscription() {
|
|
434
|
+
if (this.errorSubscription) {
|
|
435
|
+
this.errorSubscription.unsubscribe();
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
clearError() {
|
|
439
|
+
this.error$.next('');
|
|
440
|
+
}
|
|
441
|
+
openFileSubscription() {
|
|
442
|
+
this.fileSubscription = this.file$.subscribe(file => {
|
|
443
|
+
if (file) {
|
|
444
|
+
const reader = new FileReader();
|
|
445
|
+
reader.onloadend = () => {
|
|
446
|
+
const result = reader.result.toString();
|
|
447
|
+
if (this.stringIsValidJson(result)) {
|
|
448
|
+
this.jsonString$.next(result);
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
reader.readAsText(file);
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
this.clearJsonString();
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
openShowSubscription() {
|
|
459
|
+
this.showSubscription = this.show$.subscribe(show => {
|
|
460
|
+
if (show) {
|
|
461
|
+
this.showModal();
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
this.hideModal();
|
|
465
|
+
}
|
|
466
|
+
this.clearJsonString();
|
|
467
|
+
this.clearError();
|
|
468
|
+
this.clearDropzone();
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
clearJsonString() {
|
|
472
|
+
this.jsonString$.next('');
|
|
473
|
+
}
|
|
474
|
+
clearDropzone() {
|
|
475
|
+
this.clear$.next();
|
|
476
|
+
}
|
|
477
|
+
showModal() {
|
|
478
|
+
this.modal.show();
|
|
479
|
+
}
|
|
480
|
+
hideModal() {
|
|
481
|
+
this.modal.hide();
|
|
482
|
+
}
|
|
483
|
+
stringIsValidJson(string) {
|
|
484
|
+
try {
|
|
485
|
+
JSON.parse(string);
|
|
486
|
+
}
|
|
487
|
+
catch (e) {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
disable() {
|
|
493
|
+
this.disabled$.next(true);
|
|
494
|
+
}
|
|
495
|
+
enable() {
|
|
496
|
+
this.disabled$.next(false);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
DossierManagementUploadComponent.decorators = [
|
|
500
|
+
{ type: Component, args: [{
|
|
501
|
+
selector: 'valtimo-dossier-management-upload',
|
|
502
|
+
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 {{ '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",
|
|
503
|
+
styles: [""]
|
|
504
|
+
},] }
|
|
505
|
+
];
|
|
506
|
+
DossierManagementUploadComponent.ctorParameters = () => [
|
|
507
|
+
{ type: DocumentService },
|
|
508
|
+
{ type: TranslateService },
|
|
509
|
+
{ type: MenuService }
|
|
510
|
+
];
|
|
511
|
+
DossierManagementUploadComponent.propDecorators = {
|
|
512
|
+
show$: [{ type: Input }],
|
|
513
|
+
definitionUploaded: [{ type: Output }],
|
|
514
|
+
modal: [{ type: ViewChild, args: ['uploadDefinitionModal',] }]
|
|
516
515
|
};
|
|
517
516
|
|
|
518
|
-
/*
|
|
519
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
520
|
-
*
|
|
521
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
522
|
-
* you may not use this file except in compliance with the License.
|
|
523
|
-
* You may obtain a copy of the License at
|
|
524
|
-
*
|
|
525
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
526
|
-
*
|
|
527
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
528
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
529
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
530
|
-
* See the License for the specific language governing permissions and
|
|
531
|
-
* limitations under the License.
|
|
532
|
-
*/
|
|
533
|
-
class DossierManagementModule {
|
|
534
|
-
}
|
|
535
|
-
DossierManagementModule.decorators = [
|
|
536
|
-
{ type: NgModule, args: [{
|
|
537
|
-
declarations: [
|
|
538
|
-
DossierManagementListComponent,
|
|
539
|
-
DossierManagementDetailComponent,
|
|
540
|
-
DossierManagementConnectModalComponent,
|
|
541
|
-
DossierManagementRemoveModalComponent,
|
|
542
|
-
DossierManagementUploadComponent,
|
|
543
|
-
],
|
|
544
|
-
imports: [
|
|
545
|
-
CommonModule,
|
|
546
|
-
WidgetModule,
|
|
547
|
-
DropzoneModule,
|
|
548
|
-
ListModule,
|
|
549
|
-
DossierManagementRoutingModule,
|
|
550
|
-
FormsModule,
|
|
551
|
-
TranslateModule,
|
|
552
|
-
ModalModule,
|
|
553
|
-
ConfigModule,
|
|
554
|
-
NgbTooltipModule,
|
|
555
|
-
],
|
|
556
|
-
exports: [],
|
|
557
|
-
entryComponents: [ExtensionComponent],
|
|
558
|
-
},] }
|
|
517
|
+
/*
|
|
518
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
519
|
+
*
|
|
520
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
521
|
+
* you may not use this file except in compliance with the License.
|
|
522
|
+
* You may obtain a copy of the License at
|
|
523
|
+
*
|
|
524
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
525
|
+
*
|
|
526
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
527
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
528
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
529
|
+
* See the License for the specific language governing permissions and
|
|
530
|
+
* limitations under the License.
|
|
531
|
+
*/
|
|
532
|
+
class DossierManagementModule {
|
|
533
|
+
}
|
|
534
|
+
DossierManagementModule.decorators = [
|
|
535
|
+
{ type: NgModule, args: [{
|
|
536
|
+
declarations: [
|
|
537
|
+
DossierManagementListComponent,
|
|
538
|
+
DossierManagementDetailComponent,
|
|
539
|
+
DossierManagementConnectModalComponent,
|
|
540
|
+
DossierManagementRemoveModalComponent,
|
|
541
|
+
DossierManagementUploadComponent,
|
|
542
|
+
],
|
|
543
|
+
imports: [
|
|
544
|
+
CommonModule,
|
|
545
|
+
WidgetModule,
|
|
546
|
+
DropzoneModule,
|
|
547
|
+
ListModule,
|
|
548
|
+
DossierManagementRoutingModule,
|
|
549
|
+
FormsModule,
|
|
550
|
+
TranslateModule,
|
|
551
|
+
ModalModule,
|
|
552
|
+
ConfigModule,
|
|
553
|
+
NgbTooltipModule,
|
|
554
|
+
],
|
|
555
|
+
exports: [],
|
|
556
|
+
entryComponents: [ExtensionComponent],
|
|
557
|
+
},] }
|
|
559
558
|
];
|
|
560
559
|
|
|
561
|
-
/*
|
|
562
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
563
|
-
*
|
|
564
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
565
|
-
* you may not use this file except in compliance with the License.
|
|
566
|
-
* You may obtain a copy of the License at
|
|
567
|
-
*
|
|
568
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
569
|
-
*
|
|
570
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
571
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
572
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
573
|
-
* See the License for the specific language governing permissions and
|
|
574
|
-
* limitations under the License.
|
|
560
|
+
/*
|
|
561
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
562
|
+
*
|
|
563
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
564
|
+
* you may not use this file except in compliance with the License.
|
|
565
|
+
* You may obtain a copy of the License at
|
|
566
|
+
*
|
|
567
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
568
|
+
*
|
|
569
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
570
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
571
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
572
|
+
* See the License for the specific language governing permissions and
|
|
573
|
+
* limitations under the License.
|
|
575
574
|
*/
|
|
576
575
|
|
|
577
|
-
/**
|
|
578
|
-
* Generated bundle index. Do not edit.
|
|
576
|
+
/**
|
|
577
|
+
* Generated bundle index. Do not edit.
|
|
579
578
|
*/
|
|
580
579
|
|
|
581
580
|
export { DossierManagementListComponent, DossierManagementModule, DossierManagementDetailComponent as ɵa, DossierManagementConnectModalComponent as ɵb, DossierManagementRemoveModalComponent as ɵc, DossierManagementUploadComponent as ɵd, DossierManagementRoutingModule as ɵe };
|