@valtimo/task 10.8.0 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/esm2022/lib/assign-user-to-task/assign-user-to-task.component.mjs +122 -0
  2. package/esm2022/lib/models/task-list.model.mjs +28 -0
  3. package/{esm2020 → esm2022}/lib/models/task.model.mjs +1 -1
  4. package/esm2022/lib/task-detail-modal/task-detail-modal.component.mjs +210 -0
  5. package/esm2022/lib/task-list/task-list.component.mjs +252 -0
  6. package/esm2022/lib/task-permissions.mjs +34 -0
  7. package/{esm2020 → esm2022}/lib/task-routing.module.mjs +5 -5
  8. package/esm2022/lib/task.module.mjs +119 -0
  9. package/esm2022/lib/task.service.mjs +72 -0
  10. package/esm2022/public_api.mjs +26 -0
  11. package/fesm2022/valtimo-task.mjs +912 -0
  12. package/fesm2022/valtimo-task.mjs.map +1 -0
  13. package/lib/assign-user-to-task/assign-user-to-task.component.d.ts +4 -4
  14. package/lib/assign-user-to-task/assign-user-to-task.component.d.ts.map +1 -1
  15. package/lib/models/task-list.model.d.ts +0 -1
  16. package/lib/models/task-list.model.d.ts.map +1 -1
  17. package/lib/models/task.model.d.ts +7 -7
  18. package/lib/models/task.model.d.ts.map +1 -1
  19. package/lib/task-detail-modal/task-detail-modal.component.d.ts +29 -34
  20. package/lib/task-detail-modal/task-detail-modal.component.d.ts.map +1 -1
  21. package/lib/task-list/task-list.component.d.ts +22 -16
  22. package/lib/task-list/task-list.component.d.ts.map +1 -1
  23. package/lib/task-permissions.d.ts +8 -0
  24. package/lib/task-permissions.d.ts.map +1 -0
  25. package/lib/task.module.d.ts +1 -1
  26. package/lib/task.module.d.ts.map +1 -1
  27. package/lib/task.service.d.ts +2 -2
  28. package/lib/task.service.d.ts.map +1 -1
  29. package/package.json +10 -16
  30. package/public_api.d.ts +1 -0
  31. package/public_api.d.ts.map +1 -1
  32. package/esm2020/lib/assign-user-to-task/assign-user-to-task.component.mjs +0 -123
  33. package/esm2020/lib/models/task-list.model.mjs +0 -29
  34. package/esm2020/lib/task-detail-modal/task-detail-modal.component.mjs +0 -269
  35. package/esm2020/lib/task-list/task-list.component.mjs +0 -222
  36. package/esm2020/lib/task.module.mjs +0 -113
  37. package/esm2020/lib/task.service.mjs +0 -69
  38. package/esm2020/public_api.mjs +0 -25
  39. package/fesm2015/valtimo-task.mjs +0 -861
  40. package/fesm2015/valtimo-task.mjs.map +0 -1
  41. package/fesm2020/valtimo-task.mjs +0 -898
  42. package/fesm2020/valtimo-task.mjs.map +0 -1
  43. /package/{esm2020 → esm2022}/lib/models/index.mjs +0 -0
  44. /package/{esm2020 → esm2022}/lib/models/task-definition.model.mjs +0 -0
  45. /package/{esm2020 → esm2022}/valtimo-task.mjs +0 -0
