@valtimo/task 12.0.0 → 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/esm2022/lib/components/assign-user-to-task/assign-user-to-task.component.mjs +2 -2
  2. package/esm2022/lib/components/task-detail-modal/task-detail-modal.component.mjs +148 -28
  3. package/esm2022/lib/components/task-list/task-list.component.mjs +96 -23
  4. package/esm2022/lib/constants/index.mjs +17 -0
  5. package/esm2022/lib/constants/task-list.constants.mjs +22 -0
  6. package/esm2022/lib/models/index.mjs +3 -1
  7. package/esm2022/lib/models/task-intermediate-save.model.mjs +17 -0
  8. package/esm2022/lib/models/task-list-search-field.model.mjs +43 -0
  9. package/esm2022/lib/models/task-list.model.mjs +1 -1
  10. package/esm2022/lib/models/task.model.mjs +1 -1
  11. package/esm2022/lib/services/index.mjs +3 -1
  12. package/esm2022/lib/services/task-intermediate-save.service.mjs +56 -0
  13. package/esm2022/lib/services/task-list-column.service.mjs +3 -2
  14. package/esm2022/lib/services/task-list-query-param.service.mjs +53 -0
  15. package/esm2022/lib/services/task-list-search.service.mjs +99 -0
  16. package/esm2022/lib/services/task-list-sort.service.mjs +27 -1
  17. package/esm2022/lib/services/task.service.mjs +17 -11
  18. package/esm2022/lib/task.module.mjs +20 -5
  19. package/esm2022/public_api.mjs +2 -1
  20. package/fesm2022/valtimo-task.mjs +593 -71
  21. package/fesm2022/valtimo-task.mjs.map +1 -1
  22. package/lib/components/assign-user-to-task/assign-user-to-task.component.d.ts.map +1 -1
  23. package/lib/components/task-detail-modal/task-detail-modal.component.d.ts +32 -9
  24. package/lib/components/task-detail-modal/task-detail-modal.component.d.ts.map +1 -1
  25. package/lib/components/task-list/task-list.component.d.ts +23 -6
  26. package/lib/components/task-list/task-list.component.d.ts.map +1 -1
  27. package/lib/constants/index.d.ts +2 -0
  28. package/lib/constants/index.d.ts.map +1 -0
  29. package/lib/constants/task-list.constants.d.ts +4 -0
  30. package/lib/constants/task-list.constants.d.ts.map +1 -0
  31. package/lib/models/index.d.ts +2 -0
  32. package/lib/models/index.d.ts.map +1 -1
  33. package/lib/models/task-intermediate-save.model.d.ts +13 -0
  34. package/lib/models/task-intermediate-save.model.d.ts.map +1 -0
  35. package/lib/models/task-list-search-field.model.d.ts +40 -0
  36. package/lib/models/task-list-search-field.model.d.ts.map +1 -0
  37. package/lib/models/task-list.model.d.ts +20 -9
  38. package/lib/models/task-list.model.d.ts.map +1 -1
  39. package/lib/models/task.model.d.ts +3 -1
  40. package/lib/models/task.model.d.ts.map +1 -1
  41. package/lib/services/index.d.ts +2 -0
  42. package/lib/services/index.d.ts.map +1 -1
  43. package/lib/services/task-intermediate-save.service.d.ts +16 -0
  44. package/lib/services/task-intermediate-save.service.d.ts.map +1 -0
  45. package/lib/services/task-list-column.service.d.ts.map +1 -1
  46. package/lib/services/task-list-query-param.service.d.ts +16 -0
  47. package/lib/services/task-list-query-param.service.d.ts.map +1 -0
  48. package/lib/services/task-list-search.service.d.ts +25 -0
  49. package/lib/services/task-list-search.service.d.ts.map +1 -0
  50. package/lib/services/task-list-sort.service.d.ts +6 -0
  51. package/lib/services/task-list-sort.service.d.ts.map +1 -1
  52. package/lib/services/task.service.d.ts +4 -2
  53. package/lib/services/task.service.d.ts.map +1 -1
  54. package/lib/task.module.d.ts +1 -1
  55. package/lib/task.module.d.ts.map +1 -1
  56. package/package.json +1 -1
  57. package/public_api.d.ts +1 -0
  58. package/public_api.d.ts.map +1 -1
@@ -1,35 +1,36 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Component, Input, Output, ViewEncapsulation, ViewChild, ChangeDetectionStrategy, NgModule } from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, Input, Output, ViewContainerRef, ViewEncapsulation, Optional, Inject, ViewChild, ChangeDetectionStrategy, HostListener, NgModule } from '@angular/core';
3
3
  import * as i1 from '@angular/common/http';
4
- import { HttpParams, HttpClient } from '@angular/common/http';
4
+ import { HttpParams, HttpHeaders, HttpClient } from '@angular/common/http';
5
5
  import * as i2 from '@valtimo/config';
6
- import { BaseApiService, TaskListTab, ROLE_USER, HttpLoaderFactory } from '@valtimo/config';
6
+ import { BaseApiService, TaskListTab, FORM_VIEW_MODEL_TOKEN, ROLE_USER, HttpLoaderFactory } from '@valtimo/config';
7
7
  import * as i5 from '@valtimo/security';
8
8
  import { InterceptorSkip, AuthGuardService } from '@valtimo/security';
9
- import * as i9 from '@angular/common';
9
+ import * as i10 from '@angular/common';
10
10
  import { CommonModule } from '@angular/common';
11
11
  import { FormsModule } from '@angular/forms';
12
12
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
13
- import * as i11 from '@ng-bootstrap/ng-bootstrap';
13
+ import * as i11$1 from '@ng-bootstrap/ng-bootstrap';
14
14
  import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
15
15
  import * as i8 from '@ngx-translate/core';
16
16
  import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
17
17
  import * as i6 from '@valtimo/components';
18
- import { ViewType, FormioOptionsImpl, CarbonListModule, PageHeaderModule, WidgetModule, SpinnerModule, SearchableDropdownSelectModule, CamundaFormModule, FormIoModule, ModalModule, RenderInPageHeaderDirectiveModule } from '@valtimo/components';
18
+ import { ViewType, FormioOptionsImpl, CarbonListModule, PageHeaderModule, WidgetModule, SpinnerModule, SearchableDropdownSelectModule, CamundaFormModule, FormIoModule, RenderInPageHeaderDirectiveModule, ConfirmationModalModule, SearchFieldsModule } from '@valtimo/components';
19
19
  import * as i2$1 from '@valtimo/process-link';
20
20
  import { ProcessLinkModule } from '@valtimo/process-link';
21
- import * as i12 from 'carbon-components-angular';
22
- import { LinkModule, TabsModule, ContentSwitcherModule, DropdownModule } from 'carbon-components-angular';
23
- import * as i1$1 from 'ngx-toastr';
21
+ import * as i11 from 'carbon-components-angular';
22
+ import { ModalModule, LinkModule, TabsModule, ContentSwitcherModule, DropdownModule, ButtonModule, IconModule, TooltipModule } from 'carbon-components-angular';
23
+ import * as i1$2 from 'ngx-toastr';
24
24
  import { ToastrModule } from 'ngx-toastr';
25
- import { BehaviorSubject, combineLatest, tap, filter, switchMap, Subscription, take as take$1, distinctUntilChanged, of } from 'rxjs';
26
- import { map, take, filter as filter$1, distinctUntilChanged as distinctUntilChanged$1 } from 'rxjs/operators';
27
- import moment from 'moment';
28
- import * as i3 from '@angular/router';
25
+ import { BehaviorSubject, combineLatest, tap, filter, switchMap, of, map as map$1, Subscription, take as take$1, Subject } from 'rxjs';
26
+ import { map, take, distinctUntilChanged, switchMap as switchMap$1, filter as filter$1 } from 'rxjs/operators';
27
+ import { omit, isEqual } from 'lodash';
28
+ import * as i1$1 from '@angular/router';
29
29
  import { RouterModule } from '@angular/router';
30
+ import moment from 'moment';
31
+ import { RecentlyViewed16 } from '@carbon/icons';
30
32
  import * as i7 from '@valtimo/document';
31
- import { isEqual } from 'lodash';
32
- import * as i3$1 from '@valtimo/access-control';
33
+ import * as i3 from '@valtimo/access-control';
33
34
 
