@valtimo/task 10.8.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 +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,898 +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 + 'v2/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
- this.candidateUsersForTask$.pipe(take(1)).subscribe(candidateUsers => {
213
- const currentUserEmail = changes.assigneeEmail?.currentValue || this.assigneeEmail;
214
- this.assignedEmailOnServer$.next(currentUserEmail || null);
215
- this.userEmailToAssign = currentUserEmail || null;
216
- this.assignedUserFullName$.next(this.getAssignedUserName(candidateUsers, currentUserEmail));
217
- });
218
- }
219
- ngOnDestroy() {
220
- this._subscriptions.unsubscribe();
221
- }
222
- assignTask(userEmail) {
223
- this.disable();
224
- combineLatest([
225
- this.candidateUsersForTask$,
226
- this.taskService.assignTask(this.taskId, { assignee: userEmail }),
227
- ])
228
- .pipe(take(1), tap(([candidateUsers]) => {
229
- this.userEmailToAssign = userEmail;
230
- this.assignedEmailOnServer$.next(userEmail);
231
- this.assignedUserFullName$.next(this.getAssignedUserName(candidateUsers, userEmail));
232
- this.emitChange();
233
- this.enable();
234
- }))
235
- .subscribe();
236
- }
237
- unassignTask() {
238
- this.disable();
239
- this.taskService
240
- .unassignTask(this.taskId)
241
- .pipe(tap(() => {
242
- this.clear();
243
- this.emitChange();
244
- this.enable();
245
- }))
246
- .subscribe();
247
- }
248
- getAssignedUserName(users, userEmail) {
249
- if (users && userEmail) {
250
- const findUser = users.find(user => user.email === userEmail);
251
- return findUser ? findUser.label : userEmail;
252
- }
253
- return userEmail || '-';
254
- }
255
- mapUsersForDropdown(users) {
256
- return (users &&
257
- users
258
- .map(user => ({ ...user, lastName: user.lastName?.split(' ').splice(-1)[0] || '' }))
259
- .sort((a, b) => a.lastName.localeCompare(b.lastName))
260
- .map(user => ({ text: user.label, id: user.email })));
261
- }
262
- clear() {
263
- this.assignedEmailOnServer$.next(null);
264
- this.userEmailToAssign = null;
265
- }
266
- emitChange() {
267
- this.assignmentOfTaskChanged.emit();
268
- }
269
- enable() {
270
- this.disabled$.next(false);
271
- }
272
- disable() {
273
- this.disabled$.next(true);
274
- }
275
- }
276
- AssignUserToTaskComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AssignUserToTaskComponent, deps: [{ token: TaskService }], target: i0.ɵɵFactoryTarget.Component });
277
- 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" }] });
278
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AssignUserToTaskComponent, decorators: [{
279
- type: Component,
280
- 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"] }]
281
- }], ctorParameters: function () { return [{ type: TaskService }]; }, propDecorators: { taskId: [{
282
- type: Input
283
- }], assigneeEmail: [{
284
- type: Input
285
- }], assignmentOfTaskChanged: [{
286
- type: Output
287
- }] } });
288
-
289
- /*
290
- * Copyright 2015-2023 Ritense BV, the Netherlands.
291
- *
292
- * Licensed under EUPL, Version 1.2 (the "License");
293
- * you may not use this file except in compliance with the License.
294
- * You may obtain a copy of the License at
295
- *
296
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
297
- *
298
- * Unless required by applicable law or agreed to in writing, software
299
- * distributed under the License is distributed on an "AS IS" basis,
300
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
301
- * See the License for the specific language governing permissions and
302
- * limitations under the License.
303
- */
304
- moment.locale(localStorage.getItem('langKey') || '');
305
- class TaskDetailModalComponent {
306
- constructor(toastr, formLinkService, processLinkService, formFlowService, router, logger, route, taskService, userProviderService, modalService, stateService, documentService, translateService) {
307
- this.toastr = toastr;
308
- this.formLinkService = formLinkService;
309
- this.processLinkService = processLinkService;
310
- this.formFlowService = formFlowService;
311
- this.router = router;
312
- this.logger = logger;
313
- this.route = route;
314
- this.taskService = taskService;
315
- this.userProviderService = userProviderService;
316
- this.modalService = modalService;
317
- this.stateService = stateService;
318
- this.documentService = documentService;
319
- this.translateService = translateService;
320
- this.formSubmit = new EventEmitter();
321
- this.assignmentOfTaskChanged = new EventEmitter();
322
- this.task = null;
323
- this.page = null;
324
- this.errorMessage = null;
325
- this.isAdmin$ = this.userProviderService
326
- .getUserSubject()
327
- .pipe(map(userIdentity => userIdentity?.roles?.includes('ROLE_ADMIN')));
328
- this.taskProcessLinkType$ = new BehaviorSubject(null);
329
- this.processLinkIsForm$ = this.taskProcessLinkType$.pipe(map(type => type === 'form'));
330
- this.processLinkIsFormFlow$ = this.taskProcessLinkType$.pipe(map(type => type === 'form-flow'));
331
- this.formIoFormData$ = new BehaviorSubject(null);
332
- this._subscriptions = new Subscription();
333
- this.loading$ = new BehaviorSubject(true);
334
- this.formioOptions = new FormioOptionsImpl();
335
- this.formioOptions.disableAlerts = true;
336
- }
337
- ngAfterViewInit() {
338
- this._subscriptions.add(this.modal.modalShowing$
339
- .pipe(distinctUntilChanged(), tap$1(modalShowing => {
340
- if (!modalShowing) {
341
- if (this.formFlow) {
342
- this.formFlow.saveData();
343
- }
344
- }
345
- }))
346
- .subscribe());
347
- }
348
- ngOnDestroy() {
349
- this._subscriptions.unsubscribe();
350
- }
351
- openTaskDetails(task) {
352
- this.resetTaskProcessLinkType();
353
- this.resetFormDefinition();
354
- this.getTaskProcessLink(task.id);
355
- this.setDocumentDefinitionNameInService(task);
356
- const documentId = task.businessKey;
357
- this.stateService.setDocumentId(documentId);
358
- this.task = task;
359
- this.page = {
360
- title: task.name,
361
- subtitle: `${this.translateService.instant('taskDetail.taskCreated')} ${task.created}`,
362
- };
363
- //only load from formlink when process link failed for backwards compatibility
364
- if (!this.taskProcessLinkType$.getValue()) {
365
- this.formLinkService
366
- .getPreFilledFormDefinitionByFormLinkId(task.processDefinitionKey, documentId, task.taskDefinitionKey, task.id // taskInstanceId
367
- )
368
- .subscribe(formDefinition => {
369
- this.formAssociation = formDefinition.formAssociation;
370
- const className = this.formAssociation.formLink.className.split('.');
371
- const linkType = className[className.length - 1];
372
- switch (linkType) {
373
- case 'BpmnElementFormIdLink':
374
- this.setFormDefinitionAndOpenModal(formDefinition);
375
- break;
376
- case 'BpmnElementFormFlowIdLink':
377
- // We can't use the formDefinition here because the form definition is provided per form flow step
378
- // I'm still leaving this in here in case we want to add form flow specific code.
379
- this.modal.show();
380
- break;
381
- case 'BpmnElementUrlLink':
382
- this.openUrlLink(formDefinition);
383
- break;
384
- case 'BpmnElementAngularStateUrlLink':
385
- this.openAngularStateUrlLink(task, formDefinition);
386
- break;
387
- default:
388
- this.logger.fatal('Unsupported class name');
389
- }
390
- }, errors => {
391
- if (errors?.error?.detail) {
392
- this.errorMessage = errors.error.detail;
393
- }
394
- this.modal.show();
395
- });
396
- }
397
- }
398
- gotoFormLinkScreen() {
399
- this.modal.hide();
400
- this.router.navigate(['form-links']);
401
- }
402
- onChange(event) {
403
- if (event.data) {
404
- this.formIoFormData$.next(event.data);
405
- }
406
- }
407
- onSubmit(submission) {
408
- if (submission.data) {
409
- this.formIoFormData$.next(submission.data);
410
- }
411
- if (this.taskProcessLinkType$.getValue() === 'form') {
412
- if (this.processLinkId) {
413
- this.processLinkService
414
- .submitForm(this.processLinkId, submission.data, this.task.businessKey, this.task.id)
415
- .subscribe({
416
- next: (_) => {
417
- this.completeTask();
418
- },
419
- error: errors => {
420
- this.form.showErrors(errors);
421
- },
422
- });
423
- }
424
- else {
425
- this.formLinkService
426
- .onSubmit(this.task.processDefinitionKey, this.formAssociation.formLink.id, submission.data, this.task.businessKey, this.task.id)
427
- .subscribe((_) => {
428
- this.completeTask();
429
- }, errors => {
430
- this.form.showErrors(errors);
431
- });
432
- }
433
- }
434
- }
435
- resetFormDefinition() {
436
- this.formDefinition = null;
437
- this.loading$.next(true);
438
- }
439
- getTaskProcessLink(taskId) {
440
- this.taskService.getTaskProcessLink(taskId).subscribe({
441
- next: res => {
442
- if (res != null) {
443
- switch (res?.type) {
444
- case 'form':
445
- this.taskProcessLinkType$.next('form');
446
- this.processLinkId = res.processLinkId;
447
- this.setFormDefinitionAndOpenModal(res.properties.prefilledForm);
448
- break;
449
- case 'form-flow':
450
- this.taskProcessLinkType$.next('form-flow');
451
- this.formFlowInstanceId = res.properties.formFlowInstanceId;
452
- break;
453
- }
454
- this.loading$.next(false);
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
- this.loading$.next(false);
483
- });
484
- }
485
- resetTaskProcessLinkType() {
486
- this.taskProcessLinkType$.next(null);
487
- this.processLinkId = null;
488
- this.formAssociation = null;
489
- }
490
- setFormDefinitionAndOpenModal(formDefinition) {
491
- this.taskProcessLinkType$.next('form');
492
- this.formDefinition = formDefinition;
493
- this.modal.show();
494
- }
495
- openUrlLink(formDefinition) {
496
- const url = this.router.serializeUrl(this.router.createUrlTree([formDefinition.formAssociation.formLink.url]));
497
- window.open(url, '_blank');
498
- }
499
- openAngularStateUrlLink(task, formDefinition) {
500
- this.route.params.pipe(take(1)).subscribe(params => {
501
- const taskId = task?.id;
502
- const documentId = params?.documentId;
503
- this.router.navigate([formDefinition.formAssociation.formLink.url], {
504
- state: {
505
- ...(taskId && { taskId }),
506
- ...(documentId && { documentId }),
507
- },
508
- });
509
- });
510
- }
511
- setDocumentDefinitionNameInService(task) {
512
- this.documentService
513
- .getProcessDocumentDefinitionFromProcessInstanceId(task.processInstanceId)
514
- .subscribe(processDocumentDefinition => {
515
- const documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
516
- this.modalService.setDocumentDefinitionName(documentDefinitionName);
517
- this.stateService.setDocumentDefinitionName(documentDefinitionName);
518
- });
519
- }
520
- }
521
- 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 });
522
- 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 });
523
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskDetailModalComponent, decorators: [{
524
- type: Component,
525
- 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"] }]
526
- }], 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: [{
527
- type: ViewChild,
528
- args: ['form']
529
- }], formFlow: [{
530
- type: ViewChild,
531
- args: ['formFlow']
532
- }], modal: [{
533
- type: ViewChild,
534
- args: ['taskDetailModal']
535
- }], formSubmit: [{
536
- type: Output
537
- }], assignmentOfTaskChanged: [{
538
- type: Output
539
- }] } });
540
-
541
- /*
542
- * Copyright 2015-2023 Ritense BV, the Netherlands.
543
- *
544
- * Licensed under EUPL, Version 1.2 (the "License");
545
- * you may not use this file except in compliance with the License.
546
- * You may obtain a copy of the License at
547
- *
548
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
549
- *
550
- * Unless required by applicable law or agreed to in writing, software
551
- * distributed under the License is distributed on an "AS IS" basis,
552
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
553
- * See the License for the specific language governing permissions and
554
- * limitations under the License.
555
- */
556
- moment.locale(localStorage.getItem('langKey') || '');
557
- class TaskListComponent {
558
- constructor(taskService, router, logger, translateService, configService, documentService) {
559
- this.taskService = taskService;
560
- this.router = router;
561
- this.logger = logger;
562
- this.translateService = translateService;
563
- this.configService = configService;
564
- this.documentService = documentService;
565
- this.tasks = {
566
- mine: new TaskList(),
567
- open: new TaskList(),
568
- all: new TaskList(),
569
- };
570
- this.visibleTabs = null;
571
- this.currentTaskType = 'mine';
572
- this.listTitle = null;
573
- this.listDescription = null;
574
- this.sortState = null;
575
- this.visibleTabs = this.configService.config?.visibleTaskListTabs || null;
576
- if (this.visibleTabs != null) {
577
- this.currentTaskType = this.visibleTabs[0];
578
- }
579
- this.setDefaultSorting();
580
- }
581
- paginationClicked(page, type) {
582
- this.tasks[type].page = page - 1;
583
- this.getTasks(type);
584
- }
585
- paginationSet() {
586
- this.tasks.mine.pagination.size =
587
- this.tasks.all.pagination.size =
588
- this.tasks.open.pagination.size =
589
- this.tasks[this.currentTaskType].pagination.size;
590
- this.getTasks(this.currentTaskType);
591
- }
592
- clearPagination(type) {
593
- this.tasks[type].page = 0;
594
- }
595
- tabChange(tab) {
596
- this.clearPagination(this.currentTaskType);
597
- this.getTasks(tab.nextId);
598
- }
599
- showTask(task) {
600
- this.router.navigate(['tasks', task.id]);
601
- }
602
- getTasks(type) {
603
- let params;
604
- this.translationSubscription = combineLatest([
605
- this.translateService.stream(`task-list.${type}.title`),
606
- this.translateService.stream(`task-list.${type}.description`),
607
- ]).subscribe(([title, description]) => {
608
- this.listTitle = title;
609
- this.listDescription = description;
610
- });
611
- switch (type) {
612
- case 'mine':
613
- params = {
614
- page: this.tasks.mine.page,
615
- size: this.tasks.mine.pagination.size,
616
- filter: 'mine',
617
- };
618
- this.currentTaskType = 'mine';
619
- break;
620
- case 'open':
621
- params = {
622
- page: this.tasks.open.page,
623
- size: this.tasks.open.pagination.size,
624
- filter: 'open',
625
- };
626
- this.currentTaskType = 'open';
627
- break;
628
- case 'all':
629
- params = { page: this.tasks.all.page, size: this.tasks.open.pagination.size, filter: 'all' };
630
- this.currentTaskType = 'all';
631
- break;
632
- default:
633
- this.logger.fatal('Unreachable case');
634
- }
635
- if (this.sortState) {
636
- params.sort = this.getSortString(this.sortState);
637
- }
638
- this.taskService.queryTasks(params).subscribe((results) => {
639
- this.tasks[type].pagination.collectionSize = results.headers.get('x-total-count');
640
- this.tasks[type].tasks = results.body;
641
- this.tasks[type].tasks.map((task) => {
642
- task.created = moment(task.created).format('DD MMM YYYY HH:mm');
643
- if (task.due) {
644
- task.due = moment(task.due).format('DD MMM YYYY HH:mm');
645
- }
646
- });
647
- if (this.taskService.getConfigCustomTaskList()) {
648
- this.customTaskListFields(type);
649
- }
650
- else {
651
- this.defaultTaskListFields(type);
652
- }
653
- });
654
- }
655
- openRelatedCase(event, index) {
656
- event.stopPropagation();
657
- const tasks = this.tasks[this.currentTaskType].tasks;
658
- const currentTask = tasks && tasks[index];
659
- if (currentTask) {
660
- this.documentService
661
- .getDocument(currentTask.businessKey)
662
- .pipe(take(1))
663
- .subscribe(document => {
664
- this.router.navigate([
665
- `/dossiers/${document.definitionId.name}/document/${currentTask.businessKey}/summary`,
666
- ]);
667
- });
668
- }
669
- }
670
- defaultTaskListFields(type) {
671
- this.translationSubscription = combineLatest([
672
- this.translateService.stream(`task-list.fieldLabels.created`),
673
- this.translateService.stream(`task-list.fieldLabels.name`),
674
- this.translateService.stream(`task-list.fieldLabels.valtimoAssignee.fullName`),
675
- this.translateService.stream(`task-list.fieldLabels.due`),
676
- this.translateService.stream(`task-list.fieldLabels.context`),
677
- ]).subscribe(([created, name, assignee, due, context]) => {
678
- this.tasks[type].fields = [
679
- {
680
- key: 'created',
681
- label: created,
682
- },
683
- {
684
- key: 'name',
685
- label: name,
686
- },
687
- {
688
- key: 'valtimoAssignee.fullName',
689
- label: assignee,
690
- },
691
- {
692
- key: 'due',
693
- label: due,
694
- },
695
- {
696
- key: 'context',
697
- label: context,
698
- },
699
- ];
700
- });
701
- }
702
- customTaskListFields(type) {
703
- const customTaskListFields = this.taskService.getConfigCustomTaskList().fields;
704
- this.translationSubscription = combineLatest(customTaskListFields.map(column => this.translateService.stream(`task-list.fieldLabels.${column.translationKey}`))).subscribe(labels => {
705
- this.tasks[type].fields = customTaskListFields.map((column, index) => ({
706
- key: column.propertyName,
707
- label: labels[index],
708
- sortable: column.sortable,
709
- ...(column.viewType && { viewType: column.viewType }),
710
- ...(column.enum && { enum: column.enum }),
711
- }));
712
- });
713
- }
714
- rowOpenTaskClick(task) {
715
- if (!task.endTime) {
716
- this.taskDetail.openTaskDetails(task);
717
- }
718
- else {
719
- return false;
720
- }
721
- }
722
- setDefaultSorting() {
723
- this.sortState = this.taskService.getConfigCustomTaskList()?.defaultSortedColumn || null;
724
- }
725
- sortChanged(sortState) {
726
- this.sortState = sortState;
727
- this.getTasks(this.currentTaskType);
728
- }
729
- getSortString(sort) {
730
- return `${sort.state.name},${sort.state.direction}`;
731
- }
732
- ngOnDestroy() {
733
- this.translationSubscription.unsubscribe();
734
- }
735
- }
736
- 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 });
737
- 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 });
738
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskListComponent, decorators: [{
739
- type: Component,
740
- 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"] }]
741
- }], ctorParameters: function () { return [{ type: TaskService }, { type: i3.Router }, { type: i4$1.NGXLogger }, { type: i4.TranslateService }, { type: i2.ConfigService }, { type: i8.DocumentService }]; }, propDecorators: { taskDetail: [{
742
- type: ViewChild,
743
- args: ['taskDetail']
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
- const routes = [
762
- {
763
- path: 'tasks',
764
- component: TaskListComponent,
765
- canActivate: [AuthGuardService],
766
- data: { title: 'Tasks', roles: [ROLE_USER] },
767
- },
768
- ];
769
- class TaskRoutingModule {
770
- }
771
- TaskRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
772
- TaskRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TaskRoutingModule, imports: [CommonModule, i3.RouterModule], exports: [RouterModule] });
773
- TaskRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] });
774
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskRoutingModule, decorators: [{
775
- type: NgModule,
776
- args: [{
777
- declarations: [],
778
- imports: [CommonModule, RouterModule.forChild(routes)],
779
- exports: [RouterModule],
780
- }]
781
- }] });
782
-
783
- /*
784
- * Copyright 2015-2023 Ritense BV, the Netherlands.
785
- *
786
- * Licensed under EUPL, Version 1.2 (the "License");
787
- * you may not use this file except in compliance with the License.
788
- * You may obtain a copy of the License at
789
- *
790
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
791
- *
792
- * Unless required by applicable law or agreed to in writing, software
793
- * distributed under the License is distributed on an "AS IS" basis,
794
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
795
- * See the License for the specific language governing permissions and
796
- * limitations under the License.
797
- */
798
- class TaskModule {
799
- }
800
- TaskModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
801
- TaskModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TaskModule, declarations: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent], imports: [CommonModule,
802
- TaskRoutingModule,
803
- ListModule,
804
- PageHeaderModule,
805
- WidgetModule,
806
- SpinnerModule,
807
- SearchableDropdownSelectModule,
808
- CamundaFormModule,
809
- BrowserAnimationsModule,
810
- FormsModule, i1$1.ToastrModule, i4.TranslateModule, NgbModule,
811
- FormIoModule,
812
- ModalModule,
813
- LinkModule,
814
- FormLinkModule], exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent] });
815
- TaskModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskModule, imports: [CommonModule,
816
- TaskRoutingModule,
817
- ListModule,
818
- PageHeaderModule,
819
- WidgetModule,
820
- SpinnerModule,
821
- SearchableDropdownSelectModule,
822
- CamundaFormModule,
823
- BrowserAnimationsModule,
824
- FormsModule,
825
- ToastrModule.forRoot({
826
- positionClass: 'toast-bottom-full-width',
827
- preventDuplicates: true,
828
- }),
829
- TranslateModule.forRoot({
830
- loader: {
831
- provide: TranslateLoader,
832
- useFactory: HttpLoaderFactory,
833
- deps: [HttpClient],
834
- },
835
- }),
836
- NgbModule,
837
- FormIoModule,
838
- ModalModule,
839
- LinkModule,
840
- FormLinkModule] });
841
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TaskModule, decorators: [{
842
- type: NgModule,
843
- args: [{
844
- declarations: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent],
845
- imports: [
846
- CommonModule,
847
- TaskRoutingModule,
848
- ListModule,
849
- PageHeaderModule,
850
- WidgetModule,
851
- SpinnerModule,
852
- SearchableDropdownSelectModule,
853
- CamundaFormModule,
854
- BrowserAnimationsModule,
855
- FormsModule,
856
- ToastrModule.forRoot({
857
- positionClass: 'toast-bottom-full-width',
858
- preventDuplicates: true,
859
- }),
860
- TranslateModule.forRoot({
861
- loader: {
862
- provide: TranslateLoader,
863
- useFactory: HttpLoaderFactory,
864
- deps: [HttpClient],
865
- },
866
- }),
867
- NgbModule,
868
- FormIoModule,
869
- ModalModule,
870
- LinkModule,
871
- FormLinkModule,
872
- ],
873
- exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent],
874
- }]
875
- }] });
876
-
877
- /*
878
- * Copyright 2015-2023 Ritense BV, the Netherlands.
879
- *
880
- * Licensed under EUPL, Version 1.2 (the "License");
881
- * you may not use this file except in compliance with the License.
882
- * You may obtain a copy of the License at
883
- *
884
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
885
- *
886
- * Unless required by applicable law or agreed to in writing, software
887
- * distributed under the License is distributed on an "AS IS" basis,
888
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
889
- * See the License for the specific language governing permissions and
890
- * limitations under the License.
891
- */
892
-
893
- /**
894
- * Generated bundle index. Do not edit.
895
- */
896
-
897
- export { AssignUserToTaskComponent, TaskDetailModalComponent, TaskList, TaskListComponent, TaskModule, TaskService };
898
- //# sourceMappingURL=valtimo-task.mjs.map