@@ -1,861 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Component, Input, Output, ViewEncapsulation, ViewChild, NgModule } from '@angular/core';
3
- import * as i6 from '@valtimo/security';
4
- import { InterceptorSkip, AuthGuardService } from '@valtimo/security';
5
- import * as i1 from '@angular/common/http';
6
- import { HttpClient } from '@angular/common/http';
7
- import * as i2 from '@valtimo/config';
8
- import { ROLE_USER, HttpLoaderFactory } from '@valtimo/config';
9
- import * as i2$1 from '@angular/common';
10
- import { CommonModule } from '@angular/common';
11
- import { FormsModule } from '@angular/forms';
12
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
13
- import * as i9 from '@ng-bootstrap/ng-bootstrap';
14
- import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
15
- import * as i4 from '@ngx-translate/core';
16
- import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
17
- import * as i7 from '@valtimo/components';
18
- import { FormioOptionsImpl, ListModule, PageHeaderModule, WidgetModule, SpinnerModule, SearchableDropdownSelectModule, CamundaFormModule, FormIoModule, ModalModule } from '@valtimo/components';
19
- import * as i1$1 from 'ngx-toastr';
20
- import { ToastrModule } from 'ngx-toastr';
21
- import moment from 'moment';
22
- import { take, tap, map } from 'rxjs/operators';
23
- import { BehaviorSubject, Subscription, combineLatest, distinctUntilChanged, tap as tap$1 } from 'rxjs';
24
- import * as i2$2 from '@valtimo/form-link';
25
- import { FormLinkModule } from '@valtimo/form-link';
26
- import * as i3 from '@angular/router';
27
- import { RouterModule } from '@angular/router';
28
- import * as i4$1 from 'ngx-logger';
29
- import * as i8 from '@valtimo/document';
30
- import * as i10 from 'carbon-components-angular';
31
- import { LinkModule } from 'carbon-components-angular';
32
-
33
- /*
34
- * Copyright 2015-2023 Ritense BV, the Netherlands.
35
- *
36
- * Licensed under EUPL, Version 1.2 (the "License");
37
- * you may not use this file except in compliance with the License.
38
- * You may obtain a copy of the License at
39
- *
40
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
41
- *
42
- * Unless required by applicable law or agreed to in writing, software
43
- * distributed under the License is distributed on an "AS IS" basis,
44
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45
- * See the License for the specific language governing permissions and
46
- * limitations under the License.
47
- */
48
- class TaskList {
49
- constructor() {
50
- this.tasks = [];
51
- this.fields = [];
52
- this.pagination = {
53
- collectionSize: 0,
54
- page: 1,
55
- size: 10,
56
- maxPaginationItemSize: 5,
57
- };
58
- this.page = 0;
59
- }
60
- }
61
-
62
- /*
63
- * Copyright 2015-2023 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
-
78
- /*
79
- * Copyright 2015-2023 Ritense BV, the Netherlands.
80
- *
81
- * Licensed under EUPL, Version 1.2 (the "License");
82
- * you may not use this file except in compliance with the License.
83
- * You may obtain a copy of the License at
84
- *
85
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
86
- *
87
- * Unless required by applicable law or agreed to in writing, software
88
- * distributed under the License is distributed on an "AS IS" basis,
89
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
90
- * See the License for the specific language governing permissions and
91
- * limitations under the License.
92
- */
93
- class TaskService {
94
- constructor(http, configService) {
95
- this.http = http;
96
- this.configService = configService;
97
- this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;
98
- }
99
- queryTasks(params) {
100
- return this.http.get(`${this.valtimoEndpointUri}v1/task`, { observe: 'response', params });
101
- }
102
- getTasks() {
103
- return this.http.get(`${this.valtimoEndpointUri}v1/task?filter=all`);
104
- }
105
- getTask(id) {
106
- return this.http.get(this.valtimoEndpointUri + 'v1/task/' + id);
107
- }
108
- getCandidateUsers(id) {
109
- return this.http.get(this.valtimoEndpointUri + 'v2/task/' + id + '/candidate-user');
110
- }
111
- assignTask(id, assigneeRequest) {
112
- return this.http.post(this.valtimoEndpointUri + 'v1/task/' + id + '/assign', assigneeRequest);
113
- }
114
- unassignTask(id) {
115
- return this.http.post(this.valtimoEndpointUri + 'v1/task/' + id + '/unassign', null);
116
- }
117
- completeTask(id, variables) {
118
- return this.http.post(this.valtimoEndpointUri + 'v1/task/' + id + '/complete', {
119
- variables,
120
- filesToDelete: [],
121
- });
122
- }
123
- getTaskProcessLink(taskId) {
124
- return this.http.get(`${this.valtimoEndpointUri}v2/process-link/task/${taskId}`, {
125
- headers: { [InterceptorSkip]: '' },
126
- });
127
- }
128
- getTaskProcessLinkV1(taskId) {
129
- return this.http.get(`${this.valtimoEndpointUri}v1/process-link/task/${taskId}`);
130
- }
131
- getConfigCustomTaskList() {
132
- return this.configService.config.customTaskList;
133
- }
134
- }
135
- TaskService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
136
- TaskService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskService, providedIn: 'root' });
137
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskService, decorators: [{
138
- type: Injectable,
139
- args: [{ providedIn: 'root' }]
140
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.ConfigService }]; } });
141
-
142
- /*
143
- * Copyright 2015-2023 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
- class AssignUserToTaskComponent {
158
- constructor(taskService) {
159
- this.taskService = taskService;
160
- this.assignmentOfTaskChanged = new EventEmitter();
161
- this.candidateUsersForTask$ = new BehaviorSubject(undefined);
162
- this.disabled$ = new BehaviorSubject(true);
163
- this.assignedEmailOnServer$ = new BehaviorSubject(null);
164
- this.userEmailToAssign = null;
165
- this.assignedUserFullName$ = new BehaviorSubject(null);
166
- this._subscriptions = new Subscription();
167
- }
168
- ngOnInit() {
169
- this._subscriptions.add(this.taskService.getCandidateUsers(this.taskId).subscribe(candidateUsers => {
170
- this.candidateUsersForTask$.next(candidateUsers);
171
- if (this.assigneeEmail) {
172
- this.assignedEmailOnServer$.next(this.assigneeEmail);
173
- this.userEmailToAssign = this.assigneeEmail;
174
- this.assignedUserFullName$.next(this.getAssignedUserName(candidateUsers, this.assigneeEmail));
175
- }
176
- this.enable();
177
- }));
178
- }
179
- ngOnChanges(changes) {
180
- this.candidateUsersForTask$.pipe(take(1)).subscribe(candidateUsers => {
181
- var _a;
182
- const currentUserEmail = ((_a = changes.assigneeEmail) === null || _a === void 0 ? void 0 : _a.currentValue) || this.assigneeEmail;
183
- this.assignedEmailOnServer$.next(currentUserEmail || null);
184
- this.userEmailToAssign = currentUserEmail || null;
185
- this.assignedUserFullName$.next(this.getAssignedUserName(candidateUsers, currentUserEmail));
186
- });
187
- }
188
- ngOnDestroy() {
189
- this._subscriptions.unsubscribe();
190
- }
191
- assignTask(userEmail) {
192
- this.disable();
193
- combineLatest([
194
- this.candidateUsersForTask$,
195
- this.taskService.assignTask(this.taskId, { assignee: userEmail }),
196
- ])
197
- .pipe(take(1), tap(([candidateUsers]) => {
198
- this.userEmailToAssign = userEmail;
199
- this.assignedEmailOnServer$.next(userEmail);
200
- this.assignedUserFullName$.next(this.getAssignedUserName(candidateUsers, userEmail));
201
- this.emitChange();
202
- this.enable();
203
- }))
204
- .subscribe();
205
- }
206
- unassignTask() {
207
- this.disable();
208
- this.taskService
209
- .unassignTask(this.taskId)
210
- .pipe(tap(() => {
211
- this.clear();
212
- this.emitChange();
213
- this.enable();
214
- }))
215
- .subscribe();
216
- }
217
- getAssignedUserName(users, userEmail) {
218
- if (users && userEmail) {
219
- const findUser = users.find(user => user.email === userEmail);
220
- return findUser ? findUser.label : userEmail;
221
- }
222
- return userEmail || '-';
223
- }
224
- mapUsersForDropdown(users) {
225
- return (users &&
226
- users
227
- .map(user => { var _a; return (Object.assign(Object.assign({}, user), { lastName: ((_a = user.lastName) === null || _a === void 0 ? void 0 : _a.split(' ').splice(-1)[0]) || '' })); })
228
- .sort((a, b) => a.lastName.localeCompare(b.lastName))
229
- .map(user => ({ text: user.label, id: user.email })));
230
- }
231
- clear() {
232
- this.assignedEmailOnServer$.next(null);
233
- this.userEmailToAssign = null;
234
- }
235
- emitChange() {
236
- this.assignmentOfTaskChanged.emit();
237
- }
238
- enable() {
239
- this.disabled$.next(false);
240
- }
241
- disable() {
242
- this.disabled$.next(true);
243
- }
244
- }
245
- AssignUserToTaskComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AssignUserToTaskComponent, deps: [{ token: TaskService }], target: i0.ɵɵFactoryTarget.Component });
246
- AssignUserToTaskComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: AssignUserToTaskComponent, selector: "valtimo-assign-user-to-task", inputs: { taskId: "taskId", assigneeEmail: "assigneeEmail" }, outputs: { assignmentOfTaskChanged: "assignmentOfTaskChanged" }, usesOnChanges: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\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", styles: ["/*!\n * Copyright 2015-2023 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 */.container-fluid{color:#959595}i{font-size:13px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.SearchableDropdownSelectComponent, selector: "valtimo-searchable-dropdown-select", inputs: ["style", "items", "buttonText", "searchText", "noResultsText", "disabled", "selectedText", "selectedTextValue", "clearSelectionButtonTitle", "hasSelection", "width", "hasPermission"], outputs: ["itemSelected", "clearSelection"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }] });
247
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AssignUserToTaskComponent, decorators: [{
248
- type: Component,
249
- args: [{ selector: 'valtimo-assign-user-to-task', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\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", styles: ["/*!\n * Copyright 2015-2023 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 */.container-fluid{color:#959595}i{font-size:13px}\n"] }]
250
- }], ctorParameters: function () { return [{ type: TaskService }]; }, propDecorators: { taskId: [{
251
- type: Input
252
- }], assigneeEmail: [{
253
- type: Input
254
- }], assignmentOfTaskChanged: [{
255
- type: Output
256
- }] } });
257
-
258
- /*
259
- * Copyright 2015-2023 Ritense BV, the Netherlands.
260
- *
261
- * Licensed under EUPL, Version 1.2 (the "License");
262
- * you may not use this file except in compliance with the License.
263
- * You may obtain a copy of the License at
264
- *
265
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
266
- *
267
- * Unless required by applicable law or agreed to in writing, software
268
- * distributed under the License is distributed on an "AS IS" basis,
269
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
270
- * See the License for the specific language governing permissions and
271
- * limitations under the License.
272
- */
273
- moment.locale(localStorage.getItem('langKey') || '');
274
- class TaskDetailModalComponent {
275
- constructor(toastr, formLinkService, processLinkService, formFlowService, router, logger, route, taskService, userProviderService, modalService, stateService, documentService, translateService) {
276
- this.toastr = toastr;
277
- this.formLinkService = formLinkService;
278
- this.processLinkService = processLinkService;
279
- this.formFlowService = formFlowService;
280
- this.router = router;
281
- this.logger = logger;
282
- this.route = route;
283
- this.taskService = taskService;
284
- this.userProviderService = userProviderService;
285
- this.modalService = modalService;
286
- this.stateService = stateService;
287
- this.documentService = documentService;
288
- this.translateService = translateService;
289
- this.formSubmit = new EventEmitter();
290
- this.assignmentOfTaskChanged = new EventEmitter();
291
- this.task = null;
292
- this.page = null;
293
- this.errorMessage = null;
294
- this.isAdmin$ = this.userProviderService
295
- .getUserSubject()
296
- .pipe(map(userIdentity => { var _a; return (_a = userIdentity === null || userIdentity === void 0 ? void 0 : userIdentity.roles) === null || _a === void 0 ? void 0 : _a.includes('ROLE_ADMIN'); }));
297
- this.taskProcessLinkType$ = new BehaviorSubject(null);
298
- this.processLinkIsForm$ = this.taskProcessLinkType$.pipe(map(type => type === 'form'));
299
- this.processLinkIsFormFlow$ = this.taskProcessLinkType$.pipe(map(type => type === 'form-flow'));
300
- this.formIoFormData$ = new BehaviorSubject(null);
301
- this._subscriptions = new Subscription();
302
- this.loading$ = new BehaviorSubject(true);
303
- this.formioOptions = new FormioOptionsImpl();
304
- this.formioOptions.disableAlerts = true;
305
- }
306
- ngAfterViewInit() {
307
- this._subscriptions.add(this.modal.modalShowing$
308
- .pipe(distinctUntilChanged(), tap$1(modalShowing => {
309
- if (!modalShowing) {
310
- if (this.formFlow) {
311
- this.formFlow.saveData();
312
- }
313
- }
314
- }))
315
- .subscribe());
316
- }
317
- ngOnDestroy() {
318
- this._subscriptions.unsubscribe();
319
- }
320
- openTaskDetails(task) {
321
- this.resetTaskProcessLinkType();
322
- this.resetFormDefinition();
323
- this.getTaskProcessLink(task.id);
324
- this.setDocumentDefinitionNameInService(task);
325
- const documentId = task.businessKey;
326
- this.stateService.setDocumentId(documentId);
327
- this.task = task;
328
- this.page = {
329
- title: task.name,
330
- subtitle: `${this.translateService.instant('taskDetail.taskCreated')} ${task.created}`,
331
- };
332
- //only load from formlink when process link failed for backwards compatibility
333
- if (!this.taskProcessLinkType$.getValue()) {
334
- this.formLinkService
335
- .getPreFilledFormDefinitionByFormLinkId(task.processDefinitionKey, documentId, task.taskDefinitionKey, task.id // taskInstanceId
336
- )
337
- .subscribe(formDefinition => {
338
- this.formAssociation = formDefinition.formAssociation;
339
- const className = this.formAssociation.formLink.className.split('.');
340
- const linkType = className[className.length - 1];
341
- switch (linkType) {
342
- case 'BpmnElementFormIdLink':
343
- this.setFormDefinitionAndOpenModal(formDefinition);
344
- break;
345
- case 'BpmnElementFormFlowIdLink':
346
- // We can't use the formDefinition here because the form definition is provided per form flow step
347
- // I'm still leaving this in here in case we want to add form flow specific code.
348
- this.modal.show();
349
- break;
350
- case 'BpmnElementUrlLink':
351
- this.openUrlLink(formDefinition);
352
- break;
353
- case 'BpmnElementAngularStateUrlLink':
354
- this.openAngularStateUrlLink(task, formDefinition);
355
- break;
356
- default:
357
- this.logger.fatal('Unsupported class name');
358
- }
359
- }, errors => {
360
- var _a;
361
- if ((_a = errors === null || errors === void 0 ? void 0 : errors.error) === null || _a === void 0 ? void 0 : _a.detail) {
362
- this.errorMessage = errors.error.detail;
363
- }
364
- this.modal.show();
365
- });
366
- }
367
- }
368
- gotoFormLinkScreen() {
369
- this.modal.hide();
370
- this.router.navigate(['form-links']);
371
- }
372
- onChange(event) {
373
- if (event.data) {
374
- this.formIoFormData$.next(event.data);
375
- }
376
- }
377
- onSubmit(submission) {
378
- if (submission.data) {
379
- this.formIoFormData$.next(submission.data);
380
- }
381
- if (this.taskProcessLinkType$.getValue() === 'form') {
382
- if (this.processLinkId) {
383
- this.processLinkService
384
- .submitForm(this.processLinkId, submission.data, this.task.businessKey, this.task.id)
385
- .subscribe({
386
- next: (_) => {
387
- this.completeTask();
388
- },
389
- error: errors => {
390
- this.form.showErrors(errors);
391
- },
392
- });
393
- }
394
- else {
395
- this.formLinkService
396
- .onSubmit(this.task.processDefinitionKey, this.formAssociation.formLink.id, submission.data, this.task.businessKey, this.task.id)
397
- .subscribe((_) => {
398
- this.completeTask();
399
- }, errors => {
400
- this.form.showErrors(errors);
401
- });
402
- }
403
- }
404
- }
405
- resetFormDefinition() {
406
- this.formDefinition = null;
407
- this.loading$.next(true);
408
- }
409
- getTaskProcessLink(taskId) {
410
- this.taskService.getTaskProcessLink(taskId).subscribe({
411
- next: res => {
412
- if (res != null) {
413
- switch (res === null || res === void 0 ? void 0 : res.type) {
414
- case 'form':
415
- this.taskProcessLinkType$.next('form');
416
- this.processLinkId = res.processLinkId;
417
- this.setFormDefinitionAndOpenModal(res.properties.prefilledForm);
418
- break;
419
- case 'form-flow':
420
- this.taskProcessLinkType$.next('form-flow');
421
- this.formFlowInstanceId = res.properties.formFlowInstanceId;
422
- break;
423
- }
424
- this.loading$.next(false);
425
- }
426
- else {
427
- this.getLegacyTaskProcessLink(taskId);
428
- }
429
- },
430
- error: _ => {
431
- this.getLegacyTaskProcessLink(taskId);
432
- },
433
- });
434
- }
435
- completeTask() {
436
- this.toastr.success(`${this.task.name} ${this.translateService.instant('taskDetail.taskCompleted')}`);
437
- this.modal.hide();
438
- this.task = null;
439
- this.formSubmit.emit();
440
- }
441
- getLegacyTaskProcessLink(taskId) {
442
- this.taskService.getTaskProcessLinkV1(taskId).subscribe(resV1 => {
443
- switch (resV1 === null || resV1 === void 0 ? void 0 : resV1.type) {
444
- case 'form':
445
- this.taskProcessLinkType$.next('form');
446
- break;
447
- case 'form-flow':
448
- this.taskProcessLinkType$.next('form-flow');
449
- this.formFlowInstanceId = resV1.properties.formFlowInstanceId;
450
- break;
451
- }
452
- this.loading$.next(false);
453
- });
454
- }
455
- resetTaskProcessLinkType() {
456
- this.taskProcessLinkType$.next(null);
457
- this.processLinkId = null;
458
- this.formAssociation = null;
459
- }
460
- setFormDefinitionAndOpenModal(formDefinition) {
461
- this.taskProcessLinkType$.next('form');
462
- this.formDefinition = formDefinition;
463
- this.modal.show();
464
- }
465
- openUrlLink(formDefinition) {
466
- const url = this.router.serializeUrl(this.router.createUrlTree([formDefinition.formAssociation.formLink.url]));
467
- window.open(url, '_blank');
468
- }
469
- openAngularStateUrlLink(task, formDefinition) {
470
- this.route.params.pipe(take(1)).subscribe(params => {
471
- const taskId = task === null || task === void 0 ? void 0 : task.id;
472
- const documentId = params === null || params === void 0 ? void 0 : params.documentId;
473
- this.router.navigate([formDefinition.formAssociation.formLink.url], {
474
- state: Object.assign(Object.assign({}, (taskId && { taskId })), (documentId && { documentId })),
475
- });
476
- });
477
- }
478
- setDocumentDefinitionNameInService(task) {
479
- this.documentService
480
- .getProcessDocumentDefinitionFromProcessInstanceId(task.processInstanceId)
481
- .subscribe(processDocumentDefinition => {
482
- const documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
483
- this.modalService.setDocumentDefinitionName(documentDefinitionName);
484
- this.stateService.setDocumentDefinitionName(documentDefinitionName);
485
- });
486
- }
487
- }
488
- TaskDetailModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskDetailModalComponent, deps: [{ token: i1$1.ToastrService }, { token: i2$2.FormLinkService }, { token: i2$2.ProcessLinkService }, { token: i2$2.FormFlowService }, { token: i3.Router }, { token: i4$1.NGXLogger }, { token: i3.ActivatedRoute }, { token: TaskService }, { token: i6.UserProviderService }, { token: i7.ValtimoModalService }, { token: i7.FormIoStateService }, { token: i8.DocumentService }, { token: i4.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
489
- TaskDetailModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TaskDetailModalComponent, selector: "valtimo-task-detail-modal", outputs: { formSubmit: "formSubmit", assignmentOfTaskChanged: "assignmentOfTaskChanged" }, viewQueries: [{ propertyName: "form", first: true, predicate: ["form"], descendants: true }, { propertyName: "formFlow", first: true, predicate: ["formFlow"], descendants: true }, { propertyName: "modal", first: true, predicate: ["taskDetailModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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 *ngIf=\"{\n loading: loading$ | async\n } as obs\"\n elementId=\"taskDetailModal\"\n [title]=\"page?.title\"\n [subtitle]=\"page?.subtitle\"\n [templateBelowSubtitle]=\"assignUserToTask\"\n>\n <div body *ngIf=\"formDefinition && (processLinkIsForm$ | async)\">\n <valtimo-form-io\n #form\n [form]=\"formDefinition\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n [options]=\"formioOptions\"\n ></valtimo-form-io>\n </div>\n <div body *ngIf=\"processLinkIsFormFlow$ | async\">\n <valtimo-form-flow\n #formFlow\n [formIoFormData]=\"formIoFormData$\"\n [formFlowInstanceId]=\"formFlowInstanceId\"\n (formFlowComplete)=\"completeTask()\"\n ></valtimo-form-flow>\n </div>\n <div body *ngIf=\"obs.loading\">\n <div class=\"text-black mb-0 p-3 text-center\">\n {{ 'formManagement.loading' | translate }}\n </div>\n </div>\n <div body *ngIf=\"obs.loading === false && !formDefinition && !formFlowInstanceId && !errorMessage\">\n <div class=\"bg-warning text-black mb-0 p-3 text-center\">\n {{\n (isAdmin$ | async)\n ? ('formManagement.noFormDefinitionFoundAdmin' | translate)\n : ('formManagement.noFormDefinitionFoundUser' | translate)\n }}\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", styles: ["/*!\n * Copyright 2015-2023 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}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i7.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "component", type: i2$2.FormFlowComponent, selector: "valtimo-form-flow", inputs: ["formIoFormData", "formFlowInstanceId"], outputs: ["formFlowComplete"] }, { kind: "component", type: AssignUserToTaskComponent, selector: "valtimo-assign-user-to-task", inputs: ["taskId", "assigneeEmail"], outputs: ["assignmentOfTaskChanged"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
490
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskDetailModalComponent, decorators: [{
491
- type: Component,
492
- args: [{ selector: 'valtimo-task-detail-modal', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2023 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 *ngIf=\"{\n loading: loading$ | async\n } as obs\"\n elementId=\"taskDetailModal\"\n [title]=\"page?.title\"\n [subtitle]=\"page?.subtitle\"\n [templateBelowSubtitle]=\"assignUserToTask\"\n>\n <div body *ngIf=\"formDefinition && (processLinkIsForm$ | async)\">\n <valtimo-form-io\n #form\n [form]=\"formDefinition\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n [options]=\"formioOptions\"\n ></valtimo-form-io>\n </div>\n <div body *ngIf=\"processLinkIsFormFlow$ | async\">\n <valtimo-form-flow\n #formFlow\n [formIoFormData]=\"formIoFormData$\"\n [formFlowInstanceId]=\"formFlowInstanceId\"\n (formFlowComplete)=\"completeTask()\"\n ></valtimo-form-flow>\n </div>\n <div body *ngIf=\"obs.loading\">\n <div class=\"text-black mb-0 p-3 text-center\">\n {{ 'formManagement.loading' | translate }}\n </div>\n </div>\n <div body *ngIf=\"obs.loading === false && !formDefinition && !formFlowInstanceId && !errorMessage\">\n <div class=\"bg-warning text-black mb-0 p-3 text-center\">\n {{\n (isAdmin$ | async)\n ? ('formManagement.noFormDefinitionFoundAdmin' | translate)\n : ('formManagement.noFormDefinitionFoundUser' | translate)\n }}\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", styles: ["/*!\n * Copyright 2015-2023 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}\n"] }]
493
- }], ctorParameters: function () { return [{ type: i1$1.ToastrService }, { type: i2$2.FormLinkService }, { type: i2$2.ProcessLinkService }, { type: i2$2.FormFlowService }, { type: i3.Router }, { type: i4$1.NGXLogger }, { type: i3.ActivatedRoute }, { type: TaskService }, { type: i6.UserProviderService }, { type: i7.ValtimoModalService }, { type: i7.FormIoStateService }, { type: i8.DocumentService }, { type: i4.TranslateService }]; }, propDecorators: { form: [{
494
- type: ViewChild,
495
- args: ['form']
496
- }], formFlow: [{
497
- type: ViewChild,
498
- args: ['formFlow']
499
- }], modal: [{
500
- type: ViewChild,
501
- args: ['taskDetailModal']
502
- }], formSubmit: [{
503
- type: Output
504
- }], assignmentOfTaskChanged: [{
505
- type: Output
506
- }] } });
507
-
508
- /*
509
- * Copyright 2015-2023 Ritense BV, the Netherlands.
510
- *
511
- * Licensed under EUPL, Version 1.2 (the "License");
512
- * you may not use this file except in compliance with the License.
513
- * You may obtain a copy of the License at
514
- *
515
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
516
- *
517
- * Unless required by applicable law or agreed to in writing, software
518
- * distributed under the License is distributed on an "AS IS" basis,
519
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
520
- * See the License for the specific language governing permissions and
521
- * limitations under the License.
522
- */
523
- moment.locale(localStorage.getItem('langKey') || '');
524
- class TaskListComponent {
525
- constructor(taskService, router, logger, translateService, configService, documentService) {
526
- var _a;
527
- this.taskService = taskService;
528
- this.router = router;
529
- this.logger = logger;
530
- this.translateService = translateService;
531
- this.configService = configService;
532
- this.documentService = documentService;
533
- this.tasks = {
534
- mine: new TaskList(),
535
- open: new TaskList(),
536
- all: new TaskList(),
537
- };
538
- this.visibleTabs = null;
539
- this.currentTaskType = 'mine';
540
- this.listTitle = null;
541
- this.listDescription = null;
542
- this.sortState = null;
543
- this.visibleTabs = ((_a = this.configService.config) === null || _a === void 0 ? void 0 : _a.visibleTaskListTabs) || null;
544
- if (this.visibleTabs != null) {
545
- this.currentTaskType = this.visibleTabs[0];
546
- }
547
- this.setDefaultSorting();
548
- }
549
- paginationClicked(page, type) {
550
- this.tasks[type].page = page - 1;
551
- this.getTasks(type);
552
- }
553
- paginationSet() {
554
- this.tasks.mine.pagination.size =
555
- this.tasks.all.pagination.size =
556
- this.tasks.open.pagination.size =
557
- this.tasks[this.currentTaskType].pagination.size;
558
- this.getTasks(this.currentTaskType);
559
- }
560
- clearPagination(type) {
561
- this.tasks[type].page = 0;
562
- }
563
- tabChange(tab) {
564
- this.clearPagination(this.currentTaskType);
565
- this.getTasks(tab.nextId);
566
- }
567
- showTask(task) {
568
- this.router.navigate(['tasks', task.id]);
569
- }
570
- getTasks(type) {
571
- let params;
572
- this.translationSubscription = combineLatest([
573
- this.translateService.stream(`task-list.${type}.title`),
574
- this.translateService.stream(`task-list.${type}.description`),
575
- ]).subscribe(([title, description]) => {
576
- this.listTitle = title;
577
- this.listDescription = description;
578
- });
579
- switch (type) {
580
- case 'mine':
581
- params = {
582
- page: this.tasks.mine.page,
583
- size: this.tasks.mine.pagination.size,
584
- filter: 'mine',
585
- };
586
- this.currentTaskType = 'mine';
587
- break;
588
- case 'open':
589
- params = {
590
- page: this.tasks.open.page,
591
- size: this.tasks.open.pagination.size,
592
- filter: 'open',
593
- };
594
- this.currentTaskType = 'open';
595
- break;
596
- case 'all':
597
- params = { page: this.tasks.all.page, size: this.tasks.open.pagination.size, filter: 'all' };
598
- this.currentTaskType = 'all';
599
- break;
600
- default:
601
- this.logger.fatal('Unreachable case');
602
- }
603
- if (this.sortState) {
604
- params.sort = this.getSortString(this.sortState);
605
- }
606
- this.taskService.queryTasks(params).subscribe((results) => {
607
- this.tasks[type].pagination.collectionSize = results.headers.get('x-total-count');
608
- this.tasks[type].tasks = results.body;
609
- this.tasks[type].tasks.map((task) => {
610
- task.created = moment(task.created).format('DD MMM YYYY HH:mm');
611
- if (task.due) {
612
- task.due = moment(task.due).format('DD MMM YYYY HH:mm');
613
- }
614
- });
615
- if (this.taskService.getConfigCustomTaskList()) {
616
- this.customTaskListFields(type);
617
- }
618
- else {
619
- this.defaultTaskListFields(type);
620
- }
621
- });
622
- }
623
- openRelatedCase(event, index) {
624
- event.stopPropagation();
625
- const tasks = this.tasks[this.currentTaskType].tasks;
626
- const currentTask = tasks && tasks[index];
627
- if (currentTask) {
628
- this.documentService
629
- .getDocument(currentTask.businessKey)
630
- .pipe(take(1))
631
- .subscribe(document => {
632
- this.router.navigate([
633
- `/dossiers/${document.definitionId.name}/document/${currentTask.businessKey}/summary`,
634
- ]);
635
- });
636
- }
637
- }
638
- defaultTaskListFields(type) {
639
- this.translationSubscription = combineLatest([
640
- this.translateService.stream(`task-list.fieldLabels.created`),
641
- this.translateService.stream(`task-list.fieldLabels.name`),
642
- this.translateService.stream(`task-list.fieldLabels.valtimoAssignee.fullName`),
643
- this.translateService.stream(`task-list.fieldLabels.due`),
644
- this.translateService.stream(`task-list.fieldLabels.context`),
645
- ]).subscribe(([created, name, assignee, due, context]) => {
646
- this.tasks[type].fields = [
647
- {
648
- key: 'created',
649
- label: created,
650
- },
651
- {
652
- key: 'name',
653
- label: name,
654
- },
655
- {
656
- key: 'valtimoAssignee.fullName',
657
- label: assignee,
658
- },
659
- {
660
- key: 'due',
661
- label: due,
662
- },
663
- {
664
- key: 'context',
665
- label: context,
666
- },
667
- ];
668
- });
669
- }
670
- customTaskListFields(type) {
671
- const customTaskListFields = this.taskService.getConfigCustomTaskList().fields;
672
- this.translationSubscription = combineLatest(customTaskListFields.map(column => this.translateService.stream(`task-list.fieldLabels.${column.translationKey}`))).subscribe(labels => {
673
- this.tasks[type].fields = customTaskListFields.map((column, index) => (Object.assign(Object.assign({ key: column.propertyName, label: labels[index], sortable: column.sortable }, (column.viewType && { viewType: column.viewType })), (column.enum && { enum: column.enum }))));
674
- });
675
- }
676
- rowOpenTaskClick(task) {
677
- if (!task.endTime) {
678
- this.taskDetail.openTaskDetails(task);
679
- }
680
- else {
681
- return false;
682
- }
683
- }
684
- setDefaultSorting() {
685
- var _a;
686
- this.sortState = ((_a = this.taskService.getConfigCustomTaskList()) === null || _a === void 0 ? void 0 : _a.defaultSortedColumn) || null;
687
- }
688
- sortChanged(sortState) {
689
- this.sortState = sortState;
690
- this.getTasks(this.currentTaskType);
691
- }
692
- getSortString(sort) {
693
- return `${sort.state.name},${sort.state.direction}`;
694
- }
695
- ngOnDestroy() {
696
- this.translationSubscription.unsubscribe();
697
- }
698
- }
699
- TaskListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskListComponent, deps: [{ token: TaskService }, { token: i3.Router }, { token: i4$1.NGXLogger }, { token: i4.TranslateService }, { token: i2.ConfigService }, { token: i8.DocumentService }], target: i0.ɵɵFactoryTarget.Component });
700
- TaskListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TaskListComponent, selector: "valtimo-task-list", viewQueries: [{ propertyName: "taskDetail", first: true, predicate: ["taskDetail"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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 (sortChanged)=\"sortChanged($event)\"\n [lastColumnTemplate]=\"caseLink\"\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 <ul\n *ngIf=\"visibleTabs === null; else configuredTabs\"\n ngbNav\n [destroyOnHide]=\"false\"\n (navChange)=\"tabChange($event)\"\n class=\"nav-tabs\"\n >\n <li ngbNavItem=\"mine\" [title]=\"'task-list.mine.title' | translate\">\n <a ngbNavLink>{{ 'task-list.mine.title' | translate }}</a>\n </li>\n <li ngbNavItem=\"open\" [title]=\"'task-list.open.title' | translate\">\n <a ngbNavLink>{{ 'task-list.open.title' | translate }}</a>\n </li>\n <li ngbNavItem=\"all\" [title]=\"'task-list.all.title' | translate\">\n <a ngbNavLink>{{ 'task-list.all.title' | translate }}</a>\n </li>\n </ul>\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\n<ng-template #configuredTabs>\n <ul ngbNav [destroyOnHide]=\"false\" (navChange)=\"tabChange($event)\" class=\"nav-tabs\">\n <li\n *ngFor=\"let tab of visibleTabs\"\n [ngbNavItem]=\"tab\"\n [title]=\"'task-list.' + tab + '.title' | translate\"\n >\n <a ngbNavLink>{{ 'task-list.' + tab + '.title' | translate }}</a>\n </li>\n </ul>\n</ng-template>\n\n<ng-template #caseLink let-index=\"index\">\n <a cdsLink href=\"javascript:void(0)\" (click)=\"openRelatedCase($event, index)\">\n {{ 'task-list.goToCase' | translate }}\n </a>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 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{padding:0;margin:0}.nav.nav-tabs{background-color:#f5f5f5}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState", "lastColumnTemplate"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: i7.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "directive", type: i9.NgbNav, selector: "[ngbNav]", inputs: ["activeId", "animation", "destroyOnHide", "orientation", "roles", "keyboard"], outputs: ["activeIdChange", "shown", "hidden", "navChange"], exportAs: ["ngbNav"] }, { kind: "directive", type: i9.NgbNavItem, selector: "[ngbNavItem]", inputs: ["destroyOnHide", "disabled", "domId", "ngbNavItem"], outputs: ["shown", "hidden"], exportAs: ["ngbNavItem"] }, { kind: "directive", type: i9.NgbNavLink, selector: "a[ngbNavLink]" }, { kind: "directive", type: i10.Link, selector: "[cdsLink], [ibmLink]", inputs: ["inline", "disabled"] }, { kind: "component", type: TaskDetailModalComponent, selector: "valtimo-task-detail-modal", outputs: ["formSubmit", "assignmentOfTaskChanged"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
701
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskListComponent, decorators: [{
702
- type: Component,
703
- args: [{ selector: 'valtimo-task-list', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2023 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 (sortChanged)=\"sortChanged($event)\"\n [lastColumnTemplate]=\"caseLink\"\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 <ul\n *ngIf=\"visibleTabs === null; else configuredTabs\"\n ngbNav\n [destroyOnHide]=\"false\"\n (navChange)=\"tabChange($event)\"\n class=\"nav-tabs\"\n >\n <li ngbNavItem=\"mine\" [title]=\"'task-list.mine.title' | translate\">\n <a ngbNavLink>{{ 'task-list.mine.title' | translate }}</a>\n </li>\n <li ngbNavItem=\"open\" [title]=\"'task-list.open.title' | translate\">\n <a ngbNavLink>{{ 'task-list.open.title' | translate }}</a>\n </li>\n <li ngbNavItem=\"all\" [title]=\"'task-list.all.title' | translate\">\n <a ngbNavLink>{{ 'task-list.all.title' | translate }}</a>\n </li>\n </ul>\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\n<ng-template #configuredTabs>\n <ul ngbNav [destroyOnHide]=\"false\" (navChange)=\"tabChange($event)\" class=\"nav-tabs\">\n <li\n *ngFor=\"let tab of visibleTabs\"\n [ngbNavItem]=\"tab\"\n [title]=\"'task-list.' + tab + '.title' | translate\"\n >\n <a ngbNavLink>{{ 'task-list.' + tab + '.title' | translate }}</a>\n </li>\n </ul>\n</ng-template>\n\n<ng-template #caseLink let-index=\"index\">\n <a cdsLink href=\"javascript:void(0)\" (click)=\"openRelatedCase($event, index)\">\n {{ 'task-list.goToCase' | translate }}\n </a>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 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{padding:0;margin:0}.nav.nav-tabs{background-color:#f5f5f5}\n"] }]
704
- }], ctorParameters: function () { return [{ type: TaskService }, { type: i3.Router }, { type: i4$1.NGXLogger }, { type: i4.TranslateService }, { type: i2.ConfigService }, { type: i8.DocumentService }]; }, propDecorators: { taskDetail: [{
705
- type: ViewChild,
706
- args: ['taskDetail']
707
- }] } });
708
-
709
- /*
710
- * Copyright 2015-2023 Ritense BV, the Netherlands.
711
- *
712
- * Licensed under EUPL, Version 1.2 (the "License");
713
- * you may not use this file except in compliance with the License.
714
- * You may obtain a copy of the License at
715
- *
716
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
717
- *
718
- * Unless required by applicable law or agreed to in writing, software
719
- * distributed under the License is distributed on an "AS IS" basis,
720
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
721
- * See the License for the specific language governing permissions and
722
- * limitations under the License.
723
- */
724
- const routes = [
725
- {
726
- path: 'tasks',
727
- component: TaskListComponent,
728
- canActivate: [AuthGuardService],
729
- data: { title: 'Tasks', roles: [ROLE_USER] },
730
- },
731
- ];
732
- class TaskRoutingModule {
733
- }
734
- TaskRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
735
- TaskRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TaskRoutingModule, imports: [CommonModule, i3.RouterModule], exports: [RouterModule] });
736
- TaskRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] });
737
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskRoutingModule, decorators: [{
738
- type: NgModule,
739
- args: [{
740
- declarations: [],
741
- imports: [CommonModule, RouterModule.forChild(routes)],
742
- exports: [RouterModule],
743
- }]
744
- }] });
745
-
746
- /*
747
- * Copyright 2015-2023 Ritense BV, the Netherlands.
748
- *
749
- * Licensed under EUPL, Version 1.2 (the "License");
750
- * you may not use this file except in compliance with the License.
751
- * You may obtain a copy of the License at
752
- *
753
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
754
- *
755
- * Unless required by applicable law or agreed to in writing, software
756
- * distributed under the License is distributed on an "AS IS" basis,
757
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
758
- * See the License for the specific language governing permissions and
759
- * limitations under the License.
760
- */
761
- class TaskModule {
762
- }
763
- TaskModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
764
- TaskModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TaskModule, declarations: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent], imports: [CommonModule,
765
- TaskRoutingModule,
766
- ListModule,
767
- PageHeaderModule,
768
- WidgetModule,
769
- SpinnerModule,
770
- SearchableDropdownSelectModule,
771
- CamundaFormModule,
772
- BrowserAnimationsModule,
773
- FormsModule, i1$1.ToastrModule, i4.TranslateModule, NgbModule,
774
- FormIoModule,
775
- ModalModule,
776
- LinkModule,
777
- FormLinkModule], exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent] });
778
- TaskModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskModule, imports: [CommonModule,
779
- TaskRoutingModule,
780
- ListModule,
781
- PageHeaderModule,
782
- WidgetModule,
783
- SpinnerModule,
784
- SearchableDropdownSelectModule,
785
- CamundaFormModule,
786
- BrowserAnimationsModule,
787
- FormsModule,
788
- ToastrModule.forRoot({
789
- positionClass: 'toast-bottom-full-width',
790
- preventDuplicates: true,
791
- }),
792
- TranslateModule.forRoot({
793
- loader: {
794
- provide: TranslateLoader,
795
- useFactory: HttpLoaderFactory,
796
- deps: [HttpClient],
797
- },
798
- }),
799
- NgbModule,
800
- FormIoModule,
801
- ModalModule,
802
- LinkModule,
803
- FormLinkModule] });
804
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskModule, decorators: [{
805
- type: NgModule,
806
- args: [{
807
- declarations: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent],
808
- imports: [
809
- CommonModule,
810
- TaskRoutingModule,
811
- ListModule,
812
- PageHeaderModule,
813
- WidgetModule,
814
- SpinnerModule,
815
- SearchableDropdownSelectModule,
816
- CamundaFormModule,
817
- BrowserAnimationsModule,
818
- FormsModule,
819
- ToastrModule.forRoot({
820
- positionClass: 'toast-bottom-full-width',
821
- preventDuplicates: true,
822
- }),
823
- TranslateModule.forRoot({
824
- loader: {
825
- provide: TranslateLoader,
826
- useFactory: HttpLoaderFactory,
827
- deps: [HttpClient],
828
- },
829
- }),
830
- NgbModule,
831
- FormIoModule,
832
- ModalModule,
833
- LinkModule,
834
- FormLinkModule,
835
- ],
836
- exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent],
837
- }]
838
- }] });
839
-
840
- /*
841
- * Copyright 2015-2023 Ritense BV, the Netherlands.
842
- *
843
- * Licensed under EUPL, Version 1.2 (the "License");
844
- * you may not use this file except in compliance with the License.
845
- * You may obtain a copy of the License at
846
- *
847
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
848
- *
849
- * Unless required by applicable law or agreed to in writing, software
850
- * distributed under the License is distributed on an "AS IS" basis,
851
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
852
- * See the License for the specific language governing permissions and
853
- * limitations under the License.
854
- */
855
-
856
- /**
857
- * Generated bundle index. Do not edit.
858
- */
859
-
860
- export { AssignUserToTaskComponent, TaskDetailModalComponent, TaskList, TaskListComponent, TaskModule, TaskService };
861
- //# sourceMappingURL=valtimo-task.mjs.map