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