@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.
- package/esm2022/lib/assign-user-to-task/assign-user-to-task.component.mjs +122 -0
- package/esm2022/lib/models/task-list.model.mjs +28 -0
- package/{esm2020 → esm2022}/lib/models/task.model.mjs +1 -1
- package/esm2022/lib/task-detail-modal/task-detail-modal.component.mjs +210 -0
- package/esm2022/lib/task-list/task-list.component.mjs +252 -0
- package/esm2022/lib/task-permissions.mjs +34 -0
- package/{esm2020 → esm2022}/lib/task-routing.module.mjs +5 -5
- package/esm2022/lib/task.module.mjs +119 -0
- package/esm2022/lib/task.service.mjs +72 -0
- package/esm2022/public_api.mjs +26 -0
- package/fesm2022/valtimo-task.mjs +912 -0
- package/fesm2022/valtimo-task.mjs.map +1 -0
- package/lib/assign-user-to-task/assign-user-to-task.component.d.ts +4 -4
- package/lib/assign-user-to-task/assign-user-to-task.component.d.ts.map +1 -1
- package/lib/models/task-list.model.d.ts +0 -1
- package/lib/models/task-list.model.d.ts.map +1 -1
- package/lib/models/task.model.d.ts +7 -7
- package/lib/models/task.model.d.ts.map +1 -1
- package/lib/task-detail-modal/task-detail-modal.component.d.ts +29 -34
- package/lib/task-detail-modal/task-detail-modal.component.d.ts.map +1 -1
- package/lib/task-list/task-list.component.d.ts +22 -16
- package/lib/task-list/task-list.component.d.ts.map +1 -1
- package/lib/task-permissions.d.ts +8 -0
- package/lib/task-permissions.d.ts.map +1 -0
- package/lib/task.module.d.ts +1 -1
- package/lib/task.module.d.ts.map +1 -1
- package/lib/task.service.d.ts +2 -2
- package/lib/task.service.d.ts.map +1 -1
- package/package.json +10 -16
- package/public_api.d.ts +1 -0
- package/public_api.d.ts.map +1 -1
- package/esm2020/lib/assign-user-to-task/assign-user-to-task.component.mjs +0 -123
- package/esm2020/lib/models/task-list.model.mjs +0 -29
- package/esm2020/lib/task-detail-modal/task-detail-modal.component.mjs +0 -269
- package/esm2020/lib/task-list/task-list.component.mjs +0 -222
- package/esm2020/lib/task.module.mjs +0 -113
- package/esm2020/lib/task.service.mjs +0 -69
- package/esm2020/public_api.mjs +0 -25
- package/fesm2015/valtimo-task.mjs +0 -861
- package/fesm2015/valtimo-task.mjs.map +0 -1
- package/fesm2020/valtimo-task.mjs +0 -898
- package/fesm2020/valtimo-task.mjs.map +0 -1
- /package/{esm2020 → esm2022}/lib/models/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/task-definition.model.mjs +0 -0
- /package/{esm2020 → esm2022}/valtimo-task.mjs +0 -0
|
@@ -0,0 +1,912 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, Component, Input, Output, ViewEncapsulation, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import * as i9 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 i8 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 i10 from '@ng-bootstrap/ng-bootstrap';
|
|
14
|
+
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
|
15
|
+
import * as i8$1 from '@ngx-translate/core';
|
|
16
|
+
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
|
17
|
+
import * as i2$1 from '@valtimo/components';
|
|
18
|
+
import { FormioOptionsImpl, CarbonListModule, PageHeaderModule, WidgetModule, SpinnerModule, SearchableDropdownSelectModule, CamundaFormModule, FormIoModule, ModalModule } from '@valtimo/components';
|
|
19
|
+
import * as i4 from '@valtimo/form-link';
|
|
20
|
+
import { FormLinkModule } from '@valtimo/form-link';
|
|
21
|
+
import * as i11 from 'carbon-components-angular';
|
|
22
|
+
import { LinkModule, TabsModule, ContentSwitcherModule } from 'carbon-components-angular';
|
|
23
|
+
import * as i7 from 'ngx-toastr';
|
|
24
|
+
import { ToastrModule } from 'ngx-toastr';
|
|
25
|
+
import { BehaviorSubject, Subscription, take, combineLatest, tap, map, distinctUntilChanged, switchMap, of } from 'rxjs';
|
|
26
|
+
import moment from 'moment';
|
|
27
|
+
import * as i1$1 from '@valtimo/document';
|
|
28
|
+
import * as i3 from '@valtimo/access-control';
|
|
29
|
+
import * as i5 from '@angular/router';
|
|
30
|
+
import { RouterModule } from '@angular/router';
|
|
31
|
+
import { take as take$1 } from 'rxjs/operators';
|
|
32
|
+
import * as i3$1 from 'ngx-logger';
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
36
|
+
*
|
|
37
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
38
|
+
* you may not use this file except in compliance with the License.
|
|
39
|
+
* You may obtain a copy of the License at
|
|
40
|
+
*
|
|
41
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
42
|
+
*
|
|
43
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
44
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
45
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
46
|
+
* See the License for the specific language governing permissions and
|
|
47
|
+
* limitations under the License.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/*
|
|
51
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
52
|
+
*
|
|
53
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
54
|
+
* you may not use this file except in compliance with the License.
|
|
55
|
+
* You may obtain a copy of the License at
|
|
56
|
+
*
|
|
57
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
58
|
+
*
|
|
59
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
60
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
61
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
62
|
+
* See the License for the specific language governing permissions and
|
|
63
|
+
* limitations under the License.
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
68
|
+
*
|
|
69
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
70
|
+
* you may not use this file except in compliance with the License.
|
|
71
|
+
* You may obtain a copy of the License at
|
|
72
|
+
*
|
|
73
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
74
|
+
*
|
|
75
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
76
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
77
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
78
|
+
* See the License for the specific language governing permissions and
|
|
79
|
+
* limitations under the License.
|
|
80
|
+
*/
|
|
81
|
+
class TaskList {
|
|
82
|
+
constructor() {
|
|
83
|
+
this.tasks = [];
|
|
84
|
+
this.fields = [];
|
|
85
|
+
this.pagination = {
|
|
86
|
+
collectionSize: 0,
|
|
87
|
+
page: 1,
|
|
88
|
+
size: 10,
|
|
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`, {
|
|
133
|
+
observe: 'response',
|
|
134
|
+
params,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
getTasks() {
|
|
138
|
+
return this.http.get(`${this.valtimoEndpointUri}v1/task?filter=all`);
|
|
139
|
+
}
|
|
140
|
+
getTask(id) {
|
|
141
|
+
return this.http.get(this.valtimoEndpointUri + 'v1/task/' + id);
|
|
142
|
+
}
|
|
143
|
+
getCandidateUsers(id) {
|
|
144
|
+
return this.http.get(this.valtimoEndpointUri + 'v2/task/' + id + '/candidate-user');
|
|
145
|
+
}
|
|
146
|
+
assignTask(id, assigneeRequest) {
|
|
147
|
+
return this.http.post(this.valtimoEndpointUri + 'v1/task/' + id + '/assign', assigneeRequest);
|
|
148
|
+
}
|
|
149
|
+
unassignTask(id) {
|
|
150
|
+
return this.http.post(this.valtimoEndpointUri + 'v1/task/' + id + '/unassign', null);
|
|
151
|
+
}
|
|
152
|
+
completeTask(id, variables) {
|
|
153
|
+
return this.http.post(this.valtimoEndpointUri + 'v1/task/' + id + '/complete', {
|
|
154
|
+
variables,
|
|
155
|
+
filesToDelete: [],
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
getTaskProcessLink(taskId) {
|
|
159
|
+
return this.http.get(`${this.valtimoEndpointUri}v2/process-link/task/${taskId}`, {
|
|
160
|
+
headers: { [InterceptorSkip]: '' },
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
getTaskProcessLinkV1(taskId) {
|
|
164
|
+
return this.http.get(`${this.valtimoEndpointUri}v1/process-link/task/${taskId}`);
|
|
165
|
+
}
|
|
166
|
+
getConfigCustomTaskList() {
|
|
167
|
+
return this.configService.config.customTaskList;
|
|
168
|
+
}
|
|
169
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
170
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskService, providedIn: 'root' }); }
|
|
171
|
+
}
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskService, decorators: [{
|
|
173
|
+
type: Injectable,
|
|
174
|
+
args: [{ providedIn: 'root' }]
|
|
175
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.ConfigService }]; } });
|
|
176
|
+
|
|
177
|
+
/*
|
|
178
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
179
|
+
*
|
|
180
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
181
|
+
* you may not use this file except in compliance with the License.
|
|
182
|
+
* You may obtain a copy of the License at
|
|
183
|
+
*
|
|
184
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
185
|
+
*
|
|
186
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
188
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
* See the License for the specific language governing permissions and
|
|
190
|
+
* limitations under the License.
|
|
191
|
+
*/
|
|
192
|
+
class AssignUserToTaskComponent {
|
|
193
|
+
constructor(taskService) {
|
|
194
|
+
this.taskService = taskService;
|
|
195
|
+
this.assignmentOfTaskChanged = new EventEmitter();
|
|
196
|
+
this.assignedEmailOnServer$ = new BehaviorSubject(null);
|
|
197
|
+
this.assignedUserFullName$ = new BehaviorSubject(null);
|
|
198
|
+
this.candidateUsersForTask$ = new BehaviorSubject(undefined);
|
|
199
|
+
this.disabled$ = new BehaviorSubject(true);
|
|
200
|
+
this.userEmailToAssign = null;
|
|
201
|
+
this._subscriptions = new Subscription();
|
|
202
|
+
}
|
|
203
|
+
ngOnInit() {
|
|
204
|
+
this._subscriptions.add(this.taskService.getCandidateUsers(this.taskId).subscribe(candidateUsers => {
|
|
205
|
+
this.candidateUsersForTask$.next(candidateUsers);
|
|
206
|
+
if (this.assigneeEmail) {
|
|
207
|
+
this.assignedEmailOnServer$.next(this.assigneeEmail);
|
|
208
|
+
this.userEmailToAssign = this.assigneeEmail;
|
|
209
|
+
this.assignedUserFullName$.next(this.getAssignedUserName(candidateUsers, this.assigneeEmail));
|
|
210
|
+
}
|
|
211
|
+
this.enable();
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
214
|
+
ngOnChanges(changes) {
|
|
215
|
+
this.candidateUsersForTask$.pipe(take(1)).subscribe(candidateUsers => {
|
|
216
|
+
const currentUserEmail = changes.assigneeEmail?.currentValue || this.assigneeEmail;
|
|
217
|
+
this.assignedEmailOnServer$.next(currentUserEmail || null);
|
|
218
|
+
this.userEmailToAssign = currentUserEmail || null;
|
|
219
|
+
this.assignedUserFullName$.next(this.getAssignedUserName(candidateUsers ?? [], currentUserEmail));
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
ngOnDestroy() {
|
|
223
|
+
this._subscriptions.unsubscribe();
|
|
224
|
+
}
|
|
225
|
+
assignTask(userEmail) {
|
|
226
|
+
this.disable();
|
|
227
|
+
combineLatest([
|
|
228
|
+
this.candidateUsersForTask$,
|
|
229
|
+
this.taskService.assignTask(this.taskId, { assignee: userEmail }),
|
|
230
|
+
])
|
|
231
|
+
.pipe(take(1), tap(([candidateUsers]) => {
|
|
232
|
+
this.userEmailToAssign = userEmail;
|
|
233
|
+
this.assignedEmailOnServer$.next(userEmail);
|
|
234
|
+
this.assignedUserFullName$.next(this.getAssignedUserName(candidateUsers ?? [], userEmail));
|
|
235
|
+
this.emitChange();
|
|
236
|
+
this.enable();
|
|
237
|
+
}))
|
|
238
|
+
.subscribe();
|
|
239
|
+
}
|
|
240
|
+
unassignTask() {
|
|
241
|
+
this.disable();
|
|
242
|
+
this.taskService
|
|
243
|
+
.unassignTask(this.taskId)
|
|
244
|
+
.pipe(tap(() => {
|
|
245
|
+
this.clear();
|
|
246
|
+
this.emitChange();
|
|
247
|
+
this.enable();
|
|
248
|
+
}))
|
|
249
|
+
.subscribe();
|
|
250
|
+
}
|
|
251
|
+
getAssignedUserName(users, userEmail) {
|
|
252
|
+
if (users && userEmail) {
|
|
253
|
+
const findUser = users.find(user => user.email === userEmail);
|
|
254
|
+
return findUser ? findUser.label : userEmail;
|
|
255
|
+
}
|
|
256
|
+
return userEmail || '-';
|
|
257
|
+
}
|
|
258
|
+
mapUsersForDropdown(users) {
|
|
259
|
+
return (users &&
|
|
260
|
+
users
|
|
261
|
+
.map(user => ({ ...user, lastName: user.lastName?.split(' ').splice(-1)[0] || '' }))
|
|
262
|
+
.sort((a, b) => a.lastName.localeCompare(b.lastName))
|
|
263
|
+
.map(user => ({ text: user.label, id: user.email })));
|
|
264
|
+
}
|
|
265
|
+
clear() {
|
|
266
|
+
this.assignedEmailOnServer$.next(null);
|
|
267
|
+
this.userEmailToAssign = null;
|
|
268
|
+
}
|
|
269
|
+
emitChange() {
|
|
270
|
+
this.assignmentOfTaskChanged.emit();
|
|
271
|
+
}
|
|
272
|
+
enable() {
|
|
273
|
+
this.disabled$.next(false);
|
|
274
|
+
}
|
|
275
|
+
disable() {
|
|
276
|
+
this.disabled$.next(true);
|
|
277
|
+
}
|
|
278
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AssignUserToTaskComponent, deps: [{ token: TaskService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
279
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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 <valtimo-searchable-dropdown-select\n *ngIf=\"obs.candidateUsers; else loading\"\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 </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: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.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: i8.AsyncPipe, name: "async" }, { kind: "pipe", type: i8$1.TranslatePipe, name: "translate" }] }); }
|
|
280
|
+
}
|
|
281
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AssignUserToTaskComponent, decorators: [{
|
|
282
|
+
type: Component,
|
|
283
|
+
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 <valtimo-searchable-dropdown-select\n *ngIf=\"obs.candidateUsers; else loading\"\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 </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"] }]
|
|
284
|
+
}], ctorParameters: function () { return [{ type: TaskService }]; }, propDecorators: { taskId: [{
|
|
285
|
+
type: Input
|
|
286
|
+
}], assigneeEmail: [{
|
|
287
|
+
type: Input
|
|
288
|
+
}], assignmentOfTaskChanged: [{
|
|
289
|
+
type: Output
|
|
290
|
+
}] } });
|
|
291
|
+
|
|
292
|
+
/*
|
|
293
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
294
|
+
*
|
|
295
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
296
|
+
* you may not use this file except in compliance with the License.
|
|
297
|
+
* You may obtain a copy of the License at
|
|
298
|
+
*
|
|
299
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
300
|
+
*
|
|
301
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
302
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
303
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
304
|
+
* See the License for the specific language governing permissions and
|
|
305
|
+
* limitations under the License.
|
|
306
|
+
*/
|
|
307
|
+
var PERMISSION_ACTION;
|
|
308
|
+
(function (PERMISSION_ACTION) {
|
|
309
|
+
PERMISSION_ACTION["assign"] = "assign";
|
|
310
|
+
PERMISSION_ACTION["view"] = "view";
|
|
311
|
+
})(PERMISSION_ACTION || (PERMISSION_ACTION = {}));
|
|
312
|
+
var TASK_DETAIL_PERMISSION_RESOURCE;
|
|
313
|
+
(function (TASK_DETAIL_PERMISSION_RESOURCE) {
|
|
314
|
+
TASK_DETAIL_PERMISSION_RESOURCE["task"] = "com.ritense.valtimo.camunda.domain.CamundaTask";
|
|
315
|
+
})(TASK_DETAIL_PERMISSION_RESOURCE || (TASK_DETAIL_PERMISSION_RESOURCE = {}));
|
|
316
|
+
const CAN_ASSIGN_TASK_PERMISSION = {
|
|
317
|
+
action: PERMISSION_ACTION.assign,
|
|
318
|
+
resource: TASK_DETAIL_PERMISSION_RESOURCE.task,
|
|
319
|
+
};
|
|
320
|
+
const CAN_VIEW_TASK_PERMISSION = {
|
|
321
|
+
action: PERMISSION_ACTION.view,
|
|
322
|
+
resource: TASK_DETAIL_PERMISSION_RESOURCE.task,
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
/*
|
|
326
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
327
|
+
*
|
|
328
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
329
|
+
* you may not use this file except in compliance with the License.
|
|
330
|
+
* You may obtain a copy of the License at
|
|
331
|
+
*
|
|
332
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
333
|
+
*
|
|
334
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
335
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
336
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
337
|
+
* See the License for the specific language governing permissions and
|
|
338
|
+
* limitations under the License.
|
|
339
|
+
*/
|
|
340
|
+
moment.locale(localStorage.getItem('langKey') || '');
|
|
341
|
+
class TaskDetailModalComponent {
|
|
342
|
+
constructor(documentService, modalService, permissionService, processLinkService, router, stateService, taskService, toastr, translateService, userProviderService) {
|
|
343
|
+
this.documentService = documentService;
|
|
344
|
+
this.modalService = modalService;
|
|
345
|
+
this.permissionService = permissionService;
|
|
346
|
+
this.processLinkService = processLinkService;
|
|
347
|
+
this.router = router;
|
|
348
|
+
this.stateService = stateService;
|
|
349
|
+
this.taskService = taskService;
|
|
350
|
+
this.toastr = toastr;
|
|
351
|
+
this.translateService = translateService;
|
|
352
|
+
this.userProviderService = userProviderService;
|
|
353
|
+
this.formSubmit = new EventEmitter();
|
|
354
|
+
this.assignmentOfTaskChanged = new EventEmitter();
|
|
355
|
+
this.errorMessage = null;
|
|
356
|
+
this.formIoFormData$ = new BehaviorSubject(null);
|
|
357
|
+
this.page = null;
|
|
358
|
+
this.task = null;
|
|
359
|
+
this._taskProcessLinkType$ = new BehaviorSubject(null);
|
|
360
|
+
this.processLinkIsForm$ = this._taskProcessLinkType$.pipe(map(type => type === 'form'));
|
|
361
|
+
this.processLinkIsFormFlow$ = this._taskProcessLinkType$.pipe(map(type => type === 'form-flow'));
|
|
362
|
+
this.isAdmin$ = this.userProviderService
|
|
363
|
+
.getUserSubject()
|
|
364
|
+
.pipe(map(userIdentity => userIdentity?.roles?.includes('ROLE_ADMIN')));
|
|
365
|
+
this.loading$ = new BehaviorSubject(true);
|
|
366
|
+
this._subscriptions = new Subscription();
|
|
367
|
+
this.formioOptions = new FormioOptionsImpl();
|
|
368
|
+
this.formioOptions.disableAlerts = true;
|
|
369
|
+
}
|
|
370
|
+
ngAfterViewInit() {
|
|
371
|
+
this._subscriptions.add(this.modal.modalShowing$
|
|
372
|
+
.pipe(distinctUntilChanged(), tap(modalShowing => {
|
|
373
|
+
if (!modalShowing) {
|
|
374
|
+
if (this.formFlow) {
|
|
375
|
+
this.formFlow.saveData();
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}))
|
|
379
|
+
.subscribe());
|
|
380
|
+
}
|
|
381
|
+
ngOnDestroy() {
|
|
382
|
+
this._subscriptions.unsubscribe();
|
|
383
|
+
}
|
|
384
|
+
openTaskDetails(task) {
|
|
385
|
+
this.canAssign$ = this.permissionService.requestPermission(CAN_ASSIGN_TASK_PERMISSION, {
|
|
386
|
+
resource: TASK_DETAIL_PERMISSION_RESOURCE.task,
|
|
387
|
+
identifier: task.id,
|
|
388
|
+
});
|
|
389
|
+
this.resetTaskProcessLinkType();
|
|
390
|
+
this.resetFormDefinition();
|
|
391
|
+
this.getTaskProcessLink(task.id);
|
|
392
|
+
this.setDocumentDefinitionNameInService(task);
|
|
393
|
+
this.stateService.setDocumentId(task.businessKey);
|
|
394
|
+
this.task = task;
|
|
395
|
+
this.page = {
|
|
396
|
+
title: task.name,
|
|
397
|
+
subtitle: `${this.translateService.instant('taskDetail.taskCreated')} ${task.created}`,
|
|
398
|
+
};
|
|
399
|
+
if (!this._taskProcessLinkType$.getValue()) {
|
|
400
|
+
this.modal.show();
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
gotoProcessLinkScreen() {
|
|
404
|
+
this.modal.hide();
|
|
405
|
+
this.router.navigate(['process-links']);
|
|
406
|
+
}
|
|
407
|
+
onChange(event) {
|
|
408
|
+
if (event.data) {
|
|
409
|
+
this.formIoFormData$.next(event.data);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
completeTask() {
|
|
413
|
+
this.toastr.success(`${this.task?.name} ${this.translateService.instant('taskDetail.taskCompleted')}`);
|
|
414
|
+
this.modal.hide();
|
|
415
|
+
this.task = null;
|
|
416
|
+
this.formSubmit.emit();
|
|
417
|
+
}
|
|
418
|
+
onSubmit(submission) {
|
|
419
|
+
if (submission.data) {
|
|
420
|
+
this.formIoFormData$.next(submission.data);
|
|
421
|
+
}
|
|
422
|
+
if (this._taskProcessLinkType$.getValue() === 'form') {
|
|
423
|
+
this.processLinkService
|
|
424
|
+
.submitForm(this._processLinkId ?? '', submission.data, this.task?.businessKey, this.task?.id)
|
|
425
|
+
.subscribe({
|
|
426
|
+
next: (_) => {
|
|
427
|
+
this.completeTask();
|
|
428
|
+
},
|
|
429
|
+
error: 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
|
+
getLegacyTaskProcessLink(taskId) {
|
|
466
|
+
this.taskService.getTaskProcessLinkV1(taskId).subscribe(resV1 => {
|
|
467
|
+
switch (resV1?.type) {
|
|
468
|
+
case 'form':
|
|
469
|
+
this._taskProcessLinkType$.next('form');
|
|
470
|
+
break;
|
|
471
|
+
case 'form-flow':
|
|
472
|
+
this._taskProcessLinkType$.next('form-flow');
|
|
473
|
+
this.formFlowInstanceId = resV1.properties.formFlowInstanceId ?? '';
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
this.loading$.next(false);
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
resetTaskProcessLinkType() {
|
|
480
|
+
this._taskProcessLinkType$.next(null);
|
|
481
|
+
this._processLinkId = null;
|
|
482
|
+
}
|
|
483
|
+
setFormDefinitionAndOpenModal(formDefinition) {
|
|
484
|
+
this._taskProcessLinkType$.next('form');
|
|
485
|
+
this.formDefinition = formDefinition;
|
|
486
|
+
this.modal.show();
|
|
487
|
+
}
|
|
488
|
+
setDocumentDefinitionNameInService(task) {
|
|
489
|
+
this.documentService
|
|
490
|
+
.getProcessDocumentDefinitionFromProcessInstanceId(task.processInstanceId)
|
|
491
|
+
.subscribe(processDocumentDefinition => {
|
|
492
|
+
const documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
|
|
493
|
+
this.modalService.setDocumentDefinitionName(documentDefinitionName);
|
|
494
|
+
this.stateService.setDocumentDefinitionName(documentDefinitionName);
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskDetailModalComponent, deps: [{ token: i1$1.DocumentService }, { token: i2$1.ValtimoModalService }, { token: i3.PermissionService }, { token: i4.ProcessLinkService }, { token: i5.Router }, { token: i2$1.FormIoStateService }, { token: TaskService }, { token: i7.ToastrService }, { token: i8$1.TranslateService }, { token: i9.UserProviderService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
498
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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 (click)=\"gotoProcessLinkScreen()\"\n class=\"btn btn-secondary btn-space\"\n id=\"process-link-button\"\n type=\"button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | 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 && (canAssign$ | async)\"\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: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i2$1.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "component", type: i4.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: i8.AsyncPipe, name: "async" }, { kind: "pipe", type: i8$1.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
499
|
+
}
|
|
500
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskDetailModalComponent, decorators: [{
|
|
501
|
+
type: Component,
|
|
502
|
+
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 (click)=\"gotoProcessLinkScreen()\"\n class=\"btn btn-secondary btn-space\"\n id=\"process-link-button\"\n type=\"button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | 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 && (canAssign$ | async)\"\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"] }]
|
|
503
|
+
}], ctorParameters: function () { return [{ type: i1$1.DocumentService }, { type: i2$1.ValtimoModalService }, { type: i3.PermissionService }, { type: i4.ProcessLinkService }, { type: i5.Router }, { type: i2$1.FormIoStateService }, { type: TaskService }, { type: i7.ToastrService }, { type: i8$1.TranslateService }, { type: i9.UserProviderService }]; }, propDecorators: { form: [{
|
|
504
|
+
type: ViewChild,
|
|
505
|
+
args: ['form']
|
|
506
|
+
}], formFlow: [{
|
|
507
|
+
type: ViewChild,
|
|
508
|
+
args: ['formFlow']
|
|
509
|
+
}], modal: [{
|
|
510
|
+
type: ViewChild,
|
|
511
|
+
args: ['taskDetailModal']
|
|
512
|
+
}], formSubmit: [{
|
|
513
|
+
type: Output
|
|
514
|
+
}], assignmentOfTaskChanged: [{
|
|
515
|
+
type: Output
|
|
516
|
+
}] } });
|
|
517
|
+
|
|
518
|
+
/*
|
|
519
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
520
|
+
*
|
|
521
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
522
|
+
* you may not use this file except in compliance with the License.
|
|
523
|
+
* You may obtain a copy of the License at
|
|
524
|
+
*
|
|
525
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
526
|
+
*
|
|
527
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
528
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
529
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
530
|
+
* See the License for the specific language governing permissions and
|
|
531
|
+
* limitations under the License.
|
|
532
|
+
*/
|
|
533
|
+
moment.locale(localStorage.getItem('langKey') || '');
|
|
534
|
+
class TaskListComponent {
|
|
535
|
+
constructor(configService, documentService, logger, permissionService, router, taskService, translateService) {
|
|
536
|
+
this.configService = configService;
|
|
537
|
+
this.documentService = documentService;
|
|
538
|
+
this.logger = logger;
|
|
539
|
+
this.permissionService = permissionService;
|
|
540
|
+
this.router = router;
|
|
541
|
+
this.taskService = taskService;
|
|
542
|
+
this.translateService = translateService;
|
|
543
|
+
this.tasks = {
|
|
544
|
+
mine: new TaskList(),
|
|
545
|
+
open: new TaskList(),
|
|
546
|
+
all: new TaskList(),
|
|
547
|
+
};
|
|
548
|
+
this.visibleTabs = null;
|
|
549
|
+
this.currentTaskType = 'mine';
|
|
550
|
+
this.listTitle = null;
|
|
551
|
+
this.listDescription = null;
|
|
552
|
+
this.sortState = null;
|
|
553
|
+
this.loadingTasks$ = new BehaviorSubject(true);
|
|
554
|
+
this.activeTab$ = new BehaviorSubject('');
|
|
555
|
+
this.visibleTabs = this.configService.config?.visibleTaskListTabs || null;
|
|
556
|
+
if (this.visibleTabs) {
|
|
557
|
+
this.currentTaskType = this.visibleTabs[0];
|
|
558
|
+
}
|
|
559
|
+
this.setDefaultSorting();
|
|
560
|
+
}
|
|
561
|
+
ngOnDestroy() {
|
|
562
|
+
this.closeTranslationSubscription();
|
|
563
|
+
}
|
|
564
|
+
paginationClicked(page, type) {
|
|
565
|
+
this.tasks[type].page = page - 1;
|
|
566
|
+
this.tasks[type].pagination.page = page;
|
|
567
|
+
this.getTasks(type);
|
|
568
|
+
}
|
|
569
|
+
paginationSet(size) {
|
|
570
|
+
this.tasks.mine.pagination.size =
|
|
571
|
+
this.tasks.all.pagination.size =
|
|
572
|
+
this.tasks.open.pagination.size =
|
|
573
|
+
size;
|
|
574
|
+
this.getTasks(this.currentTaskType);
|
|
575
|
+
}
|
|
576
|
+
tabChange(tab) {
|
|
577
|
+
this.clearPagination(this.currentTaskType);
|
|
578
|
+
this.getTasks(tab);
|
|
579
|
+
}
|
|
580
|
+
showTask(task) {
|
|
581
|
+
this.router.navigate(['tasks', task.id]);
|
|
582
|
+
}
|
|
583
|
+
getTasks(type) {
|
|
584
|
+
this.loadingTasks$.next(true);
|
|
585
|
+
this.activeTab$.next(type);
|
|
586
|
+
let params;
|
|
587
|
+
this.closeTranslationSubscription();
|
|
588
|
+
this._translationSubscription = combineLatest([
|
|
589
|
+
this.translateService.stream(`task-list.${type}.title`),
|
|
590
|
+
this.translateService.stream(`task-list.${type}.description`),
|
|
591
|
+
]).subscribe(([title, description]) => {
|
|
592
|
+
this.listTitle = title;
|
|
593
|
+
this.listDescription = description;
|
|
594
|
+
});
|
|
595
|
+
switch (type) {
|
|
596
|
+
case 'mine':
|
|
597
|
+
params = {
|
|
598
|
+
page: this.tasks.mine.page,
|
|
599
|
+
size: this.tasks.mine.pagination.size,
|
|
600
|
+
filter: 'mine',
|
|
601
|
+
};
|
|
602
|
+
this.currentTaskType = 'mine';
|
|
603
|
+
break;
|
|
604
|
+
case 'open':
|
|
605
|
+
params = {
|
|
606
|
+
page: this.tasks.open.page,
|
|
607
|
+
size: this.tasks.open.pagination.size,
|
|
608
|
+
filter: 'open',
|
|
609
|
+
};
|
|
610
|
+
this.currentTaskType = 'open';
|
|
611
|
+
break;
|
|
612
|
+
case 'all':
|
|
613
|
+
params = { page: this.tasks.all.page, size: this.tasks.open.pagination.size, filter: 'all' };
|
|
614
|
+
this.currentTaskType = 'all';
|
|
615
|
+
break;
|
|
616
|
+
default:
|
|
617
|
+
this.logger.fatal('Unreachable case');
|
|
618
|
+
}
|
|
619
|
+
if (this.sortState) {
|
|
620
|
+
params.sort = this.getSortString(this.sortState);
|
|
621
|
+
}
|
|
622
|
+
this.taskService
|
|
623
|
+
.queryTasks(params)
|
|
624
|
+
.pipe(switchMap(tasksResult => combineLatest([
|
|
625
|
+
of(tasksResult),
|
|
626
|
+
...tasksResult.body.map(task => this.permissionService.requestPermission(CAN_VIEW_TASK_PERMISSION, {
|
|
627
|
+
resource: TASK_DETAIL_PERMISSION_RESOURCE.task,
|
|
628
|
+
identifier: task.id,
|
|
629
|
+
})),
|
|
630
|
+
])))
|
|
631
|
+
.subscribe(results => {
|
|
632
|
+
const tasksResult = results[0];
|
|
633
|
+
const permissions = results.filter((_, index) => index !== 0);
|
|
634
|
+
this.tasks[type].pagination = {
|
|
635
|
+
...this.tasks[type].pagination,
|
|
636
|
+
collectionSize: tasksResult.headers.get('x-total-count'),
|
|
637
|
+
};
|
|
638
|
+
this.tasks[type].tasks = tasksResult.body;
|
|
639
|
+
this.tasks[type].tasks.map((task, taskIndex) => {
|
|
640
|
+
task.created = moment(task.created).format('DD MMM YYYY HH:mm');
|
|
641
|
+
if (task.due) {
|
|
642
|
+
task.due = moment(task.due).format('DD MMM YYYY HH:mm');
|
|
643
|
+
}
|
|
644
|
+
task.isLocked = !permissions[taskIndex];
|
|
645
|
+
});
|
|
646
|
+
if (this.taskService.getConfigCustomTaskList()) {
|
|
647
|
+
this.customTaskListFields(type);
|
|
648
|
+
}
|
|
649
|
+
else {
|
|
650
|
+
this.defaultTaskListFields(type);
|
|
651
|
+
}
|
|
652
|
+
this.loadingTasks$.next(false);
|
|
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(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.closeTranslationSubscription();
|
|
672
|
+
this._translationSubscription = combineLatest([
|
|
673
|
+
this.translateService.stream(`task-list.fieldLabels.created`),
|
|
674
|
+
this.translateService.stream(`task-list.fieldLabels.name`),
|
|
675
|
+
this.translateService.stream(`task-list.fieldLabels.valtimoAssignee.fullName`),
|
|
676
|
+
this.translateService.stream(`task-list.fieldLabels.due`),
|
|
677
|
+
this.translateService.stream(`task-list.fieldLabels.context`),
|
|
678
|
+
]).subscribe(([created, name, assignee, due, context]) => {
|
|
679
|
+
this.tasks[type].fields = [
|
|
680
|
+
{
|
|
681
|
+
key: 'created',
|
|
682
|
+
label: created,
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
key: 'name',
|
|
686
|
+
label: name,
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
key: 'valtimoAssignee.fullName',
|
|
690
|
+
label: assignee,
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
key: 'due',
|
|
694
|
+
label: due,
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
key: 'context',
|
|
698
|
+
label: context,
|
|
699
|
+
},
|
|
700
|
+
];
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
customTaskListFields(type) {
|
|
704
|
+
const customTaskListFields = this.taskService.getConfigCustomTaskList().fields;
|
|
705
|
+
this.closeTranslationSubscription();
|
|
706
|
+
this._translationSubscription = combineLatest(customTaskListFields.map(column => this.translateService.stream(`task-list.fieldLabels.${column.translationKey}`))).subscribe(labels => {
|
|
707
|
+
this.tasks[type].fields = customTaskListFields.map((column, index) => ({
|
|
708
|
+
key: column.propertyName,
|
|
709
|
+
label: labels[index],
|
|
710
|
+
sortable: column.sortable,
|
|
711
|
+
...(column.viewType && { viewType: column.viewType }),
|
|
712
|
+
...(column.enum && { enum: column.enum }),
|
|
713
|
+
}));
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
rowOpenTaskClick(task) {
|
|
717
|
+
if (!task.endTime && !task.isLocked) {
|
|
718
|
+
this.taskDetail.openTaskDetails(task);
|
|
719
|
+
}
|
|
720
|
+
else {
|
|
721
|
+
return false;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
setDefaultSorting() {
|
|
725
|
+
this.sortState = this.taskService.getConfigCustomTaskList()?.defaultSortedColumn || null;
|
|
726
|
+
}
|
|
727
|
+
sortChanged(sortState) {
|
|
728
|
+
this.sortState = sortState;
|
|
729
|
+
this.getTasks(this.currentTaskType);
|
|
730
|
+
}
|
|
731
|
+
getSortString(sort) {
|
|
732
|
+
return `${sort.state.name},${sort.state.direction}`;
|
|
733
|
+
}
|
|
734
|
+
clearPagination(type) {
|
|
735
|
+
this.tasks[type].page = 0;
|
|
736
|
+
}
|
|
737
|
+
closeTranslationSubscription() {
|
|
738
|
+
this._translationSubscription?.unsubscribe();
|
|
739
|
+
}
|
|
740
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskListComponent, deps: [{ token: i2.ConfigService }, { token: i1$1.DocumentService }, { token: i3$1.NGXLogger }, { token: i3.PermissionService }, { token: i5.Router }, { token: TaskService }, { token: i8$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
741
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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\n class=\"main-content\"\n *ngIf=\"{loadingTasks: loadingTasks$ | async, activeTab: activeTab$ | async} as obs\"\n>\n <div class=\"container-fluid\">\n <ng-container\n *ngTemplateOutlet=\"tasksList; context: {show: !obs.loadingTasks, activeTab: obs.activeTab}\"\n ></ng-container>\n\n <ng-container\n *ngTemplateOutlet=\"\n tasksListLoading;\n context: {show: obs.loadingTasks, activeTab: obs.activeTab}\n \"\n ></ng-container>\n\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 let-activeTab=\"activeTab\">\n <cds-tabs type=\"contained\" class=\"valtimo-carbon-list__tabs\">\n <cds-tab\n *ngFor=\"let tab of visibleTabs\"\n [heading]=\"'task-list.' + tab + '.title' | translate\"\n [active]=\"activeTab === tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n</ng-template>\n\n<ng-template #caseLinkWithTaskLock let-data=\"data\">\n <a\n class=\"float-left\"\n cdsLink\n href=\"javascript:void(0)\"\n (click)=\"openRelatedCase($event, data.index)\"\n >\n {{ 'task-list.goToCase' | translate }}\n </a>\n <div *ngIf=\"tasks[currentTaskType].tasks[data.index].isLocked\">\n <span\n class=\"float-right badge badge-pill badge-secondary bg-grey\"\n ngbTooltip=\"{{ 'task-list.taskLocked' | translate }}\"\n >\n <i class=\"icon mdi mdi-lock\"></i>\n </span>\n </div>\n</ng-template>\n\n<ng-template #tasksList let-show=\"show\" let-activeTab=\"activeTab\">\n <valtimo-carbon-list\n [ngClass]=\"{'hide-tasks-list': !show}\"\n [fields]=\"tasks[currentTaskType].fields\"\n [header]=\"false\"\n [items]=\"tasks[currentTaskType].tasks\"\n [lastColumnTemplate]=\"caseLinkWithTaskLock\"\n [pagination]=\"tasks[currentTaskType].pagination\"\n paginationIdentifier=\"taskList\"\n (paginationClicked)=\"paginationClicked($event, currentTaskType)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"rowOpenTaskClick($event)\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <div tabs>\n <cds-tabs\n *ngIf=\"visibleTabs === null; else configuredTabs; context: {activeTab: activeTab}\"\n type=\"contained\"\n class=\"valtimo-carbon-list__tabs\"\n >\n <cds-tab\n [heading]=\"'task-list.mine.title' | translate\"\n (selected)=\"tabChange('mine')\"\n [active]=\"activeTab === 'mine'\"\n >\n </cds-tab>\n\n <cds-tab\n [heading]=\"'task-list.open.title' | translate\"\n (selected)=\"tabChange('open')\"\n [active]=\"activeTab === 'open'\"\n >\n </cds-tab>\n\n <cds-tab\n [heading]=\"'task-list.all.title' | translate\"\n (selected)=\"tabChange('all')\"\n [active]=\"activeTab === 'all'\"\n >\n </cds-tab>\n </cds-tabs>\n </div>\n\n <valtimo-no-results\n [description]=\"'task-list.' + currentTaskType + '.noResultsDescription' | translate\"\n [title]=\"'task-list.' + currentTaskType + '.noResultsTitle' | translate\"\n >\n </valtimo-no-results>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #tasksListLoading let-show=\"show\" let-activeTab=\"activeTab\">\n <valtimo-carbon-list [ngClass]=\"{'hide-tasks-list': !show}\" [loading]=\"true\">\n <div tabs>\n <cds-tabs *ngIf=\"visibleTabs === null\" type=\"contained\" class=\"valtimo-carbon-list__tabs\">\n <cds-tab [heading]=\"'task-list.mine.title' | translate\" [active]=\"activeTab === 'mine'\">\n </cds-tab>\n\n <cds-tab [heading]=\"'task-list.open.title' | translate\" [active]=\"activeTab === 'open'\">\n </cds-tab>\n\n <cds-tab [heading]=\"'task-list.all.title' | translate\" [active]=\"activeTab === 'all'\">\n </cds-tab>\n </cds-tabs>\n\n <cds-tabs type=\"contained\" class=\"valtimo-carbon-list__tabs\" *ngIf=\"visibleTabs\">\n <cds-tab\n *ngFor=\"let tab of visibleTabs\"\n [heading]=\"'task-list.' + tab + '.title' | translate\"\n [active]=\"activeTab === tab\"\n ></cds-tab>\n </cds-tabs>\n </div>\n </valtimo-carbon-list>\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 */.hide-tasks-list{display:none}\n"], dependencies: [{ kind: "directive", type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i8.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2$1.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "header", "initialSortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: i2$1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title"] }, { kind: "directive", type: i10.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { kind: "directive", type: i11.Link, selector: "[cdsLink], [ibmLink]", inputs: ["inline", "disabled"] }, { kind: "component", type: i11.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i11.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive"], outputs: ["selected"] }, { kind: "component", type: TaskDetailModalComponent, selector: "valtimo-task-detail-modal", outputs: ["formSubmit", "assignmentOfTaskChanged"] }, { kind: "pipe", type: i8.AsyncPipe, name: "async" }, { kind: "pipe", type: i8$1.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
742
|
+
}
|
|
743
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskListComponent, decorators: [{
|
|
744
|
+
type: Component,
|
|
745
|
+
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\n class=\"main-content\"\n *ngIf=\"{loadingTasks: loadingTasks$ | async, activeTab: activeTab$ | async} as obs\"\n>\n <div class=\"container-fluid\">\n <ng-container\n *ngTemplateOutlet=\"tasksList; context: {show: !obs.loadingTasks, activeTab: obs.activeTab}\"\n ></ng-container>\n\n <ng-container\n *ngTemplateOutlet=\"\n tasksListLoading;\n context: {show: obs.loadingTasks, activeTab: obs.activeTab}\n \"\n ></ng-container>\n\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 let-activeTab=\"activeTab\">\n <cds-tabs type=\"contained\" class=\"valtimo-carbon-list__tabs\">\n <cds-tab\n *ngFor=\"let tab of visibleTabs\"\n [heading]=\"'task-list.' + tab + '.title' | translate\"\n [active]=\"activeTab === tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n</ng-template>\n\n<ng-template #caseLinkWithTaskLock let-data=\"data\">\n <a\n class=\"float-left\"\n cdsLink\n href=\"javascript:void(0)\"\n (click)=\"openRelatedCase($event, data.index)\"\n >\n {{ 'task-list.goToCase' | translate }}\n </a>\n <div *ngIf=\"tasks[currentTaskType].tasks[data.index].isLocked\">\n <span\n class=\"float-right badge badge-pill badge-secondary bg-grey\"\n ngbTooltip=\"{{ 'task-list.taskLocked' | translate }}\"\n >\n <i class=\"icon mdi mdi-lock\"></i>\n </span>\n </div>\n</ng-template>\n\n<ng-template #tasksList let-show=\"show\" let-activeTab=\"activeTab\">\n <valtimo-carbon-list\n [ngClass]=\"{'hide-tasks-list': !show}\"\n [fields]=\"tasks[currentTaskType].fields\"\n [header]=\"false\"\n [items]=\"tasks[currentTaskType].tasks\"\n [lastColumnTemplate]=\"caseLinkWithTaskLock\"\n [pagination]=\"tasks[currentTaskType].pagination\"\n paginationIdentifier=\"taskList\"\n (paginationClicked)=\"paginationClicked($event, currentTaskType)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"rowOpenTaskClick($event)\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <div tabs>\n <cds-tabs\n *ngIf=\"visibleTabs === null; else configuredTabs; context: {activeTab: activeTab}\"\n type=\"contained\"\n class=\"valtimo-carbon-list__tabs\"\n >\n <cds-tab\n [heading]=\"'task-list.mine.title' | translate\"\n (selected)=\"tabChange('mine')\"\n [active]=\"activeTab === 'mine'\"\n >\n </cds-tab>\n\n <cds-tab\n [heading]=\"'task-list.open.title' | translate\"\n (selected)=\"tabChange('open')\"\n [active]=\"activeTab === 'open'\"\n >\n </cds-tab>\n\n <cds-tab\n [heading]=\"'task-list.all.title' | translate\"\n (selected)=\"tabChange('all')\"\n [active]=\"activeTab === 'all'\"\n >\n </cds-tab>\n </cds-tabs>\n </div>\n\n <valtimo-no-results\n [description]=\"'task-list.' + currentTaskType + '.noResultsDescription' | translate\"\n [title]=\"'task-list.' + currentTaskType + '.noResultsTitle' | translate\"\n >\n </valtimo-no-results>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #tasksListLoading let-show=\"show\" let-activeTab=\"activeTab\">\n <valtimo-carbon-list [ngClass]=\"{'hide-tasks-list': !show}\" [loading]=\"true\">\n <div tabs>\n <cds-tabs *ngIf=\"visibleTabs === null\" type=\"contained\" class=\"valtimo-carbon-list__tabs\">\n <cds-tab [heading]=\"'task-list.mine.title' | translate\" [active]=\"activeTab === 'mine'\">\n </cds-tab>\n\n <cds-tab [heading]=\"'task-list.open.title' | translate\" [active]=\"activeTab === 'open'\">\n </cds-tab>\n\n <cds-tab [heading]=\"'task-list.all.title' | translate\" [active]=\"activeTab === 'all'\">\n </cds-tab>\n </cds-tabs>\n\n <cds-tabs type=\"contained\" class=\"valtimo-carbon-list__tabs\" *ngIf=\"visibleTabs\">\n <cds-tab\n *ngFor=\"let tab of visibleTabs\"\n [heading]=\"'task-list.' + tab + '.title' | translate\"\n [active]=\"activeTab === tab\"\n ></cds-tab>\n </cds-tabs>\n </div>\n </valtimo-carbon-list>\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 */.hide-tasks-list{display:none}\n"] }]
|
|
746
|
+
}], ctorParameters: function () { return [{ type: i2.ConfigService }, { type: i1$1.DocumentService }, { type: i3$1.NGXLogger }, { type: i3.PermissionService }, { type: i5.Router }, { type: TaskService }, { type: i8$1.TranslateService }]; }, propDecorators: { taskDetail: [{
|
|
747
|
+
type: ViewChild,
|
|
748
|
+
args: ['taskDetail']
|
|
749
|
+
}] } });
|
|
750
|
+
|
|
751
|
+
/*
|
|
752
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
753
|
+
*
|
|
754
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
755
|
+
* you may not use this file except in compliance with the License.
|
|
756
|
+
* You may obtain a copy of the License at
|
|
757
|
+
*
|
|
758
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
759
|
+
*
|
|
760
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
761
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
762
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
763
|
+
* See the License for the specific language governing permissions and
|
|
764
|
+
* limitations under the License.
|
|
765
|
+
*/
|
|
766
|
+
const routes = [
|
|
767
|
+
{
|
|
768
|
+
path: 'tasks',
|
|
769
|
+
component: TaskListComponent,
|
|
770
|
+
canActivate: [AuthGuardService],
|
|
771
|
+
data: { title: 'Tasks', roles: [ROLE_USER] },
|
|
772
|
+
},
|
|
773
|
+
];
|
|
774
|
+
class TaskRoutingModule {
|
|
775
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
776
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TaskRoutingModule, imports: [CommonModule, i5.RouterModule], exports: [RouterModule] }); }
|
|
777
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
|
|
778
|
+
}
|
|
779
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskRoutingModule, decorators: [{
|
|
780
|
+
type: NgModule,
|
|
781
|
+
args: [{
|
|
782
|
+
declarations: [],
|
|
783
|
+
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
784
|
+
exports: [RouterModule],
|
|
785
|
+
}]
|
|
786
|
+
}] });
|
|
787
|
+
|
|
788
|
+
/*
|
|
789
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
790
|
+
*
|
|
791
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
792
|
+
* you may not use this file except in compliance with the License.
|
|
793
|
+
* You may obtain a copy of the License at
|
|
794
|
+
*
|
|
795
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
796
|
+
*
|
|
797
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
798
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
799
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
800
|
+
* See the License for the specific language governing permissions and
|
|
801
|
+
* limitations under the License.
|
|
802
|
+
*/
|
|
803
|
+
class TaskModule {
|
|
804
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
805
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TaskModule, declarations: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent], imports: [CommonModule,
|
|
806
|
+
TaskRoutingModule,
|
|
807
|
+
CarbonListModule,
|
|
808
|
+
PageHeaderModule,
|
|
809
|
+
WidgetModule,
|
|
810
|
+
SpinnerModule,
|
|
811
|
+
SearchableDropdownSelectModule,
|
|
812
|
+
CamundaFormModule,
|
|
813
|
+
BrowserAnimationsModule,
|
|
814
|
+
FormsModule, i7.ToastrModule, i8$1.TranslateModule, NgbModule,
|
|
815
|
+
FormIoModule,
|
|
816
|
+
ModalModule,
|
|
817
|
+
LinkModule,
|
|
818
|
+
FormLinkModule,
|
|
819
|
+
TabsModule,
|
|
820
|
+
ContentSwitcherModule], exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent] }); }
|
|
821
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskModule, imports: [CommonModule,
|
|
822
|
+
TaskRoutingModule,
|
|
823
|
+
CarbonListModule,
|
|
824
|
+
PageHeaderModule,
|
|
825
|
+
WidgetModule,
|
|
826
|
+
SpinnerModule,
|
|
827
|
+
SearchableDropdownSelectModule,
|
|
828
|
+
CamundaFormModule,
|
|
829
|
+
BrowserAnimationsModule,
|
|
830
|
+
FormsModule,
|
|
831
|
+
ToastrModule.forRoot({
|
|
832
|
+
positionClass: 'toast-bottom-full-width',
|
|
833
|
+
preventDuplicates: true,
|
|
834
|
+
}),
|
|
835
|
+
TranslateModule.forRoot({
|
|
836
|
+
loader: {
|
|
837
|
+
provide: TranslateLoader,
|
|
838
|
+
useFactory: HttpLoaderFactory,
|
|
839
|
+
deps: [HttpClient],
|
|
840
|
+
},
|
|
841
|
+
}),
|
|
842
|
+
NgbModule,
|
|
843
|
+
FormIoModule,
|
|
844
|
+
ModalModule,
|
|
845
|
+
LinkModule,
|
|
846
|
+
FormLinkModule,
|
|
847
|
+
TabsModule,
|
|
848
|
+
ContentSwitcherModule] }); }
|
|
849
|
+
}
|
|
850
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TaskModule, decorators: [{
|
|
851
|
+
type: NgModule,
|
|
852
|
+
args: [{
|
|
853
|
+
declarations: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent],
|
|
854
|
+
imports: [
|
|
855
|
+
CommonModule,
|
|
856
|
+
TaskRoutingModule,
|
|
857
|
+
CarbonListModule,
|
|
858
|
+
PageHeaderModule,
|
|
859
|
+
WidgetModule,
|
|
860
|
+
SpinnerModule,
|
|
861
|
+
SearchableDropdownSelectModule,
|
|
862
|
+
CamundaFormModule,
|
|
863
|
+
BrowserAnimationsModule,
|
|
864
|
+
FormsModule,
|
|
865
|
+
ToastrModule.forRoot({
|
|
866
|
+
positionClass: 'toast-bottom-full-width',
|
|
867
|
+
preventDuplicates: true,
|
|
868
|
+
}),
|
|
869
|
+
TranslateModule.forRoot({
|
|
870
|
+
loader: {
|
|
871
|
+
provide: TranslateLoader,
|
|
872
|
+
useFactory: HttpLoaderFactory,
|
|
873
|
+
deps: [HttpClient],
|
|
874
|
+
},
|
|
875
|
+
}),
|
|
876
|
+
NgbModule,
|
|
877
|
+
FormIoModule,
|
|
878
|
+
ModalModule,
|
|
879
|
+
LinkModule,
|
|
880
|
+
FormLinkModule,
|
|
881
|
+
TabsModule,
|
|
882
|
+
ContentSwitcherModule,
|
|
883
|
+
],
|
|
884
|
+
exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent],
|
|
885
|
+
}]
|
|
886
|
+
}] });
|
|
887
|
+
|
|
888
|
+
/*
|
|
889
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
890
|
+
*
|
|
891
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
892
|
+
* you may not use this file except in compliance with the License.
|
|
893
|
+
* You may obtain a copy of the License at
|
|
894
|
+
*
|
|
895
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
896
|
+
*
|
|
897
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
898
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
899
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
900
|
+
* See the License for the specific language governing permissions and
|
|
901
|
+
* limitations under the License.
|
|
902
|
+
*/
|
|
903
|
+
/*
|
|
904
|
+
* Public API Surface of task
|
|
905
|
+
*/
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* Generated bundle index. Do not edit.
|
|
909
|
+
*/
|
|
910
|
+
|
|
911
|
+
export { AssignUserToTaskComponent, CAN_ASSIGN_TASK_PERMISSION, CAN_VIEW_TASK_PERMISSION, TASK_DETAIL_PERMISSION_RESOURCE, TaskDetailModalComponent, TaskList, TaskListComponent, TaskModule, TaskService };
|
|
912
|
+
//# sourceMappingURL=valtimo-task.mjs.map
|