34
35
  /*
35
36
  * Copyright 2015-2024 Ritense BV, the Netherlands.
@@ -84,6 +85,64 @@ var TaskListColumnDefaultSort;
84
85
  TaskListColumnDefaultSort["DESC"] = "DESC";
85
86
  })(TaskListColumnDefaultSort || (TaskListColumnDefaultSort = {}));
86
87
 
88
+ /*
89
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
90
+ *
91
+ * Licensed under EUPL, Version 1.2 (the "License");
92
+ * you may not use this file except in compliance with the License.
93
+ * You may obtain a copy of the License at
94
+ *
95
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
96
+ *
97
+ * Unless required by applicable law or agreed to in writing, software
98
+ * distributed under the License is distributed on an "AS IS" basis,
99
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
100
+ * See the License for the specific language governing permissions and
101
+ * limitations under the License.
102
+ */
103
+
104
+ /*
105
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
106
+ *
107
+ * Licensed under EUPL, Version 1.2 (the "License");
108
+ * you may not use this file except in compliance with the License.
109
+ * You may obtain a copy of the License at
110
+ *
111
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
112
+ *
113
+ * Unless required by applicable law or agreed to in writing, software
114
+ * distributed under the License is distributed on an "AS IS" basis,
115
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
116
+ * See the License for the specific language governing permissions and
117
+ * limitations under the License.
118
+ */
119
+ var TaskListSearchFieldDataType;
120
+ (function (TaskListSearchFieldDataType) {
121
+ TaskListSearchFieldDataType["TEXT"] = "text";
122
+ TaskListSearchFieldDataType["NUMBER"] = "number";
123
+ TaskListSearchFieldDataType["DATE"] = "date";
124
+ TaskListSearchFieldDataType["DATETIME"] = "datetime";
125
+ TaskListSearchFieldDataType["TIME"] = "time";
126
+ TaskListSearchFieldDataType["BOOLEAN"] = "boolean";
127
+ })(TaskListSearchFieldDataType || (TaskListSearchFieldDataType = {}));
128
+ var TaskListSearchFieldFieldType;
129
+ (function (TaskListSearchFieldFieldType) {
130
+ TaskListSearchFieldFieldType["SINGLE"] = "single";
131
+ TaskListSearchFieldFieldType["RANGE"] = "range";
132
+ TaskListSearchFieldFieldType["SINGLE_SELECT_DROPDOWN"] = "single_select_dropdown";
133
+ TaskListSearchFieldFieldType["MULTI_SELECT_DROPDOWN"] = "multi_select_dropdown";
134
+ })(TaskListSearchFieldFieldType || (TaskListSearchFieldFieldType = {}));
135
+ var TaskListSearchFieldMatchType;
136
+ (function (TaskListSearchFieldMatchType) {
137
+ TaskListSearchFieldMatchType["LIKE"] = "like";
138
+ TaskListSearchFieldMatchType["EXACT"] = "exact";
139
+ })(TaskListSearchFieldMatchType || (TaskListSearchFieldMatchType = {}));
140
+ var TaskListSearchDropdownDataProvider;
141
+ (function (TaskListSearchDropdownDataProvider) {
142
+ TaskListSearchDropdownDataProvider["DATABASE"] = "dropdownDatabaseDataProvider";
143
+ TaskListSearchDropdownDataProvider["JSON"] = "dropdownJsonFileDataProvider";
144
+ })(TaskListSearchDropdownDataProvider || (TaskListSearchDropdownDataProvider = {}));
145
+
87
146
  /*
88
147
  * Copyright 2015-2024 Ritense BV, the Netherlands.
89
148
  *
@@ -132,20 +191,23 @@ class TaskService extends BaseApiService {
132
191
  params,
133
192
  });
134
193
  }
135
- queryTasksPageV3(assigneeFilter = TaskListTab.ALL, pageParams, caseDefinitionName) {
136
- let httpParams = new HttpParams()
137
- .set('filter', assigneeFilter.toUpperCase())
138
- .set('page', pageParams.page)
139
- .set('size', pageParams.size);
194
+ queryTasksPageV3(assigneeFilter = TaskListTab.ALL, pageParams, caseDefinitionName, otherFilters) {
195
+ let httpParams = new HttpParams().set('page', pageParams.page).set('size', pageParams.size);
140
196
  if (pageParams.sort) {
141
197
  httpParams = httpParams.append('sort', pageParams.sort);
142
198
  }
143
- if (caseDefinitionName) {
144
- return this.httpClient.post(this.getApiUrl('/v3/task'), {
145
- caseDefinitionName,
146
- }, { params: httpParams });
199
+ if (caseDefinitionName && (otherFilters || []).length > 0) {
200
+ return this.searchTasks(httpParams, caseDefinitionName, otherFilters, assigneeFilter);
147
201
  }
148
- return this.httpClient.post(this.getApiUrl('/v3/task'), {}, { params: httpParams });
202
+ httpParams = httpParams.append('filter', assigneeFilter.toUpperCase());
203
+ return this.httpClient.post(this.getApiUrl('/v3/task'), { ...(caseDefinitionName && { caseDefinitionName }) }, { params: httpParams });
204
+ }
205
+ searchTasks(params, caseDefinitionName, otherFilters, assigneeFilter = TaskListTab.ALL) {
206
+ return this.httpClient.post(this.getApiUrl(`/v1/document-definition/${caseDefinitionName}/task/search`), {
207
+ caseDefinitionName,
208
+ assigneeFilter: assigneeFilter.toUpperCase(),
209
+ ...(otherFilters && { otherFilters }),
210
+ }, { params });
149
211
  }
150
212
  getTasks() {
151
213
  return this.httpClient.get(this.getApiUrl('/v1/task?filter=all`'));
@@ -179,6 +241,9 @@ class TaskService extends BaseApiService {
179
241
  getConfigCustomTaskList() {
180
242
  return this.configService.config.customTaskList;
181
243
  }
244
+ getTaskListSearchFields(caseDefinitionName) {
245
+ return this.httpClient.get(this.getApiUrl(`v1/search/field/TaskListSearchColumns/${caseDefinitionName}`));
246
+ }
182
247
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
183
248
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskService, providedIn: 'root' }); }
184
249
  }
@@ -264,12 +329,19 @@ class TaskListSortService {
264
329
  get sortStringForCurrentTaskType$() {
265
330
  return this.sortStateForCurrentTaskType$.pipe(map(sortState => (sortState ? this.getSortString(sortState) : null)));
266
331
  }
332
+ get overrideSortState$() {
333
+ return this._overrideSortState$.asObservable();
334
+ }
335
+ get overrideSortStateString$() {
336
+ return this._overrideSortState$.pipe(map(state => (state ? this.getSortString(state) : null)));
337
+ }
267
338
  get _defaultSortState() {
268
339
  return this.taskService.getConfigCustomTaskList()?.defaultSortedColumn || null;
269
340
  }
270
341
  constructor(taskService, taskListService) {
271
342
  this.taskService = taskService;
272
343
  this.taskListService = taskListService;
344
+ this._overrideSortState$ = new BehaviorSubject(null);
273
345
  this._sortState$ = new BehaviorSubject({
274
346
  [TaskListTab.ALL]: this._defaultSortState,
275
347
  [TaskListTab.MINE]: this._defaultSortState,
@@ -315,6 +387,25 @@ class TaskListSortService {
315
387
  this._sortState$.next(sortStatesCopy);
316
388
  });
317
389
  }
390
+ getSortStateFromSortString(sortString) {
391
+ const splitString = sortString && sortString.split(',');
392
+ if (splitString?.length > 1) {
393
+ return {
394
+ isSorting: true,
395
+ state: {
396
+ name: splitString[0],
397
+ direction: splitString[1],
398
+ },
399
+ };
400
+ }
401
+ return null;
402
+ }
403
+ setOverrideSortState(state) {
404
+ this._overrideSortState$.next(state);
405
+ }
406
+ resetOverrideSortState() {
407
+ this._overrideSortState$.next(null);
408
+ }
318
409
  getSortString(sort) {
319
410
  return `${sort.state.name},${sort.state.direction}`;
320
411
  }
@@ -406,8 +497,9 @@ class TaskListColumnService {
406
497
  {
407
498
  key: 'createTime',
408
499
  label: `task-list.fieldLabels.created`,
409
- viewType: ViewType.TEXT,
500
+ viewType: ViewType.DATE,
410
501
  sortable: true,
502
+ format: 'DD MMM YYYY HH:mm',
411
503
  },
412
504
  {
413
505
  key: 'name',
@@ -578,6 +670,148 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
578
670
  type: Injectable
579
671
  }], ctorParameters: () => [{ type: TaskListService }] });
580
672
 
673
+ /*
674
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
675
+ *
676
+ * Licensed under EUPL, Version 1.2 (the "License");
677
+ * you may not use this file except in compliance with the License.
678
+ * You may obtain a copy of the License at
679
+ *
680
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
681
+ *
682
+ * Unless required by applicable law or agreed to in writing, software
683
+ * distributed under the License is distributed on an "AS IS" basis,
684
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
685
+ * See the License for the specific language governing permissions and
686
+ * limitations under the License.
687
+ */
688
+ class TaskListSearchService {
689
+ get loadingSearchFields$() {
690
+ return this._loadingSearchFields$.asObservable();
691
+ }
692
+ get otherFilters$() {
693
+ return this._otherFilters$.asObservable();
694
+ }
695
+ constructor(configService, taskListService, taskService) {
696
+ this.configService = configService;
697
+ this.taskListService = taskListService;
698
+ this.taskService = taskService;
699
+ this._loadingSearchFields$ = new BehaviorSubject(true);
700
+ this._otherFilters$ = new BehaviorSubject([]);
701
+ this.searchFields$ = this.taskListService.caseDefinitionName$.pipe(tap(() => this._loadingSearchFields$.next(true)), switchMap(caseDefinitionName => caseDefinitionName
702
+ ? this.taskService.getTaskListSearchFields(caseDefinitionName)
703
+ : of([])), map$1(searchFields => searchFields.map(searchField => {
704
+ const fieldTypeLowerCase = searchField.fieldType?.toLowerCase();
705
+ return {
706
+ ...searchField,
707
+ dataType: searchField.dataType?.toLowerCase(),
708
+ fieldType: fieldTypeLowerCase === 'text_contains' ? 'single' : fieldTypeLowerCase,
709
+ matchType: searchField?.matchType?.toLowerCase(),
710
+ };
711
+ })), tap(() => this._loadingSearchFields$.next(false)));
712
+ }
713
+ setSearchFieldValues(searchFieldValues) {
714
+ this._otherFilters$.next(this.mapSearchValuesToFilters(searchFieldValues));
715
+ }
716
+ setOtherFilters(otherFilters) {
717
+ this._otherFilters$.next(otherFilters);
718
+ }
719
+ resetOtherFilters() {
720
+ this._otherFilters$.next([]);
721
+ }
722
+ mapOtherFilterToSearchValues(otherFilters) {
723
+ return otherFilters.reduce((acc, curr) => {
724
+ const filter = curr;
725
+ if (filter.rangeFrom) {
726
+ return {
727
+ ...acc,
728
+ [filter.key]: {
729
+ start: filter.rangeFrom,
730
+ end: filter.rangeTo,
731
+ },
732
+ };
733
+ }
734
+ else if (filter.multiValue) {
735
+ return { ...acc, [filter.key]: filter.values };
736
+ }
737
+ else if (Array.isArray(filter.values) && filter.values.length > 0 && !filter.multiValue) {
738
+ return { ...acc, [filter.key]: filter.values[0] };
739
+ }
740
+ return acc;
741
+ }, {});
742
+ }
743
+ mapSearchValuesToFilters(values) {
744
+ const filters = [];
745
+ Object.keys(values).forEach(valueKey => {
746
+ const searchValue = values[valueKey];
747
+ if (searchValue.start) {
748
+ filters.push({ key: valueKey, rangeFrom: searchValue.start, rangeTo: searchValue.end });
749
+ }
750
+ else if (Array.isArray(searchValue)) {
751
+ filters.push({ key: valueKey, values: searchValue, multiValue: true });
752
+ }
753
+ else {
754
+ filters.push({ key: valueKey, values: [searchValue], multiValue: false });
755
+ }
756
+ });
757
+ return filters;
758
+ }
759
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskListSearchService, deps: [{ token: i2.ConfigService }, { token: TaskListService }, { token: TaskService }], target: i0.ɵɵFactoryTarget.Injectable }); }
760
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskListSearchService }); }
761
+ }
762
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskListSearchService, decorators: [{
763
+ type: Injectable
764
+ }], ctorParameters: () => [{ type: i2.ConfigService }, { type: TaskListService }, { type: TaskService }] });
765
+
766
+ /*
767
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
768
+ *
769
+ * Licensed under EUPL, Version 1.2 (the "License");
770
+ * you may not use this file except in compliance with the License.
771
+ * You may obtain a copy of the License at
772
+ *
773
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
774
+ *
775
+ * Unless required by applicable law or agreed to in writing, software
776
+ * distributed under the License is distributed on an "AS IS" basis,
777
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
778
+ * See the License for the specific language governing permissions and
779
+ * limitations under the License.
780
+ */
781
+ class TaskListQueryParamService {
782
+ setTaskListParams(params) {
783
+ const queryParams = omit(params, 'reload');
784
+ const encodedQueryParams = Object.keys(queryParams).reduce((acc, curr) => ({ ...acc, [curr]: this.objectToBase64(queryParams[curr]) }), {});
785
+ this.router.navigate([this.getUrlWithoutParams()], { queryParams: encodedQueryParams });
786
+ }
787
+ constructor(router, route) {
788
+ this.router = router;
789
+ this.route = route;
790
+ }
791
+ getTaskListQueryParams() {
792
+ const queryParams = this.route.snapshot.queryParams;
793
+ const decodedParams = Object.keys(queryParams).reduce((acc, curr) => ({ ...acc, [curr]: this.parseBase64(queryParams[curr]) }), {});
794
+ return decodedParams;
795
+ }
796
+ getUrlWithoutParams() {
797
+ const urlTree = this.router.parseUrl(this.router.url);
798
+ urlTree.queryParams = {};
799
+ urlTree.fragment = null;
800
+ return urlTree.toString();
801
+ }
802
+ objectToBase64(jsObject) {
803
+ return btoa(JSON.stringify(jsObject));
804
+ }
805
+ parseBase64(base64string) {
806
+ return JSON.parse(atob(base64string));
807
+ }
808
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskListQueryParamService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable }); }
809
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskListQueryParamService }); }
810
+ }
811
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskListQueryParamService, decorators: [{
812
+ type: Injectable
813
+ }], ctorParameters: () => [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }] });
814
+
581
815
  /*
582
816
  * Copyright 2015-2024 Ritense BV, the Netherlands.
583
817
  *
@@ -670,7 +904,7 @@ class AssignUserToTaskComponent {
670
904
  }
671
905
  getAssignedUserName(users, userId) {
672
906
  if (users && userId) {
673
- const findUser = users.find(user => user.id === userId);
907
+ const findUser = users.find(user => user.id === userId) || users.find(user => user.userName === userId);
674
908
  return findUser ? findUser.label : userId;
675
909
  }
676
910
  return userId || '-';
@@ -696,7 +930,7 @@ class AssignUserToTaskComponent {
696
930
  this.disabled$.next(true);
697
931
  }
698
932
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AssignUserToTaskComponent, deps: [{ token: TaskService }], target: i0.ɵɵFactoryTarget.Component }); }
699
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: AssignUserToTaskComponent, selector: "valtimo-assign-user-to-task", inputs: { taskId: "taskId", assigneeId: "assigneeId" }, outputs: { assignmentOfTaskChanged: "assignmentOfTaskChanged" }, usesOnChanges: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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 idOnServer: assignedIdOnServer$ | 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]=\"userIdToAssign === obs.idOnServer && obs.idOnServer !== 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: [".container-fluid{color:#959595}i{font-size:13px}\n/*!\n * Copyright 2015-2024 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"], dependencies: [{ kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.SearchableDropdownSelectComponent, selector: "valtimo-searchable-dropdown-select", inputs: ["style", "items", "buttonText", "searchText", "noResultsText", "disabled", "selectedText", "selectedTextValue", "clearSelectionButtonTitle", "hasSelection", "width", "hasPermission", "showClearSelection"], outputs: ["itemSelected", "clearSelection"] }, { kind: "pipe", type: i9.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.TranslatePipe, name: "translate" }] }); }
933
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: AssignUserToTaskComponent, selector: "valtimo-assign-user-to-task", inputs: { taskId: "taskId", assigneeId: "assigneeId" }, outputs: { assignmentOfTaskChanged: "assignmentOfTaskChanged" }, usesOnChanges: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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 idOnServer: assignedIdOnServer$ | 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]=\"userIdToAssign === obs.idOnServer && obs.idOnServer !== 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: [".container-fluid{color:#959595}i{font-size:13px}\n/*!\n * Copyright 2015-2024 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"], dependencies: [{ kind: "directive", type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.SearchableDropdownSelectComponent, selector: "valtimo-searchable-dropdown-select", inputs: ["style", "items", "buttonText", "searchText", "noResultsText", "disabled", "selectedText", "selectedTextValue", "clearSelectionButtonTitle", "hasSelection", "width", "hasPermission", "showClearSelection"], outputs: ["itemSelected", "clearSelection"] }, { kind: "pipe", type: i10.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.TranslatePipe, name: "translate" }] }); }
700
934
  }
701
935
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AssignUserToTaskComponent, decorators: [{
702
936
  type: Component,
@@ -709,6 +943,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
709
943
  type: Output
710
944
  }] } });
711
945
 
946
+ /*
947
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
948
+ *
949
+ * Licensed under EUPL, Version 1.2 (the "License");
950
+ * you may not use this file except in compliance with the License.
951
+ * You may obtain a copy of the License at
952
+ *
953
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
954
+ *
955
+ * Unless required by applicable law or agreed to in writing, software
956
+ * distributed under the License is distributed on an "AS IS" basis,
957
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
958
+ * See the License for the specific language governing permissions and
959
+ * limitations under the License.
960
+ */
961
+ class TaskIntermediateSaveService extends BaseApiService {
962
+ constructor(httpClient, configService) {
963
+ super(httpClient, configService);
964
+ this.httpClient = httpClient;
965
+ this.configService = configService;
966
+ }
967
+ getIntermediateSubmission(taskInstanceId) {
968
+ return this.httpClient.get(this.getApiUrl('/v1/form/intermediate/submission'), {
969
+ params: {
970
+ taskInstanceId,
971
+ },
972
+ headers: new HttpHeaders().set(InterceptorSkip, '404'),
973
+ });
974
+ }
975
+ storeIntermediateSubmission(request) {
976
+ return this.httpClient.post(this.getApiUrl('/v1/form/intermediate/submission'), request, {
977
+ headers: new HttpHeaders().set(InterceptorSkip, '400'),
978
+ });
979
+ }
980
+ clearIntermediateSubmission(taskInstanceId) {
981
+ return this.httpClient.delete(this.getApiUrl('/v1/form/intermediate/submission'), {
982
+ params: {
983
+ taskInstanceId,
984
+ },
985
+ });
986
+ }
987
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskIntermediateSaveService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
988
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskIntermediateSaveService, providedIn: 'root' }); }
989
+ }
990
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskIntermediateSaveService, decorators: [{
991
+ type: Injectable,
992
+ args: [{ providedIn: 'root' }]
993
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ConfigService }] });
994
+
712
995
  /*
713
996
  * Copyright 2015-2024 Ritense BV, the Netherlands.
714
997
  *
@@ -726,7 +1009,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
726
1009
  */
