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