@valtimo/task 4.23.0 → 5.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/esm2020/lib/assign-user-to-task/assign-user-to-task.component.mjs +125 -0
- package/esm2020/lib/models/index.mjs +21 -0
- package/esm2020/lib/models/task-definition.model.mjs +17 -0
- package/esm2020/lib/models/task-list.model.mjs +29 -0
- package/esm2020/lib/models/task.model.mjs +17 -0
- package/esm2020/lib/task-detail-modal/task-detail-modal.component.mjs +198 -0
- package/esm2020/lib/task-list/task-list.component.mjs +160 -0
- package/esm2020/lib/task-routing.module.mjs +45 -0
- package/esm2020/lib/task.module.mjs +107 -0
- package/esm2020/lib/task.service.mjs +59 -0
- package/esm2020/public_api.mjs +25 -0
- package/esm2020/valtimo-task.mjs +5 -0
- package/fesm2015/valtimo-task.mjs +724 -0
- package/fesm2015/valtimo-task.mjs.map +1 -0
- package/fesm2020/valtimo-task.mjs +758 -0
- package/fesm2020/valtimo-task.mjs.map +1 -0
- package/lib/assign-user-to-task/assign-user-to-task.component.d.ts +4 -0
- package/lib/assign-user-to-task/assign-user-to-task.component.d.ts.map +1 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.d.ts.map +1 -0
- package/lib/models/task-definition.model.d.ts +1 -0
- package/lib/models/task-definition.model.d.ts.map +1 -0
- package/lib/models/task-list.model.d.ts +1 -0
- package/lib/models/task-list.model.d.ts.map +1 -0
- package/lib/models/task.model.d.ts +10 -0
- package/lib/models/task.model.d.ts.map +1 -0
- package/lib/task-detail-modal/task-detail-modal.component.d.ts +31 -10
- package/lib/task-detail-modal/task-detail-modal.component.d.ts.map +1 -0
- package/lib/task-list/task-list.component.d.ts +4 -0
- package/lib/task-list/task-list.component.d.ts.map +1 -0
- package/lib/task-routing.module.d.ts +7 -0
- package/lib/task-routing.module.d.ts.map +1 -0
- package/lib/task.module.d.ts +16 -0
- package/lib/task.module.d.ts.map +1 -0
- package/lib/task.service.d.ts +6 -1
- package/lib/task.service.d.ts.map +1 -0
- package/package.json +23 -11
- package/public_api.d.ts +2 -0
- package/public_api.d.ts.map +1 -0
- package/valtimo-task.d.ts +2 -2
- package/valtimo-task.d.ts.map +1 -0
- package/bundles/valtimo-task.umd.js +0 -960
- package/bundles/valtimo-task.umd.js.map +0 -1
- package/bundles/valtimo-task.umd.min.js +0 -2
- package/bundles/valtimo-task.umd.min.js.map +0 -1
- package/esm2015/lib/assign-user-to-task/assign-user-to-task.component.js +0 -124
- package/esm2015/lib/models/index.js +0 -21
- package/esm2015/lib/models/task-definition.model.js +0 -16
- package/esm2015/lib/models/task-list.model.js +0 -29
- package/esm2015/lib/models/task.model.js +0 -16
- package/esm2015/lib/task-detail-modal/task-detail-modal.component.js +0 -127
- package/esm2015/lib/task-list/task-list.component.js +0 -166
- package/esm2015/lib/task-routing.module.js +0 -41
- package/esm2015/lib/task.module.js +0 -66
- package/esm2015/lib/task.service.js +0 -60
- package/esm2015/public_api.js +0 -24
- package/esm2015/valtimo-task.js +0 -7
- package/fesm2015/valtimo-task.js +0 -653
- package/fesm2015/valtimo-task.js.map +0 -1
- package/valtimo-task.metadata.json +0 -1
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, Component, Input, Output, ViewEncapsulation, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common/http';
|
|
4
|
+
import { HttpClient } from '@angular/common/http';
|
|
5
|
+
import * as i2 from '@valtimo/config';
|
|
6
|
+
import { ROLE_USER, HttpLoaderFactory } from '@valtimo/config';
|
|
7
|
+
import * as i3 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import { FormsModule } from '@angular/forms';
|
|
10
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
11
|
+
import * as i7 from '@ng-bootstrap/ng-bootstrap';
|
|
12
|
+
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
|
13
|
+
import * as i4 from '@ngx-translate/core';
|
|
14
|
+
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
|
15
|
+
import * as i6 from '@valtimo/components';
|
|
16
|
+
import { FormioOptionsImpl, ListModule, PageHeaderModule, WidgetModule, SpinnerModule, SearchableDropdownSelectModule, CamundaFormModule, FormIoModule, ModalModule } from '@valtimo/components';
|
|
17
|
+
import * as i1$1 from 'ngx-toastr';
|
|
18
|
+
import { ToastrModule } from 'ngx-toastr';
|
|
19
|
+
import moment from 'moment';
|
|
20
|
+
import { take, tap, map } from 'rxjs/operators';
|
|
21
|
+
import { BehaviorSubject, combineLatest } from 'rxjs';
|
|
22
|
+
import * as i2$1 from '@valtimo/form-link';
|
|
23
|
+
import * as i3$1 from '@angular/router';
|
|
24
|
+
import { RouterModule } from '@angular/router';
|
|
25
|
+
import * as i4$1 from 'ngx-logger';
|
|
26
|
+
import { AuthGuardService } from '@valtimo/security';
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
30
|
+
*
|
|
31
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
32
|
+
* you may not use this file except in compliance with the License.
|
|
33
|
+
* You may obtain a copy of the License at
|
|
34
|
+
*
|
|
35
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
36
|
+
*
|
|
37
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
38
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
39
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
40
|
+
* See the License for the specific language governing permissions and
|
|
41
|
+
* limitations under the License.
|
|
42
|
+
*/
|
|
43
|
+
class TaskList {
|
|
44
|
+
constructor() {
|
|
45
|
+
this.tasks = [];
|
|
46
|
+
this.fields = [];
|
|
47
|
+
this.pagination = {
|
|
48
|
+
collectionSize: 0,
|
|
49
|
+
page: 1,
|
|
50
|
+
size: 10,
|
|
51
|
+
maxPaginationItemSize: 5,
|
|
52
|
+
};
|
|
53
|
+
this.page = 0;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
*
|
|
59
|
+
* * Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
60
|
+
* *
|
|
61
|
+
* * Licensed under EUPL, Version 1.2 (the "License");
|
|
62
|
+
* * you may not use this file except in compliance with the License.
|
|
63
|
+
* * You may obtain a copy of the License at
|
|
64
|
+
* *
|
|
65
|
+
* * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
66
|
+
* *
|
|
67
|
+
* * Unless required by applicable law or agreed to in writing, software
|
|
68
|
+
* * distributed under the License is distributed on an "AS IS" basis,
|
|
69
|
+
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
70
|
+
* * See the License for the specific language governing permissions and
|
|
71
|
+
* * limitations under the License.
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
/*
|
|
76
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
77
|
+
*
|
|
78
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
79
|
+
* you may not use this file except in compliance with the License.
|
|
80
|
+
* You may obtain a copy of the License at
|
|
81
|
+
*
|
|
82
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
83
|
+
*
|
|
84
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
85
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
86
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
87
|
+
* See the License for the specific language governing permissions and
|
|
88
|
+
* limitations under the License.
|
|
89
|
+
*/
|
|
90
|
+
class TaskService {
|
|
91
|
+
constructor(http, configService) {
|
|
92
|
+
this.http = http;
|
|
93
|
+
this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;
|
|
94
|
+
}
|
|
95
|
+
queryTasks(params) {
|
|
96
|
+
return this.http.get(`${this.valtimoEndpointUri}task`, { observe: 'response', params });
|
|
97
|
+
}
|
|
98
|
+
getTasks() {
|
|
99
|
+
return this.http.get(`${this.valtimoEndpointUri}task?filter=all`);
|
|
100
|
+
}
|
|
101
|
+
getTask(id) {
|
|
102
|
+
return this.http.get(this.valtimoEndpointUri + 'task/' + id);
|
|
103
|
+
}
|
|
104
|
+
getCandidateUsers(id) {
|
|
105
|
+
return this.http.get(this.valtimoEndpointUri + 'task/' + id + '/candidate-user');
|
|
106
|
+
}
|
|
107
|
+
assignTask(id, assigneeRequest) {
|
|
108
|
+
return this.http.post(this.valtimoEndpointUri + 'task/' + id + '/assign', assigneeRequest);
|
|
109
|
+
}
|
|
110
|
+
unassignTask(id) {
|
|
111
|
+
return this.http.post(this.valtimoEndpointUri + 'task/' + id + '/unassign', null);
|
|
112
|
+
}
|
|
113
|
+
completeTask(id, variables) {
|
|
114
|
+
return this.http.post(this.valtimoEndpointUri + 'task/' + id + '/complete', {
|
|
115
|
+
variables,
|
|
116
|
+
filesToDelete: [],
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
getTaskProcessLink(taskId) {
|
|
120
|
+
return this.http.get(`${this.valtimoEndpointUri}process-link/task/${taskId}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
TaskService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
124
|
+
TaskService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskService, providedIn: 'root' });
|
|
125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskService, decorators: [{
|
|
126
|
+
type: Injectable,
|
|
127
|
+
args: [{ providedIn: 'root' }]
|
|
128
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.ConfigService }]; } });
|
|
129
|
+
|
|
130
|
+
/*
|
|
131
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
132
|
+
*
|
|
133
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
134
|
+
* you may not use this file except in compliance with the License.
|
|
135
|
+
* You may obtain a copy of the License at
|
|
136
|
+
*
|
|
137
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
138
|
+
*
|
|
139
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
140
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
141
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
142
|
+
* See the License for the specific language governing permissions and
|
|
143
|
+
* limitations under the License.
|
|
144
|
+
*/
|
|
145
|
+
class AssignUserToTaskComponent {
|
|
146
|
+
constructor(taskService) {
|
|
147
|
+
this.taskService = taskService;
|
|
148
|
+
this.assignmentOfTaskChanged = new EventEmitter();
|
|
149
|
+
this.candidateUsersForTask$ = new BehaviorSubject(undefined);
|
|
150
|
+
this.disabled$ = new BehaviorSubject(true);
|
|
151
|
+
this.assignedEmailOnServer$ = new BehaviorSubject(null);
|
|
152
|
+
this.userEmailToAssign = null;
|
|
153
|
+
this.assignedUserFullName$ = new BehaviorSubject(null);
|
|
154
|
+
}
|
|
155
|
+
ngOnInit() {
|
|
156
|
+
this.taskService.getCandidateUsers(this.taskId).subscribe(candidateUsers => {
|
|
157
|
+
this.candidateUsersForTask$.next(candidateUsers);
|
|
158
|
+
if (this.assigneeEmail) {
|
|
159
|
+
this.assignedEmailOnServer$.next(this.assigneeEmail);
|
|
160
|
+
this.userEmailToAssign = this.assigneeEmail;
|
|
161
|
+
this.assignedUserFullName$.next(this.getAssignedUserName(candidateUsers, this.assigneeEmail));
|
|
162
|
+
}
|
|
163
|
+
this.enable();
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
ngOnChanges(changes) {
|
|
167
|
+
const assigneeEmail = changes.assigneeEmail;
|
|
168
|
+
if (assigneeEmail) {
|
|
169
|
+
this.candidateUsersForTask$.pipe(take(1)).subscribe(candidateUsers => {
|
|
170
|
+
const currentUserEmail = assigneeEmail.currentValue;
|
|
171
|
+
this.assignedEmailOnServer$.next(currentUserEmail || null);
|
|
172
|
+
this.userEmailToAssign = currentUserEmail || null;
|
|
173
|
+
this.assignedUserFullName$.next(this.getAssignedUserName(candidateUsers, currentUserEmail));
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
this.clear();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
assignTask(userEmail) {
|
|
181
|
+
this.disable();
|
|
182
|
+
combineLatest([
|
|
183
|
+
this.candidateUsersForTask$,
|
|
184
|
+
this.taskService.assignTask(this.taskId, { assignee: userEmail }),
|
|
185
|
+
])
|
|
186
|
+
.pipe(take(1), tap(([candidateUsers]) => {
|
|
187
|
+
this.userEmailToAssign = userEmail;
|
|
188
|
+
this.assignedEmailOnServer$.next(userEmail);
|
|
189
|
+
this.assignedUserFullName$.next(this.getAssignedUserName(candidateUsers, userEmail));
|
|
190
|
+
this.emitChange();
|
|
191
|
+
this.enable();
|
|
192
|
+
}))
|
|
193
|
+
.subscribe();
|
|
194
|
+
}
|
|
195
|
+
unassignTask() {
|
|
196
|
+
this.disable();
|
|
197
|
+
this.taskService
|
|
198
|
+
.unassignTask(this.taskId)
|
|
199
|
+
.pipe(tap(() => {
|
|
200
|
+
this.clear();
|
|
201
|
+
this.emitChange();
|
|
202
|
+
this.enable();
|
|
203
|
+
}))
|
|
204
|
+
.subscribe();
|
|
205
|
+
}
|
|
206
|
+
getAssignedUserName(users, userEmail) {
|
|
207
|
+
if (users && userEmail) {
|
|
208
|
+
const findUser = users.find(user => user.email === userEmail);
|
|
209
|
+
return findUser ? findUser.fullName : '';
|
|
210
|
+
}
|
|
211
|
+
return '';
|
|
212
|
+
}
|
|
213
|
+
mapUsersForDropdown(users) {
|
|
214
|
+
return (users &&
|
|
215
|
+
users
|
|
216
|
+
.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]) || '' })); })
|
|
217
|
+
.sort((a, b) => a.lastName.localeCompare(b.lastName))
|
|
218
|
+
.map(user => ({ text: user.fullName, id: user.email })));
|
|
219
|
+
}
|
|
220
|
+
clear() {
|
|
221
|
+
this.assignedEmailOnServer$.next(null);
|
|
222
|
+
this.userEmailToAssign = null;
|
|
223
|
+
}
|
|
224
|
+
emitChange() {
|
|
225
|
+
this.assignmentOfTaskChanged.emit();
|
|
226
|
+
}
|
|
227
|
+
enable() {
|
|
228
|
+
this.disabled$.next(false);
|
|
229
|
+
}
|
|
230
|
+
disable() {
|
|
231
|
+
this.disabled$.next(true);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
AssignUserToTaskComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AssignUserToTaskComponent, deps: [{ token: TaskService }], target: i0.ɵɵFactoryTarget.Component });
|
|
235
|
+
AssignUserToTaskComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: AssignUserToTaskComponent, selector: "valtimo-assign-user-to-task", inputs: { taskId: "taskId", assigneeEmail: "assigneeEmail" }, outputs: { assignmentOfTaskChanged: "assignmentOfTaskChanged" }, usesOnChanges: true, ngImport: i0, template: "<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: [".container-fluid{color:#959595}i{font-size:13px}\n"], components: [{ type: i6.SearchableDropdownSelectComponent, selector: "valtimo-searchable-dropdown-select", inputs: ["style", "items", "buttonText", "searchText", "noResultsText", "disabled", "selectedText", "selectedTextValue", "clearSelectionButtonTitle", "hasSelection", "width"], outputs: ["itemSelected", "clearSelection"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe, "translate": i4.TranslatePipe } });
|
|
236
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AssignUserToTaskComponent, decorators: [{
|
|
237
|
+
type: Component,
|
|
238
|
+
args: [{ selector: 'valtimo-assign-user-to-task', template: "<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: [".container-fluid{color:#959595}i{font-size:13px}\n"] }]
|
|
239
|
+
}], ctorParameters: function () { return [{ type: TaskService }]; }, propDecorators: { taskId: [{
|
|
240
|
+
type: Input
|
|
241
|
+
}], assigneeEmail: [{
|
|
242
|
+
type: Input
|
|
243
|
+
}], assignmentOfTaskChanged: [{
|
|
244
|
+
type: Output
|
|
245
|
+
}] } });
|
|
246
|
+
|
|
247
|
+
/*
|
|
248
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
249
|
+
*
|
|
250
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
251
|
+
* you may not use this file except in compliance with the License.
|
|
252
|
+
* You may obtain a copy of the License at
|
|
253
|
+
*
|
|
254
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
255
|
+
*
|
|
256
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
257
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
258
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
259
|
+
* See the License for the specific language governing permissions and
|
|
260
|
+
* limitations under the License.
|
|
261
|
+
*/
|
|
262
|
+
moment.locale(localStorage.getItem('langKey') || '');
|
|
263
|
+
class TaskDetailModalComponent {
|
|
264
|
+
constructor(toastr, formLinkService, formFlowService, router, logger, route, taskService) {
|
|
265
|
+
this.toastr = toastr;
|
|
266
|
+
this.formLinkService = formLinkService;
|
|
267
|
+
this.formFlowService = formFlowService;
|
|
268
|
+
this.router = router;
|
|
269
|
+
this.logger = logger;
|
|
270
|
+
this.route = route;
|
|
271
|
+
this.taskService = taskService;
|
|
272
|
+
this.formSubmit = new EventEmitter();
|
|
273
|
+
this.assignmentOfTaskChanged = new EventEmitter();
|
|
274
|
+
this.task = null;
|
|
275
|
+
this.page = null;
|
|
276
|
+
this.errorMessage = null;
|
|
277
|
+
this.taskProcessLinkType$ = new BehaviorSubject(null);
|
|
278
|
+
this.processLinkIsForm$ = this.taskProcessLinkType$.pipe(map(type => type === 'form'));
|
|
279
|
+
this.processLinkIsFormFlow$ = this.taskProcessLinkType$.pipe(map(type => type === 'form-flow'));
|
|
280
|
+
this.formFlowStepType$ = new BehaviorSubject(null);
|
|
281
|
+
this.formFlowStepTypeIsForm$ = this.formFlowStepType$.pipe(map(type => type === 'form'));
|
|
282
|
+
this.formioOptions = new FormioOptionsImpl();
|
|
283
|
+
this.formioOptions.disableAlerts = true;
|
|
284
|
+
}
|
|
285
|
+
openTaskDetails(task) {
|
|
286
|
+
this.resetTaskProcessLinkType();
|
|
287
|
+
this.resetFormDefinition();
|
|
288
|
+
this.getTaskProcessLink(task.id);
|
|
289
|
+
this.task = task;
|
|
290
|
+
this.page = {
|
|
291
|
+
title: task.name,
|
|
292
|
+
subtitle: `Created ${task.created}`,
|
|
293
|
+
};
|
|
294
|
+
this.formLinkService
|
|
295
|
+
.getPreFilledFormDefinitionByFormLinkId(task.processDefinitionKey, task.businessKey, task.taskDefinitionKey, task.id // taskInstanceId
|
|
296
|
+
)
|
|
297
|
+
.subscribe(formDefinition => {
|
|
298
|
+
this.formAssociation = formDefinition.formAssociation;
|
|
299
|
+
const className = this.formAssociation.formLink.className.split('.');
|
|
300
|
+
const linkType = className[className.length - 1];
|
|
301
|
+
switch (linkType) {
|
|
302
|
+
case 'BpmnElementFormIdLink':
|
|
303
|
+
this.setFormDefinitionAndOpenModal(formDefinition);
|
|
304
|
+
break;
|
|
305
|
+
case 'BpmnElementFormFlowIdLink':
|
|
306
|
+
// We can't use the formDefinition here because the form definition is provided per form flow step
|
|
307
|
+
// I'm still leaving this in here in case we want to add form flow specific code.
|
|
308
|
+
break;
|
|
309
|
+
case 'BpmnElementUrlLink':
|
|
310
|
+
this.openUrlLink(formDefinition);
|
|
311
|
+
break;
|
|
312
|
+
case 'BpmnElementAngularStateUrlLink':
|
|
313
|
+
this.openAngularStateUrlLink(task, formDefinition);
|
|
314
|
+
break;
|
|
315
|
+
default:
|
|
316
|
+
this.logger.fatal('Unsupported class name');
|
|
317
|
+
}
|
|
318
|
+
}, errors => {
|
|
319
|
+
var _a;
|
|
320
|
+
if ((_a = errors === null || errors === void 0 ? void 0 : errors.error) === null || _a === void 0 ? void 0 : _a.detail) {
|
|
321
|
+
this.errorMessage = errors.error.detail;
|
|
322
|
+
}
|
|
323
|
+
this.modal.show();
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
gotoFormLinkScreen() {
|
|
327
|
+
this.modal.hide();
|
|
328
|
+
this.router.navigate(['form-links']);
|
|
329
|
+
}
|
|
330
|
+
onSubmit(submission) {
|
|
331
|
+
if (this.taskProcessLinkType$.getValue() === 'form') {
|
|
332
|
+
this.formLinkService
|
|
333
|
+
.onSubmit(this.task.processDefinitionKey, this.formAssociation.formLink.id, submission.data, this.task.businessKey, this.task.id)
|
|
334
|
+
.subscribe((_) => {
|
|
335
|
+
this.completeTask();
|
|
336
|
+
}, errors => {
|
|
337
|
+
this.form.showErrors(errors);
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
if (this.taskProcessLinkType$.getValue() === 'form-flow') {
|
|
341
|
+
if (submission.data.submit) {
|
|
342
|
+
this.formFlowService.submitStep(this.formFlowInstanceId, this.formFlowStepInstanceId, submission.data).subscribe((result) => this.handleFormFlowStep(result), errors => this.form.showErrors(errors));
|
|
343
|
+
}
|
|
344
|
+
else if (submission.data['back']) {
|
|
345
|
+
this.formFlowService.back(this.formFlowInstanceId).subscribe((result) => this.handleFormFlowStep(result), errors => this.form.showErrors(errors));
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
resetFormDefinition() {
|
|
350
|
+
this.formDefinition = null;
|
|
351
|
+
}
|
|
352
|
+
getTaskProcessLink(taskId) {
|
|
353
|
+
this.taskService.getTaskProcessLink(taskId).subscribe(res => {
|
|
354
|
+
switch (res === null || res === void 0 ? void 0 : res.type) {
|
|
355
|
+
case 'form':
|
|
356
|
+
this.taskProcessLinkType$.next('form');
|
|
357
|
+
break;
|
|
358
|
+
case 'form-flow':
|
|
359
|
+
this.taskProcessLinkType$.next('form-flow');
|
|
360
|
+
this.getFormFlowStep(res === null || res === void 0 ? void 0 : res.properties.formFlowInstanceId);
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
getFormFlowStep(formFlowInstanceId) {
|
|
366
|
+
this.formFlowService.getFormFlowStep(formFlowInstanceId).subscribe((result) => {
|
|
367
|
+
this.handleFormFlowStep(result);
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
handleFormFlowStep(formFlowInstance) {
|
|
371
|
+
if (formFlowInstance.step === null) {
|
|
372
|
+
this.formFlowStepType$.next(null);
|
|
373
|
+
this.formFlowInstanceId = null;
|
|
374
|
+
this.formFlowStepInstanceId = null;
|
|
375
|
+
this.completeTask();
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
this.formFlowStepType$.next(formFlowInstance.step.type);
|
|
379
|
+
this.formFlowInstanceId = formFlowInstance.id;
|
|
380
|
+
this.formFlowStepInstanceId = formFlowInstance.step.id;
|
|
381
|
+
this.setFormDefinitionAndOpenModal(formFlowInstance.step.typeProperties.definition);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
completeTask() {
|
|
385
|
+
this.toastr.success(this.task.name + ' has successfully been completed');
|
|
386
|
+
this.modal.hide();
|
|
387
|
+
this.task = null;
|
|
388
|
+
this.formSubmit.emit();
|
|
389
|
+
}
|
|
390
|
+
resetTaskProcessLinkType() {
|
|
391
|
+
this.taskProcessLinkType$.next(null);
|
|
392
|
+
}
|
|
393
|
+
setFormDefinitionAndOpenModal(formDefinition) {
|
|
394
|
+
this.formDefinition = formDefinition;
|
|
395
|
+
this.modal.show();
|
|
396
|
+
}
|
|
397
|
+
openUrlLink(formDefinition) {
|
|
398
|
+
const url = this.router.serializeUrl(this.router.createUrlTree([formDefinition.formAssociation.formLink.url]));
|
|
399
|
+
window.open(url, '_blank');
|
|
400
|
+
}
|
|
401
|
+
openAngularStateUrlLink(task, formDefinition) {
|
|
402
|
+
this.route.params.pipe(take(1)).subscribe(params => {
|
|
403
|
+
const taskId = task === null || task === void 0 ? void 0 : task.id;
|
|
404
|
+
const documentId = params === null || params === void 0 ? void 0 : params.documentId;
|
|
405
|
+
this.router.navigate([formDefinition.formAssociation.formLink.url], {
|
|
406
|
+
state: Object.assign(Object.assign({}, (taskId && { taskId })), (documentId && { documentId })),
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
TaskDetailModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskDetailModalComponent, deps: [{ token: i1$1.ToastrService }, { token: i2$1.FormLinkService }, { token: i2$1.FormFlowService }, { token: i3$1.Router }, { token: i4$1.NGXLogger }, { token: i3$1.ActivatedRoute }, { token: TaskService }], target: i0.ɵɵFactoryTarget.Component });
|
|
412
|
+
TaskDetailModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: TaskDetailModalComponent, selector: "valtimo-task-detail-modal", outputs: { formSubmit: "formSubmit", assignmentOfTaskChanged: "assignmentOfTaskChanged" }, viewQueries: [{ propertyName: "form", first: true, predicate: ["form"], descendants: true }, { propertyName: "modal", first: true, predicate: ["taskDetailModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 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) || (formFlowStepTypeIsForm$ | async))\">\n <valtimo-form-io\n #form\n [form]=\"formDefinition\"\n (submit)=\"onSubmit($event)\"\n [options]=\"formioOptions\"\n ></valtimo-form-io>\n </div>\n <div body *ngIf=\"!formDefinition && !errorMessage\">\n <div\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'formManagement.noFormDefinitionFound'\"\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-2020 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"], components: [{ type: i6.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { type: i6.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "formRefresh$"], outputs: ["submit", "change"] }, { type: AssignUserToTaskComponent, selector: "valtimo-assign-user-to-task", inputs: ["taskId", "assigneeEmail"], outputs: ["assignmentOfTaskChanged"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "async": i3.AsyncPipe, "translate": i4.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
|
|
413
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskDetailModalComponent, decorators: [{
|
|
414
|
+
type: Component,
|
|
415
|
+
args: [{ selector: 'valtimo-task-detail-modal', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2020 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) || (formFlowStepTypeIsForm$ | async))\">\n <valtimo-form-io\n #form\n [form]=\"formDefinition\"\n (submit)=\"onSubmit($event)\"\n [options]=\"formioOptions\"\n ></valtimo-form-io>\n </div>\n <div body *ngIf=\"!formDefinition && !errorMessage\">\n <div\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'formManagement.noFormDefinitionFound'\"\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-2020 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"] }]
|
|
416
|
+
}], ctorParameters: function () { return [{ type: i1$1.ToastrService }, { type: i2$1.FormLinkService }, { type: i2$1.FormFlowService }, { type: i3$1.Router }, { type: i4$1.NGXLogger }, { type: i3$1.ActivatedRoute }, { type: TaskService }]; }, propDecorators: { form: [{
|
|
417
|
+
type: ViewChild,
|
|
418
|
+
args: ['form']
|
|
419
|
+
}], modal: [{
|
|
420
|
+
type: ViewChild,
|
|
421
|
+
args: ['taskDetailModal']
|
|
422
|
+
}], formSubmit: [{
|
|
423
|
+
type: Output
|
|
424
|
+
}], assignmentOfTaskChanged: [{
|
|
425
|
+
type: Output
|
|
426
|
+
}] } });
|
|
427
|
+
|
|
428
|
+
/*
|
|
429
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
430
|
+
*
|
|
431
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
432
|
+
* you may not use this file except in compliance with the License.
|
|
433
|
+
* You may obtain a copy of the License at
|
|
434
|
+
*
|
|
435
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
436
|
+
*
|
|
437
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
438
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
439
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
440
|
+
* See the License for the specific language governing permissions and
|
|
441
|
+
* limitations under the License.
|
|
442
|
+
*/
|
|
443
|
+
moment.locale(localStorage.getItem('langKey') || '');
|
|
444
|
+
class TaskListComponent {
|
|
445
|
+
constructor(taskService, router, logger, translateService) {
|
|
446
|
+
this.taskService = taskService;
|
|
447
|
+
this.router = router;
|
|
448
|
+
this.logger = logger;
|
|
449
|
+
this.translateService = translateService;
|
|
450
|
+
this.tasks = {
|
|
451
|
+
mine: new TaskList(),
|
|
452
|
+
open: new TaskList(),
|
|
453
|
+
all: new TaskList(),
|
|
454
|
+
};
|
|
455
|
+
this.currentTaskType = 'mine';
|
|
456
|
+
this.listTitle = null;
|
|
457
|
+
this.listDescription = null;
|
|
458
|
+
}
|
|
459
|
+
paginationClicked(page, type) {
|
|
460
|
+
this.tasks[type].page = page - 1;
|
|
461
|
+
this.getTasks(type);
|
|
462
|
+
}
|
|
463
|
+
paginationSet() {
|
|
464
|
+
this.tasks.mine.pagination.size =
|
|
465
|
+
this.tasks.all.pagination.size =
|
|
466
|
+
this.tasks.open.pagination.size =
|
|
467
|
+
this.tasks[this.currentTaskType].pagination.size;
|
|
468
|
+
this.getTasks(this.currentTaskType);
|
|
469
|
+
}
|
|
470
|
+
clearPagination(type) {
|
|
471
|
+
this.tasks[type].page = 0;
|
|
472
|
+
}
|
|
473
|
+
tabChange(tab) {
|
|
474
|
+
this.clearPagination(this.currentTaskType);
|
|
475
|
+
switch (tab.nextId) {
|
|
476
|
+
case 1:
|
|
477
|
+
this.getTasks('mine');
|
|
478
|
+
break;
|
|
479
|
+
case 2:
|
|
480
|
+
this.getTasks('open');
|
|
481
|
+
break;
|
|
482
|
+
case 3:
|
|
483
|
+
this.getTasks('all');
|
|
484
|
+
break;
|
|
485
|
+
default:
|
|
486
|
+
this.logger.fatal('Unreachable case');
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
showTask(task) {
|
|
490
|
+
this.router.navigate(['tasks', task.id]);
|
|
491
|
+
}
|
|
492
|
+
getTasks(type) {
|
|
493
|
+
let params;
|
|
494
|
+
this.translationSubscription = combineLatest([
|
|
495
|
+
this.translateService.stream(`task-list.${type}.title`),
|
|
496
|
+
this.translateService.stream(`task-list.${type}.description`),
|
|
497
|
+
]).subscribe(([title, description]) => {
|
|
498
|
+
this.listTitle = title;
|
|
499
|
+
this.listDescription = description;
|
|
500
|
+
});
|
|
501
|
+
switch (type) {
|
|
502
|
+
case 'mine':
|
|
503
|
+
params = {
|
|
504
|
+
page: this.tasks.mine.page,
|
|
505
|
+
size: this.tasks.mine.pagination.size,
|
|
506
|
+
filter: 'mine',
|
|
507
|
+
};
|
|
508
|
+
this.currentTaskType = 'mine';
|
|
509
|
+
break;
|
|
510
|
+
case 'open':
|
|
511
|
+
params = {
|
|
512
|
+
page: this.tasks.open.page,
|
|
513
|
+
size: this.tasks.open.pagination.size,
|
|
514
|
+
filter: 'open',
|
|
515
|
+
};
|
|
516
|
+
this.currentTaskType = 'open';
|
|
517
|
+
break;
|
|
518
|
+
case 'all':
|
|
519
|
+
params = { page: this.tasks.all.page, size: this.tasks.open.pagination.size, filter: 'all' };
|
|
520
|
+
this.currentTaskType = 'all';
|
|
521
|
+
break;
|
|
522
|
+
default:
|
|
523
|
+
this.logger.fatal('Unreachable case');
|
|
524
|
+
}
|
|
525
|
+
this.taskService.queryTasks(params).subscribe((results) => {
|
|
526
|
+
this.tasks[type].pagination.collectionSize = results.headers.get('x-total-count');
|
|
527
|
+
this.tasks[type].tasks = results.body;
|
|
528
|
+
this.tasks[type].tasks.map((task) => {
|
|
529
|
+
task.created = moment(task.created).format('DD MMM YYYY HH:mm');
|
|
530
|
+
if (task.due) {
|
|
531
|
+
task.due = moment(task.due).format('DD MMM YYYY HH:mm');
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
this.tasks[type].fields = [
|
|
535
|
+
{
|
|
536
|
+
key: 'created',
|
|
537
|
+
label: 'Created on',
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
key: 'name',
|
|
541
|
+
label: 'Name',
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
key: 'valtimoAssignee.fullName',
|
|
545
|
+
label: 'Assignee',
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
key: 'due',
|
|
549
|
+
label: 'Due date',
|
|
550
|
+
},
|
|
551
|
+
];
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
rowOpenTaskClick(task) {
|
|
555
|
+
if (!task.endTime) {
|
|
556
|
+
this.taskDetail.openTaskDetails(task);
|
|
557
|
+
}
|
|
558
|
+
else {
|
|
559
|
+
return false;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
ngOnDestroy() {
|
|
563
|
+
this.translationSubscription.unsubscribe();
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
TaskListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskListComponent, deps: [{ token: TaskService }, { token: i3$1.Router }, { token: i4$1.NGXLogger }, { token: i4.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
567
|
+
TaskListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: TaskListComponent, selector: "valtimo-task-list", viewQueries: [{ propertyName: "taskDetail", first: true, predicate: ["taskDetail"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 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 >\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 ngbNav [destroyOnHide]=\"false\" (navChange)=\"tabChange($event)\" class=\"nav-tabs\">\n <li [ngbNavItem]=\"1\" [title]=\"'task-list.mine.title' | translate\">\n <a ngbNavLink>{{ 'task-list.mine.title' | translate }}</a>\n </li>\n <li [ngbNavItem]=\"2\" [title]=\"'task-list.open.title' | translate\">\n <a ngbNavLink>{{ 'task-list.open.title' | translate }}</a>\n </li>\n <li [ngbNavItem]=\"3\" [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", styles: ["/*!\n * Copyright 2015-2020 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"], components: [{ type: i6.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { type: i6.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { type: TaskDetailModalComponent, selector: "valtimo-task-detail-modal", outputs: ["formSubmit", "assignmentOfTaskChanged"] }], directives: [{ type: i7.NgbNav, selector: "[ngbNav]", inputs: ["activeId", "animation", "destroyOnHide", "orientation", "roles", "keyboard"], outputs: ["activeIdChange", "shown", "hidden", "navChange"], exportAs: ["ngbNav"] }, { type: i7.NgbNavItem, selector: "[ngbNavItem]", inputs: ["destroyOnHide", "disabled", "domId", "ngbNavItem"], outputs: ["shown", "hidden"], exportAs: ["ngbNavItem"] }, { type: i7.NgbNavLink, selector: "a[ngbNavLink]" }], pipes: { "translate": i4.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
|
|
568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskListComponent, decorators: [{
|
|
569
|
+
type: Component,
|
|
570
|
+
args: [{ selector: 'valtimo-task-list', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2020 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 >\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 ngbNav [destroyOnHide]=\"false\" (navChange)=\"tabChange($event)\" class=\"nav-tabs\">\n <li [ngbNavItem]=\"1\" [title]=\"'task-list.mine.title' | translate\">\n <a ngbNavLink>{{ 'task-list.mine.title' | translate }}</a>\n </li>\n <li [ngbNavItem]=\"2\" [title]=\"'task-list.open.title' | translate\">\n <a ngbNavLink>{{ 'task-list.open.title' | translate }}</a>\n </li>\n <li [ngbNavItem]=\"3\" [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", styles: ["/*!\n * Copyright 2015-2020 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"] }]
|
|
571
|
+
}], ctorParameters: function () { return [{ type: TaskService }, { type: i3$1.Router }, { type: i4$1.NGXLogger }, { type: i4.TranslateService }]; }, propDecorators: { taskDetail: [{
|
|
572
|
+
type: ViewChild,
|
|
573
|
+
args: ['taskDetail']
|
|
574
|
+
}] } });
|
|
575
|
+
|
|
576
|
+
/*
|
|
577
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
578
|
+
*
|
|
579
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
580
|
+
* you may not use this file except in compliance with the License.
|
|
581
|
+
* You may obtain a copy of the License at
|
|
582
|
+
*
|
|
583
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
584
|
+
*
|
|
585
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
586
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
587
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
588
|
+
* See the License for the specific language governing permissions and
|
|
589
|
+
* limitations under the License.
|
|
590
|
+
*/
|
|
591
|
+
const routes = [
|
|
592
|
+
{
|
|
593
|
+
path: 'tasks',
|
|
594
|
+
component: TaskListComponent,
|
|
595
|
+
canActivate: [AuthGuardService],
|
|
596
|
+
data: { title: 'Tasks', roles: [ROLE_USER] },
|
|
597
|
+
},
|
|
598
|
+
];
|
|
599
|
+
class TaskRoutingModule {
|
|
600
|
+
}
|
|
601
|
+
TaskRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
602
|
+
TaskRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskRoutingModule, imports: [CommonModule, i3$1.RouterModule], exports: [RouterModule] });
|
|
603
|
+
TaskRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskRoutingModule, imports: [[CommonModule, RouterModule.forChild(routes)], RouterModule] });
|
|
604
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskRoutingModule, decorators: [{
|
|
605
|
+
type: NgModule,
|
|
606
|
+
args: [{
|
|
607
|
+
declarations: [],
|
|
608
|
+
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
609
|
+
exports: [RouterModule],
|
|
610
|
+
}]
|
|
611
|
+
}] });
|
|
612
|
+
|
|
613
|
+
/*
|
|
614
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
615
|
+
*
|
|
616
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
617
|
+
* you may not use this file except in compliance with the License.
|
|
618
|
+
* You may obtain a copy of the License at
|
|
619
|
+
*
|
|
620
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
621
|
+
*
|
|
622
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
623
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
624
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
625
|
+
* See the License for the specific language governing permissions and
|
|
626
|
+
* limitations under the License.
|
|
627
|
+
*/
|
|
628
|
+
class TaskModule {
|
|
629
|
+
}
|
|
630
|
+
TaskModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
631
|
+
TaskModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskModule, declarations: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent], imports: [CommonModule,
|
|
632
|
+
TaskRoutingModule,
|
|
633
|
+
ListModule,
|
|
634
|
+
PageHeaderModule,
|
|
635
|
+
WidgetModule,
|
|
636
|
+
SpinnerModule,
|
|
637
|
+
SearchableDropdownSelectModule,
|
|
638
|
+
CamundaFormModule,
|
|
639
|
+
BrowserAnimationsModule,
|
|
640
|
+
FormsModule, i1$1.ToastrModule, i4.TranslateModule, NgbModule,
|
|
641
|
+
FormIoModule,
|
|
642
|
+
ModalModule], exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent] });
|
|
643
|
+
TaskModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskModule, imports: [[
|
|
644
|
+
CommonModule,
|
|
645
|
+
TaskRoutingModule,
|
|
646
|
+
ListModule,
|
|
647
|
+
PageHeaderModule,
|
|
648
|
+
WidgetModule,
|
|
649
|
+
SpinnerModule,
|
|
650
|
+
SearchableDropdownSelectModule,
|
|
651
|
+
CamundaFormModule,
|
|
652
|
+
BrowserAnimationsModule,
|
|
653
|
+
FormsModule,
|
|
654
|
+
ToastrModule.forRoot({
|
|
655
|
+
positionClass: 'toast-bottom-full-width',
|
|
656
|
+
preventDuplicates: true,
|
|
657
|
+
}),
|
|
658
|
+
TranslateModule.forRoot({
|
|
659
|
+
loader: {
|
|
660
|
+
provide: TranslateLoader,
|
|
661
|
+
useFactory: HttpLoaderFactory,
|
|
662
|
+
deps: [HttpClient],
|
|
663
|
+
},
|
|
664
|
+
}),
|
|
665
|
+
NgbModule,
|
|
666
|
+
FormIoModule,
|
|
667
|
+
ModalModule,
|
|
668
|
+
]] });
|
|
669
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: TaskModule, decorators: [{
|
|
670
|
+
type: NgModule,
|
|
671
|
+
args: [{
|
|
672
|
+
declarations: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent],
|
|
673
|
+
imports: [
|
|
674
|
+
CommonModule,
|
|
675
|
+
TaskRoutingModule,
|
|
676
|
+
ListModule,
|
|
677
|
+
PageHeaderModule,
|
|
678
|
+
WidgetModule,
|
|
679
|
+
SpinnerModule,
|
|
680
|
+
SearchableDropdownSelectModule,
|
|
681
|
+
CamundaFormModule,
|
|
682
|
+
BrowserAnimationsModule,
|
|
683
|
+
FormsModule,
|
|
684
|
+
ToastrModule.forRoot({
|
|
685
|
+
positionClass: 'toast-bottom-full-width',
|
|
686
|
+
preventDuplicates: true,
|
|
687
|
+
}),
|
|
688
|
+
TranslateModule.forRoot({
|
|
689
|
+
loader: {
|
|
690
|
+
provide: TranslateLoader,
|
|
691
|
+
useFactory: HttpLoaderFactory,
|
|
692
|
+
deps: [HttpClient],
|
|
693
|
+
},
|
|
694
|
+
}),
|
|
695
|
+
NgbModule,
|
|
696
|
+
FormIoModule,
|
|
697
|
+
ModalModule,
|
|
698
|
+
],
|
|
699
|
+
exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent],
|
|
700
|
+
}]
|
|
701
|
+
}] });
|
|
702
|
+
|
|
703
|
+
/*
|
|
704
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
705
|
+
*
|
|
706
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
707
|
+
* you may not use this file except in compliance with the License.
|
|
708
|
+
* You may obtain a copy of the License at
|
|
709
|
+
*
|
|
710
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
711
|
+
*
|
|
712
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
713
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
714
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
715
|
+
* See the License for the specific language governing permissions and
|
|
716
|
+
* limitations under the License.
|
|
717
|
+
*/
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* Generated bundle index. Do not edit.
|
|
721
|
+
*/
|
|
722
|
+
|
|
723
|
+
export { AssignUserToTaskComponent, TaskDetailModalComponent, TaskList, TaskListComponent, TaskModule, TaskService };
|
|
724
|
+
//# sourceMappingURL=valtimo-task.mjs.map
|