727
1010
  moment.locale(localStorage.getItem('langKey') || '');
728
1011
  class TaskDetailModalComponent {
729
- constructor(toastr, processLinkService, router, taskService, userProviderService, modalService, stateService, documentService, translateService) {
1012
+ constructor(toastr, processLinkService, router, taskService, userProviderService, modalService, stateService, documentService, translateService, formViewModel, taskIntermediateSaveService, configService, iconService) {
730
1013
  this.toastr = toastr;
731
1014
  this.processLinkService = processLinkService;
732
1015
  this.router = router;
@@ -736,10 +1019,20 @@ class TaskDetailModalComponent {
736
1019
  this.stateService = stateService;
737
1020
  this.documentService = documentService;
738
1021
  this.translateService = translateService;
1022
+ this.formViewModel = formViewModel;
1023
+ this.taskIntermediateSaveService = taskIntermediateSaveService;
1024
+ this.configService = configService;
1025
+ this.iconService = iconService;
739
1026
  this.formSubmit = new EventEmitter();
740
1027
  this.assignmentOfTaskChanged = new EventEmitter();
1028
+ this.intermediateSaveEnabled = false;
1029
+ this.currentIntermediateSave = null;
741
1030
  this.task$ = new BehaviorSubject(null);
1031
+ this.taskInstanceId$ = new BehaviorSubject(null);
742
1032
  this.formDefinition$ = new BehaviorSubject(undefined);
1033
+ this.formDefinitionId$ = new BehaviorSubject(undefined);
1034
+ this.formName$ = new BehaviorSubject(undefined);
1035
+ this.submission$ = new BehaviorSubject({});
743
1036
  this.formFlowInstanceId$ = new BehaviorSubject(undefined);
744
1037
  this.page$ = new BehaviorSubject(null);
745
1038
  this.formioOptions$ = new BehaviorSubject(null);
@@ -749,28 +1042,21 @@ class TaskDetailModalComponent {
749
1042
  .pipe(map(userIdentity => userIdentity?.roles?.includes('ROLE_ADMIN')));
750
1043
  this.formIoFormData$ = new BehaviorSubject(null);
751
1044
  this.loading$ = new BehaviorSubject(true);
1045
+ this.showConfirmationModal$ = new BehaviorSubject(false);
752
1046
  this.taskProcessLinkType$ = new BehaviorSubject(null);
753
1047
  this.processLinkIsForm$ = this.taskProcessLinkType$.pipe(map(type => type === 'form'));
1048
+ this.processLinkIsFormViewModel$ = this.taskProcessLinkType$.pipe(map(type => type === 'form-view-model'));
754
1049
  this.processLinkIsFormFlow$ = this.taskProcessLinkType$.pipe(map(type => type === 'form-flow'));
755
1050
  this.processLinkId$ = new BehaviorSubject(undefined);
756
- this._subscriptions = new Subscription();
757
1051
  const options = new FormioOptionsImpl();
758
1052
  options.disableAlerts = true;
759
1053
  this.formioOptions$.next(options);
760
- }
761
- ngAfterViewInit() {
762
- this._subscriptions.add(this.modal.modalShowing$
763
- .pipe(distinctUntilChanged(), tap(modalShowing => {
764
- if (!modalShowing) {
765
- if (this.formFlow) {
766
- this.formFlow.saveData();
767
- }
768
- }
769
- }))
770
- .subscribe());
1054
+ this.intermediateSaveEnabled = this.configService.featureToggles.enableIntermediateSave;
1055
+ this.iconService.registerAll([RecentlyViewed16]);
771
1056
  }
772
1057
  ngOnDestroy() {
773
- this._subscriptions.unsubscribe();
1058
+ this._fvmSubmissionSubscription?.unsubscribe();
1059
+ this._submissionSubscription?.unsubscribe();
774
1060
  }
775
1061
  openTaskDetails(task) {
776
1062
  this.resetTaskProcessLinkType();
@@ -780,17 +1066,18 @@ class TaskDetailModalComponent {
780
1066
  const documentId = task.businessKey;
781
1067
  this.stateService.setDocumentId(documentId);
782
1068
  this.task$.next(task);
1069
+ this.taskInstanceId$.next(task.id);
783
1070
  this.page$.next({
784
1071
  title: task.name,
785
1072
  subtitle: `${this.translateService.instant('taskDetail.taskCreated')} ${task.created}`,
786
1073
  });
787
1074
  //only load from formlink when process link failed for backwards compatibility
788
1075
  if (!this.taskProcessLinkType$.getValue()) {
789
- this.modal.show();
1076
+ this.openModal();
790
1077
  }
791
1078
  }
792
1079
  gotoProcessLinkScreen() {
793
- this.modal.hide();
1080
+ this.closeModal();
794
1081
  this.router.navigate(['process-links']);
795
1082
  }
796
1083
  onChange(event) {
@@ -819,12 +1106,15 @@ class TaskDetailModalComponent {
819
1106
  });
820
1107
  }
821
1108
  }
1109
+ else if (taskProcessLinkType === 'form-view-model') {
1110
+ this.completeTask();
1111
+ }
822
1112
  });
823
1113
  }
824
1114
  completeTask() {
825
1115
  this.task$.pipe(take(1)).subscribe(task => {
826
1116
  this.toastr.success(`${task.name} ${this.translateService.instant('taskDetail.taskCompleted')}`);
827
- this.modal.hide();
1117
+ this.closeModal();
828
1118
  this.task$.next(null);
829
1119
  this.formSubmit.emit();
830
1120
  });
@@ -841,12 +1131,22 @@ class TaskDetailModalComponent {
841
1131
  case 'form':
842
1132
  this.taskProcessLinkType$.next('form');
843
1133
  this.processLinkId$.next(res.processLinkId);
1134
+ if (this.intermediateSaveEnabled)
1135
+ this.getCurrentProgress();
844
1136
  this.setFormDefinitionAndOpenModal(res.properties.prefilledForm);
845
1137
  break;
846
1138
  case 'form-flow':
847
1139
  this.taskProcessLinkType$.next('form-flow');
848
1140
  this.formFlowInstanceId$.next(res.properties.formFlowInstanceId);
849
1141
  break;
1142
+ case 'form-view-model':
1143
+ this.taskProcessLinkType$.next('form-view-model');
1144
+ this.processLinkId$.next(res.processLinkId);
1145
+ this.formDefinition$.next(res.properties.formDefinition);
1146
+ this.formName$.next(res.properties.formName);
1147
+ this.openModal();
1148
+ this.setFormViewModelComponent();
1149
+ break;
850
1150
  }
851
1151
  this.loading$.next(false);
852
1152
  }
@@ -863,7 +1163,7 @@ class TaskDetailModalComponent {
863
1163
  setFormDefinitionAndOpenModal(formDefinition) {
864
1164
  this.taskProcessLinkType$.next('form');
865
1165
  this.formDefinition$.next(formDefinition);
866
- this.modal.show();
1166
+ this.openModal();
867
1167
  }
868
1168
  setDocumentDefinitionNameInService(task) {
869
1169
  this.documentService
@@ -874,13 +1174,108 @@ class TaskDetailModalComponent {
874
1174
  this.stateService.setDocumentDefinitionName(documentDefinitionName);
875
1175
  });
876
1176
  }
