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