@valtimo/task 4.15.3-next-main.14 → 4.15.3-next-main.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/valtimo-task.umd.js +807 -807
- package/esm2015/lib/assign-user-to-task/assign-user-to-task.component.js +120 -120
- package/esm2015/lib/task-detail-modal/task-detail-modal.component.js +117 -117
- package/esm2015/lib/task-list/task-list.component.js +154 -154
- package/esm2015/lib/task-routing.module.js +43 -43
- package/esm2015/lib/task.module.js +65 -65
- package/esm2015/lib/task.service.js +59 -59
- package/esm2015/public_api.js +22 -22
- package/esm2015/valtimo-task.js +6 -6
- package/fesm2015/valtimo-task.js +519 -519
- package/lib/assign-user-to-task/assign-user-to-task.component.d.ts +26 -26
- package/lib/task-detail-modal/task-detail-modal.component.d.ts +30 -30
- package/lib/task-list/task-list.component.d.ts +32 -32
- package/lib/task-routing.module.d.ts +2 -2
- package/lib/task.module.d.ts +2 -2
- package/lib/task.service.d.ts +16 -16
- package/package.json +1 -1
- package/public_api.d.ts +4 -4
- package/valtimo-task.d.ts +6 -6
|
@@ -4,829 +4,829 @@
|
|
|
4
4
|
(global = global || self, factory((global.valtimo = global.valtimo || {}, global.valtimo.task = {}), global.ng.core, global.ng.common.http, global.config, global.ng.common, global.ng.forms, global.ng.platformBrowser.animations, global.ngBootstrap, global.core$1, global.components, global.contract, global.ngxToastr, global.ng.router, global.formLink, global.moment, global.ngxLogger, global.rxjs, global.security, global.rxjs.operators));
|
|
5
5
|
}(this, (function (exports, i0, i1, i2, common, forms, animations, ngBootstrap, core, components, contract, ngxToastr, router, formLink, momentImported, ngxLogger, rxjs, security, operators) { 'use strict';
|
|
6
6
|
|
|
7
|
-
/*
|
|
8
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
9
|
-
*
|
|
10
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
11
|
-
* you may not use this file except in compliance with the License.
|
|
12
|
-
* You may obtain a copy of the License at
|
|
13
|
-
*
|
|
14
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
15
|
-
*
|
|
16
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
18
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
-
* See the License for the specific language governing permissions and
|
|
20
|
-
* limitations under the License.
|
|
21
|
-
*/
|
|
22
|
-
var TaskService = /** @class */ (function () {
|
|
23
|
-
function TaskService(http, configService) {
|
|
24
|
-
this.http = http;
|
|
25
|
-
this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;
|
|
26
|
-
}
|
|
27
|
-
TaskService.prototype.queryTasks = function (params) {
|
|
28
|
-
return this.http.get(this.valtimoEndpointUri + "task", { observe: 'response', params: params });
|
|
29
|
-
};
|
|
30
|
-
TaskService.prototype.getTasks = function () {
|
|
31
|
-
return this.http.get(this.valtimoEndpointUri + "task?filter=all");
|
|
32
|
-
};
|
|
33
|
-
TaskService.prototype.getTask = function (id) {
|
|
34
|
-
return this.http.get(this.valtimoEndpointUri + 'task/' + id);
|
|
35
|
-
};
|
|
36
|
-
TaskService.prototype.getCandidateUsers = function (id) {
|
|
37
|
-
return this.http.get(this.valtimoEndpointUri + 'task/' + id + '/candidate-user');
|
|
38
|
-
};
|
|
39
|
-
TaskService.prototype.assignTask = function (id, assigneeRequest) {
|
|
40
|
-
return this.http.post(this.valtimoEndpointUri + 'task/' + id + '/assign', assigneeRequest);
|
|
41
|
-
};
|
|
42
|
-
TaskService.prototype.unassignTask = function (id) {
|
|
43
|
-
return this.http.post(this.valtimoEndpointUri + 'task/' + id + '/unassign', null);
|
|
44
|
-
};
|
|
45
|
-
TaskService.prototype.completeTask = function (id, variables) {
|
|
46
|
-
return this.http.post(this.valtimoEndpointUri + 'task/' + id + '/complete', {
|
|
47
|
-
variables: variables,
|
|
48
|
-
filesToDelete: []
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
return TaskService;
|
|
52
|
-
}());
|
|
53
|
-
TaskService.ɵprov = i0.ɵɵdefineInjectable({ factory: function TaskService_Factory() { return new TaskService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i2.ConfigService)); }, token: TaskService, providedIn: "root" });
|
|
54
|
-
TaskService.decorators = [
|
|
55
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
56
|
-
];
|
|
57
|
-
TaskService.ctorParameters = function () { return [
|
|
58
|
-
{ type: i1.HttpClient },
|
|
59
|
-
{ type: i2.ConfigService }
|
|
7
|
+
/*
|
|
8
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
9
|
+
*
|
|
10
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
11
|
+
* you may not use this file except in compliance with the License.
|
|
12
|
+
* You may obtain a copy of the License at
|
|
13
|
+
*
|
|
14
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
* See the License for the specific language governing permissions and
|
|
20
|
+
* limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
var TaskService = /** @class */ (function () {
|
|
23
|
+
function TaskService(http, configService) {
|
|
24
|
+
this.http = http;
|
|
25
|
+
this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;
|
|
26
|
+
}
|
|
27
|
+
TaskService.prototype.queryTasks = function (params) {
|
|
28
|
+
return this.http.get(this.valtimoEndpointUri + "task", { observe: 'response', params: params });
|
|
29
|
+
};
|
|
30
|
+
TaskService.prototype.getTasks = function () {
|
|
31
|
+
return this.http.get(this.valtimoEndpointUri + "task?filter=all");
|
|
32
|
+
};
|
|
33
|
+
TaskService.prototype.getTask = function (id) {
|
|
34
|
+
return this.http.get(this.valtimoEndpointUri + 'task/' + id);
|
|
35
|
+
};
|
|
36
|
+
TaskService.prototype.getCandidateUsers = function (id) {
|
|
37
|
+
return this.http.get(this.valtimoEndpointUri + 'task/' + id + '/candidate-user');
|
|
38
|
+
};
|
|
39
|
+
TaskService.prototype.assignTask = function (id, assigneeRequest) {
|
|
40
|
+
return this.http.post(this.valtimoEndpointUri + 'task/' + id + '/assign', assigneeRequest);
|
|
41
|
+
};
|
|
42
|
+
TaskService.prototype.unassignTask = function (id) {
|
|
43
|
+
return this.http.post(this.valtimoEndpointUri + 'task/' + id + '/unassign', null);
|
|
44
|
+
};
|
|
45
|
+
TaskService.prototype.completeTask = function (id, variables) {
|
|
46
|
+
return this.http.post(this.valtimoEndpointUri + 'task/' + id + '/complete', {
|
|
47
|
+
variables: variables,
|
|
48
|
+
filesToDelete: []
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
return TaskService;
|
|
52
|
+
}());
|
|
53
|
+
TaskService.ɵprov = i0.ɵɵdefineInjectable({ factory: function TaskService_Factory() { return new TaskService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i2.ConfigService)); }, token: TaskService, providedIn: "root" });
|
|
54
|
+
TaskService.decorators = [
|
|
55
|
+
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
56
|
+
];
|
|
57
|
+
TaskService.ctorParameters = function () { return [
|
|
58
|
+
{ type: i1.HttpClient },
|
|
59
|
+
{ type: i2.ConfigService }
|
|
60
60
|
]; };
|
|
61
61
|
|
|
62
|
-
/*
|
|
63
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
64
|
-
*
|
|
65
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
66
|
-
* you may not use this file except in compliance with the License.
|
|
67
|
-
* You may obtain a copy of the License at
|
|
68
|
-
*
|
|
69
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
70
|
-
*
|
|
71
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
72
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
73
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
74
|
-
* See the License for the specific language governing permissions and
|
|
75
|
-
* limitations under the License.
|
|
76
|
-
*/
|
|
77
|
-
var moment = momentImported;
|
|
78
|
-
moment.locale(localStorage.getItem('langKey') || '');
|
|
79
|
-
var TaskDetailModalComponent = /** @class */ (function () {
|
|
80
|
-
function TaskDetailModalComponent(toastr, formLinkService, router, logger) {
|
|
81
|
-
this.toastr = toastr;
|
|
82
|
-
this.formLinkService = formLinkService;
|
|
83
|
-
this.router = router;
|
|
84
|
-
this.logger = logger;
|
|
85
|
-
this.task = null;
|
|
86
|
-
this.page = null;
|
|
87
|
-
this.formSubmit = new i0.EventEmitter();
|
|
88
|
-
this.assignmentOfTaskChanged = new i0.EventEmitter();
|
|
89
|
-
this.errorMessage = null;
|
|
90
|
-
this.formioOptions = new contract.FormioOptionsImpl();
|
|
91
|
-
this.formioOptions.disableAlerts = true;
|
|
92
|
-
}
|
|
93
|
-
TaskDetailModalComponent.prototype.resetFormDefinition = function () {
|
|
94
|
-
// reset formDefinition in order to reload form-io component
|
|
95
|
-
this.formDefinition = null;
|
|
96
|
-
};
|
|
97
|
-
TaskDetailModalComponent.prototype.openTaskDetails = function (task) {
|
|
98
|
-
var _this = this;
|
|
99
|
-
this.resetFormDefinition();
|
|
100
|
-
this.task = task;
|
|
101
|
-
this.page = {
|
|
102
|
-
title: task.name,
|
|
103
|
-
subtitle: "Created " + moment(task.created).fromNow()
|
|
104
|
-
};
|
|
105
|
-
this.formLinkService
|
|
106
|
-
.getPreFilledFormDefinitionByFormLinkId(task.processDefinitionKey, task.businessKey, task.taskDefinitionKey, task.id // taskInstanceId
|
|
107
|
-
)
|
|
108
|
-
.subscribe(function (formDefinition) {
|
|
109
|
-
_this.formAssociation = formDefinition.formAssociation;
|
|
110
|
-
var className = _this.formAssociation.formLink.className.split('.');
|
|
111
|
-
var linkType = className[className.length - 1];
|
|
112
|
-
switch (linkType) {
|
|
113
|
-
case 'BpmnElementFormIdLink':
|
|
114
|
-
_this.formDefinition = formDefinition;
|
|
115
|
-
_this.modal.show();
|
|
116
|
-
break;
|
|
117
|
-
case 'BpmnElementUrlLink':
|
|
118
|
-
var url = _this.router.serializeUrl(_this.router.createUrlTree([formDefinition.formAssociation.formLink.url]));
|
|
119
|
-
window.open(url, '_blank');
|
|
120
|
-
break;
|
|
121
|
-
case 'BpmnElementAngularStateUrlLink':
|
|
122
|
-
_this.router.navigate([formDefinition.formAssociation.formLink.url]);
|
|
123
|
-
break;
|
|
124
|
-
default:
|
|
125
|
-
_this.logger.fatal('Unsupported class name');
|
|
126
|
-
}
|
|
127
|
-
}, function (errors) {
|
|
128
|
-
var _a;
|
|
129
|
-
if ((_a = errors === null || errors === void 0 ? void 0 : errors.error) === null || _a === void 0 ? void 0 : _a.detail) {
|
|
130
|
-
_this.errorMessage = errors.error.detail;
|
|
131
|
-
}
|
|
132
|
-
_this.modal.show();
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
TaskDetailModalComponent.prototype.gotoFormLinkScreen = function () {
|
|
136
|
-
this.modal.hide();
|
|
137
|
-
this.router.navigate(['form-links']);
|
|
138
|
-
};
|
|
139
|
-
TaskDetailModalComponent.prototype.onSubmit = function (submission) {
|
|
140
|
-
var _this = this;
|
|
141
|
-
this.formLinkService
|
|
142
|
-
.onSubmit(this.task.processDefinitionKey, this.formAssociation.formLink.id, submission.data, this.task.businessKey, this.task.id)
|
|
143
|
-
.subscribe(function (formSubmissionResult) {
|
|
144
|
-
_this.toastr.success(_this.task.name + ' has successfully been completed');
|
|
145
|
-
_this.modal.hide();
|
|
146
|
-
_this.task = null;
|
|
147
|
-
_this.formSubmit.emit();
|
|
148
|
-
}, function (errors) {
|
|
149
|
-
_this.form.showErrors(errors);
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
return TaskDetailModalComponent;
|
|
153
|
-
}());
|
|
154
|
-
TaskDetailModalComponent.decorators = [
|
|
155
|
-
{ type: i0.Component, args: [{
|
|
156
|
-
selector: 'valtimo-task-detail-modal',
|
|
157
|
-
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 #taskDetailModal\n elementId=\"taskDetailModal\"\n [title]=\"page?.title\"\n [subtitle]=\"page?.subtitle\"\n [templateBelowSubtitle]=\"assignUserToTask\"\n>\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io\n #form\n [form]=\"formDefinition\"\n (submit)=\"onSubmit($event)\"\n [options]=\"formioOptions\"\n ></valtimo-form-io>\n </div>\n <div body *ngIf=\"!formDefinition && !errorMessage\">\n <div class=\"bg-warning text-black mb-0 p-3 text-center\" [translate]=\"'formManagement.noFormDefinitionFound'\"></div>\n </div>\n <div body *ngIf=\"errorMessage\">\n <div class=\"bg-danger text-black mb-0 p-3 text-center\">\n {{ errorMessage }}\n </div>\n </div>\n <div footer>\n <div class=\"mb-0 p-3 text-center\" *ngIf=\"!formDefinition\">\n <button class=\"btn btn-secondary btn-space\" type=\"button\" (click)=\"gotoFormLinkScreen()\" id=\"form-link-button\">\n {{ 'formManagement.gotoFormLinksButton' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n\n<ng-template #assignUserToTask>\n <valtimo-assign-user-to-task\n *ngIf=\"task && assignmentOfTaskChanged\"\n [taskId]=\"task.id\"\n [assigneeEmail]=\"task.assignee\"\n (assignmentOfTaskChanged)=\"assignmentOfTaskChanged.emit()\"\n ></valtimo-assign-user-to-task>\n</ng-template>\n",
|
|
158
|
-
encapsulation: i0.ViewEncapsulation.None,
|
|
159
|
-
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 */#taskDetailModal .formio-component-submit{text-align:right}"]
|
|
160
|
-
},] }
|
|
161
|
-
];
|
|
162
|
-
TaskDetailModalComponent.ctorParameters = function () { return [
|
|
163
|
-
{ type: ngxToastr.ToastrService },
|
|
164
|
-
{ type: formLink.FormLinkService },
|
|
165
|
-
{ type: router.Router },
|
|
166
|
-
{ type: ngxLogger.NGXLogger }
|
|
167
|
-
]; };
|
|
168
|
-
TaskDetailModalComponent.propDecorators = {
|
|
169
|
-
form: [{ type: i0.ViewChild, args: ['form',] }],
|
|
170
|
-
modal: [{ type: i0.ViewChild, args: ['taskDetailModal',] }],
|
|
171
|
-
formSubmit: [{ type: i0.Output }],
|
|
172
|
-
assignmentOfTaskChanged: [{ type: i0.Output }]
|
|
62
|
+
/*
|
|
63
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
64
|
+
*
|
|
65
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
66
|
+
* you may not use this file except in compliance with the License.
|
|
67
|
+
* You may obtain a copy of the License at
|
|
68
|
+
*
|
|
69
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
70
|
+
*
|
|
71
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
72
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
73
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
74
|
+
* See the License for the specific language governing permissions and
|
|
75
|
+
* limitations under the License.
|
|
76
|
+
*/
|
|
77
|
+
var moment = momentImported;
|
|
78
|
+
moment.locale(localStorage.getItem('langKey') || '');
|
|
79
|
+
var TaskDetailModalComponent = /** @class */ (function () {
|
|
80
|
+
function TaskDetailModalComponent(toastr, formLinkService, router, logger) {
|
|
81
|
+
this.toastr = toastr;
|
|
82
|
+
this.formLinkService = formLinkService;
|
|
83
|
+
this.router = router;
|
|
84
|
+
this.logger = logger;
|
|
85
|
+
this.task = null;
|
|
86
|
+
this.page = null;
|
|
87
|
+
this.formSubmit = new i0.EventEmitter();
|
|
88
|
+
this.assignmentOfTaskChanged = new i0.EventEmitter();
|
|
89
|
+
this.errorMessage = null;
|
|
90
|
+
this.formioOptions = new contract.FormioOptionsImpl();
|
|
91
|
+
this.formioOptions.disableAlerts = true;
|
|
92
|
+
}
|
|
93
|
+
TaskDetailModalComponent.prototype.resetFormDefinition = function () {
|
|
94
|
+
// reset formDefinition in order to reload form-io component
|
|
95
|
+
this.formDefinition = null;
|
|
96
|
+
};
|
|
97
|
+
TaskDetailModalComponent.prototype.openTaskDetails = function (task) {
|
|
98
|
+
var _this = this;
|
|
99
|
+
this.resetFormDefinition();
|
|
100
|
+
this.task = task;
|
|
101
|
+
this.page = {
|
|
102
|
+
title: task.name,
|
|
103
|
+
subtitle: "Created " + moment(task.created).fromNow()
|
|
104
|
+
};
|
|
105
|
+
this.formLinkService
|
|
106
|
+
.getPreFilledFormDefinitionByFormLinkId(task.processDefinitionKey, task.businessKey, task.taskDefinitionKey, task.id // taskInstanceId
|
|
107
|
+
)
|
|
108
|
+
.subscribe(function (formDefinition) {
|
|
109
|
+
_this.formAssociation = formDefinition.formAssociation;
|
|
110
|
+
var className = _this.formAssociation.formLink.className.split('.');
|
|
111
|
+
var linkType = className[className.length - 1];
|
|
112
|
+
switch (linkType) {
|
|
113
|
+
case 'BpmnElementFormIdLink':
|
|
114
|
+
_this.formDefinition = formDefinition;
|
|
115
|
+
_this.modal.show();
|
|
116
|
+
break;
|
|
117
|
+
case 'BpmnElementUrlLink':
|
|
118
|
+
var url = _this.router.serializeUrl(_this.router.createUrlTree([formDefinition.formAssociation.formLink.url]));
|
|
119
|
+
window.open(url, '_blank');
|
|
120
|
+
break;
|
|
121
|
+
case 'BpmnElementAngularStateUrlLink':
|
|
122
|
+
_this.router.navigate([formDefinition.formAssociation.formLink.url]);
|
|
123
|
+
break;
|
|
124
|
+
default:
|
|
125
|
+
_this.logger.fatal('Unsupported class name');
|
|
126
|
+
}
|
|
127
|
+
}, function (errors) {
|
|
128
|
+
var _a;
|
|
129
|
+
if ((_a = errors === null || errors === void 0 ? void 0 : errors.error) === null || _a === void 0 ? void 0 : _a.detail) {
|
|
130
|
+
_this.errorMessage = errors.error.detail;
|
|
131
|
+
}
|
|
132
|
+
_this.modal.show();
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
TaskDetailModalComponent.prototype.gotoFormLinkScreen = function () {
|
|
136
|
+
this.modal.hide();
|
|
137
|
+
this.router.navigate(['form-links']);
|
|
138
|
+
};
|
|
139
|
+
TaskDetailModalComponent.prototype.onSubmit = function (submission) {
|
|
140
|
+
var _this = this;
|
|
141
|
+
this.formLinkService
|
|
142
|
+
.onSubmit(this.task.processDefinitionKey, this.formAssociation.formLink.id, submission.data, this.task.businessKey, this.task.id)
|
|
143
|
+
.subscribe(function (formSubmissionResult) {
|
|
144
|
+
_this.toastr.success(_this.task.name + ' has successfully been completed');
|
|
145
|
+
_this.modal.hide();
|
|
146
|
+
_this.task = null;
|
|
147
|
+
_this.formSubmit.emit();
|
|
148
|
+
}, function (errors) {
|
|
149
|
+
_this.form.showErrors(errors);
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
return TaskDetailModalComponent;
|
|
153
|
+
}());
|
|
154
|
+
TaskDetailModalComponent.decorators = [
|
|
155
|
+
{ type: i0.Component, args: [{
|
|
156
|
+
selector: 'valtimo-task-detail-modal',
|
|
157
|
+
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 #taskDetailModal\n elementId=\"taskDetailModal\"\n [title]=\"page?.title\"\n [subtitle]=\"page?.subtitle\"\n [templateBelowSubtitle]=\"assignUserToTask\"\n>\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io\n #form\n [form]=\"formDefinition\"\n (submit)=\"onSubmit($event)\"\n [options]=\"formioOptions\"\n ></valtimo-form-io>\n </div>\n <div body *ngIf=\"!formDefinition && !errorMessage\">\n <div class=\"bg-warning text-black mb-0 p-3 text-center\" [translate]=\"'formManagement.noFormDefinitionFound'\"></div>\n </div>\n <div body *ngIf=\"errorMessage\">\n <div class=\"bg-danger text-black mb-0 p-3 text-center\">\n {{ errorMessage }}\n </div>\n </div>\n <div footer>\n <div class=\"mb-0 p-3 text-center\" *ngIf=\"!formDefinition\">\n <button class=\"btn btn-secondary btn-space\" type=\"button\" (click)=\"gotoFormLinkScreen()\" id=\"form-link-button\">\n {{ 'formManagement.gotoFormLinksButton' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n\n<ng-template #assignUserToTask>\n <valtimo-assign-user-to-task\n *ngIf=\"task && assignmentOfTaskChanged\"\n [taskId]=\"task.id\"\n [assigneeEmail]=\"task.assignee\"\n (assignmentOfTaskChanged)=\"assignmentOfTaskChanged.emit()\"\n ></valtimo-assign-user-to-task>\n</ng-template>\n",
|
|
158
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
159
|
+
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 */#taskDetailModal .formio-component-submit{text-align:right}"]
|
|
160
|
+
},] }
|
|
161
|
+
];
|
|
162
|
+
TaskDetailModalComponent.ctorParameters = function () { return [
|
|
163
|
+
{ type: ngxToastr.ToastrService },
|
|
164
|
+
{ type: formLink.FormLinkService },
|
|
165
|
+
{ type: router.Router },
|
|
166
|
+
{ type: ngxLogger.NGXLogger }
|
|
167
|
+
]; };
|
|
168
|
+
TaskDetailModalComponent.propDecorators = {
|
|
169
|
+
form: [{ type: i0.ViewChild, args: ['form',] }],
|
|
170
|
+
modal: [{ type: i0.ViewChild, args: ['taskDetailModal',] }],
|
|
171
|
+
formSubmit: [{ type: i0.Output }],
|
|
172
|
+
assignmentOfTaskChanged: [{ type: i0.Output }]
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
-
/*! *****************************************************************************
|
|
176
|
-
Copyright (c) Microsoft Corporation.
|
|
177
|
-
|
|
178
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
179
|
-
purpose with or without fee is hereby granted.
|
|
180
|
-
|
|
181
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
182
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
183
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
184
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
185
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
186
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
187
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
188
|
-
***************************************************************************** */
|
|
189
|
-
/* global Reflect, Promise */
|
|
190
|
-
var extendStatics = function (d, b) {
|
|
191
|
-
extendStatics = Object.setPrototypeOf ||
|
|
192
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
193
|
-
function (d, b) { for (var p in b)
|
|
194
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
195
|
-
d[p] = b[p]; };
|
|
196
|
-
return extendStatics(d, b);
|
|
197
|
-
};
|
|
198
|
-
function __extends(d, b) {
|
|
199
|
-
extendStatics(d, b);
|
|
200
|
-
function __() { this.constructor = d; }
|
|
201
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
202
|
-
}
|
|
203
|
-
var __assign = function () {
|
|
204
|
-
__assign = Object.assign || function __assign(t) {
|
|
205
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
206
|
-
s = arguments[i];
|
|
207
|
-
for (var p in s)
|
|
208
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
209
|
-
t[p] = s[p];
|
|
210
|
-
}
|
|
211
|
-
return t;
|
|
212
|
-
};
|
|
213
|
-
return __assign.apply(this, arguments);
|
|
214
|
-
};
|
|
215
|
-
function __rest(s, e) {
|
|
216
|
-
var t = {};
|
|
217
|
-
for (var p in s)
|
|
218
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
219
|
-
t[p] = s[p];
|
|
220
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
221
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
222
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
223
|
-
t[p[i]] = s[p[i]];
|
|
224
|
-
}
|
|
225
|
-
return t;
|
|
226
|
-
}
|
|
227
|
-
function __decorate(decorators, target, key, desc) {
|
|
228
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
229
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
230
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
231
|
-
else
|
|
232
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
233
|
-
if (d = decorators[i])
|
|
234
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
235
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
236
|
-
}
|
|
237
|
-
function __param(paramIndex, decorator) {
|
|
238
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
239
|
-
}
|
|
240
|
-
function __metadata(metadataKey, metadataValue) {
|
|
241
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
242
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
243
|
-
}
|
|
244
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
245
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
246
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
247
|
-
function fulfilled(value) { try {
|
|
248
|
-
step(generator.next(value));
|
|
249
|
-
}
|
|
250
|
-
catch (e) {
|
|
251
|
-
reject(e);
|
|
252
|
-
} }
|
|
253
|
-
function rejected(value) { try {
|
|
254
|
-
step(generator["throw"](value));
|
|
255
|
-
}
|
|
256
|
-
catch (e) {
|
|
257
|
-
reject(e);
|
|
258
|
-
} }
|
|
259
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
260
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
function __generator(thisArg, body) {
|
|
264
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
265
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
266
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
267
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
268
|
-
function step(op) {
|
|
269
|
-
if (f)
|
|
270
|
-
throw new TypeError("Generator is already executing.");
|
|
271
|
-
while (_)
|
|
272
|
-
try {
|
|
273
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
274
|
-
return t;
|
|
275
|
-
if (y = 0, t)
|
|
276
|
-
op = [op[0] & 2, t.value];
|
|
277
|
-
switch (op[0]) {
|
|
278
|
-
case 0:
|
|
279
|
-
case 1:
|
|
280
|
-
t = op;
|
|
281
|
-
break;
|
|
282
|
-
case 4:
|
|
283
|
-
_.label++;
|
|
284
|
-
return { value: op[1], done: false };
|
|
285
|
-
case 5:
|
|
286
|
-
_.label++;
|
|
287
|
-
y = op[1];
|
|
288
|
-
op = [0];
|
|
289
|
-
continue;
|
|
290
|
-
case 7:
|
|
291
|
-
op = _.ops.pop();
|
|
292
|
-
_.trys.pop();
|
|
293
|
-
continue;
|
|
294
|
-
default:
|
|
295
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
296
|
-
_ = 0;
|
|
297
|
-
continue;
|
|
298
|
-
}
|
|
299
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
300
|
-
_.label = op[1];
|
|
301
|
-
break;
|
|
302
|
-
}
|
|
303
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
304
|
-
_.label = t[1];
|
|
305
|
-
t = op;
|
|
306
|
-
break;
|
|
307
|
-
}
|
|
308
|
-
if (t && _.label < t[2]) {
|
|
309
|
-
_.label = t[2];
|
|
310
|
-
_.ops.push(op);
|
|
311
|
-
break;
|
|
312
|
-
}
|
|
313
|
-
if (t[2])
|
|
314
|
-
_.ops.pop();
|
|
315
|
-
_.trys.pop();
|
|
316
|
-
continue;
|
|
317
|
-
}
|
|
318
|
-
op = body.call(thisArg, _);
|
|
319
|
-
}
|
|
320
|
-
catch (e) {
|
|
321
|
-
op = [6, e];
|
|
322
|
-
y = 0;
|
|
323
|
-
}
|
|
324
|
-
finally {
|
|
325
|
-
f = t = 0;
|
|
326
|
-
}
|
|
327
|
-
if (op[0] & 5)
|
|
328
|
-
throw op[1];
|
|
329
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
333
|
-
if (k2 === undefined)
|
|
334
|
-
k2 = k;
|
|
335
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
336
|
-
}) : (function (o, m, k, k2) {
|
|
337
|
-
if (k2 === undefined)
|
|
338
|
-
k2 = k;
|
|
339
|
-
o[k2] = m[k];
|
|
340
|
-
});
|
|
341
|
-
function __exportStar(m, o) {
|
|
342
|
-
for (var p in m)
|
|
343
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
344
|
-
__createBinding(o, m, p);
|
|
345
|
-
}
|
|
346
|
-
function __values(o) {
|
|
347
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
348
|
-
if (m)
|
|
349
|
-
return m.call(o);
|
|
350
|
-
if (o && typeof o.length === "number")
|
|
351
|
-
return {
|
|
352
|
-
next: function () {
|
|
353
|
-
if (o && i >= o.length)
|
|
354
|
-
o = void 0;
|
|
355
|
-
return { value: o && o[i++], done: !o };
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
359
|
-
}
|
|
360
|
-
function __read(o, n) {
|
|
361
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
362
|
-
if (!m)
|
|
363
|
-
return o;
|
|
364
|
-
var i = m.call(o), r, ar = [], e;
|
|
365
|
-
try {
|
|
366
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
367
|
-
ar.push(r.value);
|
|
368
|
-
}
|
|
369
|
-
catch (error) {
|
|
370
|
-
e = { error: error };
|
|
371
|
-
}
|
|
372
|
-
finally {
|
|
373
|
-
try {
|
|
374
|
-
if (r && !r.done && (m = i["return"]))
|
|
375
|
-
m.call(i);
|
|
376
|
-
}
|
|
377
|
-
finally {
|
|
378
|
-
if (e)
|
|
379
|
-
throw e.error;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
return ar;
|
|
383
|
-
}
|
|
384
|
-
function __spread() {
|
|
385
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
386
|
-
ar = ar.concat(__read(arguments[i]));
|
|
387
|
-
return ar;
|
|
388
|
-
}
|
|
389
|
-
function __spreadArrays() {
|
|
390
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
391
|
-
s += arguments[i].length;
|
|
392
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
393
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
394
|
-
r[k] = a[j];
|
|
395
|
-
return r;
|
|
396
|
-
}
|
|
397
|
-
;
|
|
398
|
-
function __await(v) {
|
|
399
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
400
|
-
}
|
|
401
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
402
|
-
if (!Symbol.asyncIterator)
|
|
403
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
404
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
405
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
406
|
-
function verb(n) { if (g[n])
|
|
407
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
408
|
-
function resume(n, v) { try {
|
|
409
|
-
step(g[n](v));
|
|
410
|
-
}
|
|
411
|
-
catch (e) {
|
|
412
|
-
settle(q[0][3], e);
|
|
413
|
-
} }
|
|
414
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
415
|
-
function fulfill(value) { resume("next", value); }
|
|
416
|
-
function reject(value) { resume("throw", value); }
|
|
417
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
418
|
-
resume(q[0][0], q[0][1]); }
|
|
419
|
-
}
|
|
420
|
-
function __asyncDelegator(o) {
|
|
421
|
-
var i, p;
|
|
422
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
423
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
424
|
-
}
|
|
425
|
-
function __asyncValues(o) {
|
|
426
|
-
if (!Symbol.asyncIterator)
|
|
427
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
428
|
-
var m = o[Symbol.asyncIterator], i;
|
|
429
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
430
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
431
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
432
|
-
}
|
|
433
|
-
function __makeTemplateObject(cooked, raw) {
|
|
434
|
-
if (Object.defineProperty) {
|
|
435
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
436
|
-
}
|
|
437
|
-
else {
|
|
438
|
-
cooked.raw = raw;
|
|
439
|
-
}
|
|
440
|
-
return cooked;
|
|
441
|
-
}
|
|
442
|
-
;
|
|
443
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
444
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
445
|
-
}) : function (o, v) {
|
|
446
|
-
o["default"] = v;
|
|
447
|
-
};
|
|
448
|
-
function __importStar(mod) {
|
|
449
|
-
if (mod && mod.__esModule)
|
|
450
|
-
return mod;
|
|
451
|
-
var result = {};
|
|
452
|
-
if (mod != null)
|
|
453
|
-
for (var k in mod)
|
|
454
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
455
|
-
__createBinding(result, mod, k);
|
|
456
|
-
__setModuleDefault(result, mod);
|
|
457
|
-
return result;
|
|
458
|
-
}
|
|
459
|
-
function __importDefault(mod) {
|
|
460
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
461
|
-
}
|
|
462
|
-
function __classPrivateFieldGet(receiver, privateMap) {
|
|
463
|
-
if (!privateMap.has(receiver)) {
|
|
464
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
465
|
-
}
|
|
466
|
-
return privateMap.get(receiver);
|
|
467
|
-
}
|
|
468
|
-
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
469
|
-
if (!privateMap.has(receiver)) {
|
|
470
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
471
|
-
}
|
|
472
|
-
privateMap.set(receiver, value);
|
|
473
|
-
return value;
|
|
175
|
+
/*! *****************************************************************************
|
|
176
|
+
Copyright (c) Microsoft Corporation.
|
|
177
|
+
|
|
178
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
179
|
+
purpose with or without fee is hereby granted.
|
|
180
|
+
|
|
181
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
182
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
183
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
184
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
185
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
186
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
187
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
188
|
+
***************************************************************************** */
|
|
189
|
+
/* global Reflect, Promise */
|
|
190
|
+
var extendStatics = function (d, b) {
|
|
191
|
+
extendStatics = Object.setPrototypeOf ||
|
|
192
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
193
|
+
function (d, b) { for (var p in b)
|
|
194
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
195
|
+
d[p] = b[p]; };
|
|
196
|
+
return extendStatics(d, b);
|
|
197
|
+
};
|
|
198
|
+
function __extends(d, b) {
|
|
199
|
+
extendStatics(d, b);
|
|
200
|
+
function __() { this.constructor = d; }
|
|
201
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
202
|
+
}
|
|
203
|
+
var __assign = function () {
|
|
204
|
+
__assign = Object.assign || function __assign(t) {
|
|
205
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
206
|
+
s = arguments[i];
|
|
207
|
+
for (var p in s)
|
|
208
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
209
|
+
t[p] = s[p];
|
|
210
|
+
}
|
|
211
|
+
return t;
|
|
212
|
+
};
|
|
213
|
+
return __assign.apply(this, arguments);
|
|
214
|
+
};
|
|
215
|
+
function __rest(s, e) {
|
|
216
|
+
var t = {};
|
|
217
|
+
for (var p in s)
|
|
218
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
219
|
+
t[p] = s[p];
|
|
220
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
221
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
222
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
223
|
+
t[p[i]] = s[p[i]];
|
|
224
|
+
}
|
|
225
|
+
return t;
|
|
226
|
+
}
|
|
227
|
+
function __decorate(decorators, target, key, desc) {
|
|
228
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
229
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
230
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
231
|
+
else
|
|
232
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
233
|
+
if (d = decorators[i])
|
|
234
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
235
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
236
|
+
}
|
|
237
|
+
function __param(paramIndex, decorator) {
|
|
238
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
239
|
+
}
|
|
240
|
+
function __metadata(metadataKey, metadataValue) {
|
|
241
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
242
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
243
|
+
}
|
|
244
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
245
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
246
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
247
|
+
function fulfilled(value) { try {
|
|
248
|
+
step(generator.next(value));
|
|
249
|
+
}
|
|
250
|
+
catch (e) {
|
|
251
|
+
reject(e);
|
|
252
|
+
} }
|
|
253
|
+
function rejected(value) { try {
|
|
254
|
+
step(generator["throw"](value));
|
|
255
|
+
}
|
|
256
|
+
catch (e) {
|
|
257
|
+
reject(e);
|
|
258
|
+
} }
|
|
259
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
260
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
function __generator(thisArg, body) {
|
|
264
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
265
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
266
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
267
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
268
|
+
function step(op) {
|
|
269
|
+
if (f)
|
|
270
|
+
throw new TypeError("Generator is already executing.");
|
|
271
|
+
while (_)
|
|
272
|
+
try {
|
|
273
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
274
|
+
return t;
|
|
275
|
+
if (y = 0, t)
|
|
276
|
+
op = [op[0] & 2, t.value];
|
|
277
|
+
switch (op[0]) {
|
|
278
|
+
case 0:
|
|
279
|
+
case 1:
|
|
280
|
+
t = op;
|
|
281
|
+
break;
|
|
282
|
+
case 4:
|
|
283
|
+
_.label++;
|
|
284
|
+
return { value: op[1], done: false };
|
|
285
|
+
case 5:
|
|
286
|
+
_.label++;
|
|
287
|
+
y = op[1];
|
|
288
|
+
op = [0];
|
|
289
|
+
continue;
|
|
290
|
+
case 7:
|
|
291
|
+
op = _.ops.pop();
|
|
292
|
+
_.trys.pop();
|
|
293
|
+
continue;
|
|
294
|
+
default:
|
|
295
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
296
|
+
_ = 0;
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
300
|
+
_.label = op[1];
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
304
|
+
_.label = t[1];
|
|
305
|
+
t = op;
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
if (t && _.label < t[2]) {
|
|
309
|
+
_.label = t[2];
|
|
310
|
+
_.ops.push(op);
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
if (t[2])
|
|
314
|
+
_.ops.pop();
|
|
315
|
+
_.trys.pop();
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
op = body.call(thisArg, _);
|
|
319
|
+
}
|
|
320
|
+
catch (e) {
|
|
321
|
+
op = [6, e];
|
|
322
|
+
y = 0;
|
|
323
|
+
}
|
|
324
|
+
finally {
|
|
325
|
+
f = t = 0;
|
|
326
|
+
}
|
|
327
|
+
if (op[0] & 5)
|
|
328
|
+
throw op[1];
|
|
329
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
333
|
+
if (k2 === undefined)
|
|
334
|
+
k2 = k;
|
|
335
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
336
|
+
}) : (function (o, m, k, k2) {
|
|
337
|
+
if (k2 === undefined)
|
|
338
|
+
k2 = k;
|
|
339
|
+
o[k2] = m[k];
|
|
340
|
+
});
|
|
341
|
+
function __exportStar(m, o) {
|
|
342
|
+
for (var p in m)
|
|
343
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
344
|
+
__createBinding(o, m, p);
|
|
345
|
+
}
|
|
346
|
+
function __values(o) {
|
|
347
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
348
|
+
if (m)
|
|
349
|
+
return m.call(o);
|
|
350
|
+
if (o && typeof o.length === "number")
|
|
351
|
+
return {
|
|
352
|
+
next: function () {
|
|
353
|
+
if (o && i >= o.length)
|
|
354
|
+
o = void 0;
|
|
355
|
+
return { value: o && o[i++], done: !o };
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
359
|
+
}
|
|
360
|
+
function __read(o, n) {
|
|
361
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
362
|
+
if (!m)
|
|
363
|
+
return o;
|
|
364
|
+
var i = m.call(o), r, ar = [], e;
|
|
365
|
+
try {
|
|
366
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
367
|
+
ar.push(r.value);
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
e = { error: error };
|
|
371
|
+
}
|
|
372
|
+
finally {
|
|
373
|
+
try {
|
|
374
|
+
if (r && !r.done && (m = i["return"]))
|
|
375
|
+
m.call(i);
|
|
376
|
+
}
|
|
377
|
+
finally {
|
|
378
|
+
if (e)
|
|
379
|
+
throw e.error;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return ar;
|
|
383
|
+
}
|
|
384
|
+
function __spread() {
|
|
385
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
386
|
+
ar = ar.concat(__read(arguments[i]));
|
|
387
|
+
return ar;
|
|
388
|
+
}
|
|
389
|
+
function __spreadArrays() {
|
|
390
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
391
|
+
s += arguments[i].length;
|
|
392
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
393
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
394
|
+
r[k] = a[j];
|
|
395
|
+
return r;
|
|
396
|
+
}
|
|
397
|
+
;
|
|
398
|
+
function __await(v) {
|
|
399
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
400
|
+
}
|
|
401
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
402
|
+
if (!Symbol.asyncIterator)
|
|
403
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
404
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
405
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
406
|
+
function verb(n) { if (g[n])
|
|
407
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
408
|
+
function resume(n, v) { try {
|
|
409
|
+
step(g[n](v));
|
|
410
|
+
}
|
|
411
|
+
catch (e) {
|
|
412
|
+
settle(q[0][3], e);
|
|
413
|
+
} }
|
|
414
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
415
|
+
function fulfill(value) { resume("next", value); }
|
|
416
|
+
function reject(value) { resume("throw", value); }
|
|
417
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
418
|
+
resume(q[0][0], q[0][1]); }
|
|
419
|
+
}
|
|
420
|
+
function __asyncDelegator(o) {
|
|
421
|
+
var i, p;
|
|
422
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
423
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
424
|
+
}
|
|
425
|
+
function __asyncValues(o) {
|
|
426
|
+
if (!Symbol.asyncIterator)
|
|
427
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
428
|
+
var m = o[Symbol.asyncIterator], i;
|
|
429
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
430
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
431
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
432
|
+
}
|
|
433
|
+
function __makeTemplateObject(cooked, raw) {
|
|
434
|
+
if (Object.defineProperty) {
|
|
435
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
cooked.raw = raw;
|
|
439
|
+
}
|
|
440
|
+
return cooked;
|
|
441
|
+
}
|
|
442
|
+
;
|
|
443
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
444
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
445
|
+
}) : function (o, v) {
|
|
446
|
+
o["default"] = v;
|
|
447
|
+
};
|
|
448
|
+
function __importStar(mod) {
|
|
449
|
+
if (mod && mod.__esModule)
|
|
450
|
+
return mod;
|
|
451
|
+
var result = {};
|
|
452
|
+
if (mod != null)
|
|
453
|
+
for (var k in mod)
|
|
454
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
455
|
+
__createBinding(result, mod, k);
|
|
456
|
+
__setModuleDefault(result, mod);
|
|
457
|
+
return result;
|
|
458
|
+
}
|
|
459
|
+
function __importDefault(mod) {
|
|
460
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
461
|
+
}
|
|
462
|
+
function __classPrivateFieldGet(receiver, privateMap) {
|
|
463
|
+
if (!privateMap.has(receiver)) {
|
|
464
|
+
throw new TypeError("attempted to get private field on non-instance");
|
|
465
|
+
}
|
|
466
|
+
return privateMap.get(receiver);
|
|
467
|
+
}
|
|
468
|
+
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
469
|
+
if (!privateMap.has(receiver)) {
|
|
470
|
+
throw new TypeError("attempted to set private field on non-instance");
|
|
471
|
+
}
|
|
472
|
+
privateMap.set(receiver, value);
|
|
473
|
+
return value;
|
|
474
474
|
}
|
|
475
475
|
|
|
476
|
-
var moment$1 = momentImported;
|
|
477
|
-
moment$1.locale(localStorage.getItem('langKey') || '');
|
|
478
|
-
var TaskListComponent = /** @class */ (function () {
|
|
479
|
-
function TaskListComponent(taskService, router, logger, translateService) {
|
|
480
|
-
this.taskService = taskService;
|
|
481
|
-
this.router = router;
|
|
482
|
-
this.logger = logger;
|
|
483
|
-
this.translateService = translateService;
|
|
484
|
-
this.tasks = {
|
|
485
|
-
mine: new contract.TaskList(),
|
|
486
|
-
open: new contract.TaskList(),
|
|
487
|
-
all: new contract.TaskList()
|
|
488
|
-
};
|
|
489
|
-
this.currentTaskType = 'mine';
|
|
490
|
-
this.listTitle = null;
|
|
491
|
-
this.listDescription = null;
|
|
492
|
-
}
|
|
493
|
-
TaskListComponent.prototype.paginationClicked = function (page, type) {
|
|
494
|
-
this.tasks[type].page = page - 1;
|
|
495
|
-
this.getTasks(type);
|
|
496
|
-
};
|
|
497
|
-
TaskListComponent.prototype.paginationSet = function () {
|
|
498
|
-
this.tasks.mine.pagination.size = this.tasks.all.pagination.size = this.tasks.open.pagination.size = this.tasks[this.currentTaskType].pagination.size;
|
|
499
|
-
this.getTasks(this.currentTaskType);
|
|
500
|
-
};
|
|
501
|
-
TaskListComponent.prototype.clearPagination = function (type) {
|
|
502
|
-
this.tasks[type].page = 0;
|
|
503
|
-
};
|
|
504
|
-
TaskListComponent.prototype.tabChange = function (tab) {
|
|
505
|
-
this.clearPagination(this.currentTaskType);
|
|
506
|
-
switch (tab.nextId) {
|
|
507
|
-
case 'ngb-tab-0':
|
|
508
|
-
this.getTasks('mine');
|
|
509
|
-
break;
|
|
510
|
-
case 'ngb-tab-1':
|
|
511
|
-
this.getTasks('open');
|
|
512
|
-
break;
|
|
513
|
-
case 'ngb-tab-2':
|
|
514
|
-
this.getTasks('all');
|
|
515
|
-
break;
|
|
516
|
-
default:
|
|
517
|
-
this.logger.fatal('Unreachable case');
|
|
518
|
-
}
|
|
519
|
-
};
|
|
520
|
-
TaskListComponent.prototype.showTask = function (task) {
|
|
521
|
-
this.router.navigate(['tasks', task.id]);
|
|
522
|
-
};
|
|
523
|
-
TaskListComponent.prototype.getTasks = function (type) {
|
|
524
|
-
var _this = this;
|
|
525
|
-
var params;
|
|
526
|
-
this.translationSubscription = rxjs.combineLatest([
|
|
527
|
-
this.translateService.stream("task-list." + type + ".title"),
|
|
528
|
-
this.translateService.stream("task-list." + type + ".description")
|
|
529
|
-
]).subscribe(function (_a) {
|
|
530
|
-
var _b = __read(_a, 2), title = _b[0], description = _b[1];
|
|
531
|
-
_this.listTitle = title;
|
|
532
|
-
_this.listDescription = description;
|
|
533
|
-
});
|
|
534
|
-
switch (type) {
|
|
535
|
-
case 'mine':
|
|
536
|
-
params = { page: this.tasks.mine.page, size: this.tasks.mine.pagination.size, filter: 'mine' };
|
|
537
|
-
this.currentTaskType = 'mine';
|
|
538
|
-
break;
|
|
539
|
-
case 'open':
|
|
540
|
-
params = { page: this.tasks.open.page, size: this.tasks.open.pagination.size, filter: 'open' };
|
|
541
|
-
this.currentTaskType = 'open';
|
|
542
|
-
break;
|
|
543
|
-
case 'all':
|
|
544
|
-
params = { page: this.tasks.all.page, size: this.tasks.open.pagination.size, filter: 'all' };
|
|
545
|
-
this.currentTaskType = 'all';
|
|
546
|
-
break;
|
|
547
|
-
default:
|
|
548
|
-
this.logger.fatal('Unreachable case');
|
|
549
|
-
}
|
|
550
|
-
this.taskService.queryTasks(params).subscribe(function (results) {
|
|
551
|
-
_this.tasks[type].pagination.collectionSize = results.headers.get('x-total-count');
|
|
552
|
-
_this.tasks[type].tasks = results.body;
|
|
553
|
-
_this.tasks[type].tasks.map(function (task) {
|
|
554
|
-
task.created = moment$1(task.created).format('DD MMM YYYY HH:mm');
|
|
555
|
-
if (task.due) {
|
|
556
|
-
task.due = moment$1(task.due).format('DD MMM YYYY HH:mm');
|
|
557
|
-
}
|
|
558
|
-
});
|
|
559
|
-
_this.tasks[type].fields = [
|
|
560
|
-
{
|
|
561
|
-
key: 'created',
|
|
562
|
-
label: 'Created on'
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
key: 'name',
|
|
566
|
-
label: 'Name'
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
key: 'valtimoAssignee.fullName',
|
|
570
|
-
label: 'Assignee'
|
|
571
|
-
},
|
|
572
|
-
{
|
|
573
|
-
key: 'due',
|
|
574
|
-
label: 'Due date'
|
|
575
|
-
}
|
|
576
|
-
];
|
|
577
|
-
});
|
|
578
|
-
};
|
|
579
|
-
TaskListComponent.prototype.rowOpenTaskClick = function (task) {
|
|
580
|
-
if (!task.endTime) {
|
|
581
|
-
this.taskDetail.openTaskDetails(task);
|
|
582
|
-
}
|
|
583
|
-
else {
|
|
584
|
-
return false;
|
|
585
|
-
}
|
|
586
|
-
};
|
|
587
|
-
TaskListComponent.prototype.ngOnDestroy = function () {
|
|
588
|
-
this.translationSubscription.unsubscribe();
|
|
589
|
-
};
|
|
590
|
-
return TaskListComponent;
|
|
591
|
-
}());
|
|
592
|
-
TaskListComponent.decorators = [
|
|
593
|
-
{ type: i0.Component, args: [{
|
|
594
|
-
selector: 'valtimo-task-list',
|
|
595
|
-
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <valtimo-widget>\n <valtimo-list\n [items]=\"tasks[currentTaskType].tasks\"\n [fields]=\"tasks[currentTaskType].fields\"\n [pagination]=\"tasks[currentTaskType].pagination\"\n [viewMode]=\"true\"\n (paginationClicked)=\"paginationClicked($event, currentTaskType)\"\n (paginationSet)=\"paginationSet()\"\n paginationIdentifier=\"taskList\"\n [isSearchable]=\"true\"\n [header]=\"true\"\n (rowClicked)=\"rowOpenTaskClick($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ listTitle }}</h3>\n <h5 class=\"list-header-description\">{{ listDescription }}</h5>\n </div>\n <div tabs>\n <ngb-tabset [destroyOnHide]=\"false\" (tabChange)=\"tabChange($event)\">\n <ngb-tab id=\"ngb-tab-0\" [title]=\"'task-list.mine.title' | translate\"> </ngb-tab>\n <ngb-tab id=\"ngb-tab-1\" [title]=\"'task-list.open.title' | translate\"> </ngb-tab>\n <ngb-tab id=\"ngb-tab-2\" [title]=\"'task-list.all.title' | translate\"> </ngb-tab>\n </ngb-tabset>\n </div>\n </valtimo-list>\n </valtimo-widget>\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"getTasks(currentTaskType)\"\n (assignmentOfTaskChanged)=\"getTasks(currentTaskType)\"\n ></valtimo-task-detail-modal>\n </div>\n</div>\n",
|
|
596
|
-
encapsulation: i0.ViewEncapsulation.None,
|
|
597
|
-
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 */.tab-content{margin:0;padding:0}.nav.nav-tabs{background-color:#f5f5f5}"]
|
|
598
|
-
},] }
|
|
599
|
-
];
|
|
600
|
-
TaskListComponent.ctorParameters = function () { return [
|
|
601
|
-
{ type: TaskService },
|
|
602
|
-
{ type: router.Router },
|
|
603
|
-
{ type: ngxLogger.NGXLogger },
|
|
604
|
-
{ type: core.TranslateService }
|
|
605
|
-
]; };
|
|
606
|
-
TaskListComponent.propDecorators = {
|
|
607
|
-
taskDetail: [{ type: i0.ViewChild, args: ['taskDetail',] }]
|
|
476
|
+
var moment$1 = momentImported;
|
|
477
|
+
moment$1.locale(localStorage.getItem('langKey') || '');
|
|
478
|
+
var TaskListComponent = /** @class */ (function () {
|
|
479
|
+
function TaskListComponent(taskService, router, logger, translateService) {
|
|
480
|
+
this.taskService = taskService;
|
|
481
|
+
this.router = router;
|
|
482
|
+
this.logger = logger;
|
|
483
|
+
this.translateService = translateService;
|
|
484
|
+
this.tasks = {
|
|
485
|
+
mine: new contract.TaskList(),
|
|
486
|
+
open: new contract.TaskList(),
|
|
487
|
+
all: new contract.TaskList()
|
|
488
|
+
};
|
|
489
|
+
this.currentTaskType = 'mine';
|
|
490
|
+
this.listTitle = null;
|
|
491
|
+
this.listDescription = null;
|
|
492
|
+
}
|
|
493
|
+
TaskListComponent.prototype.paginationClicked = function (page, type) {
|
|
494
|
+
this.tasks[type].page = page - 1;
|
|
495
|
+
this.getTasks(type);
|
|
496
|
+
};
|
|
497
|
+
TaskListComponent.prototype.paginationSet = function () {
|
|
498
|
+
this.tasks.mine.pagination.size = this.tasks.all.pagination.size = this.tasks.open.pagination.size = this.tasks[this.currentTaskType].pagination.size;
|
|
499
|
+
this.getTasks(this.currentTaskType);
|
|
500
|
+
};
|
|
501
|
+
TaskListComponent.prototype.clearPagination = function (type) {
|
|
502
|
+
this.tasks[type].page = 0;
|
|
503
|
+
};
|
|
504
|
+
TaskListComponent.prototype.tabChange = function (tab) {
|
|
505
|
+
this.clearPagination(this.currentTaskType);
|
|
506
|
+
switch (tab.nextId) {
|
|
507
|
+
case 'ngb-tab-0':
|
|
508
|
+
this.getTasks('mine');
|
|
509
|
+
break;
|
|
510
|
+
case 'ngb-tab-1':
|
|
511
|
+
this.getTasks('open');
|
|
512
|
+
break;
|
|
513
|
+
case 'ngb-tab-2':
|
|
514
|
+
this.getTasks('all');
|
|
515
|
+
break;
|
|
516
|
+
default:
|
|
517
|
+
this.logger.fatal('Unreachable case');
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
TaskListComponent.prototype.showTask = function (task) {
|
|
521
|
+
this.router.navigate(['tasks', task.id]);
|
|
522
|
+
};
|
|
523
|
+
TaskListComponent.prototype.getTasks = function (type) {
|
|
524
|
+
var _this = this;
|
|
525
|
+
var params;
|
|
526
|
+
this.translationSubscription = rxjs.combineLatest([
|
|
527
|
+
this.translateService.stream("task-list." + type + ".title"),
|
|
528
|
+
this.translateService.stream("task-list." + type + ".description")
|
|
529
|
+
]).subscribe(function (_a) {
|
|
530
|
+
var _b = __read(_a, 2), title = _b[0], description = _b[1];
|
|
531
|
+
_this.listTitle = title;
|
|
532
|
+
_this.listDescription = description;
|
|
533
|
+
});
|
|
534
|
+
switch (type) {
|
|
535
|
+
case 'mine':
|
|
536
|
+
params = { page: this.tasks.mine.page, size: this.tasks.mine.pagination.size, filter: 'mine' };
|
|
537
|
+
this.currentTaskType = 'mine';
|
|
538
|
+
break;
|
|
539
|
+
case 'open':
|
|
540
|
+
params = { page: this.tasks.open.page, size: this.tasks.open.pagination.size, filter: 'open' };
|
|
541
|
+
this.currentTaskType = 'open';
|
|
542
|
+
break;
|
|
543
|
+
case 'all':
|
|
544
|
+
params = { page: this.tasks.all.page, size: this.tasks.open.pagination.size, filter: 'all' };
|
|
545
|
+
this.currentTaskType = 'all';
|
|
546
|
+
break;
|
|
547
|
+
default:
|
|
548
|
+
this.logger.fatal('Unreachable case');
|
|
549
|
+
}
|
|
550
|
+
this.taskService.queryTasks(params).subscribe(function (results) {
|
|
551
|
+
_this.tasks[type].pagination.collectionSize = results.headers.get('x-total-count');
|
|
552
|
+
_this.tasks[type].tasks = results.body;
|
|
553
|
+
_this.tasks[type].tasks.map(function (task) {
|
|
554
|
+
task.created = moment$1(task.created).format('DD MMM YYYY HH:mm');
|
|
555
|
+
if (task.due) {
|
|
556
|
+
task.due = moment$1(task.due).format('DD MMM YYYY HH:mm');
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
_this.tasks[type].fields = [
|
|
560
|
+
{
|
|
561
|
+
key: 'created',
|
|
562
|
+
label: 'Created on'
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
key: 'name',
|
|
566
|
+
label: 'Name'
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
key: 'valtimoAssignee.fullName',
|
|
570
|
+
label: 'Assignee'
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
key: 'due',
|
|
574
|
+
label: 'Due date'
|
|
575
|
+
}
|
|
576
|
+
];
|
|
577
|
+
});
|
|
578
|
+
};
|
|
579
|
+
TaskListComponent.prototype.rowOpenTaskClick = function (task) {
|
|
580
|
+
if (!task.endTime) {
|
|
581
|
+
this.taskDetail.openTaskDetails(task);
|
|
582
|
+
}
|
|
583
|
+
else {
|
|
584
|
+
return false;
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
TaskListComponent.prototype.ngOnDestroy = function () {
|
|
588
|
+
this.translationSubscription.unsubscribe();
|
|
589
|
+
};
|
|
590
|
+
return TaskListComponent;
|
|
591
|
+
}());
|
|
592
|
+
TaskListComponent.decorators = [
|
|
593
|
+
{ type: i0.Component, args: [{
|
|
594
|
+
selector: 'valtimo-task-list',
|
|
595
|
+
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <valtimo-widget>\n <valtimo-list\n [items]=\"tasks[currentTaskType].tasks\"\n [fields]=\"tasks[currentTaskType].fields\"\n [pagination]=\"tasks[currentTaskType].pagination\"\n [viewMode]=\"true\"\n (paginationClicked)=\"paginationClicked($event, currentTaskType)\"\n (paginationSet)=\"paginationSet()\"\n paginationIdentifier=\"taskList\"\n [isSearchable]=\"true\"\n [header]=\"true\"\n (rowClicked)=\"rowOpenTaskClick($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ listTitle }}</h3>\n <h5 class=\"list-header-description\">{{ listDescription }}</h5>\n </div>\n <div tabs>\n <ngb-tabset [destroyOnHide]=\"false\" (tabChange)=\"tabChange($event)\">\n <ngb-tab id=\"ngb-tab-0\" [title]=\"'task-list.mine.title' | translate\"> </ngb-tab>\n <ngb-tab id=\"ngb-tab-1\" [title]=\"'task-list.open.title' | translate\"> </ngb-tab>\n <ngb-tab id=\"ngb-tab-2\" [title]=\"'task-list.all.title' | translate\"> </ngb-tab>\n </ngb-tabset>\n </div>\n </valtimo-list>\n </valtimo-widget>\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"getTasks(currentTaskType)\"\n (assignmentOfTaskChanged)=\"getTasks(currentTaskType)\"\n ></valtimo-task-detail-modal>\n </div>\n</div>\n",
|
|
596
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
597
|
+
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 */.tab-content{margin:0;padding:0}.nav.nav-tabs{background-color:#f5f5f5}"]
|
|
598
|
+
},] }
|
|
599
|
+
];
|
|
600
|
+
TaskListComponent.ctorParameters = function () { return [
|
|
601
|
+
{ type: TaskService },
|
|
602
|
+
{ type: router.Router },
|
|
603
|
+
{ type: ngxLogger.NGXLogger },
|
|
604
|
+
{ type: core.TranslateService }
|
|
605
|
+
]; };
|
|
606
|
+
TaskListComponent.propDecorators = {
|
|
607
|
+
taskDetail: [{ type: i0.ViewChild, args: ['taskDetail',] }]
|
|
608
608
|
};
|
|
609
609
|
|
|
610
|
-
/*
|
|
611
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
612
|
-
*
|
|
613
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
614
|
-
* you may not use this file except in compliance with the License.
|
|
615
|
-
* You may obtain a copy of the License at
|
|
616
|
-
*
|
|
617
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
618
|
-
*
|
|
619
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
620
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
621
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
622
|
-
* See the License for the specific language governing permissions and
|
|
623
|
-
* limitations under the License.
|
|
624
|
-
*/
|
|
625
|
-
var ɵ0 = { title: 'Tasks', roles: [contract.ROLE_USER] };
|
|
626
|
-
var routes = [
|
|
627
|
-
{
|
|
628
|
-
path: 'tasks',
|
|
629
|
-
component: TaskListComponent,
|
|
630
|
-
canActivate: [security.AuthGuardService],
|
|
631
|
-
data: ɵ0
|
|
632
|
-
}
|
|
633
|
-
];
|
|
634
|
-
var TaskRoutingModule = /** @class */ (function () {
|
|
635
|
-
function TaskRoutingModule() {
|
|
636
|
-
}
|
|
637
|
-
return TaskRoutingModule;
|
|
638
|
-
}());
|
|
639
|
-
TaskRoutingModule.decorators = [
|
|
640
|
-
{ type: i0.NgModule, args: [{
|
|
641
|
-
declarations: [],
|
|
642
|
-
imports: [
|
|
643
|
-
common.CommonModule,
|
|
644
|
-
router.RouterModule.forChild(routes),
|
|
645
|
-
],
|
|
646
|
-
exports: [router.RouterModule]
|
|
647
|
-
},] }
|
|
610
|
+
/*
|
|
611
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
612
|
+
*
|
|
613
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
614
|
+
* you may not use this file except in compliance with the License.
|
|
615
|
+
* You may obtain a copy of the License at
|
|
616
|
+
*
|
|
617
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
618
|
+
*
|
|
619
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
620
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
621
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
622
|
+
* See the License for the specific language governing permissions and
|
|
623
|
+
* limitations under the License.
|
|
624
|
+
*/
|
|
625
|
+
var ɵ0 = { title: 'Tasks', roles: [contract.ROLE_USER] };
|
|
626
|
+
var routes = [
|
|
627
|
+
{
|
|
628
|
+
path: 'tasks',
|
|
629
|
+
component: TaskListComponent,
|
|
630
|
+
canActivate: [security.AuthGuardService],
|
|
631
|
+
data: ɵ0
|
|
632
|
+
}
|
|
633
|
+
];
|
|
634
|
+
var TaskRoutingModule = /** @class */ (function () {
|
|
635
|
+
function TaskRoutingModule() {
|
|
636
|
+
}
|
|
637
|
+
return TaskRoutingModule;
|
|
638
|
+
}());
|
|
639
|
+
TaskRoutingModule.decorators = [
|
|
640
|
+
{ type: i0.NgModule, args: [{
|
|
641
|
+
declarations: [],
|
|
642
|
+
imports: [
|
|
643
|
+
common.CommonModule,
|
|
644
|
+
router.RouterModule.forChild(routes),
|
|
645
|
+
],
|
|
646
|
+
exports: [router.RouterModule]
|
|
647
|
+
},] }
|
|
648
648
|
];
|
|
649
649
|
|
|
650
|
-
var AssignUserToTaskComponent = /** @class */ (function () {
|
|
651
|
-
function AssignUserToTaskComponent(taskService) {
|
|
652
|
-
this.taskService = taskService;
|
|
653
|
-
this.assignmentOfTaskChanged = new i0.EventEmitter();
|
|
654
|
-
this.candidateUsersForTask$ = new rxjs.BehaviorSubject(undefined);
|
|
655
|
-
this.disabled$ = new rxjs.BehaviorSubject(true);
|
|
656
|
-
this.assignedEmailOnServer$ = new rxjs.BehaviorSubject(null);
|
|
657
|
-
this.userEmailToAssign = null;
|
|
658
|
-
this.assignedUserFullName$ = new rxjs.BehaviorSubject(null);
|
|
659
|
-
}
|
|
660
|
-
AssignUserToTaskComponent.prototype.ngOnInit = function () {
|
|
661
|
-
var _this = this;
|
|
662
|
-
this.taskService.getCandidateUsers(this.taskId).subscribe(function (candidateUsers) {
|
|
663
|
-
_this.candidateUsersForTask$.next(candidateUsers);
|
|
664
|
-
if (_this.assigneeEmail) {
|
|
665
|
-
_this.assignedEmailOnServer$.next(_this.assigneeEmail);
|
|
666
|
-
_this.userEmailToAssign = _this.assigneeEmail;
|
|
667
|
-
_this.assignedUserFullName$.next(_this.getAssignedUserName(candidateUsers, _this.assigneeEmail));
|
|
668
|
-
}
|
|
669
|
-
_this.enable();
|
|
670
|
-
});
|
|
671
|
-
};
|
|
672
|
-
AssignUserToTaskComponent.prototype.ngOnChanges = function (changes) {
|
|
673
|
-
var _this = this;
|
|
674
|
-
var assigneeEmail = changes.assigneeEmail;
|
|
675
|
-
if (assigneeEmail) {
|
|
676
|
-
this.candidateUsersForTask$.pipe(operators.take(1)).subscribe(function (candidateUsers) {
|
|
677
|
-
var currentUserEmail = assigneeEmail.currentValue;
|
|
678
|
-
_this.assignedEmailOnServer$.next(currentUserEmail || null);
|
|
679
|
-
_this.userEmailToAssign = currentUserEmail || null;
|
|
680
|
-
_this.assignedUserFullName$.next(_this.getAssignedUserName(candidateUsers, currentUserEmail));
|
|
681
|
-
});
|
|
682
|
-
}
|
|
683
|
-
else {
|
|
684
|
-
this.clear();
|
|
685
|
-
}
|
|
686
|
-
};
|
|
687
|
-
AssignUserToTaskComponent.prototype.assignTask = function (userEmail) {
|
|
688
|
-
var _this = this;
|
|
689
|
-
this.disable();
|
|
690
|
-
rxjs.combineLatest([this.candidateUsersForTask$, this.taskService.assignTask(this.taskId, { assignee: userEmail })])
|
|
691
|
-
.pipe(operators.take(1), operators.tap(function (_b) {
|
|
692
|
-
var _c = __read(_b, 1), candidateUsers = _c[0];
|
|
693
|
-
_this.userEmailToAssign = userEmail;
|
|
694
|
-
_this.assignedEmailOnServer$.next(userEmail);
|
|
695
|
-
_this.assignedUserFullName$.next(_this.getAssignedUserName(candidateUsers, userEmail));
|
|
696
|
-
_this.emitChange();
|
|
697
|
-
_this.enable();
|
|
698
|
-
}))
|
|
699
|
-
.subscribe();
|
|
700
|
-
};
|
|
701
|
-
AssignUserToTaskComponent.prototype.unassignTask = function () {
|
|
702
|
-
var _this = this;
|
|
703
|
-
this.disable();
|
|
704
|
-
this.taskService
|
|
705
|
-
.unassignTask(this.taskId)
|
|
706
|
-
.pipe(operators.tap(function () {
|
|
707
|
-
_this.clear();
|
|
708
|
-
_this.emitChange();
|
|
709
|
-
_this.enable();
|
|
710
|
-
}))
|
|
711
|
-
.subscribe();
|
|
712
|
-
};
|
|
713
|
-
AssignUserToTaskComponent.prototype.getAssignedUserName = function (users, userEmail) {
|
|
714
|
-
if (users && userEmail) {
|
|
715
|
-
var findUser = users.find(function (user) { return user.email === userEmail; });
|
|
716
|
-
return findUser ? findUser.fullName : '';
|
|
717
|
-
}
|
|
718
|
-
return '';
|
|
719
|
-
};
|
|
720
|
-
AssignUserToTaskComponent.prototype.mapUsersForDropdown = function (users) {
|
|
721
|
-
return (users &&
|
|
722
|
-
users
|
|
723
|
-
.map(function (user) { var _a; return (Object.assign(Object.assign({}, user), { lastName: ((_a = user.lastName) === null || _a === void 0 ? void 0 : _a.split(' ').splice(-1)[0]) || '' })); })
|
|
724
|
-
.sort(function (a, b) { return a.lastName.localeCompare(b.lastName); })
|
|
725
|
-
.map(function (user) { return ({ text: user.fullName, id: user.email }); }));
|
|
726
|
-
};
|
|
727
|
-
AssignUserToTaskComponent.prototype.clear = function () {
|
|
728
|
-
this.assignedEmailOnServer$.next(null);
|
|
729
|
-
this.userEmailToAssign = null;
|
|
730
|
-
};
|
|
731
|
-
AssignUserToTaskComponent.prototype.emitChange = function () {
|
|
732
|
-
this.assignmentOfTaskChanged.emit();
|
|
733
|
-
};
|
|
734
|
-
AssignUserToTaskComponent.prototype.enable = function () {
|
|
735
|
-
this.disabled$.next(false);
|
|
736
|
-
};
|
|
737
|
-
AssignUserToTaskComponent.prototype.disable = function () {
|
|
738
|
-
this.disabled$.next(true);
|
|
739
|
-
};
|
|
740
|
-
return AssignUserToTaskComponent;
|
|
741
|
-
}());
|
|
742
|
-
AssignUserToTaskComponent.decorators = [
|
|
743
|
-
{ type: i0.Component, args: [{
|
|
744
|
-
selector: 'valtimo-assign-user-to-task',
|
|
745
|
-
template: "<ng-container\n *ngIf=\"{\n candidateUsers: candidateUsersForTask$ | async,\n disabled: disabled$ | async,\n emailOnServer: assignedEmailOnServer$ | async\n } as obs\"\n>\n <div class=\"container-fluid\">\n <div class=\"row mt-2 mb-2\">\n <div class=\"col-12 pl-0 d-flex flex-row align-items-center\">\n <ng-container *ngIf=\"obs.candidateUsers; else loading\">\n <valtimo-searchable-dropdown-select\n [style]=\"'underlinedText'\"\n [items]=\"mapUsersForDropdown(obs.candidateUsers)\"\n [buttonText]=\"'assignTask.header' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [disabled]=\"obs.disabled\"\n [selectedText]=\"'assignTask.assignedTo' | translate\"\n [selectedTextValue]=\"assignedUserFullName$ | async\"\n [clearSelectionButtonTitle]=\"'assignTask.remove' | translate\"\n [hasSelection]=\"userEmailToAssign === obs.emailOnServer && obs.emailOnServer !== null\"\n [width]=\"250\"\n (itemSelected)=\"assignTask($event)\"\n (clearSelection)=\"unassignTask()\"\n >\n </valtimo-searchable-dropdown-select>\n </ng-container>\n </div>\n </div>\n </div>\n</ng-container>\n\n<ng-template #loading>\n <h5><b>{{'assignTask.fetchingUsers' | translate}}</b></h5>\n</ng-template>\n\n",
|
|
746
|
-
styles: [".container-fluid{color:#959595}i{font-size:13px}"]
|
|
747
|
-
},] }
|
|
748
|
-
];
|
|
749
|
-
AssignUserToTaskComponent.ctorParameters = function () { return [
|
|
750
|
-
{ type: TaskService }
|
|
751
|
-
]; };
|
|
752
|
-
AssignUserToTaskComponent.propDecorators = {
|
|
753
|
-
taskId: [{ type: i0.Input }],
|
|
754
|
-
assigneeEmail: [{ type: i0.Input }],
|
|
755
|
-
assignmentOfTaskChanged: [{ type: i0.Output }]
|
|
650
|
+
var AssignUserToTaskComponent = /** @class */ (function () {
|
|
651
|
+
function AssignUserToTaskComponent(taskService) {
|
|
652
|
+
this.taskService = taskService;
|
|
653
|
+
this.assignmentOfTaskChanged = new i0.EventEmitter();
|
|
654
|
+
this.candidateUsersForTask$ = new rxjs.BehaviorSubject(undefined);
|
|
655
|
+
this.disabled$ = new rxjs.BehaviorSubject(true);
|
|
656
|
+
this.assignedEmailOnServer$ = new rxjs.BehaviorSubject(null);
|
|
657
|
+
this.userEmailToAssign = null;
|
|
658
|
+
this.assignedUserFullName$ = new rxjs.BehaviorSubject(null);
|
|
659
|
+
}
|
|
660
|
+
AssignUserToTaskComponent.prototype.ngOnInit = function () {
|
|
661
|
+
var _this = this;
|
|
662
|
+
this.taskService.getCandidateUsers(this.taskId).subscribe(function (candidateUsers) {
|
|
663
|
+
_this.candidateUsersForTask$.next(candidateUsers);
|
|
664
|
+
if (_this.assigneeEmail) {
|
|
665
|
+
_this.assignedEmailOnServer$.next(_this.assigneeEmail);
|
|
666
|
+
_this.userEmailToAssign = _this.assigneeEmail;
|
|
667
|
+
_this.assignedUserFullName$.next(_this.getAssignedUserName(candidateUsers, _this.assigneeEmail));
|
|
668
|
+
}
|
|
669
|
+
_this.enable();
|
|
670
|
+
});
|
|
671
|
+
};
|
|
672
|
+
AssignUserToTaskComponent.prototype.ngOnChanges = function (changes) {
|
|
673
|
+
var _this = this;
|
|
674
|
+
var assigneeEmail = changes.assigneeEmail;
|
|
675
|
+
if (assigneeEmail) {
|
|
676
|
+
this.candidateUsersForTask$.pipe(operators.take(1)).subscribe(function (candidateUsers) {
|
|
677
|
+
var currentUserEmail = assigneeEmail.currentValue;
|
|
678
|
+
_this.assignedEmailOnServer$.next(currentUserEmail || null);
|
|
679
|
+
_this.userEmailToAssign = currentUserEmail || null;
|
|
680
|
+
_this.assignedUserFullName$.next(_this.getAssignedUserName(candidateUsers, currentUserEmail));
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
this.clear();
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
AssignUserToTaskComponent.prototype.assignTask = function (userEmail) {
|
|
688
|
+
var _this = this;
|
|
689
|
+
this.disable();
|
|
690
|
+
rxjs.combineLatest([this.candidateUsersForTask$, this.taskService.assignTask(this.taskId, { assignee: userEmail })])
|
|
691
|
+
.pipe(operators.take(1), operators.tap(function (_b) {
|
|
692
|
+
var _c = __read(_b, 1), candidateUsers = _c[0];
|
|
693
|
+
_this.userEmailToAssign = userEmail;
|
|
694
|
+
_this.assignedEmailOnServer$.next(userEmail);
|
|
695
|
+
_this.assignedUserFullName$.next(_this.getAssignedUserName(candidateUsers, userEmail));
|
|
696
|
+
_this.emitChange();
|
|
697
|
+
_this.enable();
|
|
698
|
+
}))
|
|
699
|
+
.subscribe();
|
|
700
|
+
};
|
|
701
|
+
AssignUserToTaskComponent.prototype.unassignTask = function () {
|
|
702
|
+
var _this = this;
|
|
703
|
+
this.disable();
|
|
704
|
+
this.taskService
|
|
705
|
+
.unassignTask(this.taskId)
|
|
706
|
+
.pipe(operators.tap(function () {
|
|
707
|
+
_this.clear();
|
|
708
|
+
_this.emitChange();
|
|
709
|
+
_this.enable();
|
|
710
|
+
}))
|
|
711
|
+
.subscribe();
|
|
712
|
+
};
|
|
713
|
+
AssignUserToTaskComponent.prototype.getAssignedUserName = function (users, userEmail) {
|
|
714
|
+
if (users && userEmail) {
|
|
715
|
+
var findUser = users.find(function (user) { return user.email === userEmail; });
|
|
716
|
+
return findUser ? findUser.fullName : '';
|
|
717
|
+
}
|
|
718
|
+
return '';
|
|
719
|
+
};
|
|
720
|
+
AssignUserToTaskComponent.prototype.mapUsersForDropdown = function (users) {
|
|
721
|
+
return (users &&
|
|
722
|
+
users
|
|
723
|
+
.map(function (user) { var _a; return (Object.assign(Object.assign({}, user), { lastName: ((_a = user.lastName) === null || _a === void 0 ? void 0 : _a.split(' ').splice(-1)[0]) || '' })); })
|
|
724
|
+
.sort(function (a, b) { return a.lastName.localeCompare(b.lastName); })
|
|
725
|
+
.map(function (user) { return ({ text: user.fullName, id: user.email }); }));
|
|
726
|
+
};
|
|
727
|
+
AssignUserToTaskComponent.prototype.clear = function () {
|
|
728
|
+
this.assignedEmailOnServer$.next(null);
|
|
729
|
+
this.userEmailToAssign = null;
|
|
730
|
+
};
|
|
731
|
+
AssignUserToTaskComponent.prototype.emitChange = function () {
|
|
732
|
+
this.assignmentOfTaskChanged.emit();
|
|
733
|
+
};
|
|
734
|
+
AssignUserToTaskComponent.prototype.enable = function () {
|
|
735
|
+
this.disabled$.next(false);
|
|
736
|
+
};
|
|
737
|
+
AssignUserToTaskComponent.prototype.disable = function () {
|
|
738
|
+
this.disabled$.next(true);
|
|
739
|
+
};
|
|
740
|
+
return AssignUserToTaskComponent;
|
|
741
|
+
}());
|
|
742
|
+
AssignUserToTaskComponent.decorators = [
|
|
743
|
+
{ type: i0.Component, args: [{
|
|
744
|
+
selector: 'valtimo-assign-user-to-task',
|
|
745
|
+
template: "<ng-container\n *ngIf=\"{\n candidateUsers: candidateUsersForTask$ | async,\n disabled: disabled$ | async,\n emailOnServer: assignedEmailOnServer$ | async\n } as obs\"\n>\n <div class=\"container-fluid\">\n <div class=\"row mt-2 mb-2\">\n <div class=\"col-12 pl-0 d-flex flex-row align-items-center\">\n <ng-container *ngIf=\"obs.candidateUsers; else loading\">\n <valtimo-searchable-dropdown-select\n [style]=\"'underlinedText'\"\n [items]=\"mapUsersForDropdown(obs.candidateUsers)\"\n [buttonText]=\"'assignTask.header' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [disabled]=\"obs.disabled\"\n [selectedText]=\"'assignTask.assignedTo' | translate\"\n [selectedTextValue]=\"assignedUserFullName$ | async\"\n [clearSelectionButtonTitle]=\"'assignTask.remove' | translate\"\n [hasSelection]=\"userEmailToAssign === obs.emailOnServer && obs.emailOnServer !== null\"\n [width]=\"250\"\n (itemSelected)=\"assignTask($event)\"\n (clearSelection)=\"unassignTask()\"\n >\n </valtimo-searchable-dropdown-select>\n </ng-container>\n </div>\n </div>\n </div>\n</ng-container>\n\n<ng-template #loading>\n <h5><b>{{'assignTask.fetchingUsers' | translate}}</b></h5>\n</ng-template>\n\n",
|
|
746
|
+
styles: [".container-fluid{color:#959595}i{font-size:13px}"]
|
|
747
|
+
},] }
|
|
748
|
+
];
|
|
749
|
+
AssignUserToTaskComponent.ctorParameters = function () { return [
|
|
750
|
+
{ type: TaskService }
|
|
751
|
+
]; };
|
|
752
|
+
AssignUserToTaskComponent.propDecorators = {
|
|
753
|
+
taskId: [{ type: i0.Input }],
|
|
754
|
+
assigneeEmail: [{ type: i0.Input }],
|
|
755
|
+
assignmentOfTaskChanged: [{ type: i0.Output }]
|
|
756
756
|
};
|
|
757
757
|
|
|
758
|
-
/*
|
|
759
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
760
|
-
*
|
|
761
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
762
|
-
* you may not use this file except in compliance with the License.
|
|
763
|
-
* You may obtain a copy of the License at
|
|
764
|
-
*
|
|
765
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
766
|
-
*
|
|
767
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
768
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
769
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
770
|
-
* See the License for the specific language governing permissions and
|
|
771
|
-
* limitations under the License.
|
|
772
|
-
*/
|
|
773
|
-
var ɵ0$1 = contract.HttpLoaderFactory;
|
|
774
|
-
var TaskModule = /** @class */ (function () {
|
|
775
|
-
function TaskModule() {
|
|
776
|
-
}
|
|
777
|
-
return TaskModule;
|
|
778
|
-
}());
|
|
779
|
-
TaskModule.decorators = [
|
|
780
|
-
{ type: i0.NgModule, args: [{
|
|
781
|
-
declarations: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent],
|
|
782
|
-
imports: [
|
|
783
|
-
common.CommonModule,
|
|
784
|
-
TaskRoutingModule,
|
|
785
|
-
components.ListModule,
|
|
786
|
-
components.PageHeaderModule,
|
|
787
|
-
components.WidgetModule,
|
|
788
|
-
components.SpinnerModule,
|
|
789
|
-
components.SearchableDropdownSelectModule,
|
|
790
|
-
components.CamundaFormModule,
|
|
791
|
-
animations.BrowserAnimationsModule,
|
|
792
|
-
forms.FormsModule,
|
|
793
|
-
ngxToastr.ToastrModule.forRoot({
|
|
794
|
-
positionClass: 'toast-bottom-full-width',
|
|
795
|
-
preventDuplicates: true
|
|
796
|
-
}),
|
|
797
|
-
core.TranslateModule.forRoot({
|
|
798
|
-
loader: {
|
|
799
|
-
provide: core.TranslateLoader,
|
|
800
|
-
useFactory: ɵ0$1,
|
|
801
|
-
deps: [i1.HttpClient]
|
|
802
|
-
}
|
|
803
|
-
}),
|
|
804
|
-
ngBootstrap.NgbModule,
|
|
805
|
-
components.FormIoModule,
|
|
806
|
-
components.ModalModule
|
|
807
|
-
],
|
|
808
|
-
exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent]
|
|
809
|
-
},] }
|
|
758
|
+
/*
|
|
759
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
760
|
+
*
|
|
761
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
762
|
+
* you may not use this file except in compliance with the License.
|
|
763
|
+
* You may obtain a copy of the License at
|
|
764
|
+
*
|
|
765
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
766
|
+
*
|
|
767
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
768
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
769
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
770
|
+
* See the License for the specific language governing permissions and
|
|
771
|
+
* limitations under the License.
|
|
772
|
+
*/
|
|
773
|
+
var ɵ0$1 = contract.HttpLoaderFactory;
|
|
774
|
+
var TaskModule = /** @class */ (function () {
|
|
775
|
+
function TaskModule() {
|
|
776
|
+
}
|
|
777
|
+
return TaskModule;
|
|
778
|
+
}());
|
|
779
|
+
TaskModule.decorators = [
|
|
780
|
+
{ type: i0.NgModule, args: [{
|
|
781
|
+
declarations: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent],
|
|
782
|
+
imports: [
|
|
783
|
+
common.CommonModule,
|
|
784
|
+
TaskRoutingModule,
|
|
785
|
+
components.ListModule,
|
|
786
|
+
components.PageHeaderModule,
|
|
787
|
+
components.WidgetModule,
|
|
788
|
+
components.SpinnerModule,
|
|
789
|
+
components.SearchableDropdownSelectModule,
|
|
790
|
+
components.CamundaFormModule,
|
|
791
|
+
animations.BrowserAnimationsModule,
|
|
792
|
+
forms.FormsModule,
|
|
793
|
+
ngxToastr.ToastrModule.forRoot({
|
|
794
|
+
positionClass: 'toast-bottom-full-width',
|
|
795
|
+
preventDuplicates: true
|
|
796
|
+
}),
|
|
797
|
+
core.TranslateModule.forRoot({
|
|
798
|
+
loader: {
|
|
799
|
+
provide: core.TranslateLoader,
|
|
800
|
+
useFactory: ɵ0$1,
|
|
801
|
+
deps: [i1.HttpClient]
|
|
802
|
+
}
|
|
803
|
+
}),
|
|
804
|
+
ngBootstrap.NgbModule,
|
|
805
|
+
components.FormIoModule,
|
|
806
|
+
components.ModalModule
|
|
807
|
+
],
|
|
808
|
+
exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent]
|
|
809
|
+
},] }
|
|
810
810
|
];
|
|
811
811
|
|
|
812
|
-
/*
|
|
813
|
-
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
814
|
-
*
|
|
815
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
816
|
-
* you may not use this file except in compliance with the License.
|
|
817
|
-
* You may obtain a copy of the License at
|
|
818
|
-
*
|
|
819
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
820
|
-
*
|
|
821
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
822
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
823
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
824
|
-
* See the License for the specific language governing permissions and
|
|
825
|
-
* limitations under the License.
|
|
812
|
+
/*
|
|
813
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
814
|
+
*
|
|
815
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
816
|
+
* you may not use this file except in compliance with the License.
|
|
817
|
+
* You may obtain a copy of the License at
|
|
818
|
+
*
|
|
819
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
820
|
+
*
|
|
821
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
822
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
823
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
824
|
+
* See the License for the specific language governing permissions and
|
|
825
|
+
* limitations under the License.
|
|
826
826
|
*/
|
|
827
827
|
|
|
828
|
-
/**
|
|
829
|
-
* Generated bundle index. Do not edit.
|
|
828
|
+
/**
|
|
829
|
+
* Generated bundle index. Do not edit.
|
|
830
830
|
*/
|
|
831
831
|
|
|
832
832
|
exports.TaskDetailModalComponent = TaskDetailModalComponent;
|