877
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskDetailModalComponent, deps: [{ token: i1$1.ToastrService }, { token: i2$1.ProcessLinkService }, { token: i3.Router }, { token: TaskService }, { token: i5.UserProviderService }, { token: i6.ValtimoModalService }, { token: i6.FormIoStateService }, { token: i7.DocumentService }, { token: i8.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
878
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", 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-2024 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 page: page$ | async,\n task: task$ | async,\n formDefinition: formDefinition$ | async,\n processLinkIsForm: processLinkIsForm$ | async,\n formioOptions: formioOptions$ | async,\n processLinkIsFormFlow: processLinkIsFormFlow$ | async,\n formFlowInstanceId: formFlowInstanceId$ | async,\n errorMessage: errorMessage$ | async\n } as obs\"\n elementId=\"taskDetailModal\"\n [title]=\"obs.page?.title\"\n [subtitle]=\"obs.page?.subtitle\"\n [templateBelowSubtitle]=\"assignUserToTask\"\n>\n <div body *ngIf=\"obs.formDefinition && obs.processLinkIsForm\">\n <valtimo-form-io\n #form\n [form]=\"obs.formDefinition\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n [options]=\"obs.formioOptions\"\n ></valtimo-form-io>\n </div>\n <div body *ngIf=\"obs.processLinkIsFormFlow\">\n <valtimo-form-flow\n #formFlow\n [formIoFormData]=\"formIoFormData$\"\n [formFlowInstanceId]=\"obs.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\n body\n *ngIf=\"\n obs.loading === false && !obs.formDefinition && !obs.formFlowInstanceId && !obs.errorMessage\n \"\n >\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=\"obs.errorMessage\">\n <div class=\"bg-danger text-black mb-0 p-3 text-center\">\n {{ obs.errorMessage }}\n </div>\n </div>\n <div footer>\n <div class=\"mb-0 p-3 text-center\" *ngIf=\"!!obs.formDefinition\">\n <button\n class=\"btn btn-secondary btn-space\"\n type=\"button\"\n (click)=\"gotoProcessLinkScreen()\"\n id=\"process-link-button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n\n<ng-template #assignUserToTask>\n <ng-container *ngIf=\"task$ | async as task\">\n <valtimo-assign-user-to-task\n *ngIf=\"task && assignmentOfTaskChanged\"\n [taskId]=\"task.id\"\n [assigneeId]=\"task.assignee\"\n (assignmentOfTaskChanged)=\"assignmentOfTaskChanged.emit()\"\n ></valtimo-assign-user-to-task>\n </ng-container>\n</ng-template>\n", styles: ["#taskDetailModal .formio-component-submit{text-align:right}\n/*!\n * Copyright 2015-2024 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"], dependencies: [{ kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.FormioComponent, selector: "valtimo-form-io", inputs: ["options", "submission", "form", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i6.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "component", type: i2$1.FormFlowComponent, selector: "valtimo-form-flow", inputs: ["formIoFormData", "formFlowInstanceId"], outputs: ["formFlowComplete"] }, { kind: "component", type: AssignUserToTaskComponent, selector: "valtimo-assign-user-to-task", inputs: ["taskId", "assigneeId"], outputs: ["assignmentOfTaskChanged"] }, { kind: "pipe", type: i9.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
1177
+ setFormViewModelComponent() {
1178
+ this.formViewModelDynamicContainer.clear();
1179
+ if (!this.formViewModel)
1180
+ return;
1181
+ const formViewModelComponent = this.formViewModelDynamicContainer.createComponent(this.formViewModel.component);
1182
+ formViewModelComponent.instance.form = this.formDefinition$.getValue();
1183
+ formViewModelComponent.instance.formName = this.formName$.getValue();
1184
+ formViewModelComponent.instance.taskInstanceId = this.taskInstanceId$.getValue();
1185
+ formViewModelComponent.instance.isStartForm = false;
1186
+ formViewModelComponent.instance.formSubmit.pipe(take(1)).subscribe(() => {
1187
+ this.completeTask();
1188
+ this.closeModal();
1189
+ });
1190
+ if (this.intermediateSaveEnabled) {
1191
+ this._fvmSubmissionSubscription = formViewModelComponent.instance.submission$.subscribe(submission => {
1192
+ this.submission$.next(submission);
1193
+ });
1194
+ this._submissionSubscription = this.submission$
1195
+ .pipe(distinctUntilChanged())
1196
+ .subscribe((submission) => {
1197
+ if (submission?.data && Object.keys(submission.data).length === 0) {
1198
+ formViewModelComponent.instance.submission = { data: {} };
1199
+ }
1200
+ });
1201
+ this.getCurrentProgress(formViewModelComponent);
1202
+ }
1203
+ }
1204
+ getCurrentProgress(formViewModelComponentRef) {
1205
+ this.taskInstanceId$
1206
+ .pipe(take(1), switchMap$1((taskInstanceId) => this.taskIntermediateSaveService.getIntermediateSubmission(taskInstanceId)))
1207
+ .subscribe({
1208
+ next: (intermediateSubmission) => {
1209
+ this.submission$.next({ data: intermediateSubmission.submission });
1210
+ this.currentIntermediateSave = this.formatIntermediateSubmission(intermediateSubmission);
1211
+ if (formViewModelComponentRef) {
1212
+ formViewModelComponentRef.instance.submission = {
1213
+ data: intermediateSubmission.submission,
1214
+ };
1215
+ }
1216
+ },
1217
+ });
1218
+ }
1219
+ saveCurrentProgress() {
1220
+ const intermediateSaveRequest = {
1221
+ submission: this.submission$.getValue().data
1222
+ ? this.submission$.getValue().data
1223
+ : this.formIoFormData$.getValue(),
1224
+ taskInstanceId: this.taskInstanceId$.getValue(),
1225
+ };
1226
+ this.taskIntermediateSaveService
1227
+ .storeIntermediateSubmission(intermediateSaveRequest)
1228
+ .pipe(take(1))
1229
+ .subscribe({
1230
+ next: intermediateSubmission => {
1231
+ this.toastr.success(this.translateService.instant('formManagement.intermediateSave.success'));
1232
+ this.currentIntermediateSave = this.formatIntermediateSubmission(intermediateSubmission);
1233
+ },
1234
+ error: () => {
1235
+ this.toastr.error(this.translateService.instant('formManagement.intermediateSave.error'));
1236
+ },
1237
+ });
1238
+ }
1239
+ clearCurrentProgress() {
1240
+ this.taskInstanceId$
1241
+ .pipe(take(1), switchMap$1((taskInstanceId) => this.taskIntermediateSaveService.clearIntermediateSubmission(taskInstanceId)))
1242
+ .subscribe({
1243
+ next: () => {
1244
+ this.submission$.next({ data: {} });
1245
+ this.currentIntermediateSave = null;
1246
+ },
1247
+ });
1248
+ }
1249
+ formatIntermediateSubmission(intermediateSubmission) {
1250
+ intermediateSubmission.createdOn = moment(intermediateSubmission.createdOn).format('DD MMM YYYY HH:mm');
1251
+ if (intermediateSubmission.editedOn) {
1252
+ intermediateSubmission.editedOn = moment(new Date(intermediateSubmission.editedOn)).format('DD MMM YYYY HH:mm');
1253
+ }
1254
+ return intermediateSubmission;
1255
+ }
1256
+ openModal() {
1257
+ this.modal.open = true;
1258
+ }
1259
+ closeModal() {
1260
+ this.modal.open = false;
1261
+ this._fvmSubmissionSubscription?.unsubscribe();
1262
+ this._submissionSubscription?.unsubscribe();
1263
+ if (this.formFlow) {
1264
+ this.formFlow.saveData();
1265
+ }
1266
+ }
1267
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskDetailModalComponent, deps: [{ token: i1$2.ToastrService }, { token: i2$1.ProcessLinkService }, { token: i1$1.Router }, { token: TaskService }, { token: i5.UserProviderService }, { token: i6.ValtimoModalService }, { token: i6.FormIoStateService }, { token: i7.DocumentService }, { token: i8.TranslateService }, { token: FORM_VIEW_MODEL_TOKEN, optional: true }, { token: TaskIntermediateSaveService }, { token: i2.ConfigService }, { token: i11.IconService }], target: i0.ɵɵFactoryTarget.Component }); }
1268
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", 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 }, { propertyName: "formViewModelDynamicContainer", first: true, predicate: ["formViewModelComponent"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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<cds-modal #taskDetailModal id=\"taskDetailModal\">\n <cds-modal-header (closeSelect)=\"closeModal()\">\n <div class=\"cds-modal-header\">\n <div class=\"title-container\">\n <p class=\"cds--modal-header__heading cds--type-beta\">{{ (page$ | async)?.title }}</p>\n <p class=\"cds--modal-header__label cds--type-delta\">{{ (page$ | async)?.subtitle }}</p>\n <p class=\"cds--modal-header__label cds--type-delta\" *ngIf=\"currentIntermediateSave\">\n {{ 'formManagement.intermediateSave.lastSavedBy' | translate }}:\n {{\n currentIntermediateSave?.editedBy\n ? currentIntermediateSave?.editedBy\n : currentIntermediateSave.createdBy\n }}\n {{ 'formManagement.intermediateSave.on' | translate }}:\n {{\n currentIntermediateSave?.editedOn\n ? currentIntermediateSave?.editedOn\n : currentIntermediateSave.createdOn\n }}\n </p>\n <ng-container *ngTemplateOutlet=\"assignUserToTask\"></ng-container>\n </div>\n <div\n *ngIf=\"intermediateSaveEnabled && (formFlowInstanceId$ | async) === undefined\"\n class=\"save-buttons-margin\"\n >\n <cds-tooltip\n [caret]=\"true\"\n enterDelayMs=\"0\"\n leaveDelayMs=\"0\"\n [description]=\"'formManagement.intermediateSave.save' | translate\"\n >\n <button\n cdsButton=\"ghost\"\n iconOnly=\"true\"\n cdsIcon=\"save\"\n (click)=\"saveCurrentProgress()\"\n ></button>\n </cds-tooltip>\n <cds-tooltip\n [caret]=\"true\"\n enterDelayMs=\"0\"\n leaveDelayMs=\"0\"\n [description]=\"'formManagement.intermediateSave.clear' | translate\"\n >\n <button\n cdsButton=\"ghost\"\n iconOnly=\"true\"\n cdsIcon=\"recently-viewed\"\n [disabled]=\"!currentIntermediateSave\"\n (click)=\"showConfirmationModal$.next(true)\"\n ></button>\n </cds-tooltip>\n </div>\n </div>\n </cds-modal-header>\n <div\n body\n class=\"cds--modal-content pb-1\"\n *ngIf=\"{\n loading: loading$ | async,\n page: page$ | async,\n task: task$ | async,\n taskId: taskInstanceId$ | async,\n formDefinition: formDefinition$ | async,\n formDefinitionId: formDefinitionId$ | async,\n formName: formName$ | async,\n formIoFormData: formIoFormData$ | async,\n submission: submission$ | async,\n processLinkIsForm: processLinkIsForm$ | async,\n processLinkIsFormViewModel: processLinkIsFormViewModel$ | async,\n formioOptions: formioOptions$ | async,\n processLinkIsFormFlow: processLinkIsFormFlow$ | async,\n formFlowInstanceId: formFlowInstanceId$ | async,\n errorMessage: errorMessage$ | async\n } as obs\"\n >\n <div *ngIf=\"obs.formDefinition && obs.processLinkIsForm\">\n <valtimo-form-io\n #form\n [form]=\"obs.formDefinition\"\n [submission]=\"obs.submission\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n [options]=\"obs.formioOptions\"\n ></valtimo-form-io>\n </div>\n <div *ngIf=\"obs.processLinkIsFormFlow\">\n <valtimo-form-flow\n #formFlow\n [formIoFormData]=\"formIoFormData$\"\n [formFlowInstanceId]=\"obs.formFlowInstanceId\"\n (formFlowComplete)=\"completeTask()\"\n ></valtimo-form-flow>\n </div>\n <div *ngIf=\"obs.loading\">\n <div class=\"text-black mb-0 p-3 text-center\">\n {{ 'formManagement.loading' | translate }}\n </div>\n </div>\n <div\n *ngIf=\"\n obs.loading === false && !obs.formDefinition && !obs.formFlowInstanceId && !obs.errorMessage\n \"\n >\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 *ngIf=\"obs.errorMessage\">\n <div class=\"bg-danger text-black mb-0 p-3 text-center\">\n {{ obs.errorMessage }}\n </div>\n </div>\n </div>\n <div\n footer\n *ngIf=\"{\n formDefinition: formDefinition$ | async,\n formFlowInstanceId: formFlowInstanceId$ | async\n } as obs\"\n >\n <div class=\"mb-0 p-3 text-center\" *ngIf=\"!obs.formDefinition && !obs.formFlowInstanceId\">\n <button\n class=\"btn btn-secondary btn-space\"\n type=\"button\"\n (click)=\"gotoProcessLinkScreen()\"\n id=\"process-link-button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | translate }}\n </button>\n </div>\n </div>\n <div body class=\"m-2\">\n <ng-template #formViewModelComponent></ng-template>\n </div>\n</cds-modal>\n\n<valtimo-confirmation-modal\n [showModalSubject$]=\"showConfirmationModal$\"\n (confirmEvent)=\"clearCurrentProgress()\"\n (cancelEvent)=\"showConfirmationModal$.next(false)\"\n cancelButtonType=\"ghost\"\n confirmButtonTextTranslationKey=\"interface.confirm\"\n titleTranslationKey=\"formManagement.intermediateSave.clear\"\n contentTranslationKey=\"formManagement.intermediateSave.clearConfirm\"\n></valtimo-confirmation-modal>\n\n<ng-template #assignUserToTask>\n <ng-container *ngIf=\"task$ | async as task\">\n <valtimo-assign-user-to-task\n *ngIf=\"task && assignmentOfTaskChanged\"\n [taskId]=\"task.id\"\n [assigneeId]=\"task.assignee\"\n (assignmentOfTaskChanged)=\"assignmentOfTaskChanged.emit()\"\n ></valtimo-assign-user-to-task>\n </ng-container>\n</ng-template>\n", styles: ["#taskDetailModal .formio-component-submit{text-align:right}.cds-modal-header{width:100%;display:flex;justify-content:space-between}.title-container{width:50%}.save-buttons-margin{margin-top:-15px}\n/*!\n * Copyright 2015-2024 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"], dependencies: [{ kind: "directive", type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i10.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i6.FormioComponent, selector: "valtimo-form-io", inputs: ["options", "submission", "form", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i11.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i11.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i2$1.FormFlowComponent, selector: "valtimo-form-flow", inputs: ["formIoFormData", "formFlowInstanceId"], outputs: ["formFlowComplete"] }, { kind: "directive", type: i11.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i11.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i11.Tooltip, selector: "cds-tooltip, ibm-tooltip", inputs: ["id", "enterDelayMs", "leaveDelayMs", "disabled", "description"] }, { kind: "component", type: i6.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }, { kind: "component", type: AssignUserToTaskComponent, selector: "valtimo-assign-user-to-task", inputs: ["taskId", "assigneeId"], outputs: ["assignmentOfTaskChanged"] }, { kind: "pipe", type: i10.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
879
1269
  }
880
1270
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskDetailModalComponent, decorators: [{
881
1271
  type: Component,
882
- args: [{ selector: 'valtimo-task-detail-modal', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2024 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 page: page$ | async,\n task: task$ | async,\n formDefinition: formDefinition$ | async,\n processLinkIsForm: processLinkIsForm$ | async,\n formioOptions: formioOptions$ | async,\n processLinkIsFormFlow: processLinkIsFormFlow$ | async,\n formFlowInstanceId: formFlowInstanceId$ | async,\n errorMessage: errorMessage$ | async\n } as obs\"\n elementId=\"taskDetailModal\"\n [title]=\"obs.page?.title\"\n [subtitle]=\"obs.page?.subtitle\"\n [templateBelowSubtitle]=\"assignUserToTask\"\n>\n <div body *ngIf=\"obs.formDefinition && obs.processLinkIsForm\">\n <valtimo-form-io\n #form\n [form]=\"obs.formDefinition\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n [options]=\"obs.formioOptions\"\n ></valtimo-form-io>\n </div>\n <div body *ngIf=\"obs.processLinkIsFormFlow\">\n <valtimo-form-flow\n #formFlow\n [formIoFormData]=\"formIoFormData$\"\n [formFlowInstanceId]=\"obs.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\n body\n *ngIf=\"\n obs.loading === false && !obs.formDefinition && !obs.formFlowInstanceId && !obs.errorMessage\n \"\n >\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=\"obs.errorMessage\">\n <div class=\"bg-danger text-black mb-0 p-3 text-center\">\n {{ obs.errorMessage }}\n </div>\n </div>\n <div footer>\n <div class=\"mb-0 p-3 text-center\" *ngIf=\"!!obs.formDefinition\">\n <button\n class=\"btn btn-secondary btn-space\"\n type=\"button\"\n (click)=\"gotoProcessLinkScreen()\"\n id=\"process-link-button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n\n<ng-template #assignUserToTask>\n <ng-container *ngIf=\"task$ | async as task\">\n <valtimo-assign-user-to-task\n *ngIf=\"task && assignmentOfTaskChanged\"\n [taskId]=\"task.id\"\n [assigneeId]=\"task.assignee\"\n (assignmentOfTaskChanged)=\"assignmentOfTaskChanged.emit()\"\n ></valtimo-assign-user-to-task>\n </ng-container>\n</ng-template>\n", styles: ["#taskDetailModal .formio-component-submit{text-align:right}\n/*!\n * Copyright 2015-2024 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"] }]
883
- }], ctorParameters: () => [{ type: i1$1.ToastrService }, { type: i2$1.ProcessLinkService }, { type: i3.Router }, { type: TaskService }, { type: i5.UserProviderService }, { type: i6.ValtimoModalService }, { type: i6.FormIoStateService }, { type: i7.DocumentService }, { type: i8.TranslateService }], propDecorators: { form: [{
1272
+ args: [{ selector: 'valtimo-task-detail-modal', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2024 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<cds-modal #taskDetailModal id=\"taskDetailModal\">\n <cds-modal-header (closeSelect)=\"closeModal()\">\n <div class=\"cds-modal-header\">\n <div class=\"title-container\">\n <p class=\"cds--modal-header__heading cds--type-beta\">{{ (page$ | async)?.title }}</p>\n <p class=\"cds--modal-header__label cds--type-delta\">{{ (page$ | async)?.subtitle }}</p>\n <p class=\"cds--modal-header__label cds--type-delta\" *ngIf=\"currentIntermediateSave\">\n {{ 'formManagement.intermediateSave.lastSavedBy' | translate }}:\n {{\n currentIntermediateSave?.editedBy\n ? currentIntermediateSave?.editedBy\n : currentIntermediateSave.createdBy\n }}\n {{ 'formManagement.intermediateSave.on' | translate }}:\n {{\n currentIntermediateSave?.editedOn\n ? currentIntermediateSave?.editedOn\n : currentIntermediateSave.createdOn\n }}\n </p>\n <ng-container *ngTemplateOutlet=\"assignUserToTask\"></ng-container>\n </div>\n <div\n *ngIf=\"intermediateSaveEnabled && (formFlowInstanceId$ | async) === undefined\"\n class=\"save-buttons-margin\"\n >\n <cds-tooltip\n [caret]=\"true\"\n enterDelayMs=\"0\"\n leaveDelayMs=\"0\"\n [description]=\"'formManagement.intermediateSave.save' | translate\"\n >\n <button\n cdsButton=\"ghost\"\n iconOnly=\"true\"\n cdsIcon=\"save\"\n (click)=\"saveCurrentProgress()\"\n ></button>\n </cds-tooltip>\n <cds-tooltip\n [caret]=\"true\"\n enterDelayMs=\"0\"\n leaveDelayMs=\"0\"\n [description]=\"'formManagement.intermediateSave.clear' | translate\"\n >\n <button\n cdsButton=\"ghost\"\n iconOnly=\"true\"\n cdsIcon=\"recently-viewed\"\n [disabled]=\"!currentIntermediateSave\"\n (click)=\"showConfirmationModal$.next(true)\"\n ></button>\n </cds-tooltip>\n </div>\n </div>\n </cds-modal-header>\n <div\n body\n class=\"cds--modal-content pb-1\"\n *ngIf=\"{\n loading: loading$ | async,\n page: page$ | async,\n task: task$ | async,\n taskId: taskInstanceId$ | async,\n formDefinition: formDefinition$ | async,\n formDefinitionId: formDefinitionId$ | async,\n formName: formName$ | async,\n formIoFormData: formIoFormData$ | async,\n submission: submission$ | async,\n processLinkIsForm: processLinkIsForm$ | async,\n processLinkIsFormViewModel: processLinkIsFormViewModel$ | async,\n formioOptions: formioOptions$ | async,\n processLinkIsFormFlow: processLinkIsFormFlow$ | async,\n formFlowInstanceId: formFlowInstanceId$ | async,\n errorMessage: errorMessage$ | async\n } as obs\"\n >\n <div *ngIf=\"obs.formDefinition && obs.processLinkIsForm\">\n <valtimo-form-io\n #form\n [form]=\"obs.formDefinition\"\n [submission]=\"obs.submission\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n [options]=\"obs.formioOptions\"\n ></valtimo-form-io>\n </div>\n <div *ngIf=\"obs.processLinkIsFormFlow\">\n <valtimo-form-flow\n #formFlow\n [formIoFormData]=\"formIoFormData$\"\n [formFlowInstanceId]=\"obs.formFlowInstanceId\"\n (formFlowComplete)=\"completeTask()\"\n ></valtimo-form-flow>\n </div>\n <div *ngIf=\"obs.loading\">\n <div class=\"text-black mb-0 p-3 text-center\">\n {{ 'formManagement.loading' | translate }}\n </div>\n </div>\n <div\n *ngIf=\"\n obs.loading === false && !obs.formDefinition && !obs.formFlowInstanceId && !obs.errorMessage\n \"\n >\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 *ngIf=\"obs.errorMessage\">\n <div class=\"bg-danger text-black mb-0 p-3 text-center\">\n {{ obs.errorMessage }}\n </div>\n </div>\n </div>\n <div\n footer\n *ngIf=\"{\n formDefinition: formDefinition$ | async,\n formFlowInstanceId: formFlowInstanceId$ | async\n } as obs\"\n >\n <div class=\"mb-0 p-3 text-center\" *ngIf=\"!obs.formDefinition && !obs.formFlowInstanceId\">\n <button\n class=\"btn btn-secondary btn-space\"\n type=\"button\"\n (click)=\"gotoProcessLinkScreen()\"\n id=\"process-link-button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | translate }}\n </button>\n </div>\n </div>\n <div body class=\"m-2\">\n <ng-template #formViewModelComponent></ng-template>\n </div>\n</cds-modal>\n\n<valtimo-confirmation-modal\n [showModalSubject$]=\"showConfirmationModal$\"\n (confirmEvent)=\"clearCurrentProgress()\"\n (cancelEvent)=\"showConfirmationModal$.next(false)\"\n cancelButtonType=\"ghost\"\n confirmButtonTextTranslationKey=\"interface.confirm\"\n titleTranslationKey=\"formManagement.intermediateSave.clear\"\n contentTranslationKey=\"formManagement.intermediateSave.clearConfirm\"\n></valtimo-confirmation-modal>\n\n<ng-template #assignUserToTask>\n <ng-container *ngIf=\"task$ | async as task\">\n <valtimo-assign-user-to-task\n *ngIf=\"task && assignmentOfTaskChanged\"\n [taskId]=\"task.id\"\n [assigneeId]=\"task.assignee\"\n (assignmentOfTaskChanged)=\"assignmentOfTaskChanged.emit()\"\n ></valtimo-assign-user-to-task>\n </ng-container>\n</ng-template>\n", styles: ["#taskDetailModal .formio-component-submit{text-align:right}.cds-modal-header{width:100%;display:flex;justify-content:space-between}.title-container{width:50%}.save-buttons-margin{margin-top:-15px}\n/*!\n * Copyright 2015-2024 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"] }]
1273
+ }], ctorParameters: () => [{ type: i1$2.ToastrService }, { type: i2$1.ProcessLinkService }, { type: i1$1.Router }, { type: TaskService }, { type: i5.UserProviderService }, { type: i6.ValtimoModalService }, { type: i6.FormIoStateService }, { type: i7.DocumentService }, { type: i8.TranslateService }, { type: undefined, decorators: [{
1274
+ type: Optional
1275
+ }, {
1276
+ type: Inject,
1277
+ args: [FORM_VIEW_MODEL_TOKEN]
1278
+ }] }, { type: TaskIntermediateSaveService }, { type: i2.ConfigService }, { type: i11.IconService }], propDecorators: { form: [{
884
1279
  type: ViewChild,
885
1280
  args: ['form']
886
1281
  }], formFlow: [{
@@ -889,6 +1284,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
889
1284
  }], modal: [{
890
1285
  type: ViewChild,
891
1286
  args: ['taskDetailModal']
1287
+ }], formViewModelDynamicContainer: [{
1288
+ type: ViewChild,
1289
+ args: ['formViewModelComponent', { static: true, read: ViewContainerRef }]
892
1290
  }], formSubmit: [{
893
1291
  type: Output
894
1292
  }], assignmentOfTaskChanged: [{
@@ -933,6 +1331,43 @@ const CAN_VIEW_CASE_PERMISSION = {
933
1331
  resource: TASK_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
934
1332
  };
935
1333
 
1334
+ /*
1335
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1336
+ *
1337
+ * Licensed under EUPL, Version 1.2 (the "License");
1338
+ * you may not use this file except in compliance with the License.
1339
+ * You may obtain a copy of the License at
1340
+ *
1341
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1342
+ *
1343
+ * Unless required by applicable law or agreed to in writing, software
1344
+ * distributed under the License is distributed on an "AS IS" basis,
1345
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1346
+ * See the License for the specific language governing permissions and
1347
+ * limitations under the License.
1348
+ */
1349
+ const TASK_LIST_NO_SEARCH_RESULTS_MESSAGE = {
1350
+ description: 'task-list.noSearchResultsDescription',
1351
+ isSearchResult: true,
1352
+ title: 'task-list.noSearchResultsTitle',
1353
+ };
1354
+
1355
+ /*
1356
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
1357
+ *
1358
+ * Licensed under EUPL, Version 1.2 (the "License");
1359
+ * you may not use this file except in compliance with the License.
1360
+ * You may obtain a copy of the License at
1361
+ *
1362
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1363
+ *
1364
+ * Unless required by applicable law or agreed to in writing, software
1365
+ * distributed under the License is distributed on an "AS IS" basis,
1366
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1367
+ * See the License for the specific language governing permissions and
1368
+ * limitations under the License.
1369
+ */
1370
+
936
1371
  /*
937
1372
  * Copyright 2015-2024 Ritense BV, the Netherlands.
938
1373
  *
@@ -950,7 +1385,12 @@ const CAN_VIEW_CASE_PERMISSION = {
950
1385
  */
951
1386
  moment.locale(localStorage.getItem('langKey') || '');
952
1387
  class TaskListComponent {
953
- constructor(configService, documentService, permissionService, router, taskService, taskListService, translateService, taskListColumnService, taskListPaginationService, taskListSortService) {
1388
+ onPopState() {
1389
+ setTimeout(() => {
1390
+ this.setParamsFromQueryParams();
1391
+ });
1392
+ }
1393
+ constructor(configService, documentService, permissionService, router, taskService, taskListService, translateService, taskListColumnService, taskListPaginationService, taskListSortService, taskListSearchService, taskListQueryParamService, pageTitleService) {
954
1394
  this.configService = configService;
955
1395
  this.documentService = documentService;
956
1396
  this.permissionService = permissionService;
@@ -961,7 +1401,20 @@ class TaskListComponent {
961
1401
  this.taskListColumnService = taskListColumnService;
962
1402
  this.taskListPaginationService = taskListPaginationService;
963
1403
  this.taskListSortService = taskListSortService;
1404
+ this.taskListSearchService = taskListSearchService;
1405
+ this.taskListQueryParamService = taskListQueryParamService;
1406
+ this.pageTitleService = pageTitleService;
1407
+ this.ALL_CASES_ID = this.taskListService.ALL_CASES_ID;
964
1408
  this.selectedTaskType$ = this.taskListService.selectedTaskType$;
1409
+ this._overrideNoResultsMessage$ = new BehaviorSubject(null);
1410
+ this.noResultsMessage$ = combineLatest([
1411
+ this.selectedTaskType$,
1412
+ this._overrideNoResultsMessage$,
1413
+ ]).pipe(map(([selectedTaskType, overrideNoResultsMessage]) => overrideNoResultsMessage || {
1414
+ title: 'task-list.' + selectedTaskType + '.noResultsDescription',
1415
+ description: 'task-list.' + selectedTaskType + '.noResultsTitle',
1416
+ isSearchResult: false,
1417
+ }));
965
1418
  this.fields$ = this.taskListColumnService.fields$;
966
1419
  this.loadingTasks$ = new BehaviorSubject(true);
967
1420
  this.visibleTabs$ = new BehaviorSubject(null);
@@ -969,20 +1422,25 @@ class TaskListComponent {
969
1422
  this.cachedTasks$ = new BehaviorSubject(null);
970
1423
  this.paginationForCurrentTaskTypeForList$ = this.taskListPaginationService.paginationForCurrentTaskTypeForList$;
971
1424
  this.sortStateForCurrentTaskType$ = this.taskListSortService.sortStateForCurrentTaskType$;
1425
+ this.overrideSortState$ = this.taskListSortService.overrideSortState$;
972
1426
  this._reload$ = new BehaviorSubject(true);
1427
+ this.caseDefinitionName$ = this.taskListService.caseDefinitionName$;
973
1428
  this.tasks$ = combineLatest([
974
1429
  this.taskListService.loadingStateForCaseDefinition$,
975
1430
  this.selectedTaskType$,
976
1431
  this.taskListPaginationService.paginationForCurrentTaskType$,
977
1432
  this.taskListSortService.sortStringForCurrentTaskType$,
978
- this.taskListService.caseDefinitionName$,
1433
+ this.caseDefinitionName$,
979
1434
  this._enableLoadingAnimation$,
980
1435
  this._reload$,
981
- ]).pipe(filter$1(([loadingStateForCaseDefinition]) => loadingStateForCaseDefinition === false), map(([_, selectedTaskType, paginationForSelectedTaskType, sortStringForSelectedTaskType, caseDefinitionName, enableLoadingAnimation, reload,]) => this.getTaskListParams(paginationForSelectedTaskType, sortStringForSelectedTaskType, selectedTaskType, caseDefinitionName, enableLoadingAnimation, reload)), distinctUntilChanged$1((previous, current) => isEqual(previous.params, current.params)), tap(({ enableLoadingAnimation }) => {
982
- if (enableLoadingAnimation)
1436
+ this.taskListSearchService.otherFilters$,
1437
+ this.taskListSortService.overrideSortStateString$,
1438
+ ]).pipe(filter$1(([loadingStateForCaseDefinition]) => loadingStateForCaseDefinition === false), map(([_, selectedTaskType, paginationForSelectedTaskType, sortStringForSelectedTaskType, caseDefinitionName, enableLoadingAnimation, reload, otherFilters, overrideSortStateString,]) => this.getTaskListParams(paginationForSelectedTaskType, overrideSortStateString || sortStringForSelectedTaskType, selectedTaskType, caseDefinitionName, enableLoadingAnimation, reload, otherFilters)), distinctUntilChanged((previous, current) => isEqual(previous.params, current.params)), tap(params => {
1439
+ if (params.enableLoadingAnimation)
983
1440
  this.loadingTasks$.next(true);
1441
+ this.taskListQueryParamService.setTaskListParams(params.params);
984
1442
  }), switchMap(({ params }) => combineLatest([
985
- this.taskService.queryTasksPageV3(params.selectedTaskType, params.params, params.caseDefinitionName),
1443
+ this.taskService.queryTasksPageV3(params.selectedTaskType, params.params, params.caseDefinitionName, params.otherFilters),
986
1444
  of(!!params.caseDefinitionName),
987
1445
  ])), switchMap(([tasksResult, isSpecified]) => this.getTaskListPermissionsRequest(tasksResult, isSpecified)), map(([isSpecified, taskResult, canViewTaskPermissions, canViewCasePermissions]) => {
988
1446
  this.updateTaskListPaginationAfterResponse(Number(taskResult.totalElements));
@@ -991,9 +1449,12 @@ class TaskListComponent {
991
1449
  this.cachedTasks$.next(tasks);
992
1450
  this.loadingTasks$.next(false);
993
1451
  this.disableLoadingAnimation();
1452
+ this.taskListSearchService.otherFilters$.pipe(take(1)).subscribe(otherFilters => {
1453
+ this._overrideNoResultsMessage$.next(otherFilters?.length > 0 ? TASK_LIST_NO_SEARCH_RESULTS_MESSAGE : null);
1454
+ });
994
1455
  }));
995
1456
  this.loadingCaseListItems$ = new BehaviorSubject(true);
996
- this._selectedCaseDefinitionId$ = new BehaviorSubject(this.taskListService.ALL_CASES_ID);
1457
+ this._selectedCaseDefinitionId$ = new BehaviorSubject(this.ALL_CASES_ID);
997
1458
  this.caseListItems$ = combineLatest([
998
1459
  this.documentService.getAllDefinitions(),
999
1460
  this._selectedCaseDefinitionId$,
@@ -1001,8 +1462,8 @@ class TaskListComponent {
1001
1462
  ]).pipe(map(([documentDefinitionRes, selectedCaseDefinitionId]) => [
1002
1463
  {
1003
1464
  content: this.translateService.instant('task-list.allCases'),
1004
- id: this.taskListService.ALL_CASES_ID,
1005
- selected: selectedCaseDefinitionId === this.taskListService.ALL_CASES_ID,
1465
+ id: this.ALL_CASES_ID,
1466
+ selected: selectedCaseDefinitionId === this.ALL_CASES_ID,
1006
1467
  },
1007
1468
  ...documentDefinitionRes.content.map(documentDefinition => ({
1008
1469
  id: documentDefinition.id.name,
@@ -1011,15 +1472,24 @@ class TaskListComponent {
1011
1472
  })),
1012
1473
  ]), tap(() => this.loadingCaseListItems$.next(false)));
1013
1474
  this.taskListColumnsForCase$ = this.taskListColumnService.taskListColumnsForCase$;
1475
+ this.loadingSearchFields$ = this.taskListSearchService.loadingSearchFields$;
1476
+ this.searchFields$ = this.taskListSearchService.searchFields$;
1014
1477
  this._DEFAULT_TASK_LIST_TABS = [
1015
1478
  TaskListTab.MINE,
1016
1479
  TaskListTab.OPEN,
1017
1480
  TaskListTab.ALL,
1018
1481
  ];
1482
+ this.setSearchFieldValuesSubject$ = new BehaviorSubject({});
1483
+ this.clearSearchFieldValuesSubject$ = new Subject();
1019
1484
  }
1020
1485
  ngOnInit() {
1021
1486
  this.taskListColumnService.resetTaskListFields();
1022
1487
  this.setVisibleTabs();
1488
+ this.pageTitleService.disableReset();
1489
+ this.setParamsFromQueryParams();
1490
+ }
1491
+ ngOnDestroy() {
1492
+ this.pageTitleService.enableReset();
1023
1493
  }
1024
1494
  paginationClicked(page, type) {
1025
1495
  this.taskListPaginationService.updateTaskPagination(type, { page: page - 1 });
@@ -1066,10 +1536,12 @@ class TaskListComponent {
1066
1536
  return !task.endTime && !task.locked ? this._taskDetail.openTaskDetails(task) : false;
1067
1537
  }
1068
1538
  sortChanged(sortState) {
1539
+ this.taskListSortService.setOverrideSortState(sortState);
1069
1540
  this.taskListSortService.updateSortState(this.taskListService.selectedTaskType, sortState);
1070
1541
  }
1071
1542
  setCaseDefinition(definition) {
1072
1543
  if (definition.item.id) {
1544
+ this.taskListSortService.resetOverrideSortState();
1073
1545
  this.loadingTasks$.next(true);
1074
1546
  this.taskListService.setCaseDefinitionName(definition.item.id);
1075
1547
  }
@@ -1078,6 +1550,11 @@ class TaskListComponent {
1078
1550
  this.enableLoadingAnimation();
1079
1551
  this._reload$.next(!this._reload$.getValue());
1080
1552
  }
1553
+ search(searchFieldValues) {
1554
+ if (!searchFieldValues)
1555
+ return;
1556
+ this.taskListSearchService.setSearchFieldValues(searchFieldValues);
1557
+ }
1081
1558
  updateTaskListPaginationAfterResponse(newCollectionSize) {
1082
1559
  this.taskListPaginationService.paginationForCurrentTaskType$
1083
1560
  .pipe(take(1))
@@ -1105,7 +1582,7 @@ class TaskListComponent {
1105
1582
  enableLoadingAnimation() {
1106
1583
  this._enableLoadingAnimation$.next(true);
1107
1584
  }
1108
- getTaskListParams(paginationForSelectedTaskType, sortStringForSelectedTaskType, selectedTaskType, caseDefinitionName, enableLoadingAnimation, reload) {
1585
+ getTaskListParams(paginationForSelectedTaskType, sortStringForSelectedTaskType, selectedTaskType, caseDefinitionName, enableLoadingAnimation, reload, otherFilters) {
1109
1586
  const params = {
1110
1587
  ...paginationForSelectedTaskType,
1111
1588
  ...(sortStringForSelectedTaskType && { sort: sortStringForSelectedTaskType }),
@@ -1116,8 +1593,8 @@ class TaskListComponent {
1116
1593
  reload,
1117
1594
  selectedTaskType,
1118
1595
  params,
1119
- ...(caseDefinitionName &&
1120
- caseDefinitionName !== this.taskListService.ALL_CASES_ID && { caseDefinitionName }),
1596
+ ...(caseDefinitionName && caseDefinitionName !== this.ALL_CASES_ID && { caseDefinitionName }),
1597
+ ...(otherFilters && { otherFilters }),
1121
1598
  },
1122
1599
  enableLoadingAnimation,
1123
1600
  };
@@ -1176,13 +1653,38 @@ class TaskListComponent {
1176
1653
  return taskCopy;
1177
1654
  });
1178
1655
  }
1179
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskListComponent, deps: [{ token: i2.ConfigService }, { token: i7.DocumentService }, { token: i3$1.PermissionService }, { token: i3.Router }, { token: TaskService }, { token: TaskListService }, { token: i8.TranslateService }, { token: TaskListColumnService }, { token: TaskListPaginationService }, { token: TaskListSortService }], target: i0.ɵɵFactoryTarget.Component }); }
1180
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: TaskListComponent, selector: "valtimo-task-list", providers: [
1656
+ setParamsFromQueryParams() {
1657
+ const decodedParams = this.taskListQueryParamService.getTaskListQueryParams();
1658
+ if (decodedParams.caseDefinitionName) {
1659
+ this.taskListService.setCaseDefinitionName(decodedParams.caseDefinitionName);
1660
+ this._selectedCaseDefinitionId$.next(decodedParams.caseDefinitionName);
1661
+ }
1662
+ if (decodedParams.otherFilters?.length > 0) {
1663
+ const searchFieldValues = this.taskListSearchService.mapOtherFilterToSearchValues(decodedParams.otherFilters);
1664
+ this.setSearchFieldValuesSubject$.next(searchFieldValues);
1665
+ }
1666
+ else {
1667
+ this.clearSearchFieldValuesSubject$.next(null);
1668
+ }
1669
+ if (decodedParams.selectedTaskType)
1670
+ this.taskListService.setSelectedTaskType(decodedParams.selectedTaskType);
1671
+ if (decodedParams.params?.sort) {
1672
+ const stateFromSortString = this.taskListSortService.getSortStateFromSortString(decodedParams.params.sort);
1673
+ if (stateFromSortString)
1674
+ this.taskListSortService.setOverrideSortState(stateFromSortString);
1675
+ }
1676
+ if (decodedParams.params)
1677
+ this.taskListPaginationService.updateTaskPagination(this.taskListService.selectedTaskType, decodedParams.params);
1678
+ }
1679
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskListComponent, deps: [{ token: i2.ConfigService }, { token: i7.DocumentService }, { token: i3.PermissionService }, { token: i1$1.Router }, { token: TaskService }, { token: TaskListService }, { token: i8.TranslateService }, { token: TaskListColumnService }, { token: TaskListPaginationService }, { token: TaskListSortService }, { token: TaskListSearchService }, { token: TaskListQueryParamService }, { token: i6.PageTitleService }], target: i0.ɵɵFactoryTarget.Component }); }
1680
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.3", type: TaskListComponent, selector: "valtimo-task-list", host: { listeners: { "window:popstate": "onPopState($event)" } }, providers: [
1181
1681
  TaskListService,
1182
1682
  TaskListColumnService,
1183
1683
  TaskListPaginationService,
1184
1684
  TaskListSortService,
1185
- ], viewQueries: [{ propertyName: "_taskDetail", first: true, predicate: ["taskDetail"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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 *ngIf=\"{\n loading: loadingTasks$ | async,\n selectedTaskType: selectedTaskType$ | async,\n tasks: tasks$ | async,\n fields: fields$ | async,\n visibleTabs: visibleTabs$ | async,\n pagination: paginationForCurrentTaskTypeForList$ | async,\n taskListColumnsForCase: taskListColumnsForCase$ | async,\n sortState: sortStateForCurrentTaskType$ | async\n } as obs\"\n class=\"main-content\"\n>\n <div class=\"container-fluid\">\n <ng-container\n *ngTemplateOutlet=\"\n tasksList;\n context: {\n obs: obs\n }\n \"\n ></ng-container>\n\n <ng-container\n *ngTemplateOutlet=\"\n tasksListLoading;\n context: {\n obs: obs\n }\n \"\n ></ng-container>\n\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"reload()\"\n (assignmentOfTaskChanged)=\"reload()\"\n ></valtimo-task-detail-modal>\n </div>\n</div>\n\n<ng-template #configuredTabs let-selectedTaskType=\"selectedTaskType\" let-visibleTabs=\"visibleTabs\">\n <cds-tabs *ngIf=\"visibleTabs\" 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]=\"selectedTaskType === tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n</ng-template>\n\n<ng-template #caseLink let-data=\"data\">\n <ng-container *ngIf=\"cachedTasks$ | async as cachedTasks\">\n <div *ngIf=\"cachedTasks[data.index].caseLocked\">\n <a\n class=\"float-left cds--link--disabled\"\n cdsLink\n href=\"javascript:void(0)\"\n ngbTooltip=\"{{ 'task-list.caseLocked' | translate }}\"\n (click)=\"$event.stopPropagation()\"\n >\n {{ 'task-list.goToCase' | translate }}\n </a>\n </div>\n <div *ngIf=\"!cachedTasks[data.index].caseLocked\">\n <a\n class=\"float-left cds--link\"\n cdsLink\n href=\"javascript:void(0)\"\n (click)=\"openRelatedCase($event, data.index)\"\n >\n {{ 'task-list.goToCase' | translate }}\n </a>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #tasksList let-obs=\"obs\">\n <valtimo-carbon-list\n *ngIf=\"!obs.loading\"\n [fields]=\"obs.fields\"\n [header]=\"false\"\n [items]=\"obs.tasks\"\n [lastColumnTemplate]=\"caseLink\"\n [pagination]=\"obs.pagination\"\n paginationIdentifier=\"taskList\"\n lockedTooltipTranslationKey=\"task-list.rowLocked\"\n [initialSortState]=\"obs.sortState\"\n (paginationClicked)=\"paginationClicked($event, obs.selectedTaskType)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"rowOpenTaskClick($event)\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <div tabs>\n <ng-container *ngIf=\"obs.visibleTabs\">\n <ng-container\n *ngTemplateOutlet=\"\n configuredTabs;\n context: {selectedTaskType: obs.selectedTaskType, visibleTabs: obs.visibleTabs}\n \"\n ></ng-container>\n </ng-container>\n </div>\n\n <valtimo-no-results\n [description]=\"'task-list.' + obs.selectedTaskType + '.noResultsDescription' | translate\"\n [title]=\"'task-list.' + obs.selectedTaskType + '.noResultsTitle' | translate\"\n >\n </valtimo-no-results>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #tasksListLoading let-obs=\"obs\">\n <valtimo-carbon-list *ngIf=\"obs.loading\" [loading]=\"true\">\n <div tabs>\n <cds-tabs *ngIf=\"!obs.visibleTabs\" type=\"contained\" class=\"valtimo-carbon-list__tabs\">\n <cds-tab\n [heading]=\"'task-list.mine.title' | translate\"\n [active]=\"obs.selectedTaskType === 'mine'\"\n >\n </cds-tab>\n\n <cds-tab\n [heading]=\"'task-list.open.title' | translate\"\n [active]=\"obs.selectedTaskType === 'open'\"\n >\n </cds-tab>\n\n <cds-tab\n [heading]=\"'task-list.all.title' | translate\"\n [active]=\"obs.selectedTaskType === 'all'\"\n >\n </cds-tab>\n </cds-tabs>\n\n <cds-tabs *ngIf=\"obs.visibleTabs\" type=\"contained\" class=\"valtimo-carbon-list__tabs\">\n <cds-tab\n *ngFor=\"let tab of obs.visibleTabs\"\n [heading]=\"'task-list.' + tab + '.title' | translate\"\n [active]=\"obs.selectedTaskType === tab\"\n ></cds-tab>\n </cds-tabs>\n </div>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <cds-dropdown\n class=\"case-definition-selection\"\n *ngIf=\"{\n loadingCaseListItems: loadingCaseListItems$ | async,\n caseListItems: caseListItems$ | async\n } as obs\"\n [disabled]=\"obs.loadingCaseListItems || (obs.caseListItems || []).length === 1\"\n [skeleton]=\"obs.loadingCaseListItems\"\n (selected)=\"setCaseDefinition($event)\"\n >\n <cds-dropdown-list\n [items]=\"obs.caseListItems || []\"\n ></cds-dropdown-list></cds-dropdown></ng-template\n></ng-container>\n", styles: [".cds--link--disabled{cursor:not-allowed;pointer-events:auto!important;outline:0!important}.case-definition-selection{display:flex;width:250px}\n/*!\n * Copyright 2015-2024 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"], dependencies: [{ kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i6.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "header", "hideColumnHeader", "initialSortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i6.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title"] }, { kind: "directive", type: i11.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { kind: "directive", type: i12.Link, selector: "[cdsLink], [ibmLink]", inputs: ["inline", "disabled"] }, { kind: "component", type: i12.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i12.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive"], outputs: ["selected"] }, { kind: "directive", type: i6.RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "component", type: i12.Dropdown, selector: "cds-dropdown, ibm-dropdown", inputs: ["id", "label", "helperText", "placeholder", "displayValue", "clearText", "size", "type", "theme", "disabled", "skeleton", "inline", "disableArrowKeys", "invalid", "invalidText", "warn", "warnText", "appendInline", "scrollableContainer", "itemValueKey", "selectionFeedback", "menuButtonLabel", "selectedLabel", "dropUp"], outputs: ["selected", "onClose", "close"] }, { kind: "component", type: i12.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "component", type: TaskDetailModalComponent, selector: "valtimo-task-detail-modal", outputs: ["formSubmit", "assignmentOfTaskChanged"] }, { kind: "pipe", type: i9.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1685
+ TaskListSearchService,
1686
+ TaskListQueryParamService,
1687
+ ], viewQueries: [{ propertyName: "_taskDetail", first: true, predicate: ["taskDetail"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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 *ngIf=\"{\n loading: loadingTasks$ | async,\n selectedTaskType: selectedTaskType$ | async,\n tasks: tasks$ | async,\n fields: fields$ | async,\n visibleTabs: visibleTabs$ | async,\n pagination: paginationForCurrentTaskTypeForList$ | async,\n taskListColumnsForCase: taskListColumnsForCase$ | async,\n sortState: sortStateForCurrentTaskType$ | async,\n overrideSortState: overrideSortState$ | async,\n searchFields: searchFields$ | async,\n loadingSearchFields: loadingSearchFields$ | async,\n caseDefinitionName: caseDefinitionName$ | async,\n noResultsMessage: noResultsMessage$ | async\n } as obs\"\n class=\"main-content\"\n>\n <div class=\"container-fluid\">\n @if (obs.caseDefinitionName && obs.caseDefinitionName !== ALL_CASES_ID) {\n <ng-container\n *ngTemplateOutlet=\"\n searchFields;\n context: {\n obs: obs\n }\n \"\n ></ng-container>\n }\n\n <ng-container\n *ngTemplateOutlet=\"\n tasksList;\n context: {\n obs: obs\n }\n \"\n ></ng-container>\n\n <ng-container\n *ngTemplateOutlet=\"\n tasksListLoading;\n context: {\n obs: obs\n }\n \"\n ></ng-container>\n\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"reload()\"\n (assignmentOfTaskChanged)=\"reload()\"\n ></valtimo-task-detail-modal>\n </div>\n</div>\n\n<ng-template #configuredTabs let-selectedTaskType=\"selectedTaskType\" let-visibleTabs=\"visibleTabs\">\n <cds-tabs *ngIf=\"visibleTabs\" 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]=\"selectedTaskType === tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n</ng-template>\n\n<ng-template #caseLink let-data=\"data\">\n <ng-container *ngIf=\"cachedTasks$ | async as cachedTasks\">\n <div *ngIf=\"cachedTasks[data.index].caseLocked\">\n <a\n class=\"float-left cds--link--disabled\"\n cdsLink\n href=\"javascript:void(0)\"\n ngbTooltip=\"{{ 'task-list.caseLocked' | translate }}\"\n (click)=\"$event.stopPropagation()\"\n >\n {{ 'task-list.goToCase' | translate }}\n </a>\n </div>\n <div *ngIf=\"!cachedTasks[data.index].caseLocked\">\n <a\n class=\"float-left cds--link\"\n cdsLink\n href=\"javascript:void(0)\"\n (click)=\"openRelatedCase($event, data.index)\"\n >\n {{ 'task-list.goToCase' | translate }}\n </a>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #tasksList let-obs=\"obs\">\n <valtimo-carbon-list\n *ngIf=\"!obs.loading\"\n [fields]=\"obs.fields\"\n [header]=\"false\"\n [items]=\"obs.tasks\"\n [lastColumnTemplate]=\"caseLink\"\n [pagination]=\"obs.pagination\"\n paginationIdentifier=\"taskList\"\n lockedTooltipTranslationKey=\"task-list.rowLocked\"\n [sortState]=\"obs.overrideSortState || obs.sortState\"\n (paginationClicked)=\"paginationClicked($event, obs.selectedTaskType)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"rowOpenTaskClick($event)\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <div tabs>\n <ng-container *ngIf=\"obs.visibleTabs\">\n <ng-container\n *ngTemplateOutlet=\"\n configuredTabs;\n context: {selectedTaskType: obs.selectedTaskType, visibleTabs: obs.visibleTabs}\n \"\n ></ng-container>\n </ng-container>\n </div>\n\n <valtimo-no-results\n [description]=\"obs.noResultsMessage.description | translate\"\n [title]=\"obs.noResultsMessage.title | translate\"\n >\n </valtimo-no-results>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #tasksListLoading let-obs=\"obs\">\n <valtimo-carbon-list *ngIf=\"obs.loading\" [loading]=\"true\">\n <div tabs>\n <cds-tabs *ngIf=\"!obs.visibleTabs\" type=\"contained\" class=\"valtimo-carbon-list__tabs\">\n <cds-tab\n [heading]=\"'task-list.mine.title' | translate\"\n [active]=\"obs.selectedTaskType === 'mine'\"\n >\n </cds-tab>\n\n <cds-tab\n [heading]=\"'task-list.open.title' | translate\"\n [active]=\"obs.selectedTaskType === 'open'\"\n >\n </cds-tab>\n\n <cds-tab\n [heading]=\"'task-list.all.title' | translate\"\n [active]=\"obs.selectedTaskType === 'all'\"\n >\n </cds-tab>\n </cds-tabs>\n\n <cds-tabs *ngIf=\"obs.visibleTabs\" type=\"contained\" class=\"valtimo-carbon-list__tabs\">\n <cds-tab\n *ngFor=\"let tab of obs.visibleTabs\"\n [heading]=\"'task-list.' + tab + '.title' | translate\"\n [active]=\"obs.selectedTaskType === tab\"\n ></cds-tab>\n </cds-tabs>\n </div>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #searchFields let-obs=\"obs\">\n <div class=\"mb-3\">\n <valtimo-search-fields\n [searchFields]=\"obs.searchFields\"\n [inputDisabled]=\"obs.loadingSearchFields\"\n [documentDefinitionName]=\"obs.caseDefinitionName\"\n [setValuesSubject$]=\"setSearchFieldValuesSubject$\"\n [clearValuesSubject$]=\"clearSearchFieldValuesSubject$\"\n (doSearch)=\"search($event)\"\n >\n </valtimo-search-fields>\n </div>\n</ng-template>\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <cds-dropdown\n class=\"case-definition-selection\"\n *ngIf=\"{\n loadingCaseListItems: loadingCaseListItems$ | async,\n caseListItems: caseListItems$ | async\n } as obs\"\n [disabled]=\"obs.loadingCaseListItems || (obs.caseListItems || []).length === 1\"\n [skeleton]=\"obs.loadingCaseListItems\"\n (selected)=\"setCaseDefinition($event)\"\n >\n <cds-dropdown-list [items]=\"obs.caseListItems || []\"></cds-dropdown-list>\n </cds-dropdown>\n </ng-template>\n</ng-container>\n", styles: [".cds--link--disabled{cursor:not-allowed;pointer-events:auto!important;outline:0!important}.case-definition-selection{display:flex;width:250px}\n/*!\n * Copyright 2015-2024 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"], dependencies: [{ kind: "directive", type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i10.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i6.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i6.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "directive", type: i11$1.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: "directive", type: i6.RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "component", type: i11.Dropdown, selector: "cds-dropdown, ibm-dropdown", inputs: ["id", "label", "helperText", "placeholder", "displayValue", "clearText", "size", "type", "theme", "disabled", "skeleton", "inline", "disableArrowKeys", "invalid", "invalidText", "warn", "warnText", "appendInline", "scrollableContainer", "itemValueKey", "selectionFeedback", "menuButtonLabel", "selectedLabel", "dropUp"], outputs: ["selected", "onClose", "close"] }, { kind: "component", type: i11.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "component", type: i6.SearchFieldsComponent, selector: "valtimo-search-fields", inputs: ["loading", "searchFields", "documentDefinitionName", "setValuesSubject$", "clearValuesSubject$", "defaultValues", "inputDisabled", "externalSearchField"], outputs: ["doSearch"] }, { kind: "component", type: TaskDetailModalComponent, selector: "valtimo-task-detail-modal", outputs: ["formSubmit", "assignmentOfTaskChanged"] }, { kind: "pipe", type: i10.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1186
1688
  }
1187
1689
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskListComponent, decorators: [{
1188
1690
  type: Component,
@@ -1191,10 +1693,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
1191
1693
  TaskListColumnService,
1192
1694
  TaskListPaginationService,
1193
1695
  TaskListSortService,
1194
- ], template: "<!--\n ~ Copyright 2015-2024 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 *ngIf=\"{\n loading: loadingTasks$ | async,\n selectedTaskType: selectedTaskType$ | async,\n tasks: tasks$ | async,\n fields: fields$ | async,\n visibleTabs: visibleTabs$ | async,\n pagination: paginationForCurrentTaskTypeForList$ | async,\n taskListColumnsForCase: taskListColumnsForCase$ | async,\n sortState: sortStateForCurrentTaskType$ | async\n } as obs\"\n class=\"main-content\"\n>\n <div class=\"container-fluid\">\n <ng-container\n *ngTemplateOutlet=\"\n tasksList;\n context: {\n obs: obs\n }\n \"\n ></ng-container>\n\n <ng-container\n *ngTemplateOutlet=\"\n tasksListLoading;\n context: {\n obs: obs\n }\n \"\n ></ng-container>\n\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"reload()\"\n (assignmentOfTaskChanged)=\"reload()\"\n ></valtimo-task-detail-modal>\n </div>\n</div>\n\n<ng-template #configuredTabs let-selectedTaskType=\"selectedTaskType\" let-visibleTabs=\"visibleTabs\">\n <cds-tabs *ngIf=\"visibleTabs\" 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]=\"selectedTaskType === tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n</ng-template>\n\n<ng-template #caseLink let-data=\"data\">\n <ng-container *ngIf=\"cachedTasks$ | async as cachedTasks\">\n <div *ngIf=\"cachedTasks[data.index].caseLocked\">\n <a\n class=\"float-left cds--link--disabled\"\n cdsLink\n href=\"javascript:void(0)\"\n ngbTooltip=\"{{ 'task-list.caseLocked' | translate }}\"\n (click)=\"$event.stopPropagation()\"\n >\n {{ 'task-list.goToCase' | translate }}\n </a>\n </div>\n <div *ngIf=\"!cachedTasks[data.index].caseLocked\">\n <a\n class=\"float-left cds--link\"\n cdsLink\n href=\"javascript:void(0)\"\n (click)=\"openRelatedCase($event, data.index)\"\n >\n {{ 'task-list.goToCase' | translate }}\n </a>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #tasksList let-obs=\"obs\">\n <valtimo-carbon-list\n *ngIf=\"!obs.loading\"\n [fields]=\"obs.fields\"\n [header]=\"false\"\n [items]=\"obs.tasks\"\n [lastColumnTemplate]=\"caseLink\"\n [pagination]=\"obs.pagination\"\n paginationIdentifier=\"taskList\"\n lockedTooltipTranslationKey=\"task-list.rowLocked\"\n [initialSortState]=\"obs.sortState\"\n (paginationClicked)=\"paginationClicked($event, obs.selectedTaskType)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"rowOpenTaskClick($event)\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <div tabs>\n <ng-container *ngIf=\"obs.visibleTabs\">\n <ng-container\n *ngTemplateOutlet=\"\n configuredTabs;\n context: {selectedTaskType: obs.selectedTaskType, visibleTabs: obs.visibleTabs}\n \"\n ></ng-container>\n </ng-container>\n </div>\n\n <valtimo-no-results\n [description]=\"'task-list.' + obs.selectedTaskType + '.noResultsDescription' | translate\"\n [title]=\"'task-list.' + obs.selectedTaskType + '.noResultsTitle' | translate\"\n >\n </valtimo-no-results>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #tasksListLoading let-obs=\"obs\">\n <valtimo-carbon-list *ngIf=\"obs.loading\" [loading]=\"true\">\n <div tabs>\n <cds-tabs *ngIf=\"!obs.visibleTabs\" type=\"contained\" class=\"valtimo-carbon-list__tabs\">\n <cds-tab\n [heading]=\"'task-list.mine.title' | translate\"\n [active]=\"obs.selectedTaskType === 'mine'\"\n >\n </cds-tab>\n\n <cds-tab\n [heading]=\"'task-list.open.title' | translate\"\n [active]=\"obs.selectedTaskType === 'open'\"\n >\n </cds-tab>\n\n <cds-tab\n [heading]=\"'task-list.all.title' | translate\"\n [active]=\"obs.selectedTaskType === 'all'\"\n >\n </cds-tab>\n </cds-tabs>\n\n <cds-tabs *ngIf=\"obs.visibleTabs\" type=\"contained\" class=\"valtimo-carbon-list__tabs\">\n <cds-tab\n *ngFor=\"let tab of obs.visibleTabs\"\n [heading]=\"'task-list.' + tab + '.title' | translate\"\n [active]=\"obs.selectedTaskType === tab\"\n ></cds-tab>\n </cds-tabs>\n </div>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <cds-dropdown\n class=\"case-definition-selection\"\n *ngIf=\"{\n loadingCaseListItems: loadingCaseListItems$ | async,\n caseListItems: caseListItems$ | async\n } as obs\"\n [disabled]=\"obs.loadingCaseListItems || (obs.caseListItems || []).length === 1\"\n [skeleton]=\"obs.loadingCaseListItems\"\n (selected)=\"setCaseDefinition($event)\"\n >\n <cds-dropdown-list\n [items]=\"obs.caseListItems || []\"\n ></cds-dropdown-list></cds-dropdown></ng-template\n></ng-container>\n", styles: [".cds--link--disabled{cursor:not-allowed;pointer-events:auto!important;outline:0!important}.case-definition-selection{display:flex;width:250px}\n/*!\n * Copyright 2015-2024 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"] }]
1195
- }], ctorParameters: () => [{ type: i2.ConfigService }, { type: i7.DocumentService }, { type: i3$1.PermissionService }, { type: i3.Router }, { type: TaskService }, { type: TaskListService }, { type: i8.TranslateService }, { type: TaskListColumnService }, { type: TaskListPaginationService }, { type: TaskListSortService }], propDecorators: { _taskDetail: [{
1696
+ TaskListSearchService,
1697
+ TaskListQueryParamService,
1698
+ ], template: "<!--\n ~ Copyright 2015-2024 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 *ngIf=\"{\n loading: loadingTasks$ | async,\n selectedTaskType: selectedTaskType$ | async,\n tasks: tasks$ | async,\n fields: fields$ | async,\n visibleTabs: visibleTabs$ | async,\n pagination: paginationForCurrentTaskTypeForList$ | async,\n taskListColumnsForCase: taskListColumnsForCase$ | async,\n sortState: sortStateForCurrentTaskType$ | async,\n overrideSortState: overrideSortState$ | async,\n searchFields: searchFields$ | async,\n loadingSearchFields: loadingSearchFields$ | async,\n caseDefinitionName: caseDefinitionName$ | async,\n noResultsMessage: noResultsMessage$ | async\n } as obs\"\n class=\"main-content\"\n>\n <div class=\"container-fluid\">\n @if (obs.caseDefinitionName && obs.caseDefinitionName !== ALL_CASES_ID) {\n <ng-container\n *ngTemplateOutlet=\"\n searchFields;\n context: {\n obs: obs\n }\n \"\n ></ng-container>\n }\n\n <ng-container\n *ngTemplateOutlet=\"\n tasksList;\n context: {\n obs: obs\n }\n \"\n ></ng-container>\n\n <ng-container\n *ngTemplateOutlet=\"\n tasksListLoading;\n context: {\n obs: obs\n }\n \"\n ></ng-container>\n\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"reload()\"\n (assignmentOfTaskChanged)=\"reload()\"\n ></valtimo-task-detail-modal>\n </div>\n</div>\n\n<ng-template #configuredTabs let-selectedTaskType=\"selectedTaskType\" let-visibleTabs=\"visibleTabs\">\n <cds-tabs *ngIf=\"visibleTabs\" 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]=\"selectedTaskType === tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n</ng-template>\n\n<ng-template #caseLink let-data=\"data\">\n <ng-container *ngIf=\"cachedTasks$ | async as cachedTasks\">\n <div *ngIf=\"cachedTasks[data.index].caseLocked\">\n <a\n class=\"float-left cds--link--disabled\"\n cdsLink\n href=\"javascript:void(0)\"\n ngbTooltip=\"{{ 'task-list.caseLocked' | translate }}\"\n (click)=\"$event.stopPropagation()\"\n >\n {{ 'task-list.goToCase' | translate }}\n </a>\n </div>\n <div *ngIf=\"!cachedTasks[data.index].caseLocked\">\n <a\n class=\"float-left cds--link\"\n cdsLink\n href=\"javascript:void(0)\"\n (click)=\"openRelatedCase($event, data.index)\"\n >\n {{ 'task-list.goToCase' | translate }}\n </a>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #tasksList let-obs=\"obs\">\n <valtimo-carbon-list\n *ngIf=\"!obs.loading\"\n [fields]=\"obs.fields\"\n [header]=\"false\"\n [items]=\"obs.tasks\"\n [lastColumnTemplate]=\"caseLink\"\n [pagination]=\"obs.pagination\"\n paginationIdentifier=\"taskList\"\n lockedTooltipTranslationKey=\"task-list.rowLocked\"\n [sortState]=\"obs.overrideSortState || obs.sortState\"\n (paginationClicked)=\"paginationClicked($event, obs.selectedTaskType)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"rowOpenTaskClick($event)\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <div tabs>\n <ng-container *ngIf=\"obs.visibleTabs\">\n <ng-container\n *ngTemplateOutlet=\"\n configuredTabs;\n context: {selectedTaskType: obs.selectedTaskType, visibleTabs: obs.visibleTabs}\n \"\n ></ng-container>\n </ng-container>\n </div>\n\n <valtimo-no-results\n [description]=\"obs.noResultsMessage.description | translate\"\n [title]=\"obs.noResultsMessage.title | translate\"\n >\n </valtimo-no-results>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #tasksListLoading let-obs=\"obs\">\n <valtimo-carbon-list *ngIf=\"obs.loading\" [loading]=\"true\">\n <div tabs>\n <cds-tabs *ngIf=\"!obs.visibleTabs\" type=\"contained\" class=\"valtimo-carbon-list__tabs\">\n <cds-tab\n [heading]=\"'task-list.mine.title' | translate\"\n [active]=\"obs.selectedTaskType === 'mine'\"\n >\n </cds-tab>\n\n <cds-tab\n [heading]=\"'task-list.open.title' | translate\"\n [active]=\"obs.selectedTaskType === 'open'\"\n >\n </cds-tab>\n\n <cds-tab\n [heading]=\"'task-list.all.title' | translate\"\n [active]=\"obs.selectedTaskType === 'all'\"\n >\n </cds-tab>\n </cds-tabs>\n\n <cds-tabs *ngIf=\"obs.visibleTabs\" type=\"contained\" class=\"valtimo-carbon-list__tabs\">\n <cds-tab\n *ngFor=\"let tab of obs.visibleTabs\"\n [heading]=\"'task-list.' + tab + '.title' | translate\"\n [active]=\"obs.selectedTaskType === tab\"\n ></cds-tab>\n </cds-tabs>\n </div>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #searchFields let-obs=\"obs\">\n <div class=\"mb-3\">\n <valtimo-search-fields\n [searchFields]=\"obs.searchFields\"\n [inputDisabled]=\"obs.loadingSearchFields\"\n [documentDefinitionName]=\"obs.caseDefinitionName\"\n [setValuesSubject$]=\"setSearchFieldValuesSubject$\"\n [clearValuesSubject$]=\"clearSearchFieldValuesSubject$\"\n (doSearch)=\"search($event)\"\n >\n </valtimo-search-fields>\n </div>\n</ng-template>\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <cds-dropdown\n class=\"case-definition-selection\"\n *ngIf=\"{\n loadingCaseListItems: loadingCaseListItems$ | async,\n caseListItems: caseListItems$ | async\n } as obs\"\n [disabled]=\"obs.loadingCaseListItems || (obs.caseListItems || []).length === 1\"\n [skeleton]=\"obs.loadingCaseListItems\"\n (selected)=\"setCaseDefinition($event)\"\n >\n <cds-dropdown-list [items]=\"obs.caseListItems || []\"></cds-dropdown-list>\n </cds-dropdown>\n </ng-template>\n</ng-container>\n", styles: [".cds--link--disabled{cursor:not-allowed;pointer-events:auto!important;outline:0!important}.case-definition-selection{display:flex;width:250px}\n/*!\n * Copyright 2015-2024 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"] }]
1699
+ }], ctorParameters: () => [{ type: i2.ConfigService }, { type: i7.DocumentService }, { type: i3.PermissionService }, { type: i1$1.Router }, { type: TaskService }, { type: TaskListService }, { type: i8.TranslateService }, { type: TaskListColumnService }, { type: TaskListPaginationService }, { type: TaskListSortService }, { type: TaskListSearchService }, { type: TaskListQueryParamService }, { type: i6.PageTitleService }], propDecorators: { _taskDetail: [{
1196
1700
  type: ViewChild,
1197
1701
  args: ['taskDetail']
1702
+ }], onPopState: [{
1703
+ type: HostListener,
1704
+ args: ['window:popstate', ['$event']]
1198
1705
  }] } });
1199
1706
 
1200
1707
  /*
@@ -1222,7 +1729,7 @@ const routes = [
1222
1729
  ];
1223
1730
  class TaskRoutingModule {
1224
1731
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1225
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.3", ngImport: i0, type: TaskRoutingModule, imports: [CommonModule, i3.RouterModule], exports: [RouterModule] }); }
1732
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.3", ngImport: i0, type: TaskRoutingModule, imports: [CommonModule, i1$1.RouterModule], exports: [RouterModule] }); }
1226
1733
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
1227
1734
  }
1228
1735
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskRoutingModule, decorators: [{
@@ -1260,7 +1767,7 @@ class TaskModule {
1260
1767
  SearchableDropdownSelectModule,
1261
1768
  CamundaFormModule,
1262
1769
  BrowserAnimationsModule,
1263
- FormsModule, i1$1.ToastrModule, i8.TranslateModule, NgbModule,
1770
+ FormsModule, i1$2.ToastrModule, i8.TranslateModule, NgbModule,
1264
1771
  FormIoModule,
1265
1772
  ModalModule,
1266
1773
  LinkModule,
@@ -1268,7 +1775,12 @@ class TaskModule {
1268
1775
  TabsModule,
1269
1776
  ContentSwitcherModule,
1270
1777
  RenderInPageHeaderDirectiveModule,
1271
- DropdownModule], exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent] }); }
1778
+ DropdownModule,
1779
+ ButtonModule,
1780
+ IconModule,
1781
+ TooltipModule,
1782
+ ConfirmationModalModule,
1783
+ SearchFieldsModule], exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent] }); }
1272
1784
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskModule, imports: [CommonModule,
1273
1785
  TaskRoutingModule,
1274
1786
  CarbonListModule,
@@ -1298,7 +1810,12 @@ class TaskModule {
1298
1810
  TabsModule,
1299
1811
  ContentSwitcherModule,
1300
1812
  RenderInPageHeaderDirectiveModule,
1301
- DropdownModule] }); }
1813
+ DropdownModule,
1814
+ ButtonModule,
1815
+ IconModule,
1816
+ TooltipModule,
1817
+ ConfirmationModalModule,
1818
+ SearchFieldsModule] }); }
1302
1819
  }
1303
1820
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TaskModule, decorators: [{
1304
1821
  type: NgModule,
@@ -1335,6 +1852,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
1335
1852
  ContentSwitcherModule,
1336
1853
  RenderInPageHeaderDirectiveModule,
1337
1854
  DropdownModule,
1855
+ ButtonModule,
1856
+ IconModule,
1857
+ TooltipModule,
1858
+ ConfirmationModalModule,
1859
+ SearchFieldsModule,
1338
1860
  ],
1339
1861
  exports: [TaskListComponent, TaskDetailModalComponent, AssignUserToTaskComponent],
1340
1862
  }]
@@ -1363,5 +1885,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
1363
1885
  * Generated bundle index. Do not edit.
1364
1886
  */
1365
1887
 
1366
- export { AssignUserToTaskComponent, CAN_ASSIGN_TASK_PERMISSION, CAN_VIEW_CASE_PERMISSION, CAN_VIEW_TASK_PERMISSION, TASK_DETAIL_PERMISSION_RESOURCE, TaskDetailModalComponent, TaskListColumnDefaultSort, TaskListComponent, TaskModule, TaskService };
1888
+ export { AssignUserToTaskComponent, CAN_ASSIGN_TASK_PERMISSION, CAN_VIEW_CASE_PERMISSION, CAN_VIEW_TASK_PERMISSION, TASK_DETAIL_PERMISSION_RESOURCE, TASK_LIST_NO_SEARCH_RESULTS_MESSAGE, TaskDetailModalComponent, TaskListColumnDefaultSort, TaskListComponent, TaskListSearchDropdownDataProvider, TaskListSearchFieldDataType, TaskListSearchFieldFieldType, TaskListSearchFieldMatchType, TaskModule, TaskService };
1367
1889
  //# sourceMappingURL=valtimo-task.mjs.map