@valtimo/dossier 10.7.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm2020 → esm2022}/lib/components/note-modal/note-modal.component.mjs +5 -5
- package/esm2022/lib/dossier-assign-user/dossier-assign-user.component.mjs +98 -0
- package/esm2022/lib/dossier-bulk-assign-modal/dossier-bulk-assign-modal.component.mjs +75 -0
- package/esm2022/lib/dossier-detail/dossier-detail.component.mjs +175 -0
- package/{esm2020 → esm2022}/lib/dossier-detail/tab/audit/audit.component.mjs +5 -5
- package/{esm2020 → esm2022}/lib/dossier-detail/tab/contact-moments/contact-moments.component.mjs +4 -4
- package/esm2022/lib/dossier-detail/tab/documenten-api-documents/documenten-api-documents.component.mjs +146 -0
- package/{esm2020 → esm2022}/lib/dossier-detail/tab/documents/documents.component.mjs +4 -4
- package/esm2022/lib/dossier-detail/tab/notes/notes.component.mjs +166 -0
- package/esm2022/lib/dossier-detail/tab/object-type/object-type.component.mjs +121 -0
- package/esm2022/lib/dossier-detail/tab/progress/progress.component.mjs +52 -0
- package/esm2022/lib/dossier-detail/tab/s3-documents/s3-documents.component.mjs +136 -0
- package/esm2022/lib/dossier-detail/tab/summary/summary.component.mjs +130 -0
- package/esm2022/lib/dossier-detail/tab/zaakobjecten/zaakobjecten.component.mjs +112 -0
- package/esm2022/lib/dossier-list/dossier-list.component.mjs +371 -0
- package/esm2022/lib/dossier-list-actions/dossier-list-actions.component.mjs +84 -0
- package/esm2022/lib/dossier-process-start-modal/dossier-process-start-modal.component.mjs +133 -0
- package/{esm2020 → esm2022}/lib/dossier-routing.module.mjs +5 -5
- package/esm2022/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.mjs +116 -0
- package/{esm2020 → esm2022}/lib/dossier-update/dossier-update.component.mjs +5 -5
- package/esm2022/lib/dossier.module.mjs +282 -0
- package/esm2022/lib/dossier.service.mjs +58 -0
- package/esm2022/lib/models/candidate-user.model.mjs +17 -0
- package/{esm2020 → esm2022}/lib/models/dossier-parameters.model.mjs +1 -1
- package/esm2022/lib/models/index.mjs +21 -0
- package/esm2022/lib/permissions/dossier.permissions.mjs +55 -0
- package/esm2022/lib/permissions/index.mjs +17 -0
- package/esm2022/lib/services/dossier-bulk-assign.service.mjs +35 -0
- package/esm2022/lib/services/dossier-column.service.mjs +98 -0
- package/esm2022/lib/services/dossier-list-assignee.service.mjs +89 -0
- package/esm2022/lib/services/dossier-list-pagination.service.mjs +119 -0
- package/esm2022/lib/services/dossier-list-search.service.mjs +59 -0
- package/esm2022/lib/services/dossier-list.service.mjs +74 -0
- package/esm2022/lib/services/dossier-parameter.service.mjs +165 -0
- package/{esm2020 → esm2022}/lib/services/file-sort.service.mjs +4 -4
- package/esm2022/lib/services/index.mjs +25 -0
- package/esm2022/lib/services/notes.service.mjs +76 -0
- package/{esm2020 → esm2022}/lib/services/zaakobjecten.service.mjs +4 -4
- package/{esm2020 → esm2022}/lib/tab.service.mjs +4 -4
- package/esm2022/public_api.mjs +36 -0
- package/fesm2022/valtimo-dossier.mjs +3681 -0
- package/fesm2022/valtimo-dossier.mjs.map +1 -0
- package/lib/components/note-modal/note-modal.component.d.ts +3 -3
- package/lib/components/note-modal/note-modal.component.d.ts.map +1 -1
- package/lib/dossier-assign-user/dossier-assign-user.component.d.ts +12 -18
- package/lib/dossier-assign-user/dossier-assign-user.component.d.ts.map +1 -1
- package/lib/dossier-bulk-assign-modal/dossier-bulk-assign-modal.component.d.ts +22 -0
- package/lib/dossier-bulk-assign-modal/dossier-bulk-assign-modal.component.d.ts.map +1 -0
- package/lib/dossier-detail/dossier-detail.component.d.ts +34 -31
- package/lib/dossier-detail/dossier-detail.component.d.ts.map +1 -1
- package/lib/dossier-detail/tab/audit/audit.component.d.ts +1 -1
- package/lib/dossier-detail/tab/contact-moments/contact-moments.component.d.ts +1 -1
- package/lib/dossier-detail/tab/documenten-api-documents/documenten-api-documents.component.d.ts +2 -3
- package/lib/dossier-detail/tab/documenten-api-documents/documenten-api-documents.component.d.ts.map +1 -1
- package/lib/dossier-detail/tab/documents/documents.component.d.ts +1 -1
- package/lib/dossier-detail/tab/notes/notes.component.d.ts +19 -12
- package/lib/dossier-detail/tab/notes/notes.component.d.ts.map +1 -1
- package/lib/dossier-detail/tab/object-type/object-type.component.d.ts +3 -3
- package/lib/dossier-detail/tab/object-type/object-type.component.d.ts.map +1 -1
- package/lib/dossier-detail/tab/progress/progress.component.d.ts +1 -1
- package/lib/dossier-detail/tab/progress/progress.component.d.ts.map +1 -1
- package/lib/dossier-detail/tab/s3-documents/s3-documents.component.d.ts +2 -2
- package/lib/dossier-detail/tab/s3-documents/s3-documents.component.d.ts.map +1 -1
- package/lib/dossier-detail/tab/summary/summary.component.d.ts +8 -4
- package/lib/dossier-detail/tab/summary/summary.component.d.ts.map +1 -1
- package/lib/dossier-detail/tab/zaakobjecten/zaakobjecten.component.d.ts +3 -3
- package/lib/dossier-detail/tab/zaakobjecten/zaakobjecten.component.d.ts.map +1 -1
- package/lib/dossier-list/dossier-list.component.d.ts +52 -24
- package/lib/dossier-list/dossier-list.component.d.ts.map +1 -1
- package/lib/dossier-list-actions/dossier-list-actions.component.d.ts +5 -6
- package/lib/dossier-list-actions/dossier-list-actions.component.d.ts.map +1 -1
- package/lib/dossier-process-start-modal/dossier-process-start-modal.component.d.ts +4 -7
- package/lib/dossier-process-start-modal/dossier-process-start-modal.component.d.ts.map +1 -1
- package/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.d.ts +4 -7
- package/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.d.ts.map +1 -1
- package/lib/dossier-update/dossier-update.component.d.ts +1 -1
- package/lib/dossier.module.d.ts +31 -31
- package/lib/dossier.module.d.ts.map +1 -1
- package/lib/dossier.service.d.ts +5 -1
- package/lib/dossier.service.d.ts.map +1 -1
- package/lib/models/candidate-user.model.d.ts +7 -0
- package/lib/models/candidate-user.model.d.ts.map +1 -0
- package/lib/models/dossier-parameters.model.d.ts +0 -1
- package/lib/models/dossier-parameters.model.d.ts.map +1 -1
- package/lib/models/index.d.ts +3 -2
- package/lib/models/index.d.ts.map +1 -1
- package/lib/models/search.model.d.ts +3 -3
- package/lib/models/search.model.d.ts.map +1 -1
- package/lib/permissions/dossier.permissions.d.ts +14 -0
- package/lib/permissions/dossier.permissions.d.ts.map +1 -0
- package/lib/permissions/index.d.ts +2 -0
- package/lib/permissions/index.d.ts.map +1 -0
- package/lib/services/dossier-bulk-assign.service.d.ts +17 -0
- package/lib/services/dossier-bulk-assign.service.d.ts.map +1 -0
- package/lib/services/dossier-column.service.d.ts +1 -1
- package/lib/services/dossier-column.service.d.ts.map +1 -1
- package/lib/services/dossier-list-assignee.service.d.ts +5 -4
- package/lib/services/dossier-list-assignee.service.d.ts.map +1 -1
- package/lib/services/dossier-list-pagination.service.d.ts +1 -1
- package/lib/services/dossier-list-pagination.service.d.ts.map +1 -1
- package/lib/services/dossier-list-search.service.d.ts +0 -3
- package/lib/services/dossier-list-search.service.d.ts.map +1 -1
- package/lib/services/dossier-list.service.d.ts +6 -0
- package/lib/services/dossier-list.service.d.ts.map +1 -1
- package/lib/services/dossier-parameter.service.d.ts.map +1 -1
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/notes.service.d.ts.map +1 -1
- package/lib/services/zaakobjecten.service.d.ts.map +1 -1
- package/package.json +13 -19
- package/public_api.d.ts +10 -9
- package/public_api.d.ts.map +1 -1
- package/esm2020/lib/dossier-assign-user/dossier-assign-user.component.mjs +0 -126
- package/esm2020/lib/dossier-detail/dossier-detail.component.mjs +0 -175
- package/esm2020/lib/dossier-detail/tab/documenten-api-documents/documenten-api-documents.component.mjs +0 -147
- package/esm2020/lib/dossier-detail/tab/notes/notes.component.mjs +0 -153
- package/esm2020/lib/dossier-detail/tab/object-type/object-type.component.mjs +0 -122
- package/esm2020/lib/dossier-detail/tab/progress/progress.component.mjs +0 -51
- package/esm2020/lib/dossier-detail/tab/s3-documents/s3-documents.component.mjs +0 -134
- package/esm2020/lib/dossier-detail/tab/summary/summary.component.mjs +0 -124
- package/esm2020/lib/dossier-detail/tab/zaakobjecten/zaakobjecten.component.mjs +0 -113
- package/esm2020/lib/dossier-list/dossier-list.component.mjs +0 -224
- package/esm2020/lib/dossier-list-actions/dossier-list-actions.component.mjs +0 -86
- package/esm2020/lib/dossier-process-start-modal/dossier-process-start-modal.component.mjs +0 -192
- package/esm2020/lib/dossier-supporting-process-start-modal/dossier-supporting-process-start-modal.component.mjs +0 -181
- package/esm2020/lib/dossier.module.mjs +0 -259
- package/esm2020/lib/dossier.service.mjs +0 -50
- package/esm2020/lib/models/index.mjs +0 -20
- package/esm2020/lib/services/dossier-column.service.mjs +0 -100
- package/esm2020/lib/services/dossier-list-assignee.service.mjs +0 -82
- package/esm2020/lib/services/dossier-list-pagination.service.mjs +0 -116
- package/esm2020/lib/services/dossier-list-search.service.mjs +0 -66
- package/esm2020/lib/services/dossier-list.service.mjs +0 -56
- package/esm2020/lib/services/dossier-parameter.service.mjs +0 -167
- package/esm2020/lib/services/index.mjs +0 -24
- package/esm2020/lib/services/notes.service.mjs +0 -76
- package/esm2020/public_api.mjs +0 -35
- package/fesm2015/valtimo-dossier.mjs +0 -3348
- package/fesm2015/valtimo-dossier.mjs.map +0 -1
- package/fesm2020/valtimo-dossier.mjs +0 -3447
- package/fesm2020/valtimo-dossier.mjs.map +0 -1
- /package/{esm2020 → esm2022}/lib/dossier-detail-tab-enum.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/dossier.config.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/notes.model.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/search.model.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/tabs.model.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/zaakobjecten.model.mjs +0 -0
- /package/{esm2020 → esm2022}/valtimo-dossier.mjs +0 -0
|
@@ -0,0 +1,3681 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, HostBinding, Input, Output, ViewEncapsulation, ViewChild, InjectionToken, Inject, ViewContainerRef, NgModule } from '@angular/core';
|
|
3
|
+
import * as i5 from '@angular/forms';
|
|
4
|
+
import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { BehaviorSubject, take, map, distinctUntilChanged, combineLatest, Subject, switchMap, tap, filter, Subscription, of, from, startWith, forkJoin } from 'rxjs';
|
|
6
|
+
import * as i1 from '@valtimo/config';
|
|
7
|
+
import { UploadProvider, DossierListTab, ROLE_USER, ConfigModule, HttpLoaderFactory } from '@valtimo/config';
|
|
8
|
+
import * as i2 from '@angular/common/http';
|
|
9
|
+
import { HttpClient } from '@angular/common/http';
|
|
10
|
+
import * as i2$1 from '@valtimo/document';
|
|
11
|
+
import { AdvancedDocumentSearchRequestImpl } from '@valtimo/document';
|
|
12
|
+
import * as i6 from '@ngx-translate/core';
|
|
13
|
+
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
|
14
|
+
import * as i1$1 from '@angular/router';
|
|
15
|
+
import { NavigationEnd, RouterModule } from '@angular/router';
|
|
16
|
+
import * as i1$2 from 'ngx-logger';
|
|
17
|
+
import * as i3 from '@angular/common';
|
|
18
|
+
import { CommonModule } from '@angular/common';
|
|
19
|
+
import * as i4 from 'carbon-components-angular';
|
|
20
|
+
import { Tabs, LoadingModule, ButtonModule as ButtonModule$1, IconModule, ModalModule as ModalModule$1, SelectModule as SelectModule$1, DropdownModule, TabsModule, ComboBoxModule } from 'carbon-components-angular';
|
|
21
|
+
import moment from 'moment';
|
|
22
|
+
import * as i3$2 from '@valtimo/components';
|
|
23
|
+
import { FormioOptionsImpl, TimelineItemImpl, CarbonListComponent, ListModule, WidgetModule, BpmnJsDiagramModule, TimelineModule, CamundaFormModule, FilterSidebarModule, DataListModule, FormIoModule, ModalModule, SpinnerModule, UploaderModule, DropzoneModule, SelectModule, InputLabelModule, ParagraphModule, TableModule, VModalModule, TitleModule, ButtonModule, DocumentenApiMetadataModalModule, SearchableDropdownSelectModule, SearchFieldsModule, PageModule, InputModule, FormModule as FormModule$1, ConfirmationModalModule, CarbonListModule } from '@valtimo/components';
|
|
24
|
+
import * as i5$2 from 'keycloak-angular';
|
|
25
|
+
import * as i7 from '@valtimo/access-control';
|
|
26
|
+
import * as i3$1 from '@valtimo/task';
|
|
27
|
+
import { CAN_VIEW_TASK_PERMISSION, TASK_DETAIL_PERMISSION_RESOURCE, TaskModule } from '@valtimo/task';
|
|
28
|
+
import * as i2$2 from '@valtimo/process';
|
|
29
|
+
import { ProcessModule } from '@valtimo/process';
|
|
30
|
+
import * as i5$1 from '@valtimo/form';
|
|
31
|
+
import { FormModule } from '@valtimo/form';
|
|
32
|
+
import * as i6$1 from '@valtimo/security';
|
|
33
|
+
import { AuthGuardService } from '@valtimo/security';
|
|
34
|
+
import * as i10 from '@ng-bootstrap/ng-bootstrap';
|
|
35
|
+
import { NgbButtonsModule, NgbTooltipModule, NgbPaginationModule, NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
|
36
|
+
import * as i3$3 from 'ngx-spinner';
|
|
37
|
+
import { switchMap as switchMap$1, map as map$1, tap as tap$1, catchError, take as take$1 } from 'rxjs/operators';
|
|
38
|
+
import * as i3$4 from 'ngx-toastr';
|
|
39
|
+
import * as i4$1 from '@valtimo/resource';
|
|
40
|
+
import * as i3$5 from '@valtimo/form-link';
|
|
41
|
+
import { FormLinkModule } from '@valtimo/form-link';
|
|
42
|
+
import * as i1$3 from '@valtimo/contact-moment';
|
|
43
|
+
import { isEqual } from 'lodash';
|
|
44
|
+
|
|
45
|
+
class DossierBulkAssignService {
|
|
46
|
+
constructor(configService, http) {
|
|
47
|
+
this.configService = configService;
|
|
48
|
+
this.http = http;
|
|
49
|
+
this.candidateUsers$ = new BehaviorSubject([]);
|
|
50
|
+
this._valtimoEndpointUri = `${this.configService.config.valtimoApi.endpointUri}v1/document/`;
|
|
51
|
+
}
|
|
52
|
+
bulkAssign(assigneeId, documentIds) {
|
|
53
|
+
return this.http.post(`${this._valtimoEndpointUri}assign`, { assigneeId, documentIds });
|
|
54
|
+
}
|
|
55
|
+
loadCandidateUsers(documentIds) {
|
|
56
|
+
this.http
|
|
57
|
+
.post(`${this._valtimoEndpointUri}candidate-user`, { documentIds })
|
|
58
|
+
.pipe(take(1))
|
|
59
|
+
.subscribe({
|
|
60
|
+
next: (candidateUsers) => {
|
|
61
|
+
this.candidateUsers$.next(candidateUsers);
|
|
62
|
+
},
|
|
63
|
+
error: error => {
|
|
64
|
+
console.error(error);
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierBulkAssignService, deps: [{ token: i1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
69
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierBulkAssignService }); }
|
|
70
|
+
}
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierBulkAssignService, decorators: [{
|
|
72
|
+
type: Injectable
|
|
73
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2.HttpClient }]; } });
|
|
74
|
+
|
|
75
|
+
/*
|
|
76
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
77
|
+
*
|
|
78
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
79
|
+
* you may not use this file except in compliance with the License.
|
|
80
|
+
* You may obtain a copy of the License at
|
|
81
|
+
*
|
|
82
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
83
|
+
*
|
|
84
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
85
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
86
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
87
|
+
* See the License for the specific language governing permissions and
|
|
88
|
+
* limitations under the License.
|
|
89
|
+
*/
|
|
90
|
+
class DossierColumnService {
|
|
91
|
+
constructor(configService, documentService, translateService) {
|
|
92
|
+
this.configService = configService;
|
|
93
|
+
this.documentService = documentService;
|
|
94
|
+
this.translateService = translateService;
|
|
95
|
+
}
|
|
96
|
+
getDefinitionColumns(documentDefinitionName) {
|
|
97
|
+
const config = this.configService.config;
|
|
98
|
+
const customDefinitionTable = config.customDefinitionTables[documentDefinitionName];
|
|
99
|
+
const defaultDefinitionTable = config.defaultDefinitionTable;
|
|
100
|
+
return this.documentService.getCaseList(documentDefinitionName).pipe(map(caseListColumns => {
|
|
101
|
+
const apiCaseListColumns = config?.featureToggles?.caseListColumn &&
|
|
102
|
+
caseListColumns &&
|
|
103
|
+
Array.isArray(caseListColumns) &&
|
|
104
|
+
caseListColumns.length > 0 &&
|
|
105
|
+
this.mapCaseListColumnsToDefinitionColumns(caseListColumns);
|
|
106
|
+
return {
|
|
107
|
+
columns: customDefinitionTable || apiCaseListColumns || defaultDefinitionTable,
|
|
108
|
+
hasApiConfig: !!apiCaseListColumns,
|
|
109
|
+
};
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
hasEnvironmentConfig(documentDefinitionName) {
|
|
113
|
+
return !!this.configService.config?.customDefinitionTables[documentDefinitionName];
|
|
114
|
+
}
|
|
115
|
+
mapDefinitionColumnsToListFields(columns, hasEnvColumnConfig, hasApiColumnConfig) {
|
|
116
|
+
return columns.map(column => {
|
|
117
|
+
const translationKey = `fieldLabels.${column.translationKey}`;
|
|
118
|
+
const translation = this.translateService.instant(translationKey);
|
|
119
|
+
const validTranslation = translation !== translationKey && translation;
|
|
120
|
+
return {
|
|
121
|
+
key: hasEnvColumnConfig || !hasApiColumnConfig ? column.propertyName : column.translationKey,
|
|
122
|
+
label: column.title || validTranslation || column.translationKey,
|
|
123
|
+
sortable: column.sortable,
|
|
124
|
+
...(column.viewType && { viewType: column.viewType }),
|
|
125
|
+
...(column.enum && { enum: column.enum }),
|
|
126
|
+
...(column.format && { format: column.format }),
|
|
127
|
+
...(column.default && { default: column.default }),
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
mapCaseListColumnsToDefinitionColumns(caseListColumns) {
|
|
132
|
+
return caseListColumns.map(caseListColumn => ({
|
|
133
|
+
translationKey: caseListColumn.key,
|
|
134
|
+
sortable: caseListColumn.sortable,
|
|
135
|
+
default: caseListColumn.defaultSort,
|
|
136
|
+
viewType: this.getViewType(caseListColumn.displayType.type),
|
|
137
|
+
propertyName: this.getPropertyName(caseListColumn.path),
|
|
138
|
+
...(caseListColumn.title && { title: caseListColumn.title }),
|
|
139
|
+
...(caseListColumn?.displayType?.displayTypeParameters?.enum && {
|
|
140
|
+
enum: caseListColumn.displayType.displayTypeParameters.enum,
|
|
141
|
+
}),
|
|
142
|
+
...(caseListColumn.displayType?.displayTypeParameters?.dateFormat && {
|
|
143
|
+
format: caseListColumn.displayType?.displayTypeParameters?.dateFormat,
|
|
144
|
+
}),
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
getViewType(caseListColumnDisplayType) {
|
|
148
|
+
switch (caseListColumnDisplayType) {
|
|
149
|
+
case 'arrayCount':
|
|
150
|
+
return 'relatedFiles';
|
|
151
|
+
case 'underscoresToSpaces':
|
|
152
|
+
return 'stringReplaceUnderscore';
|
|
153
|
+
default:
|
|
154
|
+
return caseListColumnDisplayType;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
getPropertyName(caseListColumnPath) {
|
|
158
|
+
return caseListColumnPath.replace('doc:', '$.').replace('case:', '');
|
|
159
|
+
}
|
|
160
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierColumnService, deps: [{ token: i1.ConfigService }, { token: i2$1.DocumentService }, { token: i6.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
161
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierColumnService }); }
|
|
162
|
+
}
|
|
163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierColumnService, decorators: [{
|
|
164
|
+
type: Injectable
|
|
165
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2$1.DocumentService }, { type: i6.TranslateService }]; } });
|
|
166
|
+
|
|
167
|
+
/*
|
|
168
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
169
|
+
*
|
|
170
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
171
|
+
* you may not use this file except in compliance with the License.
|
|
172
|
+
* You may obtain a copy of the License at
|
|
173
|
+
*
|
|
174
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
175
|
+
*
|
|
176
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
177
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
178
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
179
|
+
* See the License for the specific language governing permissions and
|
|
180
|
+
* limitations under the License.
|
|
181
|
+
*/
|
|
182
|
+
class ZaakobjectenService {
|
|
183
|
+
constructor(configService, http) {
|
|
184
|
+
this.configService = configService;
|
|
185
|
+
this.http = http;
|
|
186
|
+
this.VALTIMO_API_ENDPOINT_URI = this.configService.config.valtimoApi.endpointUri;
|
|
187
|
+
}
|
|
188
|
+
getDocumentObjectTypes(documentId) {
|
|
189
|
+
return this.http.get(`${this.VALTIMO_API_ENDPOINT_URI}v1/document/${documentId}/zaak/objecttype`);
|
|
190
|
+
}
|
|
191
|
+
getDocumentObjectsOfType(documentId, typeUrl) {
|
|
192
|
+
return this.http.get(`${this.VALTIMO_API_ENDPOINT_URI}v1/document/${documentId}/zaak/object?typeUrl=${typeUrl}`);
|
|
193
|
+
}
|
|
194
|
+
getObjectTypeForm(documentId, objectUrl) {
|
|
195
|
+
return this.http.get(`${this.VALTIMO_API_ENDPOINT_URI}v1/document/${documentId}/zaak/object/form?objectUrl=${objectUrl}`);
|
|
196
|
+
}
|
|
197
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ZaakobjectenService, deps: [{ token: i1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
198
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ZaakobjectenService, providedIn: 'root' }); }
|
|
199
|
+
}
|
|
200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ZaakobjectenService, decorators: [{
|
|
201
|
+
type: Injectable,
|
|
202
|
+
args: [{
|
|
203
|
+
providedIn: 'root',
|
|
204
|
+
}]
|
|
205
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2.HttpClient }]; } });
|
|
206
|
+
|
|
207
|
+
/*
|
|
208
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
209
|
+
*
|
|
210
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
211
|
+
* you may not use this file except in compliance with the License.
|
|
212
|
+
* You may obtain a copy of the License at
|
|
213
|
+
*
|
|
214
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
215
|
+
*
|
|
216
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
217
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
218
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
219
|
+
* See the License for the specific language governing permissions and
|
|
220
|
+
* limitations under the License.
|
|
221
|
+
*/
|
|
222
|
+
class DossierParameterService {
|
|
223
|
+
get dossierParameters$() {
|
|
224
|
+
return this._dossierParameters$.asObservable();
|
|
225
|
+
}
|
|
226
|
+
get searchFieldValues$() {
|
|
227
|
+
return this._searchFieldValues$.asObservable();
|
|
228
|
+
}
|
|
229
|
+
get querySearchParams$() {
|
|
230
|
+
return this.route.queryParams.pipe(map(params => {
|
|
231
|
+
if (params.search) {
|
|
232
|
+
return JSON.parse(atob(params.search));
|
|
233
|
+
}
|
|
234
|
+
return {};
|
|
235
|
+
}), distinctUntilChanged((prevParams, currParams) => JSON.stringify(prevParams) === JSON.stringify(currParams)));
|
|
236
|
+
}
|
|
237
|
+
get queryPaginationParams$() {
|
|
238
|
+
return this.route.queryParams.pipe(map(params => {
|
|
239
|
+
const paramsCopy = { ...params };
|
|
240
|
+
if (paramsCopy.search) {
|
|
241
|
+
delete paramsCopy.search;
|
|
242
|
+
}
|
|
243
|
+
return paramsCopy.collectionSize
|
|
244
|
+
? {
|
|
245
|
+
collectionSize: Number(paramsCopy.collectionSize),
|
|
246
|
+
page: Number(paramsCopy.page),
|
|
247
|
+
size: Number(paramsCopy.size),
|
|
248
|
+
...(paramsCopy.isSorting === 'true' && {
|
|
249
|
+
sort: {
|
|
250
|
+
isSorting: !!(paramsCopy.isSorting === 'true'),
|
|
251
|
+
state: {
|
|
252
|
+
name: paramsCopy.sortStateName,
|
|
253
|
+
direction: paramsCopy.sortStateDirection,
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
}),
|
|
257
|
+
}
|
|
258
|
+
: null;
|
|
259
|
+
}), distinctUntilChanged((prevParams, currParams) => JSON.stringify(prevParams) === JSON.stringify(currParams)));
|
|
260
|
+
}
|
|
261
|
+
get queryAssigneeParam$() {
|
|
262
|
+
return this.route.queryParams.pipe(map(params => {
|
|
263
|
+
if (params?.assignee) {
|
|
264
|
+
return params?.assignee?.toUpperCase();
|
|
265
|
+
}
|
|
266
|
+
return '';
|
|
267
|
+
}), distinctUntilChanged((prevParams, currParams) => prevParams === currParams));
|
|
268
|
+
}
|
|
269
|
+
constructor(router, route) {
|
|
270
|
+
this.router = router;
|
|
271
|
+
this.route = route;
|
|
272
|
+
this._dossierParameters$ = new BehaviorSubject(undefined);
|
|
273
|
+
this._searchFieldValues$ = new BehaviorSubject({});
|
|
274
|
+
this.setDossierParameters();
|
|
275
|
+
}
|
|
276
|
+
ngOnDestroy() {
|
|
277
|
+
this.dossierParametersSubscription?.unsubscribe();
|
|
278
|
+
}
|
|
279
|
+
setSearchFieldValues(searchFieldValues) {
|
|
280
|
+
this._searchFieldValues$.next(searchFieldValues);
|
|
281
|
+
}
|
|
282
|
+
setSearchParameters(searchParameters) {
|
|
283
|
+
this._dossierParameters$.pipe(take(1)).subscribe(dossierParameters => {
|
|
284
|
+
if (Object.keys(searchParameters || {}).length > 0) {
|
|
285
|
+
this._dossierParameters$.next({
|
|
286
|
+
...dossierParameters,
|
|
287
|
+
search: this.objectToBase64(searchParameters),
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
if (dossierParameters?.search) {
|
|
292
|
+
delete dossierParameters.search;
|
|
293
|
+
}
|
|
294
|
+
this._dossierParameters$.next(dossierParameters);
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
setPaginationParameters(pagination) {
|
|
299
|
+
if (pagination) {
|
|
300
|
+
this._dossierParameters$.pipe(take(1)).subscribe(dossierParameters => {
|
|
301
|
+
this._dossierParameters$.next({
|
|
302
|
+
...dossierParameters,
|
|
303
|
+
size: `${pagination.size}`,
|
|
304
|
+
collectionSize: `${pagination.collectionSize}`,
|
|
305
|
+
page: `${pagination.page}`,
|
|
306
|
+
isSorting: pagination.sort?.isSorting ? 'true' : 'false',
|
|
307
|
+
...(pagination.sort?.state?.name && { sortStateName: `${pagination.sort?.state.name}` }),
|
|
308
|
+
...(pagination.sort?.state?.direction && {
|
|
309
|
+
sortStateDirection: `${pagination.sort?.state.direction}`,
|
|
310
|
+
}),
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
setAssigneeParameter(assigneeFilter) {
|
|
316
|
+
this._dossierParameters$.pipe(take(1)).subscribe(dossierParameters => {
|
|
317
|
+
this._dossierParameters$.next({
|
|
318
|
+
...dossierParameters,
|
|
319
|
+
assignee: assigneeFilter.toLowerCase(),
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
clearSearchFieldValues() {
|
|
324
|
+
this._searchFieldValues$.next({});
|
|
325
|
+
}
|
|
326
|
+
clearParameters() {
|
|
327
|
+
this._dossierParameters$.next(undefined);
|
|
328
|
+
this.router.navigate([this.getUrlWithoutParams()]);
|
|
329
|
+
}
|
|
330
|
+
openDossierParametersSubscription() {
|
|
331
|
+
this.dossierParametersSubscription = this.dossierParameters$.subscribe(dossierParams => {
|
|
332
|
+
this.router.navigate([this.getUrlWithoutParams()], { queryParams: dossierParams });
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
objectToBase64(jsObject) {
|
|
336
|
+
return btoa(JSON.stringify(jsObject));
|
|
337
|
+
}
|
|
338
|
+
getUrlWithoutParams() {
|
|
339
|
+
const urlTree = this.router.parseUrl(this.router.url);
|
|
340
|
+
urlTree.queryParams = {};
|
|
341
|
+
urlTree.fragment = null;
|
|
342
|
+
return urlTree.toString();
|
|
343
|
+
}
|
|
344
|
+
setDossierParameters() {
|
|
345
|
+
combineLatest([this.queryPaginationParams$, this.querySearchParams$, this.queryAssigneeParam$])
|
|
346
|
+
.pipe(take(1))
|
|
347
|
+
.subscribe(([paginationParams, searchParams, assigneeParams]) => {
|
|
348
|
+
if (paginationParams) {
|
|
349
|
+
this.setPaginationParameters(paginationParams);
|
|
350
|
+
}
|
|
351
|
+
if (searchParams) {
|
|
352
|
+
this.setSearchParameters(searchParams);
|
|
353
|
+
this.setSearchFieldValues(searchParams);
|
|
354
|
+
}
|
|
355
|
+
if (assigneeParams) {
|
|
356
|
+
this.setAssigneeParameter(assigneeParams);
|
|
357
|
+
}
|
|
358
|
+
this.openDossierParametersSubscription();
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierParameterService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
362
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierParameterService }); }
|
|
363
|
+
}
|
|
364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierParameterService, decorators: [{
|
|
365
|
+
type: Injectable
|
|
366
|
+
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }]; } });
|
|
367
|
+
|
|
368
|
+
/*
|
|
369
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
370
|
+
*
|
|
371
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
372
|
+
* you may not use this file except in compliance with the License.
|
|
373
|
+
* You may obtain a copy of the License at
|
|
374
|
+
*
|
|
375
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
376
|
+
*
|
|
377
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
378
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
379
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
380
|
+
* See the License for the specific language governing permissions and
|
|
381
|
+
* limitations under the License.
|
|
382
|
+
*/
|
|
383
|
+
class FileSortService {
|
|
384
|
+
constructor(configService) {
|
|
385
|
+
this.configService = configService;
|
|
386
|
+
}
|
|
387
|
+
sortRelatedFilesByDateDescending(relatedFiles) {
|
|
388
|
+
const sortByDate = this.configService.config?.featureToggles?.sortFilesByDate;
|
|
389
|
+
if (sortByDate) {
|
|
390
|
+
return relatedFiles.sort((a, b) => new Date(b.createdOn).getTime() - new Date(a.createdOn).getTime());
|
|
391
|
+
}
|
|
392
|
+
return relatedFiles;
|
|
393
|
+
}
|
|
394
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileSortService, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
395
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileSortService, providedIn: 'root' }); }
|
|
396
|
+
}
|
|
397
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileSortService, decorators: [{
|
|
398
|
+
type: Injectable,
|
|
399
|
+
args: [{
|
|
400
|
+
providedIn: 'root',
|
|
401
|
+
}]
|
|
402
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigService }]; } });
|
|
403
|
+
|
|
404
|
+
/*
|
|
405
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
406
|
+
*
|
|
407
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
408
|
+
* you may not use this file except in compliance with the License.
|
|
409
|
+
* You may obtain a copy of the License at
|
|
410
|
+
*
|
|
411
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
412
|
+
*
|
|
413
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
414
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
415
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
416
|
+
* See the License for the specific language governing permissions and
|
|
417
|
+
* limitations under the License.
|
|
418
|
+
*/
|
|
419
|
+
class DossierListService {
|
|
420
|
+
get documentDefinitionName$() {
|
|
421
|
+
return this._documentDefinitionName$.asObservable();
|
|
422
|
+
}
|
|
423
|
+
get hasEnvColumnConfig$() {
|
|
424
|
+
return this._hasEnvColumnConfig$;
|
|
425
|
+
}
|
|
426
|
+
get checkRefresh$() {
|
|
427
|
+
return this._checkRefresh$.asObservable();
|
|
428
|
+
}
|
|
429
|
+
get forceRefresh$() {
|
|
430
|
+
return this._forceRefresh$.asObservable();
|
|
431
|
+
}
|
|
432
|
+
constructor(dossierColumnService) {
|
|
433
|
+
this.dossierColumnService = dossierColumnService;
|
|
434
|
+
this._documentDefinitionName$ = new BehaviorSubject('');
|
|
435
|
+
this._hasEnvColumnConfig$ = this.documentDefinitionName$.pipe(map(documentDefinitionName => this.dossierColumnService.hasEnvironmentConfig(documentDefinitionName)));
|
|
436
|
+
this._checkRefresh$ = new BehaviorSubject(false);
|
|
437
|
+
this._forceRefresh$ = new BehaviorSubject(false);
|
|
438
|
+
}
|
|
439
|
+
setDocumentDefinitionName(documentDefinitionName) {
|
|
440
|
+
this._documentDefinitionName$.next(documentDefinitionName);
|
|
441
|
+
}
|
|
442
|
+
mapDocuments(documents, hasEnvColumnConfig, hasApiColumnConfig) {
|
|
443
|
+
if (hasEnvColumnConfig || !hasApiColumnConfig) {
|
|
444
|
+
return documents.content.map(document => {
|
|
445
|
+
const { content, ...others } = document;
|
|
446
|
+
return { ...content, ...others };
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
return documents.content.reduce((acc, curr) => {
|
|
450
|
+
const propsObject = { id: curr.id };
|
|
451
|
+
curr.items?.forEach(item => {
|
|
452
|
+
propsObject[item.key] = item.value;
|
|
453
|
+
});
|
|
454
|
+
return [...acc, propsObject];
|
|
455
|
+
}, []);
|
|
456
|
+
}
|
|
457
|
+
forceRefresh() {
|
|
458
|
+
this._forceRefresh$.pipe(take(1)).subscribe(forceRefresh => {
|
|
459
|
+
this._forceRefresh$.next(!forceRefresh);
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
checkRefresh() {
|
|
463
|
+
this._checkRefresh$.pipe(take(1)).subscribe(checkRefresh => {
|
|
464
|
+
this._checkRefresh$.next(!checkRefresh);
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListService, deps: [{ token: DossierColumnService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
468
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListService }); }
|
|
469
|
+
}
|
|
470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListService, decorators: [{
|
|
471
|
+
type: Injectable
|
|
472
|
+
}], ctorParameters: function () { return [{ type: DossierColumnService }]; } });
|
|
473
|
+
|
|
474
|
+
/*
|
|
475
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
476
|
+
*
|
|
477
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
478
|
+
* you may not use this file except in compliance with the License.
|
|
479
|
+
* You may obtain a copy of the License at
|
|
480
|
+
*
|
|
481
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
482
|
+
*
|
|
483
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
484
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
485
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
486
|
+
* See the License for the specific language governing permissions and
|
|
487
|
+
* limitations under the License.
|
|
488
|
+
*/
|
|
489
|
+
class DossierListAssigneeService {
|
|
490
|
+
get assigneeFilter$() {
|
|
491
|
+
return this._assigneeFilter$.asObservable();
|
|
492
|
+
}
|
|
493
|
+
constructor(configService, dossierListService, documentService, translateService, dossierParameterService) {
|
|
494
|
+
this.configService = configService;
|
|
495
|
+
this.dossierListService = dossierListService;
|
|
496
|
+
this.documentService = documentService;
|
|
497
|
+
this.translateService = translateService;
|
|
498
|
+
this.dossierParameterService = dossierParameterService;
|
|
499
|
+
this.ASSIGNEE_KEY = 'assigneeFullName';
|
|
500
|
+
this._defaultAssigneeFilter$ = new Subject();
|
|
501
|
+
this._assigneeFilter$ = new BehaviorSubject(null);
|
|
502
|
+
this.canHaveAssignee$ = this.dossierListService.documentDefinitionName$.pipe(switchMap(documentDefinitionName => this.documentService.getCaseSettings(documentDefinitionName)), map(caseSettings => caseSettings?.canHaveAssignee), tap(canHaveAssignee => {
|
|
503
|
+
const visibleTabs = this.configService.config.visibleDossierListTabs;
|
|
504
|
+
this._defaultAssigneeFilter$.next(!!visibleTabs && canHaveAssignee ? visibleTabs[0] : 'ALL');
|
|
505
|
+
}));
|
|
506
|
+
}
|
|
507
|
+
resetAssigneeFilter() {
|
|
508
|
+
combineLatest([this.dossierParameterService.queryAssigneeParam$, this._defaultAssigneeFilter$])
|
|
509
|
+
.pipe(take(1))
|
|
510
|
+
.subscribe(([assigneeParam, defaultAssigneeFilter]) => {
|
|
511
|
+
if (assigneeParam) {
|
|
512
|
+
this._assigneeFilter$.next(assigneeParam);
|
|
513
|
+
this.dossierParameterService.setAssigneeParameter(assigneeParam);
|
|
514
|
+
}
|
|
515
|
+
else {
|
|
516
|
+
this._assigneeFilter$.next(defaultAssigneeFilter);
|
|
517
|
+
this.dossierParameterService.setAssigneeParameter(defaultAssigneeFilter);
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
setAssigneeFilter(assigneeFilter) {
|
|
522
|
+
this._assigneeFilter$.next(assigneeFilter);
|
|
523
|
+
this.dossierParameterService.setAssigneeParameter(assigneeFilter);
|
|
524
|
+
}
|
|
525
|
+
filterAssigneeColumns(columns, canHaveAssignee) {
|
|
526
|
+
return columns.filter(column => {
|
|
527
|
+
if (column?.key === this.ASSIGNEE_KEY && !canHaveAssignee) {
|
|
528
|
+
return false;
|
|
529
|
+
}
|
|
530
|
+
return true;
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
addAssigneeListField(columns, listFields, canHaveAssignee) {
|
|
534
|
+
return [
|
|
535
|
+
...listFields,
|
|
536
|
+
...(canHaveAssignee && !columns.find(column => column.propertyName === this.ASSIGNEE_KEY)
|
|
537
|
+
? [
|
|
538
|
+
{
|
|
539
|
+
key: this.ASSIGNEE_KEY,
|
|
540
|
+
label: this.translateService.instant(`fieldLabels.${this.ASSIGNEE_KEY}`),
|
|
541
|
+
sortable: true,
|
|
542
|
+
viewType: 'string',
|
|
543
|
+
},
|
|
544
|
+
]
|
|
545
|
+
: []),
|
|
546
|
+
];
|
|
547
|
+
}
|
|
548
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListAssigneeService, deps: [{ token: i1.ConfigService }, { token: DossierListService }, { token: i2$1.DocumentService }, { token: i6.TranslateService }, { token: DossierParameterService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
549
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListAssigneeService }); }
|
|
550
|
+
}
|
|
551
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListAssigneeService, decorators: [{
|
|
552
|
+
type: Injectable
|
|
553
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: DossierListService }, { type: i2$1.DocumentService }, { type: i6.TranslateService }, { type: DossierParameterService }]; } });
|
|
554
|
+
|
|
555
|
+
/*
|
|
556
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
557
|
+
*
|
|
558
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
559
|
+
* you may not use this file except in compliance with the License.
|
|
560
|
+
* You may obtain a copy of the License at
|
|
561
|
+
*
|
|
562
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
563
|
+
*
|
|
564
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
565
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
566
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
567
|
+
* See the License for the specific language governing permissions and
|
|
568
|
+
* limitations under the License.
|
|
569
|
+
*/
|
|
570
|
+
class DossierService {
|
|
571
|
+
constructor(configService) {
|
|
572
|
+
this.configService = configService;
|
|
573
|
+
this._refreshDocument$ = new BehaviorSubject(null);
|
|
574
|
+
this.definitions = configService.config.definitions;
|
|
575
|
+
}
|
|
576
|
+
getImplementationEnvironmentDefinitions(name) {
|
|
577
|
+
return this.definitions.dossiers.find(definition => definition.name === name);
|
|
578
|
+
}
|
|
579
|
+
getInitialSortState(columns) {
|
|
580
|
+
const defaultColumn = columns.find(column => column.default);
|
|
581
|
+
const isSorting = defaultColumn?.default === 'ASC' || defaultColumn?.default === 'DESC';
|
|
582
|
+
const direction = typeof !defaultColumn || defaultColumn.default === 'boolean'
|
|
583
|
+
? 'DESC'
|
|
584
|
+
: defaultColumn.default;
|
|
585
|
+
return {
|
|
586
|
+
isSorting,
|
|
587
|
+
state: {
|
|
588
|
+
name: defaultColumn ? defaultColumn.propertyName : columns[0].propertyName,
|
|
589
|
+
direction,
|
|
590
|
+
},
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
get refreshDocument() {
|
|
594
|
+
return this._refreshDocument$.asObservable();
|
|
595
|
+
}
|
|
596
|
+
refresh() {
|
|
597
|
+
this._refreshDocument$.next(null);
|
|
598
|
+
}
|
|
599
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierService, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
600
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierService, providedIn: 'root' }); }
|
|
601
|
+
}
|
|
602
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierService, decorators: [{
|
|
603
|
+
type: Injectable,
|
|
604
|
+
args: [{
|
|
605
|
+
providedIn: 'root',
|
|
606
|
+
}]
|
|
607
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigService }]; } });
|
|
608
|
+
|
|
609
|
+
/*
|
|
610
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
611
|
+
*
|
|
612
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
613
|
+
* you may not use this file except in compliance with the License.
|
|
614
|
+
* You may obtain a copy of the License at
|
|
615
|
+
*
|
|
616
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
617
|
+
*
|
|
618
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
619
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
620
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
621
|
+
* See the License for the specific language governing permissions and
|
|
622
|
+
* limitations under the License.
|
|
623
|
+
*/
|
|
624
|
+
class DossierListPaginationService {
|
|
625
|
+
get pagination$() {
|
|
626
|
+
return this._paginationCopy$;
|
|
627
|
+
}
|
|
628
|
+
constructor(logger, dossierParameterService, dossierService) {
|
|
629
|
+
this.logger = logger;
|
|
630
|
+
this.dossierParameterService = dossierParameterService;
|
|
631
|
+
this.dossierService = dossierService;
|
|
632
|
+
this.DEFAULT_PAGINATION = {
|
|
633
|
+
collectionSize: 0,
|
|
634
|
+
page: 1,
|
|
635
|
+
size: 10,
|
|
636
|
+
sort: undefined,
|
|
637
|
+
};
|
|
638
|
+
this._pagination$ = new BehaviorSubject(undefined);
|
|
639
|
+
this._paginationCopy$ = this._pagination$.pipe(filter(pagination => !!pagination), map(pagination => pagination && JSON.parse(JSON.stringify(pagination))), tap(pagination => this.dossierParameterService.setPaginationParameters(pagination)));
|
|
640
|
+
}
|
|
641
|
+
pageChange(newPage) {
|
|
642
|
+
this._pagination$.pipe(take(1)).subscribe(pagination => {
|
|
643
|
+
if (pagination && pagination.page !== newPage) {
|
|
644
|
+
this.logger.debug(`Page change: ${newPage}`);
|
|
645
|
+
this._pagination$.next({ ...pagination, page: newPage });
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
pageSizeChange(newPageSize) {
|
|
650
|
+
this._pagination$.pipe(take(1)).subscribe(pagination => {
|
|
651
|
+
if (pagination && pagination.size !== newPageSize) {
|
|
652
|
+
const amountOfAvailablePages = Math.ceil(+pagination.collectionSize / newPageSize);
|
|
653
|
+
const newPage = amountOfAvailablePages < pagination.page ? amountOfAvailablePages : pagination.page;
|
|
654
|
+
this.logger.debug(`Page size change. New Page: ${newPage} New page size: ${newPageSize}`);
|
|
655
|
+
this._pagination$.next({ ...pagination, size: newPageSize, page: newPage });
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
sortChanged(newSortState) {
|
|
660
|
+
this._pagination$.pipe(take(1)).subscribe(pagination => {
|
|
661
|
+
if (pagination && JSON.stringify(pagination.sort) !== JSON.stringify(newSortState)) {
|
|
662
|
+
this.logger.debug(`Sort state change: ${JSON.stringify(newSortState)}`);
|
|
663
|
+
this._pagination$.next({ ...pagination, sort: newSortState });
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
setPage(newPageNumber) {
|
|
668
|
+
this._pagination$.pipe(take(1)).subscribe(pagination => {
|
|
669
|
+
this._pagination$.next({ ...pagination, page: newPageNumber });
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
setCollectionSize(documents) {
|
|
673
|
+
this._pagination$.pipe(take(1)).subscribe(pagination => {
|
|
674
|
+
if (pagination && pagination.collectionSize !== documents.totalElements) {
|
|
675
|
+
this._pagination$.next({ ...pagination, collectionSize: documents.totalElements });
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
checkPage(documents) {
|
|
680
|
+
this._pagination$.pipe(take(1)).subscribe(pagination => {
|
|
681
|
+
if (pagination) {
|
|
682
|
+
const amountOfItems = documents.totalElements;
|
|
683
|
+
const amountOfPages = Math.ceil(amountOfItems / pagination.size);
|
|
684
|
+
const currentPage = pagination.page;
|
|
685
|
+
if (!!amountOfItems && !currentPage) {
|
|
686
|
+
this._pagination$.next({ ...pagination, page: 1 });
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
if (currentPage > amountOfPages) {
|
|
690
|
+
this._pagination$.next({ ...pagination, page: amountOfPages });
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
clearPagination() {
|
|
696
|
+
this._pagination$.next(undefined);
|
|
697
|
+
}
|
|
698
|
+
setPagination(columns) {
|
|
699
|
+
this.dossierParameterService.queryPaginationParams$
|
|
700
|
+
.pipe(take(1))
|
|
701
|
+
.subscribe(queryPaginationParams => {
|
|
702
|
+
const defaultPagination = this.getDefaultPagination(columns);
|
|
703
|
+
const paginationToUse = queryPaginationParams || defaultPagination;
|
|
704
|
+
this.logger.debug(`Set pagination: ${JSON.stringify(paginationToUse)}`);
|
|
705
|
+
this._pagination$.next(paginationToUse);
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
getDefaultPagination(columns) {
|
|
709
|
+
const defaultSortState = this.dossierService.getInitialSortState(columns);
|
|
710
|
+
return {
|
|
711
|
+
...this.DEFAULT_PAGINATION,
|
|
712
|
+
sort: defaultSortState,
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListPaginationService, deps: [{ token: i1$2.NGXLogger }, { token: DossierParameterService }, { token: DossierService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
716
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListPaginationService }); }
|
|
717
|
+
}
|
|
718
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListPaginationService, decorators: [{
|
|
719
|
+
type: Injectable
|
|
720
|
+
}], ctorParameters: function () { return [{ type: i1$2.NGXLogger }, { type: DossierParameterService }, { type: DossierService }]; } });
|
|
721
|
+
|
|
722
|
+
/*
|
|
723
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
724
|
+
*
|
|
725
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
726
|
+
* you may not use this file except in compliance with the License.
|
|
727
|
+
* You may obtain a copy of the License at
|
|
728
|
+
*
|
|
729
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
730
|
+
*
|
|
731
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
732
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
733
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
734
|
+
* See the License for the specific language governing permissions and
|
|
735
|
+
* limitations under the License.
|
|
736
|
+
*/
|
|
737
|
+
class DossierListSearchService {
|
|
738
|
+
get documentSearchFields$() {
|
|
739
|
+
return this._documentSearchFields$;
|
|
740
|
+
}
|
|
741
|
+
constructor(dossierListService, documentService, dossierParameterService) {
|
|
742
|
+
this.dossierListService = dossierListService;
|
|
743
|
+
this.documentService = documentService;
|
|
744
|
+
this.dossierParameterService = dossierParameterService;
|
|
745
|
+
this._documentSearchFields$ = this.dossierListService.documentDefinitionName$.pipe(switchMap(documentDefinitionName => this.documentService.getDocumentSearchFields(documentDefinitionName)));
|
|
746
|
+
}
|
|
747
|
+
search(searchFieldValues) {
|
|
748
|
+
this.dossierParameterService.setSearchFieldValues(searchFieldValues || {});
|
|
749
|
+
this.dossierParameterService.setSearchParameters(searchFieldValues);
|
|
750
|
+
this.dossierListService.checkRefresh();
|
|
751
|
+
}
|
|
752
|
+
mapSearchValuesToFilters(values) {
|
|
753
|
+
const filters = [];
|
|
754
|
+
Object.keys(values).forEach(valueKey => {
|
|
755
|
+
const searchValue = values[valueKey];
|
|
756
|
+
if (searchValue.start) {
|
|
757
|
+
filters.push({ key: valueKey, rangeFrom: searchValue.start, rangeTo: searchValue.end });
|
|
758
|
+
}
|
|
759
|
+
else if (Array.isArray(searchValue)) {
|
|
760
|
+
filters.push({ key: valueKey, values: searchValue });
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
filters.push({ key: valueKey, values: [searchValue] });
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
return filters;
|
|
767
|
+
}
|
|
768
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListSearchService, deps: [{ token: DossierListService }, { token: i2$1.DocumentService }, { token: DossierParameterService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
769
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListSearchService }); }
|
|
770
|
+
}
|
|
771
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListSearchService, decorators: [{
|
|
772
|
+
type: Injectable
|
|
773
|
+
}], ctorParameters: function () { return [{ type: DossierListService }, { type: i2$1.DocumentService }, { type: DossierParameterService }]; } });
|
|
774
|
+
|
|
775
|
+
/*
|
|
776
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
777
|
+
*
|
|
778
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
779
|
+
* you may not use this file except in compliance with the License.
|
|
780
|
+
* You may obtain a copy of the License at
|
|
781
|
+
*
|
|
782
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
783
|
+
*
|
|
784
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
785
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
786
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
787
|
+
* See the License for the specific language governing permissions and
|
|
788
|
+
* limitations under the License.
|
|
789
|
+
*/
|
|
790
|
+
|
|
791
|
+
/*
|
|
792
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
793
|
+
*
|
|
794
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
795
|
+
* you may not use this file except in compliance with the License.
|
|
796
|
+
* You may obtain a copy of the License at
|
|
797
|
+
*
|
|
798
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
799
|
+
*
|
|
800
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
801
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
802
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
803
|
+
* See the License for the specific language governing permissions and
|
|
804
|
+
* limitations under the License.
|
|
805
|
+
*/
|
|
806
|
+
class DossierBulkAssignModalComponent {
|
|
807
|
+
set documentIds(value) {
|
|
808
|
+
if (!value.length) {
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
this.bulkAssignService.loadCandidateUsers(value);
|
|
812
|
+
}
|
|
813
|
+
constructor(bulkAssignService, fb) {
|
|
814
|
+
this.bulkAssignService = bulkAssignService;
|
|
815
|
+
this.fb = fb;
|
|
816
|
+
this.modalClass = 'valtimo-dossier-bulk-assign-modal';
|
|
817
|
+
this.open = false;
|
|
818
|
+
this.closeEvent = new EventEmitter();
|
|
819
|
+
this.candidateUsers$ = this.bulkAssignService.candidateUsers$.pipe(map((candidateUsers) => candidateUsers.map((candidateUser) => ({
|
|
820
|
+
id: candidateUser.id,
|
|
821
|
+
content: `${candidateUser.firstName} ${candidateUser.lastName}`,
|
|
822
|
+
selected: this.formGroup.get('assignee')?.value?.id === candidateUser.id,
|
|
823
|
+
}))));
|
|
824
|
+
this.formGroup = this.fb.group({
|
|
825
|
+
assignee: this.fb.control({ id: '', content: '', selected: false }, Validators.required),
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
closeModal(confirm) {
|
|
829
|
+
const assignee = this.formGroup.get('assignee')?.value ?? null;
|
|
830
|
+
if (!assignee) {
|
|
831
|
+
this.closeEvent.emit(null);
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
this.closeEvent.emit(confirm ? assignee.id : null);
|
|
835
|
+
this.formGroup.reset();
|
|
836
|
+
}
|
|
837
|
+
trackByIndex(index) {
|
|
838
|
+
return index;
|
|
839
|
+
}
|
|
840
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierBulkAssignModalComponent, deps: [{ token: DossierBulkAssignService }, { token: i5.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
841
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierBulkAssignModalComponent, selector: "valtimo-dossier-bulk-assign-modal", inputs: { documentIds: "documentIds", open: "open" }, outputs: { closeEvent: "closeEvent" }, host: { properties: { "class": "this.modalClass" } }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal valtimoCdsModal [open]=\"open\" (close)=\"closeModal()\" showFooter=\"true\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'dossier.bulkAssign.modal.title' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <form *ngIf=\"candidateUsers$ | async as candidateUsers\" [formGroup]=\"formGroup\">\n <cds-combo-box\n formControlName=\"assignee\"\n [dropUp]=\"false\"\n [items]=\"candidateUsers\"\n [label]=\"'dossier.bulkAssign.modal.selectLabel' | translate\"\n [placeholder]=\"'dossier.bulkAssign.modal.selectPlaceholder' | translate\"\n >\n <cds-dropdown-list></cds-dropdown-list>\n </cds-combo-box>\n </form>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">{{ 'interface.cancel' | translate }}</button>\n\n <button cdsButton=\"primary\" [disabled]=\"formGroup.invalid\" (click)=\"closeModal(true)\">\n {{ 'dossier.bulkAssign.modal.confirm' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["::ng-deep .valtimo-dossier-bulk-assign-modal .cds--list-box__field{background-color:#fff}::ng-deep .valtimo-dossier-bulk-assign-modal .cds--modal-container,::ng-deep .valtimo-dossier-bulk-assign-modal .cds--modal-content{overflow:unset}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i4.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i4.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i4.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i4.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i4.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "component", type: i4.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "component", type: i4.ComboBox, selector: "cds-combo-box, ibm-combo-box", inputs: ["placeholder", "openMenuAria", "closeMenuAria", "clearSelectionsTitle", "clearSelectionsAria", "clearSelectionTitle", "clearSelectionAria", "id", "items", "type", "size", "itemValueKey", "label", "helperText", "appendInline", "invalid", "invalidText", "warn", "warnText", "maxLength", "theme", "selectionFeedback", "autocomplete", "dropUp", "disabled"], outputs: ["selected", "submit", "close", "search", "clear"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
842
|
+
}
|
|
843
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierBulkAssignModalComponent, decorators: [{
|
|
844
|
+
type: Component,
|
|
845
|
+
args: [{ selector: 'valtimo-dossier-bulk-assign-modal', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal valtimoCdsModal [open]=\"open\" (close)=\"closeModal()\" showFooter=\"true\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'dossier.bulkAssign.modal.title' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <form *ngIf=\"candidateUsers$ | async as candidateUsers\" [formGroup]=\"formGroup\">\n <cds-combo-box\n formControlName=\"assignee\"\n [dropUp]=\"false\"\n [items]=\"candidateUsers\"\n [label]=\"'dossier.bulkAssign.modal.selectLabel' | translate\"\n [placeholder]=\"'dossier.bulkAssign.modal.selectPlaceholder' | translate\"\n >\n <cds-dropdown-list></cds-dropdown-list>\n </cds-combo-box>\n </form>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">{{ 'interface.cancel' | translate }}</button>\n\n <button cdsButton=\"primary\" [disabled]=\"formGroup.invalid\" (click)=\"closeModal(true)\">\n {{ 'dossier.bulkAssign.modal.confirm' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["::ng-deep .valtimo-dossier-bulk-assign-modal .cds--list-box__field{background-color:#fff}::ng-deep .valtimo-dossier-bulk-assign-modal .cds--modal-container,::ng-deep .valtimo-dossier-bulk-assign-modal .cds--modal-content{overflow:unset}\n"] }]
|
|
846
|
+
}], ctorParameters: function () { return [{ type: DossierBulkAssignService }, { type: i5.FormBuilder }]; }, propDecorators: { modalClass: [{
|
|
847
|
+
type: HostBinding,
|
|
848
|
+
args: ['class']
|
|
849
|
+
}], documentIds: [{
|
|
850
|
+
type: Input
|
|
851
|
+
}], open: [{
|
|
852
|
+
type: Input
|
|
853
|
+
}], closeEvent: [{
|
|
854
|
+
type: Output
|
|
855
|
+
}] } });
|
|
856
|
+
|
|
857
|
+
/*
|
|
858
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
859
|
+
*
|
|
860
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
861
|
+
* you may not use this file except in compliance with the License.
|
|
862
|
+
* You may obtain a copy of the License at
|
|
863
|
+
*
|
|
864
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
865
|
+
*
|
|
866
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
867
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
868
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
869
|
+
* See the License for the specific language governing permissions and
|
|
870
|
+
* limitations under the License.
|
|
871
|
+
*/
|
|
872
|
+
var DefaultTabs;
|
|
873
|
+
(function (DefaultTabs) {
|
|
874
|
+
DefaultTabs["summary"] = "summary";
|
|
875
|
+
DefaultTabs["progress"] = "progress";
|
|
876
|
+
DefaultTabs["audit"] = "audit";
|
|
877
|
+
DefaultTabs["documents"] = "documents";
|
|
878
|
+
DefaultTabs["contactMoments"] = "contact-moments";
|
|
879
|
+
DefaultTabs["zaakobjecten"] = "zaakobjecten";
|
|
880
|
+
DefaultTabs["notes"] = "notes";
|
|
881
|
+
})(DefaultTabs || (DefaultTabs = {}));
|
|
882
|
+
|
|
883
|
+
/*
|
|
884
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
885
|
+
*
|
|
886
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
887
|
+
* you may not use this file except in compliance with the License.
|
|
888
|
+
* You may obtain a copy of the License at
|
|
889
|
+
*
|
|
890
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
891
|
+
*
|
|
892
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
893
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
894
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
895
|
+
* See the License for the specific language governing permissions and
|
|
896
|
+
* limitations under the License.
|
|
897
|
+
*/
|
|
898
|
+
|
|
899
|
+
/*
|
|
900
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
901
|
+
*
|
|
902
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
903
|
+
* you may not use this file except in compliance with the License.
|
|
904
|
+
* You may obtain a copy of the License at
|
|
905
|
+
*
|
|
906
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
907
|
+
*
|
|
908
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
909
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
910
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
911
|
+
* See the License for the specific language governing permissions and
|
|
912
|
+
* limitations under the License.
|
|
913
|
+
*/
|
|
914
|
+
|
|
915
|
+
/*
|
|
916
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
917
|
+
*
|
|
918
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
919
|
+
* you may not use this file except in compliance with the License.
|
|
920
|
+
* You may obtain a copy of the License at
|
|
921
|
+
*
|
|
922
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
923
|
+
*
|
|
924
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
925
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
926
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
927
|
+
* See the License for the specific language governing permissions and
|
|
928
|
+
* limitations under the License.
|
|
929
|
+
*/
|
|
930
|
+
|
|
931
|
+
/*
|
|
932
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
933
|
+
*
|
|
934
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
935
|
+
* you may not use this file except in compliance with the License.
|
|
936
|
+
* You may obtain a copy of the License at
|
|
937
|
+
*
|
|
938
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
939
|
+
*
|
|
940
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
941
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
942
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
943
|
+
* See the License for the specific language governing permissions and
|
|
944
|
+
* limitations under the License.
|
|
945
|
+
*/
|
|
946
|
+
class TabLoaderImpl {
|
|
947
|
+
constructor(tabs, componentFactoryResolver, viewContainerRef, translateService, router, location) {
|
|
948
|
+
this._tabs = null;
|
|
949
|
+
this._componentFactoryResolver = null;
|
|
950
|
+
this._viewContainerRef = null;
|
|
951
|
+
this._activeComponent = null;
|
|
952
|
+
this._activeTab = null;
|
|
953
|
+
this._translateService = null;
|
|
954
|
+
this._tabs = tabs;
|
|
955
|
+
this._componentFactoryResolver = componentFactoryResolver;
|
|
956
|
+
this._viewContainerRef = viewContainerRef;
|
|
957
|
+
this._translateService = translateService;
|
|
958
|
+
this._router = router;
|
|
959
|
+
this._location = location;
|
|
960
|
+
}
|
|
961
|
+
initial(tabName) {
|
|
962
|
+
let initialTab;
|
|
963
|
+
if (tabName) {
|
|
964
|
+
initialTab = this._tabs.find(tab => tab.name === tabName);
|
|
965
|
+
}
|
|
966
|
+
else {
|
|
967
|
+
initialTab = this._tabs[0] || null;
|
|
968
|
+
}
|
|
969
|
+
this.load(initialTab);
|
|
970
|
+
}
|
|
971
|
+
load(newTab) {
|
|
972
|
+
if (newTab !== this._activeTab) {
|
|
973
|
+
this._tabs.forEach(tab => tab.deactivate());
|
|
974
|
+
this.replaceView(newTab);
|
|
975
|
+
this.replaceUrlState(newTab);
|
|
976
|
+
this.setActive(newTab);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
refreshView() {
|
|
980
|
+
this.replaceView(this._activeTab);
|
|
981
|
+
}
|
|
982
|
+
replaceView(tab) {
|
|
983
|
+
const componentFactory = this._componentFactoryResolver.resolveComponentFactory(tab.component);
|
|
984
|
+
this._viewContainerRef.clear();
|
|
985
|
+
if (this._activeTab !== null) {
|
|
986
|
+
this._activeComponent.destroy();
|
|
987
|
+
}
|
|
988
|
+
this._activeComponent = this._viewContainerRef.createComponent(componentFactory);
|
|
989
|
+
}
|
|
990
|
+
replaceUrlState(tab) {
|
|
991
|
+
const currentUrl = this._router.url;
|
|
992
|
+
const queryParams = currentUrl.split('?')[1] || '';
|
|
993
|
+
const urlParts = currentUrl.split('/');
|
|
994
|
+
urlParts.splice(urlParts.length - 1, 1, tab.name);
|
|
995
|
+
const newUrl = urlParts.join('/');
|
|
996
|
+
if (currentUrl.includes(newUrl) && queryParams) {
|
|
997
|
+
this._router.navigateByUrl(`${newUrl}?${queryParams}`);
|
|
998
|
+
}
|
|
999
|
+
else {
|
|
1000
|
+
this._router.navigateByUrl(newUrl);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
setActive(tab) {
|
|
1004
|
+
tab.activate();
|
|
1005
|
+
this._activeTab = tab;
|
|
1006
|
+
}
|
|
1007
|
+
get tabs() {
|
|
1008
|
+
return this._tabs;
|
|
1009
|
+
}
|
|
1010
|
+
translateTabName(tab) {
|
|
1011
|
+
const translationId = 'dossier.tabs.' + tab.name;
|
|
1012
|
+
const translation = this._translateService.instant('dossier.tabs.' + tab.name);
|
|
1013
|
+
return translationId !== translation ? translation : tab.name;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
class TabImpl {
|
|
1017
|
+
constructor(name, sequence, component) {
|
|
1018
|
+
this._active = false;
|
|
1019
|
+
this._name = name;
|
|
1020
|
+
this._sequence = sequence;
|
|
1021
|
+
this._component = component;
|
|
1022
|
+
}
|
|
1023
|
+
get name() {
|
|
1024
|
+
return this._name;
|
|
1025
|
+
}
|
|
1026
|
+
get sequence() {
|
|
1027
|
+
return this._sequence;
|
|
1028
|
+
}
|
|
1029
|
+
get component() {
|
|
1030
|
+
return this._component;
|
|
1031
|
+
}
|
|
1032
|
+
activate() {
|
|
1033
|
+
this._active = true;
|
|
1034
|
+
}
|
|
1035
|
+
deactivate() {
|
|
1036
|
+
this._active = false;
|
|
1037
|
+
}
|
|
1038
|
+
isActive() {
|
|
1039
|
+
return this._active;
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
/*
|
|
1044
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1045
|
+
*
|
|
1046
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1047
|
+
* you may not use this file except in compliance with the License.
|
|
1048
|
+
* You may obtain a copy of the License at
|
|
1049
|
+
*
|
|
1050
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1051
|
+
*
|
|
1052
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1053
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1054
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1055
|
+
* See the License for the specific language governing permissions and
|
|
1056
|
+
* limitations under the License.
|
|
1057
|
+
*/
|
|
1058
|
+
|
|
1059
|
+
/*
|
|
1060
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1061
|
+
*
|
|
1062
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1063
|
+
* you may not use this file except in compliance with the License.
|
|
1064
|
+
* You may obtain a copy of the License at
|
|
1065
|
+
*
|
|
1066
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1067
|
+
*
|
|
1068
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1069
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1070
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1071
|
+
* See the License for the specific language governing permissions and
|
|
1072
|
+
* limitations under the License.
|
|
1073
|
+
*/
|
|
1074
|
+
|
|
1075
|
+
/*
|
|
1076
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1077
|
+
*
|
|
1078
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1079
|
+
* you may not use this file except in compliance with the License.
|
|
1080
|
+
* You may obtain a copy of the License at
|
|
1081
|
+
*
|
|
1082
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1083
|
+
*
|
|
1084
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1085
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1086
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1087
|
+
* See the License for the specific language governing permissions and
|
|
1088
|
+
* limitations under the License.
|
|
1089
|
+
*/
|
|
1090
|
+
var PERMISSION_ACTION;
|
|
1091
|
+
(function (PERMISSION_ACTION) {
|
|
1092
|
+
PERMISSION_ACTION["add"] = "create";
|
|
1093
|
+
PERMISSION_ACTION["assign"] = "assign";
|
|
1094
|
+
PERMISSION_ACTION["claim"] = "claim";
|
|
1095
|
+
PERMISSION_ACTION["delete"] = "delete";
|
|
1096
|
+
PERMISSION_ACTION["edit"] = "modify";
|
|
1097
|
+
})(PERMISSION_ACTION || (PERMISSION_ACTION = {}));
|
|
1098
|
+
var DOSSIER_DETAIL_PERMISSION_RESOURCE;
|
|
1099
|
+
(function (DOSSIER_DETAIL_PERMISSION_RESOURCE) {
|
|
1100
|
+
DOSSIER_DETAIL_PERMISSION_RESOURCE["jsonSchemaDocument"] = "com.ritense.document.domain.impl.JsonSchemaDocument";
|
|
1101
|
+
DOSSIER_DETAIL_PERMISSION_RESOURCE["note"] = "com.ritense.note.domain.Note";
|
|
1102
|
+
DOSSIER_DETAIL_PERMISSION_RESOURCE["jsonSchemaDocumentDefinition"] = "com.ritense.document.domain.impl.JsonSchemaDocumentDefinition";
|
|
1103
|
+
})(DOSSIER_DETAIL_PERMISSION_RESOURCE || (DOSSIER_DETAIL_PERMISSION_RESOURCE = {}));
|
|
1104
|
+
const CAN_CLAIM_CASE_PERMISSION = {
|
|
1105
|
+
action: PERMISSION_ACTION.claim,
|
|
1106
|
+
resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
|
|
1107
|
+
};
|
|
1108
|
+
const CAN_ADD_NOTE_PERMISSION = {
|
|
1109
|
+
action: PERMISSION_ACTION.add,
|
|
1110
|
+
resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.note,
|
|
1111
|
+
};
|
|
1112
|
+
const CAN_DELETE_NOTE_PERMISSION = {
|
|
1113
|
+
action: PERMISSION_ACTION.delete,
|
|
1114
|
+
resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.note,
|
|
1115
|
+
};
|
|
1116
|
+
const CAN_EDIT_NOTE_PERMISSION = {
|
|
1117
|
+
action: PERMISSION_ACTION.edit,
|
|
1118
|
+
resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.note,
|
|
1119
|
+
};
|
|
1120
|
+
const CAN_ASSIGN_CASE_PERMISSION = {
|
|
1121
|
+
action: PERMISSION_ACTION.assign,
|
|
1122
|
+
resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
|
|
1123
|
+
};
|
|
1124
|
+
const CAN_CREATE_CASE_PERMISSION = {
|
|
1125
|
+
action: PERMISSION_ACTION.add,
|
|
1126
|
+
resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
|
|
1127
|
+
};
|
|
1128
|
+
|
|
1129
|
+
/*
|
|
1130
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1131
|
+
*
|
|
1132
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1133
|
+
* you may not use this file except in compliance with the License.
|
|
1134
|
+
* You may obtain a copy of the License at
|
|
1135
|
+
*
|
|
1136
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1137
|
+
*
|
|
1138
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1139
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1140
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1141
|
+
* See the License for the specific language governing permissions and
|
|
1142
|
+
* limitations under the License.
|
|
1143
|
+
*/
|
|
1144
|
+
|
|
1145
|
+
/*
|
|
1146
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1147
|
+
*
|
|
1148
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1149
|
+
* you may not use this file except in compliance with the License.
|
|
1150
|
+
* You may obtain a copy of the License at
|
|
1151
|
+
*
|
|
1152
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1153
|
+
*
|
|
1154
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1155
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1156
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1157
|
+
* See the License for the specific language governing permissions and
|
|
1158
|
+
* limitations under the License.
|
|
1159
|
+
*/
|
|
1160
|
+
moment.locale(localStorage.getItem('langKey') || '');
|
|
1161
|
+
moment.defaultFormat = 'DD MMM YYYY HH:mm';
|
|
1162
|
+
class DossierDetailTabSummaryComponent {
|
|
1163
|
+
constructor(router, documentService, taskService, processService, el, renderer, route, formService, userProviderService, permissionService) {
|
|
1164
|
+
this.router = router;
|
|
1165
|
+
this.documentService = documentService;
|
|
1166
|
+
this.taskService = taskService;
|
|
1167
|
+
this.processService = processService;
|
|
1168
|
+
this.el = el;
|
|
1169
|
+
this.renderer = renderer;
|
|
1170
|
+
this.route = route;
|
|
1171
|
+
this.formService = formService;
|
|
1172
|
+
this.userProviderService = userProviderService;
|
|
1173
|
+
this.permissionService = permissionService;
|
|
1174
|
+
this.processDocumentInstances = [];
|
|
1175
|
+
this.tasks = [];
|
|
1176
|
+
this.formDefinition = null;
|
|
1177
|
+
this.roles = [];
|
|
1178
|
+
this.loadingTasks$ = new BehaviorSubject(true);
|
|
1179
|
+
this._subscriptions = new Subscription();
|
|
1180
|
+
this.snapshot = this.route.snapshot.paramMap;
|
|
1181
|
+
this.documentDefinitionName = this.snapshot.get('documentDefinitionName') || '';
|
|
1182
|
+
this.documentId = this.snapshot.get('documentId') || '';
|
|
1183
|
+
this.options = new FormioOptionsImpl();
|
|
1184
|
+
this.options.disableAlerts = true;
|
|
1185
|
+
}
|
|
1186
|
+
ngOnInit() {
|
|
1187
|
+
this.moment = moment;
|
|
1188
|
+
this.init();
|
|
1189
|
+
}
|
|
1190
|
+
ngOnDestroy() {
|
|
1191
|
+
this._subscriptions.unsubscribe();
|
|
1192
|
+
}
|
|
1193
|
+
init() {
|
|
1194
|
+
this._subscriptions.add(this.documentService.getDocument(this.documentId).subscribe(document => {
|
|
1195
|
+
this.document = document;
|
|
1196
|
+
}));
|
|
1197
|
+
this._subscriptions.add(this.formService
|
|
1198
|
+
.getFormDefinitionByNamePreFilled(`${this.documentDefinitionName}.summary`, this.documentId)
|
|
1199
|
+
.subscribe(formDefinition => {
|
|
1200
|
+
this.formDefinition = formDefinition;
|
|
1201
|
+
}));
|
|
1202
|
+
this._subscriptions.add(this.userProviderService.getUserSubject().subscribe(user => {
|
|
1203
|
+
this.roles = user.roles;
|
|
1204
|
+
this.tasks = [];
|
|
1205
|
+
this.loadProcessDocumentInstances(this.documentId);
|
|
1206
|
+
}));
|
|
1207
|
+
}
|
|
1208
|
+
loadProcessDocumentInstances(documentId) {
|
|
1209
|
+
this._subscriptions.add(this.documentService
|
|
1210
|
+
.findProcessDocumentInstances(documentId)
|
|
1211
|
+
.subscribe(processDocumentInstances => {
|
|
1212
|
+
this.processDocumentInstances = processDocumentInstances;
|
|
1213
|
+
this.processDocumentInstances.forEach(instance => {
|
|
1214
|
+
this.loadProcessInstanceTasks(instance.id.processInstanceId);
|
|
1215
|
+
});
|
|
1216
|
+
}));
|
|
1217
|
+
}
|
|
1218
|
+
rowTaskClick(task) {
|
|
1219
|
+
this.taskDetail.openTaskDetails(task);
|
|
1220
|
+
}
|
|
1221
|
+
loadProcessInstanceTasks(processInstanceId) {
|
|
1222
|
+
this._subscriptions.add(this.processService
|
|
1223
|
+
.getProcessInstanceTasks(processInstanceId)
|
|
1224
|
+
.pipe(switchMap(tasks => combineLatest([
|
|
1225
|
+
of(tasks),
|
|
1226
|
+
...tasks.map(task => this.permissionService.requestPermission(CAN_VIEW_TASK_PERMISSION, {
|
|
1227
|
+
resource: TASK_DETAIL_PERMISSION_RESOURCE.task,
|
|
1228
|
+
identifier: task.id,
|
|
1229
|
+
})),
|
|
1230
|
+
])))
|
|
1231
|
+
.subscribe(res => {
|
|
1232
|
+
const tasks = res[0];
|
|
1233
|
+
const permissions = res.filter((_, index) => index !== 0);
|
|
1234
|
+
if (tasks != null) {
|
|
1235
|
+
tasks.forEach((task, taskIndex) => {
|
|
1236
|
+
task.createdUnix = this.moment(task.created).unix();
|
|
1237
|
+
task.created = this.moment(task.created).format('DD MMM YYYY HH:mm');
|
|
1238
|
+
task.isLocked = !permissions[taskIndex];
|
|
1239
|
+
});
|
|
1240
|
+
this.tasks = this.tasks.concat(tasks);
|
|
1241
|
+
this.tasks.sort((t1, t2) => t2.createdUnix - t1.createdUnix);
|
|
1242
|
+
}
|
|
1243
|
+
this.loadingTasks$.next(false);
|
|
1244
|
+
}));
|
|
1245
|
+
}
|
|
1246
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabSummaryComponent, deps: [{ token: i1$1.Router }, { token: i2$1.DocumentService }, { token: i3$1.TaskService }, { token: i2$2.ProcessService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1$1.ActivatedRoute }, { token: i5$1.FormService }, { token: i6$1.UserProviderService }, { token: i7.PermissionService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1247
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabSummaryComponent, selector: "valtimo-dossier-detail-tab-summary", viewQueries: [{ propertyName: "taskDetail", first: true, predicate: ["taskDetail"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"container-fluid\" *ngIf=\"{loadingTasks: loadingTasks$ | async} as obs\">\n <div class=\"row py-4\">\n <div class=\"col-sm-12 col-md-8 col-xl-9\">\n <div *ngIf=\"document\">\n <div *ngIf=\"formDefinition\" class=\"summaryForm\">\n <div class=\"mb-4\">\n <valtimo-form-io [form]=\"formDefinition\" [options]=\"options\"></valtimo-form-io>\n </div>\n </div>\n </div>\n </div>\n\n <!--Current user tasks right side-->\n <div class=\"col-sm-12 col-md-4 col-xl-3\">\n <h4 class=\"user-tasks-title\">{{ 'summary.userTasks' | translate }}</h4>\n <ng-container *ngIf=\"!obs.loadingTasks; else loadingTasksTemplate\">\n <ng-container *ngIf=\"!tasks.length\">\n <valtimo-widget>\n <div class=\"p-3\">\n <img class=\"float-left\" src=\"assets/audit-2.png\" height=\"25\" />\n <span class=\"float-right\">{{ 'summary.userTasksDoneState' | translate }}</span>\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </ng-container>\n\n <ng-container *ngFor=\"let task of tasks\">\n <valtimo-widget>\n <div\n *ngIf=\"!task.isLocked\"\n class=\"p-3 clickable hoverable\"\n (click)=\"rowTaskClick(task)\"\n >\n <span class=\"float-right badge badge-pill badge-primary\">{{\n 'summary.taskOpen' | translate\n }}</span>\n <strong>{{ task.name }}</strong>\n <div class=\"mt-1\">{{ 'summary.taskCreated' | translate }} {{ task.created }}</div>\n </div>\n <div class=\"p-3 hoverable\" *ngIf=\"task.isLocked\">\n <span\n class=\"float-right badge badge-pill badge-secondary bg-grey\"\n ngbTooltip=\"{{ 'summary.taskLocked' | translate }}\"\n >\n <i class=\"icon mdi mdi-lock\"></i>\n </span>\n <strong>{{ task.name }}</strong>\n <div>{{ 'summary.taskCreated' | translate }} {{ task.created }}</div>\n </div>\n </valtimo-widget>\n </ng-container>\n </ng-container>\n\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"init()\"\n (assignmentOfTaskChanged)=\"init()\"\n ></valtimo-task-detail-modal>\n </div>\n </div>\n</div>\n\n<ng-template #loadingTasksTemplate>\n <div class=\"loading-container\">\n <cds-loading size=\"sm\"></cds-loading>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.hoverable:hover{background-color:#eee}.summaryForm .formio-component{margin-bottom:0!important}.summaryForm .formio-component div[ref=element] .form-control{height:24px!important;background-color:#fff;border:0px;margin:0;padding:0!important;font-size:13px}.summaryForm .formio-field div[ref=element] .form-control{font-weight:400}.summaryForm .formio-value div[ref=element] .form-control{font-weight:700}.user-tasks-title{margin-top:0;margin-bottom:12px;font-weight:400;color:#000;height:20px}.loading-container{display:flex;width:100%;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: i3$2.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i3$1.TaskDetailModalComponent, selector: "valtimo-task-detail-modal", outputs: ["formSubmit", "assignmentOfTaskChanged"] }, { kind: "directive", type: i10.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { kind: "component", type: i4.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1248
|
+
}
|
|
1249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabSummaryComponent, decorators: [{
|
|
1250
|
+
type: Component,
|
|
1251
|
+
args: [{ selector: 'valtimo-dossier-detail-tab-summary', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"container-fluid\" *ngIf=\"{loadingTasks: loadingTasks$ | async} as obs\">\n <div class=\"row py-4\">\n <div class=\"col-sm-12 col-md-8 col-xl-9\">\n <div *ngIf=\"document\">\n <div *ngIf=\"formDefinition\" class=\"summaryForm\">\n <div class=\"mb-4\">\n <valtimo-form-io [form]=\"formDefinition\" [options]=\"options\"></valtimo-form-io>\n </div>\n </div>\n </div>\n </div>\n\n <!--Current user tasks right side-->\n <div class=\"col-sm-12 col-md-4 col-xl-3\">\n <h4 class=\"user-tasks-title\">{{ 'summary.userTasks' | translate }}</h4>\n <ng-container *ngIf=\"!obs.loadingTasks; else loadingTasksTemplate\">\n <ng-container *ngIf=\"!tasks.length\">\n <valtimo-widget>\n <div class=\"p-3\">\n <img class=\"float-left\" src=\"assets/audit-2.png\" height=\"25\" />\n <span class=\"float-right\">{{ 'summary.userTasksDoneState' | translate }}</span>\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </ng-container>\n\n <ng-container *ngFor=\"let task of tasks\">\n <valtimo-widget>\n <div\n *ngIf=\"!task.isLocked\"\n class=\"p-3 clickable hoverable\"\n (click)=\"rowTaskClick(task)\"\n >\n <span class=\"float-right badge badge-pill badge-primary\">{{\n 'summary.taskOpen' | translate\n }}</span>\n <strong>{{ task.name }}</strong>\n <div class=\"mt-1\">{{ 'summary.taskCreated' | translate }} {{ task.created }}</div>\n </div>\n <div class=\"p-3 hoverable\" *ngIf=\"task.isLocked\">\n <span\n class=\"float-right badge badge-pill badge-secondary bg-grey\"\n ngbTooltip=\"{{ 'summary.taskLocked' | translate }}\"\n >\n <i class=\"icon mdi mdi-lock\"></i>\n </span>\n <strong>{{ task.name }}</strong>\n <div>{{ 'summary.taskCreated' | translate }} {{ task.created }}</div>\n </div>\n </valtimo-widget>\n </ng-container>\n </ng-container>\n\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"init()\"\n (assignmentOfTaskChanged)=\"init()\"\n ></valtimo-task-detail-modal>\n </div>\n </div>\n</div>\n\n<ng-template #loadingTasksTemplate>\n <div class=\"loading-container\">\n <cds-loading size=\"sm\"></cds-loading>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.hoverable:hover{background-color:#eee}.summaryForm .formio-component{margin-bottom:0!important}.summaryForm .formio-component div[ref=element] .form-control{height:24px!important;background-color:#fff;border:0px;margin:0;padding:0!important;font-size:13px}.summaryForm .formio-field div[ref=element] .form-control{font-weight:400}.summaryForm .formio-value div[ref=element] .form-control{font-weight:700}.user-tasks-title{margin-top:0;margin-bottom:12px;font-weight:400;color:#000;height:20px}.loading-container{display:flex;width:100%;justify-content:center}\n"] }]
|
|
1252
|
+
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i2$1.DocumentService }, { type: i3$1.TaskService }, { type: i2$2.ProcessService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1$1.ActivatedRoute }, { type: i5$1.FormService }, { type: i6$1.UserProviderService }, { type: i7.PermissionService }]; }, propDecorators: { taskDetail: [{
|
|
1253
|
+
type: ViewChild,
|
|
1254
|
+
args: ['taskDetail']
|
|
1255
|
+
}] } });
|
|
1256
|
+
|
|
1257
|
+
/*
|
|
1258
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1259
|
+
*
|
|
1260
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1261
|
+
* you may not use this file except in compliance with the License.
|
|
1262
|
+
* You may obtain a copy of the License at
|
|
1263
|
+
*
|
|
1264
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1265
|
+
*
|
|
1266
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1267
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1268
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1269
|
+
* See the License for the specific language governing permissions and
|
|
1270
|
+
* limitations under the License.
|
|
1271
|
+
*/
|
|
1272
|
+
class DossierDetailTabProgressComponent {
|
|
1273
|
+
constructor(route, documentService) {
|
|
1274
|
+
this.route = route;
|
|
1275
|
+
this.documentService = documentService;
|
|
1276
|
+
const snapshot = this.route.snapshot.paramMap;
|
|
1277
|
+
this.documentId = snapshot.get('documentId') || '';
|
|
1278
|
+
}
|
|
1279
|
+
ngOnInit() {
|
|
1280
|
+
this.documentService
|
|
1281
|
+
.findProcessDocumentInstances(this.documentId)
|
|
1282
|
+
.subscribe(processDocumentInstances => {
|
|
1283
|
+
this.processDocumentInstances = processDocumentInstances.sort((a, b) => a.isActive === b.isActive ? 0 : a.isActive ? -1 : 1);
|
|
1284
|
+
if (processDocumentInstances.length > 0) {
|
|
1285
|
+
this.selectedProcessInstanceId = processDocumentInstances[0].id.processInstanceId;
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
loadProcessInstance(processInstanceId) {
|
|
1290
|
+
this.selectedProcessInstanceId = processInstanceId;
|
|
1291
|
+
}
|
|
1292
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabProgressComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i2$1.DocumentService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1293
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabProgressComponent, selector: "valtimo-dossier-detail-tab-progress", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"full-height-tab-content\"\n *ngIf=\"\n processDocumentInstances && processDocumentInstances.length > 0;\n else emptyProcessDocumentInstances\n \"\n>\n <div class=\"col-3\">\n <label><strong>Process</strong></label\n ><br />\n <select class=\"form-control\" (change)=\"loadProcessInstance($event.target.value)\">\n <option\n *ngFor=\"let processDocumentInstance of processDocumentInstances\"\n [value]=\"processDocumentInstance.id.processInstanceId\"\n [selected]=\"selectedProcessInstanceId === processDocumentInstance.id.processInstanceId\"\n >\n {{ processDocumentInstance.processName }}\n </option>\n </select>\n </div>\n <valtimo-process-diagram\n [processInstanceId]=\"selectedProcessInstanceId\"\n ></valtimo-process-diagram>\n</div>\n\n<ng-template #emptyProcessDocumentInstances>\n <span> {{ 'progress.noProcessDocumentInstances' | translate }}</span>\n</ng-template>\n", styles: [".full-height-tab-content{height:calc(100vh - 380px);width:100%}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$2.ProcessDiagramComponent, selector: "valtimo-process-diagram", inputs: ["processDefinitionKey", "processInstanceId"], outputs: ["importDone"] }, { kind: "directive", type: i5.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.Option, selector: "option" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
1294
|
+
}
|
|
1295
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabProgressComponent, decorators: [{
|
|
1296
|
+
type: Component,
|
|
1297
|
+
args: [{ selector: 'valtimo-dossier-detail-tab-progress', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"full-height-tab-content\"\n *ngIf=\"\n processDocumentInstances && processDocumentInstances.length > 0;\n else emptyProcessDocumentInstances\n \"\n>\n <div class=\"col-3\">\n <label><strong>Process</strong></label\n ><br />\n <select class=\"form-control\" (change)=\"loadProcessInstance($event.target.value)\">\n <option\n *ngFor=\"let processDocumentInstance of processDocumentInstances\"\n [value]=\"processDocumentInstance.id.processInstanceId\"\n [selected]=\"selectedProcessInstanceId === processDocumentInstance.id.processInstanceId\"\n >\n {{ processDocumentInstance.processName }}\n </option>\n </select>\n </div>\n <valtimo-process-diagram\n [processInstanceId]=\"selectedProcessInstanceId\"\n ></valtimo-process-diagram>\n</div>\n\n<ng-template #emptyProcessDocumentInstances>\n <span> {{ 'progress.noProcessDocumentInstances' | translate }}</span>\n</ng-template>\n", styles: [".full-height-tab-content{height:calc(100vh - 380px);width:100%}\n"] }]
|
|
1298
|
+
}], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i2$1.DocumentService }]; } });
|
|
1299
|
+
|
|
1300
|
+
/*
|
|
1301
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1302
|
+
*
|
|
1303
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1304
|
+
* you may not use this file except in compliance with the License.
|
|
1305
|
+
* You may obtain a copy of the License at
|
|
1306
|
+
*
|
|
1307
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1308
|
+
*
|
|
1309
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1310
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1311
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1312
|
+
* See the License for the specific language governing permissions and
|
|
1313
|
+
* limitations under the License.
|
|
1314
|
+
*/
|
|
1315
|
+
moment.locale(localStorage.getItem('langKey') || '');
|
|
1316
|
+
moment.defaultFormat = 'DD MMM YYYY HH:mm';
|
|
1317
|
+
class DossierDetailTabAuditComponent {
|
|
1318
|
+
constructor(route, documentService, spinnerService) {
|
|
1319
|
+
this.route = route;
|
|
1320
|
+
this.documentService = documentService;
|
|
1321
|
+
this.spinnerService = spinnerService;
|
|
1322
|
+
this.paginationClicked = new EventEmitter();
|
|
1323
|
+
this.defaultAuditPage = 0;
|
|
1324
|
+
this.spinnerService.show('auditSpinner');
|
|
1325
|
+
const snapshot = this.route.snapshot.paramMap;
|
|
1326
|
+
this.documentId = snapshot.get('documentId') || '';
|
|
1327
|
+
}
|
|
1328
|
+
static getTranslationKey(auditEvent) {
|
|
1329
|
+
const classNameArray = auditEvent.className.split('.');
|
|
1330
|
+
const eventName = classNameArray[classNameArray.length - 1];
|
|
1331
|
+
return 'events.' + eventName;
|
|
1332
|
+
}
|
|
1333
|
+
ngOnInit() {
|
|
1334
|
+
this.loadAuditPage(this.defaultAuditPage);
|
|
1335
|
+
}
|
|
1336
|
+
loadAuditPage(pageNumber) {
|
|
1337
|
+
this.documentService.getAuditLog(this.documentId, pageNumber).subscribe(page => {
|
|
1338
|
+
const timelineItems = [];
|
|
1339
|
+
page.content.forEach(auditRecord => {
|
|
1340
|
+
const occurredOn = moment(auditRecord.metaData.occurredOn);
|
|
1341
|
+
const fromNow = occurredOn.fromNow();
|
|
1342
|
+
timelineItems.push(new TimelineItemImpl(occurredOn.format('DD MMM YYYY'), occurredOn.format('HH:mm'), auditRecord.metaData.user, fromNow, DossierDetailTabAuditComponent.getTranslationKey(auditRecord.auditEvent), auditRecord.auditEvent));
|
|
1343
|
+
});
|
|
1344
|
+
this.timelineItems = timelineItems;
|
|
1345
|
+
this.spinnerService.hide('auditSpinner');
|
|
1346
|
+
this.pagination = page;
|
|
1347
|
+
this.pagination.number += 1;
|
|
1348
|
+
});
|
|
1349
|
+
}
|
|
1350
|
+
onChangePagination(page) {
|
|
1351
|
+
this.paginationClicked.emit(page);
|
|
1352
|
+
this.currentAuditPage = page - 1;
|
|
1353
|
+
this.loadAuditPage(this.currentAuditPage);
|
|
1354
|
+
}
|
|
1355
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabAuditComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i2$1.DocumentService }, { token: i3$3.NgxSpinnerService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1356
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabAuditComponent, selector: "valtimo-dossier-detail-tab-audit", outputs: { paginationClicked: "paginationClicked" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngIf=\"timelineItems\">\n <valtimo-timeline [items]=\"timelineItems\"></valtimo-timeline>\n</div>\n<valtimo-spinner\n [useBootstrapSpinner]=\"false\"\n name=\"auditSpinner\"\n bdColor=\"rgba(125, 125, 125, 0.35)\"\n color=\"#264251\"\n type=\"square-jelly-box\"\n>\n</valtimo-spinner>\n<div\n class=\"pagination-holder audit-pagination bg-light px-4 pt-4 pb-2 overflow-auto row mr-0 ml-0\"\n *ngIf=\"pagination && pagination.totalElements > pagination.size\"\n>\n <div class=\"float-left page-count col-4\">\n <strong>{{\n 'list.currentPage' | translate: {current: pagination.number, total: pagination.totalPages}\n }}</strong>\n <br />\n {{\n pagination.totalElements === 1\n ? ('list.showingResult' | translate: {number: pagination.content.length})\n : ('list.showingResults'\n | translate: {number: pagination.content.length, total: pagination.totalElements})\n }}\n </div>\n <div class=\"col-8\">\n <ngb-pagination\n *ngIf=\"pagination.totalElements > pagination.size\"\n class=\"float-right\"\n [collectionSize]=\"pagination.totalElements\"\n [(page)]=\"pagination.number\"\n [pageSize]=\"pagination.size\"\n [maxSize]=\"pagination.size\"\n [rotate]=\"true\"\n (pageChange)=\"onChangePagination(pagination.number)\"\n ></ngb-pagination>\n </div>\n</div>\n", styles: [".audit-pagination{margin:0 -1.923rem -1.923rem!important;border-top:1px solid #dee2e6}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.TimelineComponent, selector: "valtimo-timeline", inputs: ["items", "actions"] }, { kind: "component", type: i3$2.SpinnerComponent, selector: "valtimo-spinner", inputs: ["useBootstrapSpinner", "name", "type", "size", "color", "bdColor", "fullScreen", "noMarginTop"] }, { kind: "component", type: i10.NgbPagination, selector: "ngb-pagination", inputs: ["disabled", "boundaryLinks", "directionLinks", "ellipses", "rotate", "collectionSize", "maxSize", "page", "pageSize", "size"], outputs: ["pageChange"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
1357
|
+
}
|
|
1358
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabAuditComponent, decorators: [{
|
|
1359
|
+
type: Component,
|
|
1360
|
+
args: [{ selector: 'valtimo-dossier-detail-tab-audit', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngIf=\"timelineItems\">\n <valtimo-timeline [items]=\"timelineItems\"></valtimo-timeline>\n</div>\n<valtimo-spinner\n [useBootstrapSpinner]=\"false\"\n name=\"auditSpinner\"\n bdColor=\"rgba(125, 125, 125, 0.35)\"\n color=\"#264251\"\n type=\"square-jelly-box\"\n>\n</valtimo-spinner>\n<div\n class=\"pagination-holder audit-pagination bg-light px-4 pt-4 pb-2 overflow-auto row mr-0 ml-0\"\n *ngIf=\"pagination && pagination.totalElements > pagination.size\"\n>\n <div class=\"float-left page-count col-4\">\n <strong>{{\n 'list.currentPage' | translate: {current: pagination.number, total: pagination.totalPages}\n }}</strong>\n <br />\n {{\n pagination.totalElements === 1\n ? ('list.showingResult' | translate: {number: pagination.content.length})\n : ('list.showingResults'\n | translate: {number: pagination.content.length, total: pagination.totalElements})\n }}\n </div>\n <div class=\"col-8\">\n <ngb-pagination\n *ngIf=\"pagination.totalElements > pagination.size\"\n class=\"float-right\"\n [collectionSize]=\"pagination.totalElements\"\n [(page)]=\"pagination.number\"\n [pageSize]=\"pagination.size\"\n [maxSize]=\"pagination.size\"\n [rotate]=\"true\"\n (pageChange)=\"onChangePagination(pagination.number)\"\n ></ngb-pagination>\n </div>\n</div>\n", styles: [".audit-pagination{margin:0 -1.923rem -1.923rem!important;border-top:1px solid #dee2e6}\n"] }]
|
|
1361
|
+
}], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i2$1.DocumentService }, { type: i3$3.NgxSpinnerService }]; }, propDecorators: { paginationClicked: [{
|
|
1362
|
+
type: Output
|
|
1363
|
+
}] } });
|
|
1364
|
+
|
|
1365
|
+
/*
|
|
1366
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1367
|
+
*
|
|
1368
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1369
|
+
* you may not use this file except in compliance with the License.
|
|
1370
|
+
* You may obtain a copy of the License at
|
|
1371
|
+
*
|
|
1372
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1373
|
+
*
|
|
1374
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1375
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1376
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1377
|
+
* See the License for the specific language governing permissions and
|
|
1378
|
+
* limitations under the License.
|
|
1379
|
+
*/
|
|
1380
|
+
class DossierDetailTabDocumentenApiDocumentsComponent {
|
|
1381
|
+
constructor(route, documentService, toastrService, uploadProviderService, downloadService, promptService, translateService, configService, userProviderService, fileSortService) {
|
|
1382
|
+
this.route = route;
|
|
1383
|
+
this.documentService = documentService;
|
|
1384
|
+
this.toastrService = toastrService;
|
|
1385
|
+
this.uploadProviderService = uploadProviderService;
|
|
1386
|
+
this.downloadService = downloadService;
|
|
1387
|
+
this.promptService = promptService;
|
|
1388
|
+
this.translateService = translateService;
|
|
1389
|
+
this.configService = configService;
|
|
1390
|
+
this.userProviderService = userProviderService;
|
|
1391
|
+
this.fileSortService = fileSortService;
|
|
1392
|
+
this.maxFileSize = this.configService?.config?.caseFileSizeUploadLimitMB || 5;
|
|
1393
|
+
this.acceptedFiles = this.configService?.config?.caseFileUploadAcceptedFiles || null;
|
|
1394
|
+
this.fields = [
|
|
1395
|
+
{ key: 'fileName', label: 'File name' },
|
|
1396
|
+
{ key: 'sizeInBytes', label: 'Size in bytes' },
|
|
1397
|
+
{ key: 'createdOn', label: 'Created on' },
|
|
1398
|
+
{ key: 'createdBy', label: 'Created by' },
|
|
1399
|
+
];
|
|
1400
|
+
this.uploadProcessLinkedSet = false;
|
|
1401
|
+
this.uploading$ = new BehaviorSubject(false);
|
|
1402
|
+
this.showModal$ = new Subject();
|
|
1403
|
+
this.hideModal$ = new Subject();
|
|
1404
|
+
this.modalDisabled$ = new BehaviorSubject(false);
|
|
1405
|
+
this.fileToBeUploaded$ = new BehaviorSubject(null);
|
|
1406
|
+
this.loading$ = new BehaviorSubject(true);
|
|
1407
|
+
this.refetch$ = new BehaviorSubject(null);
|
|
1408
|
+
this.relatedFiles$ = this.refetch$.pipe(switchMap$1(() => combineLatest([
|
|
1409
|
+
this.documentService.getZakenApiDocuments(this.documentId),
|
|
1410
|
+
this.translateService.stream('key'),
|
|
1411
|
+
])), map$1(([relatedFiles]) => {
|
|
1412
|
+
const translatedFiles = relatedFiles?.map(file => ({
|
|
1413
|
+
...file,
|
|
1414
|
+
createdBy: file.createdBy || this.translateService.instant('list.automaticallyGenerated'),
|
|
1415
|
+
}));
|
|
1416
|
+
return translatedFiles || [];
|
|
1417
|
+
}), map$1(relatedFiles => this.fileSortService.sortRelatedFilesByDateDescending(relatedFiles)), map$1(relatedFiles => {
|
|
1418
|
+
moment.locale(this.translateService.currentLang);
|
|
1419
|
+
return relatedFiles.map(file => ({
|
|
1420
|
+
...file,
|
|
1421
|
+
createdOn: moment(new Date(file.createdOn)).format('L'),
|
|
1422
|
+
}));
|
|
1423
|
+
}), tap$1(() => this.loading$.next(false)), catchError(() => {
|
|
1424
|
+
this.showZaakLinkWarning = true;
|
|
1425
|
+
return of([]);
|
|
1426
|
+
}));
|
|
1427
|
+
this.downloadingFileIndexes$ = new BehaviorSubject([]);
|
|
1428
|
+
const snapshot = this.route.snapshot.paramMap;
|
|
1429
|
+
this.documentId = snapshot.get('documentId') || '';
|
|
1430
|
+
this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
|
|
1431
|
+
}
|
|
1432
|
+
ngOnInit() {
|
|
1433
|
+
this.refetchDocuments();
|
|
1434
|
+
this.setUploadProcessLinked();
|
|
1435
|
+
this.isUserAdmin();
|
|
1436
|
+
}
|
|
1437
|
+
fileSelected(file) {
|
|
1438
|
+
this.fileToBeUploaded$.next(file);
|
|
1439
|
+
this.showModal$.next(null);
|
|
1440
|
+
}
|
|
1441
|
+
downloadDocument(relatedFile, index) {
|
|
1442
|
+
this.downloadingFileIndexes$.pipe(take$1(1)).subscribe(indexes => {
|
|
1443
|
+
this.downloadingFileIndexes$.next([...indexes, index]);
|
|
1444
|
+
const finished$ = this.downloadService.downloadFile(`/api/v1/documenten-api/${relatedFile.pluginConfigurationId}/files/${relatedFile.fileId}/download`, relatedFile.fileName);
|
|
1445
|
+
finished$.pipe(take$1(1)).subscribe(() => {
|
|
1446
|
+
this.downloadingFileIndexes$.next(this.downloadingFileIndexes$.getValue().filter(downloadIndex => downloadIndex !== index));
|
|
1447
|
+
});
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
metadataSet(metadata) {
|
|
1451
|
+
this.uploading$.next(true);
|
|
1452
|
+
this.hideModal$.next(null);
|
|
1453
|
+
this.fileToBeUploaded$
|
|
1454
|
+
.pipe(take$1(1))
|
|
1455
|
+
.pipe(tap$1(file => {
|
|
1456
|
+
this.uploadProviderService
|
|
1457
|
+
.uploadFileWithMetadata(file, this.documentId, metadata)
|
|
1458
|
+
.subscribe(res => {
|
|
1459
|
+
this.refetchDocuments();
|
|
1460
|
+
this.uploading$.next(false);
|
|
1461
|
+
this.fileToBeUploaded$.next(null);
|
|
1462
|
+
});
|
|
1463
|
+
}))
|
|
1464
|
+
.subscribe();
|
|
1465
|
+
}
|
|
1466
|
+
indexesIncludeIndex(indexes, index) {
|
|
1467
|
+
return indexes.includes(index);
|
|
1468
|
+
}
|
|
1469
|
+
isUserAdmin() {
|
|
1470
|
+
this.userProviderService.getUserSubject().subscribe(userIdentity => {
|
|
1471
|
+
this.isAdmin = userIdentity.roles.includes('ROLE_ADMIN');
|
|
1472
|
+
}, error => {
|
|
1473
|
+
this.isAdmin = false;
|
|
1474
|
+
});
|
|
1475
|
+
}
|
|
1476
|
+
refetchDocuments() {
|
|
1477
|
+
this.refetch$.next(null);
|
|
1478
|
+
}
|
|
1479
|
+
setUploadProcessLinked() {
|
|
1480
|
+
this.uploadProviderService.checkUploadProcessLink(this.documentDefinitionName).subscribe(linked => {
|
|
1481
|
+
this.uploadProcessLinked = linked;
|
|
1482
|
+
this.uploadProcessLinkedSet = true;
|
|
1483
|
+
}, () => {
|
|
1484
|
+
this.uploadProcessLinkedSet = true;
|
|
1485
|
+
});
|
|
1486
|
+
}
|
|
1487
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabDocumentenApiDocumentsComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i2$1.DocumentService }, { token: i3$4.ToastrService }, { token: i4$1.UploadProviderService }, { token: i4$1.DownloadService }, { token: i3$2.PromptService }, { token: i6.TranslateService }, { token: i1.ConfigService }, { token: i6$1.UserProviderService }, { token: FileSortService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1488
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabDocumentenApiDocumentsComponent, selector: "valtimo-dossier-detail-tab-documenten-api-documents", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"{loading: loading$ | async} as obs\">\n <div *ngIf=\"uploadProcessLinkedSet && !uploadProcessLinked\">\n <div\n *ngIf=\"isAdmin\"\n [translate]=\"'dossier.documenten.noProcessLinked.adminRole'\"\n class=\"bg-warning text-black mb-2 p-3 text-center\"\n ></div>\n <div\n *ngIf=\"!isAdmin\"\n [translate]=\"'dossier.documenten.noProcessLinked.regularUser'\"\n class=\"bg-warning text-black mb-2 p-3 text-center\"\n ></div>\n </div>\n <div *ngIf=\"showZaakLinkWarning\">\n <div\n [translate]=\"'dossier.documenten.noZaakFound'\"\n class=\"bg-warning text-black mb-2 p-3 text-center\"\n ></div>\n </div>\n\n <valtimo-dropzone\n *ngIf=\"!obs.loading\"\n (fileSelected)=\"fileSelected($event)\"\n [acceptedFiles]=\"acceptedFiles\"\n [camera]=\"false\"\n [disabled]=\"\n !uploadProcessLinkedSet || !uploadProcessLinked || obs.loading || showZaakLinkWarning\n \"\n [hideFilePreview]=\"true\"\n [hideTitle]=\"true\"\n [maxFileSize]=\"maxFileSize\"\n [maxFiles]=\"1\"\n [showMaxFileSize]=\"true\"\n [uploading]=\"uploading$ | async\"\n ></valtimo-dropzone>\n\n <valtimo-widget>\n <valtimo-list\n [ngClass]=\"{hidden: obs.loading}\"\n [fields]=\"fields\"\n [header]=\"true\"\n [isSearchable]=\"true\"\n [items]=\"relatedFiles$ | async\"\n [viewMode]=\"true\"\n [lastColumnTemplate]=\"downloadButton\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Related documents' | translate }}</h3>\n <h5 class=\"list-header-description\">\n {{ 'Overview of all documents in this dossier' | translate }}\n </h5>\n </div>\n </valtimo-list>\n <ng-container *ngTemplateOutlet=\"loading; context: {loading: obs.loading}\"></ng-container>\n </valtimo-widget>\n</ng-container>\n\n<valtimo-documenten-api-metadata-modal\n (metadata)=\"metadataSet($event)\"\n [disabled$]=\"modalDisabled$\"\n [file$]=\"fileToBeUploaded$\"\n [hide$]=\"hideModal$\"\n [show$]=\"showModal$\"\n></valtimo-documenten-api-metadata-modal>\n\n<ng-template #loading let-loading=\"loading\">\n <div *ngIf=\"loading\" class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n</ng-template>\n\n<ng-template #downloadButton let-index=\"index\" let-item=\"item\">\n <div\n class=\"download-button-container\"\n *ngIf=\"{isDownloading: indexesIncludeIndex(downloadingFileIndexes$ | async, index)} as vars\"\n >\n <button\n *ngIf=\"!vars.isDownloading\"\n cdsButton=\"primary\"\n size=\"sm\"\n (click)=\"downloadDocument(item, index)\"\n >\n {{ 'interface.download' | translate\n }}<svg class=\"cds--btn__icon\" cdsIcon=\"download\" size=\"16\"></svg>\n </button>\n <cds-loading size=\"sm\" *ngIf=\"vars.isDownloading\"></cds-loading>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.hidden{display:none}.loading-container{padding:var(--cds-grid-margin);display:flex;align-items:center;justify-content:center}.download-button-container{display:flex;width:100%;flex-direction:row;justify-content:flex-end;align-items:center;min-height:32px}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$2.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState", "lastColumnTemplate"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: i3$2.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "directive", type: i6.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: i3$2.DropzoneComponent, selector: "valtimo-dropzone", inputs: ["title", "hideTitle", "subtitle", "externalError$", "maxFileSize", "showMaxFileSize", "acceptedFiles", "clear$", "disabled", "hideFilePreview", "uploading", "camera", "maxFiles"], outputs: ["fileSelected"] }, { kind: "component", type: i3$2.DocumentenApiMetadataModalComponent, selector: "valtimo-documenten-api-metadata-modal", inputs: ["show$", "hide$", "disabled$", "file$", "documentTitle", "disableDocumentTitle", "filename", "disableFilename", "author", "disableAuthor", "status", "disableStatus", "language", "disableLanguage", "documentType", "disableDocumentType", "description", "disableDescription", "confidentialityLevel", "disableConfidentialityLevel"], outputs: ["metadata"] }, { kind: "component", type: i4.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "directive", type: i4.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i4.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
1489
|
+
}
|
|
1490
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabDocumentenApiDocumentsComponent, decorators: [{
|
|
1491
|
+
type: Component,
|
|
1492
|
+
args: [{ selector: 'valtimo-dossier-detail-tab-documenten-api-documents', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"{loading: loading$ | async} as obs\">\n <div *ngIf=\"uploadProcessLinkedSet && !uploadProcessLinked\">\n <div\n *ngIf=\"isAdmin\"\n [translate]=\"'dossier.documenten.noProcessLinked.adminRole'\"\n class=\"bg-warning text-black mb-2 p-3 text-center\"\n ></div>\n <div\n *ngIf=\"!isAdmin\"\n [translate]=\"'dossier.documenten.noProcessLinked.regularUser'\"\n class=\"bg-warning text-black mb-2 p-3 text-center\"\n ></div>\n </div>\n <div *ngIf=\"showZaakLinkWarning\">\n <div\n [translate]=\"'dossier.documenten.noZaakFound'\"\n class=\"bg-warning text-black mb-2 p-3 text-center\"\n ></div>\n </div>\n\n <valtimo-dropzone\n *ngIf=\"!obs.loading\"\n (fileSelected)=\"fileSelected($event)\"\n [acceptedFiles]=\"acceptedFiles\"\n [camera]=\"false\"\n [disabled]=\"\n !uploadProcessLinkedSet || !uploadProcessLinked || obs.loading || showZaakLinkWarning\n \"\n [hideFilePreview]=\"true\"\n [hideTitle]=\"true\"\n [maxFileSize]=\"maxFileSize\"\n [maxFiles]=\"1\"\n [showMaxFileSize]=\"true\"\n [uploading]=\"uploading$ | async\"\n ></valtimo-dropzone>\n\n <valtimo-widget>\n <valtimo-list\n [ngClass]=\"{hidden: obs.loading}\"\n [fields]=\"fields\"\n [header]=\"true\"\n [isSearchable]=\"true\"\n [items]=\"relatedFiles$ | async\"\n [viewMode]=\"true\"\n [lastColumnTemplate]=\"downloadButton\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Related documents' | translate }}</h3>\n <h5 class=\"list-header-description\">\n {{ 'Overview of all documents in this dossier' | translate }}\n </h5>\n </div>\n </valtimo-list>\n <ng-container *ngTemplateOutlet=\"loading; context: {loading: obs.loading}\"></ng-container>\n </valtimo-widget>\n</ng-container>\n\n<valtimo-documenten-api-metadata-modal\n (metadata)=\"metadataSet($event)\"\n [disabled$]=\"modalDisabled$\"\n [file$]=\"fileToBeUploaded$\"\n [hide$]=\"hideModal$\"\n [show$]=\"showModal$\"\n></valtimo-documenten-api-metadata-modal>\n\n<ng-template #loading let-loading=\"loading\">\n <div *ngIf=\"loading\" class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n</ng-template>\n\n<ng-template #downloadButton let-index=\"index\" let-item=\"item\">\n <div\n class=\"download-button-container\"\n *ngIf=\"{isDownloading: indexesIncludeIndex(downloadingFileIndexes$ | async, index)} as vars\"\n >\n <button\n *ngIf=\"!vars.isDownloading\"\n cdsButton=\"primary\"\n size=\"sm\"\n (click)=\"downloadDocument(item, index)\"\n >\n {{ 'interface.download' | translate\n }}<svg class=\"cds--btn__icon\" cdsIcon=\"download\" size=\"16\"></svg>\n </button>\n <cds-loading size=\"sm\" *ngIf=\"vars.isDownloading\"></cds-loading>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.hidden{display:none}.loading-container{padding:var(--cds-grid-margin);display:flex;align-items:center;justify-content:center}.download-button-container{display:flex;width:100%;flex-direction:row;justify-content:flex-end;align-items:center;min-height:32px}\n"] }]
|
|
1493
|
+
}], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i2$1.DocumentService }, { type: i3$4.ToastrService }, { type: i4$1.UploadProviderService }, { type: i4$1.DownloadService }, { type: i3$2.PromptService }, { type: i6.TranslateService }, { type: i1.ConfigService }, { type: i6$1.UserProviderService }, { type: FileSortService }]; } });
|
|
1494
|
+
|
|
1495
|
+
/*
|
|
1496
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1497
|
+
*
|
|
1498
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1499
|
+
* you may not use this file except in compliance with the License.
|
|
1500
|
+
* You may obtain a copy of the License at
|
|
1501
|
+
*
|
|
1502
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1503
|
+
*
|
|
1504
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1505
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1506
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1507
|
+
* See the License for the specific language governing permissions and
|
|
1508
|
+
* limitations under the License.
|
|
1509
|
+
*/
|
|
1510
|
+
class DossierDetailTabS3DocumentsComponent {
|
|
1511
|
+
constructor(route, documentService, toastrService, uploadProviderService, downloadService, promptService, translateService, configService, fileSortService) {
|
|
1512
|
+
this.route = route;
|
|
1513
|
+
this.documentService = documentService;
|
|
1514
|
+
this.toastrService = toastrService;
|
|
1515
|
+
this.uploadProviderService = uploadProviderService;
|
|
1516
|
+
this.downloadService = downloadService;
|
|
1517
|
+
this.promptService = promptService;
|
|
1518
|
+
this.translateService = translateService;
|
|
1519
|
+
this.configService = configService;
|
|
1520
|
+
this.fileSortService = fileSortService;
|
|
1521
|
+
this.maxFileSize = this.configService?.config?.caseFileSizeUploadLimitMB || 5;
|
|
1522
|
+
this.acceptedFiles = this.configService?.config?.caseFileUploadAcceptedFiles || null;
|
|
1523
|
+
this.fields = [
|
|
1524
|
+
{ key: 'fileName', label: 'File name' },
|
|
1525
|
+
{ key: 'sizeInBytes', label: 'Size in bytes' },
|
|
1526
|
+
{ key: 'createdOn', label: 'Created on', viewType: 'date' },
|
|
1527
|
+
{ key: 'createdBy', label: 'Created by' },
|
|
1528
|
+
];
|
|
1529
|
+
this.actions = [
|
|
1530
|
+
{
|
|
1531
|
+
columnName: '',
|
|
1532
|
+
iconClass: 'mdi mdi-open-in-new',
|
|
1533
|
+
callback: this.downloadDocument.bind(this),
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
columnName: '',
|
|
1537
|
+
iconClass: 'mdi mdi-delete',
|
|
1538
|
+
callback: this.removeRelatedFile.bind(this),
|
|
1539
|
+
},
|
|
1540
|
+
];
|
|
1541
|
+
this.uploading$ = new BehaviorSubject(false);
|
|
1542
|
+
this.refetch$ = new BehaviorSubject(null);
|
|
1543
|
+
this.relatedFiles$ = this.refetch$.pipe(switchMap$1(() => combineLatest([
|
|
1544
|
+
this.documentService.getDocument(this.documentId),
|
|
1545
|
+
this.translateService.stream('key'),
|
|
1546
|
+
])), map$1(([document]) => {
|
|
1547
|
+
const relatedFiles = document?.relatedFiles || [];
|
|
1548
|
+
const translatedFiles = relatedFiles.map(file => ({
|
|
1549
|
+
...file,
|
|
1550
|
+
createdBy: file.createdBy || this.translateService.instant('list.automaticallyGenerated'),
|
|
1551
|
+
}));
|
|
1552
|
+
return translatedFiles || [];
|
|
1553
|
+
}), map$1(relatedFiles => this.fileSortService.sortRelatedFilesByDateDescending(relatedFiles)));
|
|
1554
|
+
const snapshot = this.route.snapshot.paramMap;
|
|
1555
|
+
this.documentId = snapshot.get('documentId') || '';
|
|
1556
|
+
this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
|
|
1557
|
+
}
|
|
1558
|
+
ngOnInit() {
|
|
1559
|
+
this.refetchDocuments();
|
|
1560
|
+
}
|
|
1561
|
+
fileSelected(file) {
|
|
1562
|
+
this.uploading$.next(true);
|
|
1563
|
+
this.uploadProviderService
|
|
1564
|
+
.uploadFile(file, this.documentDefinitionName, this.documentId)
|
|
1565
|
+
.pipe(switchMap$1(resourceFile => this.documentService.assignResource(this.documentId, resourceFile.data.resourceId)))
|
|
1566
|
+
.subscribe({
|
|
1567
|
+
next: () => {
|
|
1568
|
+
this.toastrService.success('Successfully uploaded document to dossier');
|
|
1569
|
+
this.refetchDocuments();
|
|
1570
|
+
this.uploading$.next(false);
|
|
1571
|
+
},
|
|
1572
|
+
error: () => {
|
|
1573
|
+
this.toastrService.error('Failed to upload document to dossier');
|
|
1574
|
+
this.uploading$.next(false);
|
|
1575
|
+
},
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
downloadDocument(relatedFile) {
|
|
1579
|
+
this.uploadProviderService
|
|
1580
|
+
.getResource(relatedFile.fileId)
|
|
1581
|
+
.subscribe((resource) => {
|
|
1582
|
+
this.downloadService.downloadFile(resource.url, resource.resource.name);
|
|
1583
|
+
});
|
|
1584
|
+
}
|
|
1585
|
+
removeRelatedFile(relatedFile) {
|
|
1586
|
+
this.promptService.openPrompt({
|
|
1587
|
+
headerText: this.translateService.instant('dossier.deleteConfirmation.title'),
|
|
1588
|
+
bodyText: this.translateService.instant('dossier.deleteConfirmation.description'),
|
|
1589
|
+
cancelButtonText: this.translateService.instant('dossier.deleteConfirmation.cancel'),
|
|
1590
|
+
confirmButtonText: this.translateService.instant('dossier.deleteConfirmation.delete'),
|
|
1591
|
+
cancelMdiIcon: 'cancel',
|
|
1592
|
+
confirmMdiIcon: 'delete',
|
|
1593
|
+
cancelButtonType: 'secondary',
|
|
1594
|
+
confirmButtonType: 'primary',
|
|
1595
|
+
closeOnConfirm: true,
|
|
1596
|
+
closeOnCancel: true,
|
|
1597
|
+
confirmCallBackFunction: () => {
|
|
1598
|
+
this.documentService.removeResource(this.documentId, relatedFile.fileId).subscribe(() => {
|
|
1599
|
+
this.toastrService.success('Successfully removed document from dossier');
|
|
1600
|
+
this.refetchDocuments();
|
|
1601
|
+
}, () => {
|
|
1602
|
+
this.toastrService.error('Failed to remove document from dossier');
|
|
1603
|
+
});
|
|
1604
|
+
},
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
refetchDocuments() {
|
|
1608
|
+
this.refetch$.next(null);
|
|
1609
|
+
}
|
|
1610
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabS3DocumentsComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i2$1.DocumentService }, { token: i3$4.ToastrService }, { token: i4$1.UploadProviderService }, { token: i4$1.DownloadService }, { token: i3$2.PromptService }, { token: i6.TranslateService }, { token: i1.ConfigService }, { token: FileSortService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1611
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabS3DocumentsComponent, selector: "valtimo-dossier-detail-tab-s3-documents", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-dropzone\n (fileSelected)=\"fileSelected($event)\"\n [acceptedFiles]=\"acceptedFiles\"\n [hideFilePreview]=\"true\"\n [hideTitle]=\"true\"\n [maxFileSize]=\"maxFileSize\"\n [showMaxFileSize]=\"true\"\n [camera]=\"false\"\n [uploading]=\"uploading$ | async\"\n></valtimo-dropzone>\n\n<valtimo-widget>\n <valtimo-list\n [fields]=\"fields\"\n [items]=\"relatedFiles$ | async\"\n [header]=\"true\"\n [isSearchable]=\"true\"\n [viewMode]=\"true\"\n [actions]=\"actions\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Related documents' | translate }}</h3>\n <h5 class=\"list-header-description\">\n {{ 'Overview of all documents in this dossier' | translate }}\n </h5>\n </div>\n </valtimo-list>\n</valtimo-widget>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "component", type: i3$2.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState", "lastColumnTemplate"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: i3$2.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: i3$2.DropzoneComponent, selector: "valtimo-dropzone", inputs: ["title", "hideTitle", "subtitle", "externalError$", "maxFileSize", "showMaxFileSize", "acceptedFiles", "clear$", "disabled", "hideFilePreview", "uploading", "camera", "maxFiles"], outputs: ["fileSelected"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
1612
|
+
}
|
|
1613
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabS3DocumentsComponent, decorators: [{
|
|
1614
|
+
type: Component,
|
|
1615
|
+
args: [{ selector: 'valtimo-dossier-detail-tab-s3-documents', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-dropzone\n (fileSelected)=\"fileSelected($event)\"\n [acceptedFiles]=\"acceptedFiles\"\n [hideFilePreview]=\"true\"\n [hideTitle]=\"true\"\n [maxFileSize]=\"maxFileSize\"\n [showMaxFileSize]=\"true\"\n [camera]=\"false\"\n [uploading]=\"uploading$ | async\"\n></valtimo-dropzone>\n\n<valtimo-widget>\n <valtimo-list\n [fields]=\"fields\"\n [items]=\"relatedFiles$ | async\"\n [header]=\"true\"\n [isSearchable]=\"true\"\n [viewMode]=\"true\"\n [actions]=\"actions\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Related documents' | translate }}</h3>\n <h5 class=\"list-header-description\">\n {{ 'Overview of all documents in this dossier' | translate }}\n </h5>\n </div>\n </valtimo-list>\n</valtimo-widget>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
1616
|
+
}], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i2$1.DocumentService }, { type: i3$4.ToastrService }, { type: i4$1.UploadProviderService }, { type: i4$1.DownloadService }, { type: i3$2.PromptService }, { type: i6.TranslateService }, { type: i1.ConfigService }, { type: FileSortService }]; } });
|
|
1617
|
+
|
|
1618
|
+
/*
|
|
1619
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1620
|
+
*
|
|
1621
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1622
|
+
* you may not use this file except in compliance with the License.
|
|
1623
|
+
* You may obtain a copy of the License at
|
|
1624
|
+
*
|
|
1625
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1626
|
+
*
|
|
1627
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1628
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1629
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1630
|
+
* See the License for the specific language governing permissions and
|
|
1631
|
+
* limitations under the License.
|
|
1632
|
+
*/
|
|
1633
|
+
class DossierDetailTabDocumentsComponent {
|
|
1634
|
+
constructor(configService) {
|
|
1635
|
+
this.configService = configService;
|
|
1636
|
+
this.setConfig(configService.config);
|
|
1637
|
+
}
|
|
1638
|
+
setConfig(config) {
|
|
1639
|
+
const uploadProvider = config.uploadProvider;
|
|
1640
|
+
this.openZaakUploadProvider = uploadProvider === UploadProvider.OPEN_ZAAK;
|
|
1641
|
+
this.documentenApiUploadProvider = uploadProvider === UploadProvider.DOCUMENTEN_API;
|
|
1642
|
+
this.s3UploadProvider = config.uploadProvider === UploadProvider.S3;
|
|
1643
|
+
}
|
|
1644
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabDocumentsComponent, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1645
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabDocumentsComponent, selector: "valtimo-dossier-detail-tab-documents", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-dossier-detail-tab-s3-documents\n *ngIf=\"s3UploadProvider || openZaakUploadProvider\"\n></valtimo-dossier-detail-tab-s3-documents>\n<valtimo-dossier-detail-tab-documenten-api-documents *ngIf=\"documentenApiUploadProvider\">\n</valtimo-dossier-detail-tab-documenten-api-documents>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: DossierDetailTabDocumentenApiDocumentsComponent, selector: "valtimo-dossier-detail-tab-documenten-api-documents" }, { kind: "component", type: DossierDetailTabS3DocumentsComponent, selector: "valtimo-dossier-detail-tab-s3-documents" }] }); }
|
|
1646
|
+
}
|
|
1647
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabDocumentsComponent, decorators: [{
|
|
1648
|
+
type: Component,
|
|
1649
|
+
args: [{ selector: 'valtimo-dossier-detail-tab-documents', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-dossier-detail-tab-s3-documents\n *ngIf=\"s3UploadProvider || openZaakUploadProvider\"\n></valtimo-dossier-detail-tab-s3-documents>\n<valtimo-dossier-detail-tab-documenten-api-documents *ngIf=\"documentenApiUploadProvider\">\n</valtimo-dossier-detail-tab-documenten-api-documents>\n" }]
|
|
1650
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigService }]; } });
|
|
1651
|
+
|
|
1652
|
+
/*
|
|
1653
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1654
|
+
*
|
|
1655
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1656
|
+
* you may not use this file except in compliance with the License.
|
|
1657
|
+
* You may obtain a copy of the License at
|
|
1658
|
+
*
|
|
1659
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1660
|
+
*
|
|
1661
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1662
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1663
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1664
|
+
* See the License for the specific language governing permissions and
|
|
1665
|
+
* limitations under the License.
|
|
1666
|
+
*/
|
|
1667
|
+
const TAB_MAP = new InjectionToken('TabMap');
|
|
1668
|
+
const DEFAULT_TABS = new Map([
|
|
1669
|
+
[DefaultTabs.summary, DossierDetailTabSummaryComponent],
|
|
1670
|
+
[DefaultTabs.progress, DossierDetailTabProgressComponent],
|
|
1671
|
+
[DefaultTabs.audit, DossierDetailTabAuditComponent],
|
|
1672
|
+
[DefaultTabs.documents, DossierDetailTabDocumentsComponent],
|
|
1673
|
+
]);
|
|
1674
|
+
|
|
1675
|
+
/*
|
|
1676
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1677
|
+
*
|
|
1678
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1679
|
+
* you may not use this file except in compliance with the License.
|
|
1680
|
+
* You may obtain a copy of the License at
|
|
1681
|
+
*
|
|
1682
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1683
|
+
*
|
|
1684
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1685
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1686
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1687
|
+
* See the License for the specific language governing permissions and
|
|
1688
|
+
* limitations under the License.
|
|
1689
|
+
*/
|
|
1690
|
+
class DossierDetailTabObjectTypeComponent {
|
|
1691
|
+
constructor(route, zaakobjectenService, modalService) {
|
|
1692
|
+
this.route = route;
|
|
1693
|
+
this.zaakobjectenService = zaakobjectenService;
|
|
1694
|
+
this.modalService = modalService;
|
|
1695
|
+
this.documentId$ = this.route.params.pipe(map(params => params.documentId));
|
|
1696
|
+
this.objecttypes$ = this.documentId$.pipe(switchMap(documentId => this.zaakobjectenService.getDocumentObjectTypes(documentId)));
|
|
1697
|
+
this.objectName$ = this.route.params.pipe(map(() => {
|
|
1698
|
+
const currentUrl = window.location.href;
|
|
1699
|
+
const splitUrl = currentUrl.split('/');
|
|
1700
|
+
const lastUrlPart = splitUrl[splitUrl.length - 1];
|
|
1701
|
+
return lastUrlPart;
|
|
1702
|
+
}));
|
|
1703
|
+
this.selectedObjecttypeUrl$ = combineLatest([
|
|
1704
|
+
this.objecttypes$,
|
|
1705
|
+
this.objectName$,
|
|
1706
|
+
]).pipe(map(([objectTypes, objectName]) => {
|
|
1707
|
+
const currentType = objectTypes?.find(type => type?.name.toLowerCase() === objectName?.toLowerCase());
|
|
1708
|
+
const currentTypeUrl = currentType?.url;
|
|
1709
|
+
if (objectTypes && objectName && currentTypeUrl)
|
|
1710
|
+
return currentTypeUrl;
|
|
1711
|
+
return '';
|
|
1712
|
+
}));
|
|
1713
|
+
this.loading$ = new BehaviorSubject(true);
|
|
1714
|
+
this.hasData$ = new BehaviorSubject(false);
|
|
1715
|
+
this.objects$ = combineLatest([
|
|
1716
|
+
this.documentId$,
|
|
1717
|
+
this.selectedObjecttypeUrl$,
|
|
1718
|
+
]).pipe(switchMap(([documentId, selectedObjecttypeUrl]) => documentId && selectedObjecttypeUrl
|
|
1719
|
+
? this.zaakobjectenService.getDocumentObjectsOfType(documentId, selectedObjecttypeUrl).pipe(map(objects => objects.map(object => ({ ...object, title: object.title || '-' }))), tap(() => {
|
|
1720
|
+
this.loading$.next(false);
|
|
1721
|
+
this.hasData$.next(true);
|
|
1722
|
+
}))
|
|
1723
|
+
: of(null).pipe(tap(() => {
|
|
1724
|
+
this.loading$.next(false);
|
|
1725
|
+
this.hasData$.next(false);
|
|
1726
|
+
}))));
|
|
1727
|
+
this.columns$ = new BehaviorSubject([
|
|
1728
|
+
{
|
|
1729
|
+
labelTranslationKey: 'dossier.zaakobjecten.index',
|
|
1730
|
+
dataKey: 'index',
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
labelTranslationKey: 'dossier.zaakobjecten.registrationAt',
|
|
1734
|
+
dataKey: 'registrationAt',
|
|
1735
|
+
},
|
|
1736
|
+
{
|
|
1737
|
+
labelTranslationKey: 'dossier.zaakobjecten.title',
|
|
1738
|
+
dataKey: 'title',
|
|
1739
|
+
},
|
|
1740
|
+
]);
|
|
1741
|
+
this.objectForm$ = new BehaviorSubject(null);
|
|
1742
|
+
this.noFormDefinitionComponent$ = new BehaviorSubject(false);
|
|
1743
|
+
}
|
|
1744
|
+
rowClicked(object) {
|
|
1745
|
+
this.documentId$.pipe(take$1(1)).subscribe(documentId => {
|
|
1746
|
+
this.zaakobjectenService.getObjectTypeForm(documentId, object.url).subscribe(res => {
|
|
1747
|
+
const definition = res.formDefinition;
|
|
1748
|
+
definition.components = definition.components.map(component => ({
|
|
1749
|
+
...component,
|
|
1750
|
+
disabled: true,
|
|
1751
|
+
}));
|
|
1752
|
+
this.setModalData(definition);
|
|
1753
|
+
}, () => {
|
|
1754
|
+
this.setModalData();
|
|
1755
|
+
});
|
|
1756
|
+
});
|
|
1757
|
+
}
|
|
1758
|
+
hide() {
|
|
1759
|
+
this.modalService.closeModal(() => {
|
|
1760
|
+
this.objectForm$.next(null);
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
show() {
|
|
1764
|
+
this.modalService.openModal(this.viewObjectModal);
|
|
1765
|
+
}
|
|
1766
|
+
setModalData(definition) {
|
|
1767
|
+
if (definition) {
|
|
1768
|
+
this.objectForm$.next(definition);
|
|
1769
|
+
this.noFormDefinitionComponent$.next(false);
|
|
1770
|
+
}
|
|
1771
|
+
else {
|
|
1772
|
+
this.noFormDefinitionComponent$.next(true);
|
|
1773
|
+
}
|
|
1774
|
+
this.show();
|
|
1775
|
+
}
|
|
1776
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabObjectTypeComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: ZaakobjectenService }, { token: i3$2.ModalService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1777
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabObjectTypeComponent, selector: "valtimo-object-type", viewQueries: [{ propertyName: "viewObjectModal", first: true, predicate: ["viewObjectModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n objects: objects$ | async,\n columns: columns$ | async,\n loading: loading$ | async,\n hasData: hasData$ | async\n } as obs\"\n>\n <v-table\n *ngIf=\"obs.hasData || obs.loading\"\n [loading]=\"obs.loading\"\n [items]=\"obs.objects\"\n [columns]=\"obs.columns\"\n [showEditButtons]=\"true\"\n editButtonTranslationKey=\"dossier.zaakobjecten.objectType.viewObject\"\n [amountOfLoadingRows]=\"2\"\n [itemsTranslationKey]=\"'pluginManagement.tableItemsText'\"\n [showPagination]=\"false\"\n (editButtonClicked)=\"rowClicked($event)\"\n ></v-table>\n\n <v-paragraph *ngIf=\"!obs.hasData && !obs.loading\" [center]=\"true\">{{\n 'dossier.zaakobjecten.noObjectType' | translate\n }}</v-paragraph>\n</ng-container>\n\n<v-modal #viewObjectModal (closeEvent)=\"hide()\" [hideFooter]=\"true\" [maxWidthPx]=\"750\">\n <div role=\"header\">\n <v-title [margin]=\"false\" type=\"h2\" [fullWidth]=\"true\" [center]=\"true\">{{\n objectName$ | async\n }}</v-title>\n </div>\n\n <div role=\"content\">\n <valtimo-form-io\n *ngIf=\"(noFormDefinitionComponent$ | async) === false\"\n [form]=\"objectForm$ | async\"\n ></valtimo-form-io>\n <v-paragraph *ngIf=\"noFormDefinitionComponent$ | async\" [center]=\"true\">{{\n 'dossier.zaakobjecten.noFormDefinitionComponent' | translate\n }}</v-paragraph>\n </div>\n</v-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i3$2.ParagraphComponent, selector: "v-paragraph", inputs: ["center", "fullWidth", "margin", "italic", "loading"] }, { kind: "component", type: i3$2.TableComponent, selector: "v-table", inputs: ["items", "columns", "loading", "showEditButtons", "showPagination", "editButtonTranslationKey", "itemsTranslationKey", "noResultsTranslationKey", "mobileBreakpointPx", "amountOfLoadingRows", "collectionSize", "page", "size"], outputs: ["editButtonClicked", "paginationSizeSet", "paginationPageSet"] }, { kind: "component", type: i3$2.VModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx", "hideFooter"], outputs: ["closeEvent"] }, { kind: "component", type: i3$2.TitleComponent, selector: "v-title", inputs: ["type", "margin", "fullWidth", "center"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
1778
|
+
}
|
|
1779
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabObjectTypeComponent, decorators: [{
|
|
1780
|
+
type: Component,
|
|
1781
|
+
args: [{ selector: 'valtimo-object-type', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n objects: objects$ | async,\n columns: columns$ | async,\n loading: loading$ | async,\n hasData: hasData$ | async\n } as obs\"\n>\n <v-table\n *ngIf=\"obs.hasData || obs.loading\"\n [loading]=\"obs.loading\"\n [items]=\"obs.objects\"\n [columns]=\"obs.columns\"\n [showEditButtons]=\"true\"\n editButtonTranslationKey=\"dossier.zaakobjecten.objectType.viewObject\"\n [amountOfLoadingRows]=\"2\"\n [itemsTranslationKey]=\"'pluginManagement.tableItemsText'\"\n [showPagination]=\"false\"\n (editButtonClicked)=\"rowClicked($event)\"\n ></v-table>\n\n <v-paragraph *ngIf=\"!obs.hasData && !obs.loading\" [center]=\"true\">{{\n 'dossier.zaakobjecten.noObjectType' | translate\n }}</v-paragraph>\n</ng-container>\n\n<v-modal #viewObjectModal (closeEvent)=\"hide()\" [hideFooter]=\"true\" [maxWidthPx]=\"750\">\n <div role=\"header\">\n <v-title [margin]=\"false\" type=\"h2\" [fullWidth]=\"true\" [center]=\"true\">{{\n objectName$ | async\n }}</v-title>\n </div>\n\n <div role=\"content\">\n <valtimo-form-io\n *ngIf=\"(noFormDefinitionComponent$ | async) === false\"\n [form]=\"objectForm$ | async\"\n ></valtimo-form-io>\n <v-paragraph *ngIf=\"noFormDefinitionComponent$ | async\" [center]=\"true\">{{\n 'dossier.zaakobjecten.noFormDefinitionComponent' | translate\n }}</v-paragraph>\n </div>\n</v-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
1782
|
+
}], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: ZaakobjectenService }, { type: i3$2.ModalService }]; }, propDecorators: { viewObjectModal: [{
|
|
1783
|
+
type: ViewChild,
|
|
1784
|
+
args: ['viewObjectModal']
|
|
1785
|
+
}] } });
|
|
1786
|
+
|
|
1787
|
+
/*
|
|
1788
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1789
|
+
*
|
|
1790
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1791
|
+
* you may not use this file except in compliance with the License.
|
|
1792
|
+
* You may obtain a copy of the License at
|
|
1793
|
+
*
|
|
1794
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1795
|
+
*
|
|
1796
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1797
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1798
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1799
|
+
* See the License for the specific language governing permissions and
|
|
1800
|
+
* limitations under the License.
|
|
1801
|
+
*/
|
|
1802
|
+
class TabService {
|
|
1803
|
+
constructor(tabMap = DEFAULT_TABS, configService, route, router) {
|
|
1804
|
+
this.configService = configService;
|
|
1805
|
+
this.route = route;
|
|
1806
|
+
this.router = router;
|
|
1807
|
+
this.tabs = [];
|
|
1808
|
+
this.tabMap = tabMap;
|
|
1809
|
+
this.setTabs();
|
|
1810
|
+
this.openRouterSubscription();
|
|
1811
|
+
}
|
|
1812
|
+
getTabs() {
|
|
1813
|
+
return this.tabs;
|
|
1814
|
+
}
|
|
1815
|
+
setTabs(extraTabs) {
|
|
1816
|
+
let i = 0;
|
|
1817
|
+
this.tabs = [];
|
|
1818
|
+
this.allTabs = extraTabs
|
|
1819
|
+
? new Map([...Array.from(this.tabMap.entries()), ...Array.from(extraTabs.entries())])
|
|
1820
|
+
: this.tabMap;
|
|
1821
|
+
this.allTabs.forEach((component, name) => {
|
|
1822
|
+
this.tabs.push(new TabImpl(name, i, component));
|
|
1823
|
+
i++;
|
|
1824
|
+
});
|
|
1825
|
+
}
|
|
1826
|
+
getConfigurableTabs(documentDefinitionName) {
|
|
1827
|
+
if (this.configService?.config?.caseObjectTypes) {
|
|
1828
|
+
const allNamesObjects = this.configService?.config?.caseObjectTypes[documentDefinitionName];
|
|
1829
|
+
const map = new Map();
|
|
1830
|
+
allNamesObjects?.forEach(name => {
|
|
1831
|
+
map.set(name, DossierDetailTabObjectTypeComponent);
|
|
1832
|
+
});
|
|
1833
|
+
this.extraTabs = map;
|
|
1834
|
+
}
|
|
1835
|
+
else {
|
|
1836
|
+
this.extraTabs = new Map();
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
openRouterSubscription() {
|
|
1840
|
+
this.router.events.subscribe((event) => {
|
|
1841
|
+
if (event instanceof NavigationEnd) {
|
|
1842
|
+
this.setTabs(this.extraTabs);
|
|
1843
|
+
}
|
|
1844
|
+
});
|
|
1845
|
+
}
|
|
1846
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabService, deps: [{ token: TAB_MAP }, { token: i1.ConfigService }, { token: i1$1.ActivatedRoute }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1847
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabService, providedIn: 'root' }); }
|
|
1848
|
+
}
|
|
1849
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabService, decorators: [{
|
|
1850
|
+
type: Injectable,
|
|
1851
|
+
args: [{
|
|
1852
|
+
providedIn: 'root',
|
|
1853
|
+
}]
|
|
1854
|
+
}], ctorParameters: function () { return [{ type: Map, decorators: [{
|
|
1855
|
+
type: Inject,
|
|
1856
|
+
args: [TAB_MAP]
|
|
1857
|
+
}] }, { type: i1.ConfigService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }]; } });
|
|
1858
|
+
|
|
1859
|
+
/*
|
|
1860
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1861
|
+
*
|
|
1862
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1863
|
+
* you may not use this file except in compliance with the License.
|
|
1864
|
+
* You may obtain a copy of the License at
|
|
1865
|
+
*
|
|
1866
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1867
|
+
*
|
|
1868
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1869
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1870
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1871
|
+
* See the License for the specific language governing permissions and
|
|
1872
|
+
* limitations under the License.
|
|
1873
|
+
*/
|
|
1874
|
+
class DossierSupportingProcessStartModalComponent {
|
|
1875
|
+
constructor(route, router, processService, processLinkService, documentService, formFlowService, logger, userProviderService) {
|
|
1876
|
+
this.route = route;
|
|
1877
|
+
this.router = router;
|
|
1878
|
+
this.processService = processService;
|
|
1879
|
+
this.processLinkService = processLinkService;
|
|
1880
|
+
this.documentService = documentService;
|
|
1881
|
+
this.formFlowService = formFlowService;
|
|
1882
|
+
this.logger = logger;
|
|
1883
|
+
this.userProviderService = userProviderService;
|
|
1884
|
+
this.isAdmin$ = this.userProviderService
|
|
1885
|
+
.getUserSubject()
|
|
1886
|
+
.pipe(map$1(userIdentity => userIdentity?.roles?.includes('ROLE_ADMIN')));
|
|
1887
|
+
this.formSubmit = new EventEmitter();
|
|
1888
|
+
}
|
|
1889
|
+
loadProcessLink() {
|
|
1890
|
+
this.processLinkId = null;
|
|
1891
|
+
this.formDefinition = null;
|
|
1892
|
+
this.formFlowInstanceId = null;
|
|
1893
|
+
this.processService
|
|
1894
|
+
.getProcessDefinitionStartProcessLink(this.processDefinitionId, this.documentId, null)
|
|
1895
|
+
.pipe(take$1(1))
|
|
1896
|
+
.subscribe(startProcessResult => {
|
|
1897
|
+
if (startProcessResult) {
|
|
1898
|
+
switch (startProcessResult.type) {
|
|
1899
|
+
case 'form':
|
|
1900
|
+
this.formDefinition = startProcessResult.properties.prefilledForm;
|
|
1901
|
+
this.processLinkId = startProcessResult.processLinkId;
|
|
1902
|
+
break;
|
|
1903
|
+
case 'form-flow':
|
|
1904
|
+
this.formFlowInstanceId = startProcessResult.properties.formFlowInstanceId;
|
|
1905
|
+
break;
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
this.modal.show();
|
|
1909
|
+
});
|
|
1910
|
+
}
|
|
1911
|
+
openModal(processDocumentDefinition, documentId) {
|
|
1912
|
+
this.documentId = documentId;
|
|
1913
|
+
this.documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
|
|
1914
|
+
this.processDefinitionKey = processDocumentDefinition.id.processDefinitionKey;
|
|
1915
|
+
this.processDefinitionId = processDocumentDefinition.latestVersionId;
|
|
1916
|
+
this.processName = processDocumentDefinition.processName;
|
|
1917
|
+
this.options = new FormioOptionsImpl();
|
|
1918
|
+
this.options.disableAlerts = true;
|
|
1919
|
+
const formioBeforeSubmit = function (submission, callback) {
|
|
1920
|
+
callback(null, submission);
|
|
1921
|
+
};
|
|
1922
|
+
this.options.setHooks(formioBeforeSubmit);
|
|
1923
|
+
this.loadProcessLink();
|
|
1924
|
+
}
|
|
1925
|
+
onSubmit(submission) {
|
|
1926
|
+
this.formioSubmission = submission;
|
|
1927
|
+
this.processLinkService
|
|
1928
|
+
.submitForm(this.processLinkId, submission.data, this.documentId)
|
|
1929
|
+
.subscribe({
|
|
1930
|
+
next: (formSubmissionResult) => {
|
|
1931
|
+
this.formSubmitted();
|
|
1932
|
+
},
|
|
1933
|
+
error: errors => {
|
|
1934
|
+
this.form.showErrors(errors);
|
|
1935
|
+
},
|
|
1936
|
+
});
|
|
1937
|
+
}
|
|
1938
|
+
formSubmitted() {
|
|
1939
|
+
this.modal.hide();
|
|
1940
|
+
this.formSubmit.emit();
|
|
1941
|
+
}
|
|
1942
|
+
gotoProcessLinkScreen() {
|
|
1943
|
+
this.modal.hide();
|
|
1944
|
+
this.router.navigate(['process-links'], { queryParams: { process: this.processDefinitionKey } });
|
|
1945
|
+
}
|
|
1946
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierSupportingProcessStartModalComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i1$1.Router }, { token: i2$2.ProcessService }, { token: i3$5.ProcessLinkService }, { token: i2$1.DocumentService }, { token: i3$5.FormFlowService }, { token: i1$2.NGXLogger }, { token: i6$1.UserProviderService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1947
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierSupportingProcessStartModalComponent, selector: "valtimo-dossier-supporting-process-start-modal", outputs: { formSubmit: "formSubmit" }, viewQueries: [{ propertyName: "form", first: true, predicate: ["form"], descendants: true }, { propertyName: "modal", first: true, predicate: ["supportingProcessStartModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #supportingProcessStartModal\n elementId=\"supportingProcessStartModal\"\n [title]=\"\n (processDefinitionKey | translate) !== processDefinitionKey\n ? (processDefinitionKey | translate)\n : processName\n \"\n>\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io\n #form\n [submission]=\"submission\"\n [form]=\"formDefinition\"\n [options]=\"options\"\n (submit)=\"onSubmit($event)\"\n >\n </valtimo-form-io>\n </div>\n <div body *ngIf=\"formFlowInstanceId\">\n <valtimo-form-flow\n #formFlow\n [formFlowInstanceId]=\"formFlowInstanceId\"\n (formFlowComplete)=\"formSubmitted()\"\n ></valtimo-form-flow>\n </div>\n <div body *ngIf=\"!formDefinition && !formFlowInstanceId\">\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 class=\"mb-0 mt-4 p-3 text-center\">\n <button\n (click)=\"gotoProcessLinkScreen()\"\n class=\"btn btn-secondary btn-space\"\n id=\"process-link-button\"\n type=\"button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#supportingProcessStartModal .formio-component-submit{text-align:right}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i3$2.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "component", type: i3$5.FormFlowComponent, selector: "valtimo-form-flow", inputs: ["formIoFormData", "formFlowInstanceId"], outputs: ["formFlowComplete"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1948
|
+
}
|
|
1949
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierSupportingProcessStartModalComponent, decorators: [{
|
|
1950
|
+
type: Component,
|
|
1951
|
+
args: [{ selector: 'valtimo-dossier-supporting-process-start-modal', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #supportingProcessStartModal\n elementId=\"supportingProcessStartModal\"\n [title]=\"\n (processDefinitionKey | translate) !== processDefinitionKey\n ? (processDefinitionKey | translate)\n : processName\n \"\n>\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io\n #form\n [submission]=\"submission\"\n [form]=\"formDefinition\"\n [options]=\"options\"\n (submit)=\"onSubmit($event)\"\n >\n </valtimo-form-io>\n </div>\n <div body *ngIf=\"formFlowInstanceId\">\n <valtimo-form-flow\n #formFlow\n [formFlowInstanceId]=\"formFlowInstanceId\"\n (formFlowComplete)=\"formSubmitted()\"\n ></valtimo-form-flow>\n </div>\n <div body *ngIf=\"!formDefinition && !formFlowInstanceId\">\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 class=\"mb-0 mt-4 p-3 text-center\">\n <button\n (click)=\"gotoProcessLinkScreen()\"\n class=\"btn btn-secondary btn-space\"\n id=\"process-link-button\"\n type=\"button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | translate }}\n </button>\n </div>\n </div>\n</valtimo-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#supportingProcessStartModal .formio-component-submit{text-align:right}\n"] }]
|
|
1952
|
+
}], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: i2$2.ProcessService }, { type: i3$5.ProcessLinkService }, { type: i2$1.DocumentService }, { type: i3$5.FormFlowService }, { type: i1$2.NGXLogger }, { type: i6$1.UserProviderService }]; }, propDecorators: { form: [{
|
|
1953
|
+
type: ViewChild,
|
|
1954
|
+
args: ['form', { static: false }]
|
|
1955
|
+
}], modal: [{
|
|
1956
|
+
type: ViewChild,
|
|
1957
|
+
args: ['supportingProcessStartModal', { static: false }]
|
|
1958
|
+
}], formSubmit: [{
|
|
1959
|
+
type: Output
|
|
1960
|
+
}] } });
|
|
1961
|
+
|
|
1962
|
+
/*
|
|
1963
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1964
|
+
*
|
|
1965
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1966
|
+
* you may not use this file except in compliance with the License.
|
|
1967
|
+
* You may obtain a copy of the License at
|
|
1968
|
+
*
|
|
1969
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1970
|
+
*
|
|
1971
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1972
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1973
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1974
|
+
* See the License for the specific language governing permissions and
|
|
1975
|
+
* limitations under the License.
|
|
1976
|
+
*/
|
|
1977
|
+
class DossierAssignUserComponent {
|
|
1978
|
+
set documentId(value) {
|
|
1979
|
+
this.documentId$.next(value);
|
|
1980
|
+
}
|
|
1981
|
+
set assigneeId(value) {
|
|
1982
|
+
this.assigneeId$.next(value);
|
|
1983
|
+
}
|
|
1984
|
+
set assigneeFullName(value) {
|
|
1985
|
+
this.assigneeFullName$.next(value);
|
|
1986
|
+
}
|
|
1987
|
+
constructor(documentService) {
|
|
1988
|
+
this.documentService = documentService;
|
|
1989
|
+
this.hasPermission = true;
|
|
1990
|
+
this.assignmentOfDocumentChanged = new EventEmitter();
|
|
1991
|
+
this.disabled$ = new BehaviorSubject(true);
|
|
1992
|
+
this.documentId$ = new BehaviorSubject('');
|
|
1993
|
+
this.userItems$ = this.documentId$.pipe(filter(documentId => !!documentId), switchMap(documentId => this.hasPermission ? this.documentService.getCandidateUsers(documentId) : of([])), map(candidateUsers => this.mapUsersForDropdown(candidateUsers)), tap$1(() => this.enable()));
|
|
1994
|
+
this.assigneeId$ = new BehaviorSubject('');
|
|
1995
|
+
this.assigneeFullName$ = new BehaviorSubject('');
|
|
1996
|
+
}
|
|
1997
|
+
assignDocument(userId) {
|
|
1998
|
+
this.disable();
|
|
1999
|
+
this.documentId$
|
|
2000
|
+
.pipe(switchMap(documentId => this.documentService.assignHandlerToDocument(documentId, userId)))
|
|
2001
|
+
.subscribe(() => {
|
|
2002
|
+
this.emitChange();
|
|
2003
|
+
this.enable();
|
|
2004
|
+
});
|
|
2005
|
+
}
|
|
2006
|
+
unassignDocument() {
|
|
2007
|
+
this.disable();
|
|
2008
|
+
this.documentId$
|
|
2009
|
+
.pipe(switchMap(documentId => this.documentService.unassignHandlerFromDocument(documentId)))
|
|
2010
|
+
.subscribe(() => {
|
|
2011
|
+
this.emitChange();
|
|
2012
|
+
this.enable();
|
|
2013
|
+
});
|
|
2014
|
+
}
|
|
2015
|
+
mapUsersForDropdown(users) {
|
|
2016
|
+
return users
|
|
2017
|
+
.sort((a, b) => {
|
|
2018
|
+
if (a.lastName && b.lastName) {
|
|
2019
|
+
return a.lastName.localeCompare(b.lastName);
|
|
2020
|
+
}
|
|
2021
|
+
return 0;
|
|
2022
|
+
})
|
|
2023
|
+
.map(user => ({ text: user.label, id: user.id }));
|
|
2024
|
+
}
|
|
2025
|
+
emitChange() {
|
|
2026
|
+
this.assignmentOfDocumentChanged.emit();
|
|
2027
|
+
}
|
|
2028
|
+
enable() {
|
|
2029
|
+
this.disabled$.next(false);
|
|
2030
|
+
}
|
|
2031
|
+
disable() {
|
|
2032
|
+
this.disabled$.next(true);
|
|
2033
|
+
}
|
|
2034
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierAssignUserComponent, deps: [{ token: i2$1.DocumentService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2035
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierAssignUserComponent, selector: "valtimo-dossier-assign-user", inputs: { documentId: "documentId", assigneeId: "assigneeId", assigneeFullName: "assigneeFullName", hasPermission: "hasPermission" }, outputs: { assignmentOfDocumentChanged: "assignmentOfDocumentChanged" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-12 pl-0 d-flex flex-row align-items-center\">\n <ng-container *ngTemplateOutlet=\"content\"> </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #content>\n <ng-container\n *ngIf=\"{\n disabled: disabled$ | async,\n assigneeFullName: assigneeFullName$ | async,\n assigneeId: assigneeId$ | async\n } as obs\"\n >\n <ng-container *ngIf=\"!hasPermission && obs.assigneeFullName\">\n <ng-container *ngTemplateOutlet=\"fullName; context: {obs: obs}\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"hasPermission\">\n <ng-container *ngTemplateOutlet=\"selectUser; context: {obs: obs}\"></ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #fullName let-obs=\"obs\">\n <valtimo-searchable-dropdown-select\n [buttonText]=\"'assignDocument.header' | translate\"\n [clearSelectionButtonTitle]=\"'assignDocument.remove' | translate\"\n [hasPermission]=\"false\"\n [hasSelection]=\"true\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [selectedTextValue]=\"obs.assigneeFullName\"\n [selectedText]=\"'assignDocument.assignedTo' | translate\"\n [style]=\"'underlinedText'\"\n [width]=\"250\"\n class=\"dossier-candidates-dropdown\"\n >\n </valtimo-searchable-dropdown-select>\n</ng-template>\n\n<ng-template #selectUser let-obs=\"obs\">\n <ng-container *ngIf=\"userItems$ | async as userItems; else loadingUsers\">\n <valtimo-searchable-dropdown-select\n [buttonText]=\"'assignDocument.header' | translate\"\n [clearSelectionButtonTitle]=\"'assignDocument.remove' | translate\"\n [disabled]=\"obs.disabled\"\n [hasPermission]=\"hasPermission\"\n [hasSelection]=\"obs.assigneeId\"\n [items]=\"userItems\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [selectedTextValue]=\"obs.assigneeFullName\"\n [selectedText]=\"'assignDocument.assignedTo' | translate\"\n [style]=\"'underlinedText'\"\n [width]=\"250\"\n (clearSelection)=\"unassignDocument()\"\n (itemSelected)=\"assignDocument($event)\"\n class=\"dossier-candidates-dropdown\"\n >\n </valtimo-searchable-dropdown-select>\n </ng-container>\n</ng-template>\n\n<ng-template #loadingUsers>\n <h5>\n <b>{{ 'assignDocument.fetchingUsers' | translate }}</b>\n </h5>\n</ng-template>\n", styles: [".container-fluid{color:#959595}valtimo-searchable-dropdown-select{font-size:13px}:host .dossier-candidates-dropdown h5{margin-block:0}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$2.SearchableDropdownSelectComponent, selector: "valtimo-searchable-dropdown-select", inputs: ["style", "items", "buttonText", "searchText", "noResultsText", "disabled", "selectedText", "selectedTextValue", "clearSelectionButtonTitle", "hasSelection", "width", "hasPermission"], outputs: ["itemSelected", "clearSelection"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
2036
|
+
}
|
|
2037
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierAssignUserComponent, decorators: [{
|
|
2038
|
+
type: Component,
|
|
2039
|
+
args: [{ selector: 'valtimo-dossier-assign-user', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-12 pl-0 d-flex flex-row align-items-center\">\n <ng-container *ngTemplateOutlet=\"content\"> </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #content>\n <ng-container\n *ngIf=\"{\n disabled: disabled$ | async,\n assigneeFullName: assigneeFullName$ | async,\n assigneeId: assigneeId$ | async\n } as obs\"\n >\n <ng-container *ngIf=\"!hasPermission && obs.assigneeFullName\">\n <ng-container *ngTemplateOutlet=\"fullName; context: {obs: obs}\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"hasPermission\">\n <ng-container *ngTemplateOutlet=\"selectUser; context: {obs: obs}\"></ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #fullName let-obs=\"obs\">\n <valtimo-searchable-dropdown-select\n [buttonText]=\"'assignDocument.header' | translate\"\n [clearSelectionButtonTitle]=\"'assignDocument.remove' | translate\"\n [hasPermission]=\"false\"\n [hasSelection]=\"true\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [selectedTextValue]=\"obs.assigneeFullName\"\n [selectedText]=\"'assignDocument.assignedTo' | translate\"\n [style]=\"'underlinedText'\"\n [width]=\"250\"\n class=\"dossier-candidates-dropdown\"\n >\n </valtimo-searchable-dropdown-select>\n</ng-template>\n\n<ng-template #selectUser let-obs=\"obs\">\n <ng-container *ngIf=\"userItems$ | async as userItems; else loadingUsers\">\n <valtimo-searchable-dropdown-select\n [buttonText]=\"'assignDocument.header' | translate\"\n [clearSelectionButtonTitle]=\"'assignDocument.remove' | translate\"\n [disabled]=\"obs.disabled\"\n [hasPermission]=\"hasPermission\"\n [hasSelection]=\"obs.assigneeId\"\n [items]=\"userItems\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [selectedTextValue]=\"obs.assigneeFullName\"\n [selectedText]=\"'assignDocument.assignedTo' | translate\"\n [style]=\"'underlinedText'\"\n [width]=\"250\"\n (clearSelection)=\"unassignDocument()\"\n (itemSelected)=\"assignDocument($event)\"\n class=\"dossier-candidates-dropdown\"\n >\n </valtimo-searchable-dropdown-select>\n </ng-container>\n</ng-template>\n\n<ng-template #loadingUsers>\n <h5>\n <b>{{ 'assignDocument.fetchingUsers' | translate }}</b>\n </h5>\n</ng-template>\n", styles: [".container-fluid{color:#959595}valtimo-searchable-dropdown-select{font-size:13px}:host .dossier-candidates-dropdown h5{margin-block:0}\n"] }]
|
|
2040
|
+
}], ctorParameters: function () { return [{ type: i2$1.DocumentService }]; }, propDecorators: { documentId: [{
|
|
2041
|
+
type: Input
|
|
2042
|
+
}], assigneeId: [{
|
|
2043
|
+
type: Input
|
|
2044
|
+
}], assigneeFullName: [{
|
|
2045
|
+
type: Input
|
|
2046
|
+
}], hasPermission: [{
|
|
2047
|
+
type: Input
|
|
2048
|
+
}], assignmentOfDocumentChanged: [{
|
|
2049
|
+
type: Output
|
|
2050
|
+
}] } });
|
|
2051
|
+
|
|
2052
|
+
class DossierDetailComponent {
|
|
2053
|
+
constructor(breadcrumbService, componentFactoryResolver, configService, documentService, dossierService, keyCloakService, location, logger, permissionService, route, router, tabService, translateService) {
|
|
2054
|
+
this.breadcrumbService = breadcrumbService;
|
|
2055
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
2056
|
+
this.configService = configService;
|
|
2057
|
+
this.documentService = documentService;
|
|
2058
|
+
this.dossierService = dossierService;
|
|
2059
|
+
this.keyCloakService = keyCloakService;
|
|
2060
|
+
this.location = location;
|
|
2061
|
+
this.logger = logger;
|
|
2062
|
+
this.permissionService = permissionService;
|
|
2063
|
+
this.route = route;
|
|
2064
|
+
this.router = router;
|
|
2065
|
+
this.tabService = tabService;
|
|
2066
|
+
this.translateService = translateService;
|
|
2067
|
+
this.customDossierHeaderItems = [];
|
|
2068
|
+
this.document = null;
|
|
2069
|
+
this.dossierStatusTabs = null;
|
|
2070
|
+
this.processDefinitionListFields = [];
|
|
2071
|
+
this.processDocumentDefinitions = [];
|
|
2072
|
+
this.tabLoader = null;
|
|
2073
|
+
this.assigneeId$ = new BehaviorSubject('');
|
|
2074
|
+
this.document$ = this.dossierService.refreshDocument.pipe(switchMap(() => this.route.params), map((params) => params?.documentId), switchMap((documentId) => documentId ? this.documentService.getDocument(this.documentId) : of(null)), tap((document) => {
|
|
2075
|
+
if (document) {
|
|
2076
|
+
this.assigneeId$.next(document.assigneeId);
|
|
2077
|
+
this.document = document;
|
|
2078
|
+
if (this.configService.config.customDossierHeader?.hasOwnProperty(this.documentDefinitionName.toLowerCase()) &&
|
|
2079
|
+
this.customDossierHeaderItems.length === 0) {
|
|
2080
|
+
this.configService.config.customDossierHeader[this.documentDefinitionName.toLowerCase()]?.forEach(item => this.getCustomDossierHeaderItem(item));
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
}));
|
|
2084
|
+
this.documentDefinitionName$ = this.route.params.pipe(map(params => params.documentDefinitionName || ''));
|
|
2085
|
+
this.userId$ = from(this.keyCloakService.isLoggedIn()).pipe(switchMap(() => this.keyCloakService.loadUserProfile()), map(profile => profile?.id));
|
|
2086
|
+
this.isAssigning$ = new BehaviorSubject(false);
|
|
2087
|
+
this.isAssignedToCurrentUser$ = combineLatest([
|
|
2088
|
+
this.assigneeId$,
|
|
2089
|
+
this.userId$,
|
|
2090
|
+
]).pipe(map(([assigneeId, userId]) => !!assigneeId && !!userId && assigneeId === userId), startWith(true));
|
|
2091
|
+
this.canHaveAssignee$ = this.documentDefinitionName$.pipe(switchMap(documentDefinitionName => this.documentService.getCaseSettings(documentDefinitionName)), map(caseSettings => caseSettings?.canHaveAssignee));
|
|
2092
|
+
this.canAssignLoaded$ = new BehaviorSubject(false);
|
|
2093
|
+
this.canAssign$ = this.route.paramMap.pipe(switchMap((params) => this.permissionService.requestPermission(CAN_ASSIGN_CASE_PERMISSION, {
|
|
2094
|
+
resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
|
|
2095
|
+
identifier: params.get('documentId') ?? '',
|
|
2096
|
+
})), tap(() => {
|
|
2097
|
+
this.canAssignLoaded$.next(true);
|
|
2098
|
+
}));
|
|
2099
|
+
this.canClaim$ = this.route.paramMap.pipe(switchMap((params) => this.permissionService.requestPermission(CAN_CLAIM_CASE_PERMISSION, {
|
|
2100
|
+
resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
|
|
2101
|
+
identifier: params.get('documentId') ?? '',
|
|
2102
|
+
})));
|
|
2103
|
+
this._snapshot = this.route.snapshot.paramMap;
|
|
2104
|
+
this.documentDefinitionName = this._snapshot.get('documentDefinitionName') || '';
|
|
2105
|
+
this.documentId = this._snapshot.get('documentId') || '';
|
|
2106
|
+
this.tabService.getConfigurableTabs(this.documentDefinitionName);
|
|
2107
|
+
}
|
|
2108
|
+
ngAfterViewInit() {
|
|
2109
|
+
this.tabLoader = new TabLoaderImpl(this.tabService.getTabs(), this.componentFactoryResolver, this.viewContainerRef, this.translateService, this.router, this.location);
|
|
2110
|
+
this.documentService
|
|
2111
|
+
.getDocumentDefinition(this.documentDefinitionName)
|
|
2112
|
+
.subscribe(definition => {
|
|
2113
|
+
this.documentDefinitionNameTitle = definition.schema.title;
|
|
2114
|
+
this.setBreadcrumb();
|
|
2115
|
+
});
|
|
2116
|
+
this._initialTabName = this._snapshot.get('tab') ?? '';
|
|
2117
|
+
this.tabLoader.initial(this._initialTabName);
|
|
2118
|
+
this.getAllAssociatedProcessDefinitions();
|
|
2119
|
+
}
|
|
2120
|
+
ngOnDestroy() {
|
|
2121
|
+
this.breadcrumbService.clearSecondBreadcrumb();
|
|
2122
|
+
}
|
|
2123
|
+
getAllAssociatedProcessDefinitions() {
|
|
2124
|
+
this.documentService
|
|
2125
|
+
.findProcessDocumentDefinitions(this.documentDefinitionName)
|
|
2126
|
+
.subscribe((processDocumentDefinitions) => {
|
|
2127
|
+
this.processDocumentDefinitions = processDocumentDefinitions.filter(processDocumentDefinition => processDocumentDefinition.startableByUser);
|
|
2128
|
+
this.processDefinitionListFields = [
|
|
2129
|
+
{
|
|
2130
|
+
key: 'processName',
|
|
2131
|
+
label: 'Proces',
|
|
2132
|
+
},
|
|
2133
|
+
];
|
|
2134
|
+
});
|
|
2135
|
+
}
|
|
2136
|
+
startProcess(processDocumentDefinition) {
|
|
2137
|
+
this.supportingProcessStart.openModal(processDocumentDefinition, this.documentId);
|
|
2138
|
+
}
|
|
2139
|
+
claimAssignee() {
|
|
2140
|
+
this.isAssigning$.next(true);
|
|
2141
|
+
this.userId$
|
|
2142
|
+
.pipe(take(1), switchMap((userId) => this.documentService.assignHandlerToDocument(this.documentId, userId ?? '')))
|
|
2143
|
+
.subscribe({
|
|
2144
|
+
next: () => {
|
|
2145
|
+
this.isAssigning$.next(false);
|
|
2146
|
+
this.dossierService.refresh();
|
|
2147
|
+
},
|
|
2148
|
+
error: () => {
|
|
2149
|
+
this.isAssigning$.next(false);
|
|
2150
|
+
this.logger.debug('Something went wrong while assigning user to case');
|
|
2151
|
+
},
|
|
2152
|
+
});
|
|
2153
|
+
}
|
|
2154
|
+
assignmentOfDocumentChanged() {
|
|
2155
|
+
this.dossierService.refresh();
|
|
2156
|
+
}
|
|
2157
|
+
getCustomDossierHeaderItem(item) {
|
|
2158
|
+
this.customDossierHeaderItems.push({
|
|
2159
|
+
label: item['labelTranslationKey'] || '',
|
|
2160
|
+
columnSize: item['columnSize'] || 3,
|
|
2161
|
+
textSize: item['textSize'] || 'md',
|
|
2162
|
+
customClass: item['customClass'] || '',
|
|
2163
|
+
modifier: item['modifier'] || '',
|
|
2164
|
+
value: item['propertyPaths']?.reduce((prev, curr) => prev + this.getStringFromDocumentPath(item, curr), ''),
|
|
2165
|
+
});
|
|
2166
|
+
}
|
|
2167
|
+
getStringFromDocumentPath(item, path) {
|
|
2168
|
+
const prefix = item['propertyPaths'].indexOf(path) > 0 ? ' ' : '';
|
|
2169
|
+
let string = path.split('.').reduce((o, i) => o[i], this.document?.content) || item['noValueText'] || '';
|
|
2170
|
+
const dateFormats = [moment.ISO_8601, 'MM-DD-YYYY', 'DD-MM-YYYY', 'YYYY-MM-DD'];
|
|
2171
|
+
switch (item['modifier']) {
|
|
2172
|
+
case 'age': {
|
|
2173
|
+
if (moment(string, dateFormats, true).isValid()) {
|
|
2174
|
+
string = moment().diff(string, 'years');
|
|
2175
|
+
}
|
|
2176
|
+
break;
|
|
2177
|
+
}
|
|
2178
|
+
default: {
|
|
2179
|
+
if (moment(string, dateFormats, true).isValid()) {
|
|
2180
|
+
string = moment(string).format('DD-MM-YYYY');
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
return prefix + string;
|
|
2185
|
+
}
|
|
2186
|
+
setBreadcrumb() {
|
|
2187
|
+
this.breadcrumbService.setSecondBreadcrumb({
|
|
2188
|
+
route: [`/dossiers/${this.documentDefinitionName}`],
|
|
2189
|
+
content: this.documentDefinitionNameTitle,
|
|
2190
|
+
href: `/dossiers/${this.documentDefinitionName}`,
|
|
2191
|
+
});
|
|
2192
|
+
}
|
|
2193
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailComponent, deps: [{ token: i3$2.BreadcrumbService }, { token: i0.ComponentFactoryResolver }, { token: i1.ConfigService }, { token: i2$1.DocumentService }, { token: DossierService }, { token: i5$2.KeycloakService }, { token: i3.Location }, { token: i1$2.NGXLogger }, { token: i7.PermissionService }, { token: i1$1.ActivatedRoute }, { token: i1$1.Router }, { token: TabService }, { token: i6.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2194
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailComponent, selector: "valtimo-dossier-detail", viewQueries: [{ propertyName: "supportingProcessStart", first: true, predicate: ["supportingProcessStartModal"], descendants: true }, { propertyName: "viewContainerRef", first: true, predicate: ["tabContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<div\n *ngIf=\"{\n canAssign: canAssign$ | async,\n canClaim: canClaim$ | async,\n canHaveAssignee: canHaveAssignee$ | async,\n document: document$ | async\n } as obs\"\n class=\"main-content\"\n>\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div class=\"card-header bg-light card-header-divider pb-2\">\n <div class=\"row\">\n <div class=\"col\">\n <ng-container\n *ngTemplateOutlet=\"\n caseDetailHeader;\n context: {\n canHaveAssignee: obs.canHaveAssignee,\n document: obs.document,\n canAssign: obs.canAssign\n }\n \"\n ></ng-container>\n </div>\n\n <div class=\"btn-group mt-m3px mb-3 col-auto\">\n <valtimo-extension\n module=\"dossier\"\n page=\"dossier-detail\"\n section=\"card-header\"\n ></valtimo-extension>\n\n <ng-container\n *ngTemplateOutlet=\"\n claimButton;\n context: {canClaim: obs.canClaim, canHaveAssignee: obs.canHaveAssignee}\n \"\n ></ng-container>\n\n <div class=\"dropdown\">\n <button\n [disabled]=\"processDocumentDefinitions.length === 0\"\n [ngbTooltip]=\"processDocumentDefinitions.length === 0 ? 'No action' : null\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n class=\"btn btn-primary dropdown-toggle\"\n data-toggle=\"dropdown\"\n id=\"startProcessDropdown\"\n placement=\"bottom\"\n type=\"button\"\n >\n <span>{{ 'dossier.startSubProcess' | translate }}</span>\n\n <i class=\"ml-1 mdi mdi-chevron-down\"></i>\n </button>\n\n <div\n aria-labelledby=\"startProcessDropdown\"\n class=\"dropdown-menu dropdown-menu-right\"\n >\n <button\n *ngFor=\"let processDocumentDefinition of processDocumentDefinitions\"\n (click)=\"startProcess(processDocumentDefinition)\"\n class=\"dropdown-item p\"\n href=\"#\"\n >\n {{\n (processDocumentDefinition?.id?.processDefinitionKey | translate) !==\n processDocumentDefinition?.id?.processDefinitionKey\n ? (processDocumentDefinition.id.processDefinitionKey | translate)\n : processDocumentDefinition.processName\n }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <ul *ngIf=\"tabLoader\" class=\"nav nav-tabs\">\n <li class=\"nav-item\" *ngFor=\"let tab of tabLoader.tabs\">\n <a\n [ngClass]=\"{active: tab.isActive()}\"\n (click)=\"tabLoader.load(tab)\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n id=\"{{ tab.name }}-tab\"\n >\n {{ tabLoader.translateTabName(tab) }}\n </a>\n </li>\n </ul>\n\n <div class=\"card-body bg-white p-5 position-relative tab-container\">\n <ng-template #tabContainer>Loading...</ng-template>\n\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </div>\n\n <valtimo-dossier-supporting-process-start-modal\n (formSubmit)=\"tabLoader.refreshView()\"\n #supportingProcessStartModal\n ></valtimo-dossier-supporting-process-start-modal>\n </div>\n</div>\n\n<ng-template\n #caseDetailHeader\n let-canHaveAssignee=\"canHaveAssignee\"\n let-document=\"document\"\n let-canAssign=\"canAssign\"\n>\n <div class=\"row\" *ngIf=\"customDossierHeaderItems.length > 0; else defaultTitle\">\n <span\n *ngFor=\"let item of customDossierHeaderItems\"\n [ngClass]=\"{\n h1: item.textSize === 'xl',\n h2: item.textSize === 'lg',\n h3: item.textSize === 'md',\n h4: item.textSize === 'sm',\n h5: item.textSize === 'xs'\n }\"\n class=\"mb-0 mt-0 pb-2 align-self-end col-xl-{{ item.columnSize }} col-lg-{{\n item.columnSize * 2\n }} {{ item.customClass }}\"\n >\n <span *ngIf=\"item.label\">{{ item.label | translate }}</span>\n\n <span *ngIf=\"item.label && item.value\">: </span>\n\n <strong>{{ item.value }}</strong>\n </span>\n </div>\n\n <ng-container\n *ngTemplateOutlet=\"\n caseDetailAssignee;\n context: {canHaveAssignee: canHaveAssignee, document: document, canAssign: canAssign}\n \"\n ></ng-container>\n</ng-template>\n\n<ng-template #defaultTitle>\n <div class=\"row ml-0 mr-0\">{{ documentDefinitionNameTitle?.trim() }}</div>\n</ng-template>\n\n<ng-template\n #caseDetailAssignee\n let-canHaveAssignee=\"canHaveAssignee\"\n let-document=\"document\"\n let-canAssign=\"canAssign\"\n>\n <div class=\"row ml-0 mr-0 mt-1 mb-1\" *ngIf=\"canHaveAssignee && document\">\n <valtimo-dossier-assign-user\n *ngIf=\"canAssignLoaded$ | async\"\n [assigneeFullName]=\"document?.assigneeFullName\"\n [assigneeId]=\"document.assigneeId\"\n [documentId]=\"document.id\"\n [hasPermission]=\"canAssign\"\n (assignmentOfDocumentChanged)=\"assignmentOfDocumentChanged()\"\n ></valtimo-dossier-assign-user>\n </div>\n</ng-template>\n\n<ng-template #claimButton let-canClaim=\"canClaim\" let-canHaveAssignee=\"canHaveAssignee\">\n <div class=\"user-full-name\" *ngIf=\"canClaim && canHaveAssignee\">\n <button\n [disabled]=\"(isAssigning$ | async) || (isAssignedToCurrentUser$ | async)\"\n (click)=\"claimAssignee()\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n class=\"btn btn-space btn-primary mr-1\"\n placement=\"bottom\"\n type=\"button\"\n >\n <span>{{ 'dossier.claimAssigneeCase' | translate }}</span>\n </button>\n </div>\n</ng-template>\n", styles: [".tab-container{min-height:300px}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$2.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "directive", type: i10.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { kind: "component", type: i1.ExtensionComponent, selector: "valtimo-extension", inputs: ["module", "page", "section"] }, { kind: "component", type: DossierSupportingProcessStartModalComponent, selector: "valtimo-dossier-supporting-process-start-modal", outputs: ["formSubmit"] }, { kind: "component", type: DossierAssignUserComponent, selector: "valtimo-dossier-assign-user", inputs: ["documentId", "assigneeId", "assigneeFullName", "hasPermission"], outputs: ["assignmentOfDocumentChanged"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
2195
|
+
}
|
|
2196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailComponent, decorators: [{
|
|
2197
|
+
type: Component,
|
|
2198
|
+
args: [{ selector: 'valtimo-dossier-detail', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<div\n *ngIf=\"{\n canAssign: canAssign$ | async,\n canClaim: canClaim$ | async,\n canHaveAssignee: canHaveAssignee$ | async,\n document: document$ | async\n } as obs\"\n class=\"main-content\"\n>\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div class=\"card-header bg-light card-header-divider pb-2\">\n <div class=\"row\">\n <div class=\"col\">\n <ng-container\n *ngTemplateOutlet=\"\n caseDetailHeader;\n context: {\n canHaveAssignee: obs.canHaveAssignee,\n document: obs.document,\n canAssign: obs.canAssign\n }\n \"\n ></ng-container>\n </div>\n\n <div class=\"btn-group mt-m3px mb-3 col-auto\">\n <valtimo-extension\n module=\"dossier\"\n page=\"dossier-detail\"\n section=\"card-header\"\n ></valtimo-extension>\n\n <ng-container\n *ngTemplateOutlet=\"\n claimButton;\n context: {canClaim: obs.canClaim, canHaveAssignee: obs.canHaveAssignee}\n \"\n ></ng-container>\n\n <div class=\"dropdown\">\n <button\n [disabled]=\"processDocumentDefinitions.length === 0\"\n [ngbTooltip]=\"processDocumentDefinitions.length === 0 ? 'No action' : null\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n class=\"btn btn-primary dropdown-toggle\"\n data-toggle=\"dropdown\"\n id=\"startProcessDropdown\"\n placement=\"bottom\"\n type=\"button\"\n >\n <span>{{ 'dossier.startSubProcess' | translate }}</span>\n\n <i class=\"ml-1 mdi mdi-chevron-down\"></i>\n </button>\n\n <div\n aria-labelledby=\"startProcessDropdown\"\n class=\"dropdown-menu dropdown-menu-right\"\n >\n <button\n *ngFor=\"let processDocumentDefinition of processDocumentDefinitions\"\n (click)=\"startProcess(processDocumentDefinition)\"\n class=\"dropdown-item p\"\n href=\"#\"\n >\n {{\n (processDocumentDefinition?.id?.processDefinitionKey | translate) !==\n processDocumentDefinition?.id?.processDefinitionKey\n ? (processDocumentDefinition.id.processDefinitionKey | translate)\n : processDocumentDefinition.processName\n }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <ul *ngIf=\"tabLoader\" class=\"nav nav-tabs\">\n <li class=\"nav-item\" *ngFor=\"let tab of tabLoader.tabs\">\n <a\n [ngClass]=\"{active: tab.isActive()}\"\n (click)=\"tabLoader.load(tab)\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n id=\"{{ tab.name }}-tab\"\n >\n {{ tabLoader.translateTabName(tab) }}\n </a>\n </li>\n </ul>\n\n <div class=\"card-body bg-white p-5 position-relative tab-container\">\n <ng-template #tabContainer>Loading...</ng-template>\n\n <div class=\"clearfix\"></div>\n </div>\n </valtimo-widget>\n </div>\n\n <valtimo-dossier-supporting-process-start-modal\n (formSubmit)=\"tabLoader.refreshView()\"\n #supportingProcessStartModal\n ></valtimo-dossier-supporting-process-start-modal>\n </div>\n</div>\n\n<ng-template\n #caseDetailHeader\n let-canHaveAssignee=\"canHaveAssignee\"\n let-document=\"document\"\n let-canAssign=\"canAssign\"\n>\n <div class=\"row\" *ngIf=\"customDossierHeaderItems.length > 0; else defaultTitle\">\n <span\n *ngFor=\"let item of customDossierHeaderItems\"\n [ngClass]=\"{\n h1: item.textSize === 'xl',\n h2: item.textSize === 'lg',\n h3: item.textSize === 'md',\n h4: item.textSize === 'sm',\n h5: item.textSize === 'xs'\n }\"\n class=\"mb-0 mt-0 pb-2 align-self-end col-xl-{{ item.columnSize }} col-lg-{{\n item.columnSize * 2\n }} {{ item.customClass }}\"\n >\n <span *ngIf=\"item.label\">{{ item.label | translate }}</span>\n\n <span *ngIf=\"item.label && item.value\">: </span>\n\n <strong>{{ item.value }}</strong>\n </span>\n </div>\n\n <ng-container\n *ngTemplateOutlet=\"\n caseDetailAssignee;\n context: {canHaveAssignee: canHaveAssignee, document: document, canAssign: canAssign}\n \"\n ></ng-container>\n</ng-template>\n\n<ng-template #defaultTitle>\n <div class=\"row ml-0 mr-0\">{{ documentDefinitionNameTitle?.trim() }}</div>\n</ng-template>\n\n<ng-template\n #caseDetailAssignee\n let-canHaveAssignee=\"canHaveAssignee\"\n let-document=\"document\"\n let-canAssign=\"canAssign\"\n>\n <div class=\"row ml-0 mr-0 mt-1 mb-1\" *ngIf=\"canHaveAssignee && document\">\n <valtimo-dossier-assign-user\n *ngIf=\"canAssignLoaded$ | async\"\n [assigneeFullName]=\"document?.assigneeFullName\"\n [assigneeId]=\"document.assigneeId\"\n [documentId]=\"document.id\"\n [hasPermission]=\"canAssign\"\n (assignmentOfDocumentChanged)=\"assignmentOfDocumentChanged()\"\n ></valtimo-dossier-assign-user>\n </div>\n</ng-template>\n\n<ng-template #claimButton let-canClaim=\"canClaim\" let-canHaveAssignee=\"canHaveAssignee\">\n <div class=\"user-full-name\" *ngIf=\"canClaim && canHaveAssignee\">\n <button\n [disabled]=\"(isAssigning$ | async) || (isAssignedToCurrentUser$ | async)\"\n (click)=\"claimAssignee()\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n class=\"btn btn-space btn-primary mr-1\"\n placement=\"bottom\"\n type=\"button\"\n >\n <span>{{ 'dossier.claimAssigneeCase' | translate }}</span>\n </button>\n </div>\n</ng-template>\n", styles: [".tab-container{min-height:300px}\n"] }]
|
|
2199
|
+
}], ctorParameters: function () { return [{ type: i3$2.BreadcrumbService }, { type: i0.ComponentFactoryResolver }, { type: i1.ConfigService }, { type: i2$1.DocumentService }, { type: DossierService }, { type: i5$2.KeycloakService }, { type: i3.Location }, { type: i1$2.NGXLogger }, { type: i7.PermissionService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: TabService }, { type: i6.TranslateService }]; }, propDecorators: { supportingProcessStart: [{
|
|
2200
|
+
type: ViewChild,
|
|
2201
|
+
args: ['supportingProcessStartModal']
|
|
2202
|
+
}], viewContainerRef: [{
|
|
2203
|
+
type: ViewChild,
|
|
2204
|
+
args: ['tabContainer', { read: ViewContainerRef }]
|
|
2205
|
+
}] } });
|
|
2206
|
+
|
|
2207
|
+
/*
|
|
2208
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
2209
|
+
*
|
|
2210
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2211
|
+
* you may not use this file except in compliance with the License.
|
|
2212
|
+
* You may obtain a copy of the License at
|
|
2213
|
+
*
|
|
2214
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2215
|
+
*
|
|
2216
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2217
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2218
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2219
|
+
* See the License for the specific language governing permissions and
|
|
2220
|
+
* limitations under the License.
|
|
2221
|
+
*/
|
|
2222
|
+
moment.locale(localStorage.getItem('langKey') || '');
|
|
2223
|
+
class DossierDetailTabContactMomentsComponent {
|
|
2224
|
+
constructor(contactMomentService, alertService, translateService) {
|
|
2225
|
+
this.contactMomentService = contactMomentService;
|
|
2226
|
+
this.alertService = alertService;
|
|
2227
|
+
this.translateService = translateService;
|
|
2228
|
+
this.refetchContactMoments$ = new BehaviorSubject('');
|
|
2229
|
+
this.contactMoments$ = this.refetchContactMoments$.pipe(switchMap$1(() => this.contactMomentService.getContactMoments()), map$1(contactMoments => contactMoments.map(contactMoment => {
|
|
2230
|
+
const registratieDatum = moment(contactMoment.registratiedatum);
|
|
2231
|
+
return new TimelineItemImpl(registratieDatum.format('DD MMM YYYY'), registratieDatum.format('HH:mm'), contactMoment.medewerkerIdentificatie.achternaam, contactMoment.kanaal, contactMoment.tekst, null);
|
|
2232
|
+
})));
|
|
2233
|
+
this.text$ = new BehaviorSubject('');
|
|
2234
|
+
this.channel$ = new BehaviorSubject('MAIL');
|
|
2235
|
+
this.requestData$ = combineLatest([this.text$, this.channel$]);
|
|
2236
|
+
this.valid$ = this.requestData$.pipe(map$1(([text, channel]) => !!(text && channel)));
|
|
2237
|
+
this.disabled$ = new BehaviorSubject(false);
|
|
2238
|
+
}
|
|
2239
|
+
textChange(text) {
|
|
2240
|
+
this.text$.next(text);
|
|
2241
|
+
}
|
|
2242
|
+
buttonClick() {
|
|
2243
|
+
this.modal.show();
|
|
2244
|
+
}
|
|
2245
|
+
saveNote() {
|
|
2246
|
+
this.disable();
|
|
2247
|
+
this.requestData$.pipe(take$1(1)).subscribe(([text, channel]) => {
|
|
2248
|
+
this.contactMomentService.saveContactMoment({ kanaal: channel, tekst: text }).subscribe(() => {
|
|
2249
|
+
this.alertService.success(this.translateService.instant('dossier.contactMoments.saveSuccess'));
|
|
2250
|
+
this.enable();
|
|
2251
|
+
this.clear();
|
|
2252
|
+
this.modal.hide();
|
|
2253
|
+
this.refetchContactMoments();
|
|
2254
|
+
}, () => {
|
|
2255
|
+
this.enable();
|
|
2256
|
+
});
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
disable() {
|
|
2260
|
+
this.disabled$.next(true);
|
|
2261
|
+
}
|
|
2262
|
+
enable() {
|
|
2263
|
+
this.disabled$.next(false);
|
|
2264
|
+
}
|
|
2265
|
+
clear() {
|
|
2266
|
+
this.text$.next('');
|
|
2267
|
+
}
|
|
2268
|
+
refetchContactMoments() {
|
|
2269
|
+
this.refetchContactMoments$.next('');
|
|
2270
|
+
}
|
|
2271
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabContactMomentsComponent, deps: [{ token: i1$3.ContactMomentService }, { token: i3$2.AlertService }, { token: i6.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2272
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabContactMomentsComponent, selector: "valtimo-dossier-detail-tab-contact-moments", viewQueries: [{ propertyName: "modal", first: true, predicate: ["contactMomentsNoteModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"contact-moments-container\">\n <ng-container *ngTemplateOutlet=\"buttons\"></ng-container>\n <ng-container *ngTemplateOutlet=\"moments\"></ng-container>\n</div>\n\n<valtimo-modal\n #contactMomentsNoteModal\n [title]=\"'dossier.contactMoments.popupTitle' | translate\"\n [showFooter]=\"true\"\n [elementId]=\"'contact-moments-modal'\"\n>\n <div class=\"mt-2\" body>\n <ng-container *ngTemplateOutlet=\"body\"></ng-container>\n </div>\n <div footer>\n <ng-container *ngTemplateOutlet=\"footer\"></ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #body>\n <form>\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"body\">\n {{ 'dossier.contactMoments.noteText' | translate }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <textarea\n [disabled]=\"disabled$ | async\"\n class=\"form-control\"\n id=\"body\"\n name=\"body\"\n [ngModel]=\"text$ | async\"\n (ngModelChange)=\"textChange($event)\"\n ></textarea>\n </div>\n </div>\n </form>\n</ng-template>\n\n<ng-template #footer>\n <button\n *ngIf=\"(disabled$ | async) === false; else loading\"\n class=\"btn btn-primary\"\n [disabled]=\"(valid$ | async) === false || (disabled$ | async)\"\n (click)=\"saveNote()\"\n >\n {{ 'dossier.contactMoments.saveButtonText' | translate }}\n </button>\n</ng-template>\n\n<ng-template #loading>\n <valtimo-spinner [noMarginTop]=\"true\"></valtimo-spinner>\n</ng-template>\n\n<ng-template #buttons>\n <div class=\"btn-group mt-m3px mb-3 button-container\">\n <button class=\"btn btn-primary btn-space\" (click)=\"buttonClick()\">\n <i class=\"icon mdi mdi-note-plus\"></i>\n {{ 'dossier.contactMoments.makeNoteButton' | translate }}\n </button>\n </div>\n</ng-template>\n\n<ng-template #moments>\n <div *ngIf=\"contactMoments$ | async as contactMoments; else loading\">\n <valtimo-timeline [items]=\"contactMoments\"></valtimo-timeline>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.contact-moments-container{display:flex;flex-direction:column}.button-container{display:inline;align-self:flex-end}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$2.TimelineComponent, selector: "valtimo-timeline", inputs: ["items", "actions"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3$2.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "component", type: i3$2.SpinnerComponent, selector: "valtimo-spinner", inputs: ["useBootstrapSpinner", "name", "type", "size", "color", "bdColor", "fullScreen", "noMarginTop"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
2273
|
+
}
|
|
2274
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabContactMomentsComponent, decorators: [{
|
|
2275
|
+
type: Component,
|
|
2276
|
+
args: [{ selector: 'valtimo-dossier-detail-tab-contact-moments', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"contact-moments-container\">\n <ng-container *ngTemplateOutlet=\"buttons\"></ng-container>\n <ng-container *ngTemplateOutlet=\"moments\"></ng-container>\n</div>\n\n<valtimo-modal\n #contactMomentsNoteModal\n [title]=\"'dossier.contactMoments.popupTitle' | translate\"\n [showFooter]=\"true\"\n [elementId]=\"'contact-moments-modal'\"\n>\n <div class=\"mt-2\" body>\n <ng-container *ngTemplateOutlet=\"body\"></ng-container>\n </div>\n <div footer>\n <ng-container *ngTemplateOutlet=\"footer\"></ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #body>\n <form>\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"body\">\n {{ 'dossier.contactMoments.noteText' | translate }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <textarea\n [disabled]=\"disabled$ | async\"\n class=\"form-control\"\n id=\"body\"\n name=\"body\"\n [ngModel]=\"text$ | async\"\n (ngModelChange)=\"textChange($event)\"\n ></textarea>\n </div>\n </div>\n </form>\n</ng-template>\n\n<ng-template #footer>\n <button\n *ngIf=\"(disabled$ | async) === false; else loading\"\n class=\"btn btn-primary\"\n [disabled]=\"(valid$ | async) === false || (disabled$ | async)\"\n (click)=\"saveNote()\"\n >\n {{ 'dossier.contactMoments.saveButtonText' | translate }}\n </button>\n</ng-template>\n\n<ng-template #loading>\n <valtimo-spinner [noMarginTop]=\"true\"></valtimo-spinner>\n</ng-template>\n\n<ng-template #buttons>\n <div class=\"btn-group mt-m3px mb-3 button-container\">\n <button class=\"btn btn-primary btn-space\" (click)=\"buttonClick()\">\n <i class=\"icon mdi mdi-note-plus\"></i>\n {{ 'dossier.contactMoments.makeNoteButton' | translate }}\n </button>\n </div>\n</ng-template>\n\n<ng-template #moments>\n <div *ngIf=\"contactMoments$ | async as contactMoments; else loading\">\n <valtimo-timeline [items]=\"contactMoments\"></valtimo-timeline>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.contact-moments-container{display:flex;flex-direction:column}.button-container{display:inline;align-self:flex-end}\n"] }]
|
|
2277
|
+
}], ctorParameters: function () { return [{ type: i1$3.ContactMomentService }, { type: i3$2.AlertService }, { type: i6.TranslateService }]; }, propDecorators: { modal: [{
|
|
2278
|
+
type: ViewChild,
|
|
2279
|
+
args: ['contactMomentsNoteModal']
|
|
2280
|
+
}] } });
|
|
2281
|
+
|
|
2282
|
+
/*
|
|
2283
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
2284
|
+
*
|
|
2285
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2286
|
+
* you may not use this file except in compliance with the License.
|
|
2287
|
+
* You may obtain a copy of the License at
|
|
2288
|
+
*
|
|
2289
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2290
|
+
*
|
|
2291
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2292
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2293
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2294
|
+
* See the License for the specific language governing permissions and
|
|
2295
|
+
* limitations under the License.
|
|
2296
|
+
*/
|
|
2297
|
+
class NotesService {
|
|
2298
|
+
constructor(configService, http) {
|
|
2299
|
+
this.configService = configService;
|
|
2300
|
+
this.http = http;
|
|
2301
|
+
this.VALTIMO_API_ENDPOINT_URI = this.configService.config.valtimoApi.endpointUri;
|
|
2302
|
+
this._showModal$ = new Subject();
|
|
2303
|
+
this._hideModal$ = new Subject();
|
|
2304
|
+
this._refresh$ = new BehaviorSubject(null);
|
|
2305
|
+
this._modalType$ = new BehaviorSubject('add');
|
|
2306
|
+
}
|
|
2307
|
+
getDocumentNotes(documentId, params) {
|
|
2308
|
+
return this.http.get(`${this.VALTIMO_API_ENDPOINT_URI}v1/document/${documentId}/note`, { params });
|
|
2309
|
+
}
|
|
2310
|
+
createDocumentNote(documentId, request) {
|
|
2311
|
+
return this.http.post(`${this.VALTIMO_API_ENDPOINT_URI}v1/document/${documentId}/note`, request);
|
|
2312
|
+
}
|
|
2313
|
+
updateNote(noteId, request) {
|
|
2314
|
+
return this.http.put(`${this.VALTIMO_API_ENDPOINT_URI}v1/note/${noteId}`, request);
|
|
2315
|
+
}
|
|
2316
|
+
deleteNote(noteId) {
|
|
2317
|
+
return this.http.delete(`${this.VALTIMO_API_ENDPOINT_URI}v1/note/${noteId}`);
|
|
2318
|
+
}
|
|
2319
|
+
get showModal$() {
|
|
2320
|
+
return this._showModal$.asObservable();
|
|
2321
|
+
}
|
|
2322
|
+
get hideModal$() {
|
|
2323
|
+
return this._hideModal$.asObservable();
|
|
2324
|
+
}
|
|
2325
|
+
get refresh$() {
|
|
2326
|
+
return this._refresh$.asObservable();
|
|
2327
|
+
}
|
|
2328
|
+
get modalType$() {
|
|
2329
|
+
return this._modalType$.asObservable();
|
|
2330
|
+
}
|
|
2331
|
+
showModal() {
|
|
2332
|
+
this._showModal$.next(null);
|
|
2333
|
+
}
|
|
2334
|
+
hideModal() {
|
|
2335
|
+
this._hideModal$.next(null);
|
|
2336
|
+
}
|
|
2337
|
+
refresh() {
|
|
2338
|
+
this._refresh$.next(null);
|
|
2339
|
+
}
|
|
2340
|
+
setModalType(type) {
|
|
2341
|
+
this._modalType$.next(type);
|
|
2342
|
+
}
|
|
2343
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NotesService, deps: [{ token: i1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2344
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NotesService, providedIn: 'root' }); }
|
|
2345
|
+
}
|
|
2346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NotesService, decorators: [{
|
|
2347
|
+
type: Injectable,
|
|
2348
|
+
args: [{
|
|
2349
|
+
providedIn: 'root',
|
|
2350
|
+
}]
|
|
2351
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2.HttpClient }]; } });
|
|
2352
|
+
|
|
2353
|
+
/*
|
|
2354
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
2355
|
+
*
|
|
2356
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2357
|
+
* you may not use this file except in compliance with the License.
|
|
2358
|
+
* You may obtain a copy of the License at
|
|
2359
|
+
*
|
|
2360
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2361
|
+
*
|
|
2362
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2363
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2364
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2365
|
+
* See the License for the specific language governing permissions and
|
|
2366
|
+
* limitations under the License.
|
|
2367
|
+
*/
|
|
2368
|
+
class NoteModalComponent {
|
|
2369
|
+
constructor(notesService, modalService) {
|
|
2370
|
+
this.notesService = notesService;
|
|
2371
|
+
this.modalService = modalService;
|
|
2372
|
+
this.createNoteEvent = new EventEmitter();
|
|
2373
|
+
this.editNoteEvent = new EventEmitter();
|
|
2374
|
+
this.valid$ = new BehaviorSubject(false);
|
|
2375
|
+
this.showForm$ = this.modalService.modalVisible$;
|
|
2376
|
+
this.formData$ = new BehaviorSubject(null);
|
|
2377
|
+
this.modalType$ = this.notesService.modalType$;
|
|
2378
|
+
this.returnToFirstStepSubject$ = new Subject();
|
|
2379
|
+
}
|
|
2380
|
+
ngAfterViewInit() {
|
|
2381
|
+
this.openShowSubscription();
|
|
2382
|
+
this.openHideSubscription();
|
|
2383
|
+
}
|
|
2384
|
+
ngOnDestroy() {
|
|
2385
|
+
this.showSubscription?.unsubscribe();
|
|
2386
|
+
this.hideSubscription?.unsubscribe();
|
|
2387
|
+
}
|
|
2388
|
+
hide() {
|
|
2389
|
+
this.formData$.next(null);
|
|
2390
|
+
this.valid$.next(false);
|
|
2391
|
+
this.modalService.closeModal();
|
|
2392
|
+
}
|
|
2393
|
+
cancel() {
|
|
2394
|
+
this.hide();
|
|
2395
|
+
}
|
|
2396
|
+
save() {
|
|
2397
|
+
combineLatest([this.valid$, this.formData$])
|
|
2398
|
+
.pipe(take$1(1))
|
|
2399
|
+
.subscribe(([valid, formData]) => {
|
|
2400
|
+
if (valid) {
|
|
2401
|
+
this.createNoteEvent.emit(formData);
|
|
2402
|
+
}
|
|
2403
|
+
});
|
|
2404
|
+
}
|
|
2405
|
+
emitNoteData() {
|
|
2406
|
+
combineLatest([this.valid$, this.formData$, this.modalType$])
|
|
2407
|
+
.pipe(take$1(1))
|
|
2408
|
+
.subscribe(([valid, formData, modalType]) => {
|
|
2409
|
+
if (valid) {
|
|
2410
|
+
if (modalType === 'add') {
|
|
2411
|
+
this.createNoteEvent.emit(formData);
|
|
2412
|
+
}
|
|
2413
|
+
else {
|
|
2414
|
+
this.editNoteEvent.emit({ formData, data: this.customData });
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
openShowSubscription() {
|
|
2420
|
+
this.showSubscription = this.notesService.showModal$.subscribe(() => {
|
|
2421
|
+
this.show();
|
|
2422
|
+
});
|
|
2423
|
+
}
|
|
2424
|
+
openHideSubscription() {
|
|
2425
|
+
this.hideSubscription = this.notesService.hideModal$.subscribe(() => {
|
|
2426
|
+
this.hide();
|
|
2427
|
+
});
|
|
2428
|
+
}
|
|
2429
|
+
show() {
|
|
2430
|
+
this.notesService.modalType$.pipe(take$1(1)).subscribe(() => {
|
|
2431
|
+
this.modalService.openModal(this.noteModal);
|
|
2432
|
+
});
|
|
2433
|
+
}
|
|
2434
|
+
formValueChange(data) {
|
|
2435
|
+
this.formData$.next(data);
|
|
2436
|
+
this.setValid(data);
|
|
2437
|
+
}
|
|
2438
|
+
setValid(data) {
|
|
2439
|
+
this.valid$.next(!!data.content);
|
|
2440
|
+
}
|
|
2441
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoteModalComponent, deps: [{ token: NotesService }, { token: i3$2.ModalService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2442
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NoteModalComponent, selector: "valtimo-note-modal", inputs: { customData: "customData" }, outputs: { createNoteEvent: "createNoteEvent", editNoteEvent: "editNoteEvent" }, viewQueries: [{ propertyName: "noteModal", first: true, predicate: ["noteModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<v-modal\n #noteModal\n *ngIf=\"{disabled: disabled$ | async, valid: valid$ | async, modalType: modalType$ | async} as obs\"\n>\n <div role=\"header\">\n <div class=\"add-note-title\">\n <v-title [margin]=\"false\">{{\n (obs.modalType === 'add' ? 'dossier.notes.addNote' : 'dossier.notes.modifyNote') | translate\n }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <ng-container *ngTemplateOutlet=\"form\"></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <v-button (clickEvent)=\"cancel()\" [disabled]=\"obs.disabled\" type=\"secondary\">\n {{ 'document.cancel' | translate }}\n </v-button>\n <ng-container\n *ngTemplateOutlet=\"\n obs.modalType === 'add' ? addNoteButton : editNoteButton;\n context: {obs: obs}\n \"\n ></ng-container>\n </div>\n </div>\n</v-modal>\n\n<ng-template #addNoteButton let-obs=\"obs\">\n <v-button\n (clickEvent)=\"emitNoteData()\"\n [disabled]=\"obs.disabled || !obs.valid\"\n mdiIcon=\"plus\"\n type=\"success\"\n >\n {{ 'dossier.notes.addNote' | translate }}\n </v-button>\n</ng-template>\n<ng-template #editNoteButton let-obs=\"obs\">\n <v-button\n [disabled]=\"obs.disabled || !obs.valid\"\n (clickEvent)=\"emitNoteData()\"\n mdiIcon=\"pencil\"\n type=\"success\"\n >\n {{ 'dossier.notes.modifyNote' | translate }}\n </v-button>\n</ng-template>\n\n<ng-template #form>\n <ng-container *ngIf=\"showForm$ | async\">\n <v-form (valueChange)=\"formValueChange($event)\">\n <v-input\n type=\"textarea\"\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'dossier.notes.input.content' | translate\"\n name=\"content\"\n [fullWidth]=\"true\"\n [rows]=\"10\"\n [defaultValue]=\"customData?.summaryTranslationKey || ''\"\n >\n </v-input>\n </v-form>\n </ng-container>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.buttons,.add-note-title{width:100%;display:flex;flex-direction:row;justify-content:space-between}.add-note-title{justify-content:center}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$2.VModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx", "hideFooter"], outputs: ["closeEvent"] }, { kind: "component", type: i3$2.TitleComponent, selector: "v-title", inputs: ["type", "margin", "fullWidth", "center"] }, { kind: "component", type: i3$2.ButtonComponent, selector: "v-button", inputs: ["type", "mdiIcon", "disabled", "title", "titleTranslationKey"], outputs: ["clickEvent"] }, { kind: "component", type: i3$2.InputComponent, selector: "v-input", inputs: ["name", "type", "title", "titleTranslationKey", "defaultValue", "widthPx", "fullWidth", "margin", "smallMargin", "disabled", "step", "min", "maxLength", "tooltip", "required", "hideNumberSpinBox", "smallLabel", "rows", "clear$", "carbonTheme", "placeholder"], outputs: ["valueChange"] }, { kind: "component", type: i3$2.FormComponent, selector: "v-form", inputs: ["className"], outputs: ["valueChange"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
2443
|
+
}
|
|
2444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NoteModalComponent, decorators: [{
|
|
2445
|
+
type: Component,
|
|
2446
|
+
args: [{ selector: 'valtimo-note-modal', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<v-modal\n #noteModal\n *ngIf=\"{disabled: disabled$ | async, valid: valid$ | async, modalType: modalType$ | async} as obs\"\n>\n <div role=\"header\">\n <div class=\"add-note-title\">\n <v-title [margin]=\"false\">{{\n (obs.modalType === 'add' ? 'dossier.notes.addNote' : 'dossier.notes.modifyNote') | translate\n }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <ng-container *ngTemplateOutlet=\"form\"></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <v-button (clickEvent)=\"cancel()\" [disabled]=\"obs.disabled\" type=\"secondary\">\n {{ 'document.cancel' | translate }}\n </v-button>\n <ng-container\n *ngTemplateOutlet=\"\n obs.modalType === 'add' ? addNoteButton : editNoteButton;\n context: {obs: obs}\n \"\n ></ng-container>\n </div>\n </div>\n</v-modal>\n\n<ng-template #addNoteButton let-obs=\"obs\">\n <v-button\n (clickEvent)=\"emitNoteData()\"\n [disabled]=\"obs.disabled || !obs.valid\"\n mdiIcon=\"plus\"\n type=\"success\"\n >\n {{ 'dossier.notes.addNote' | translate }}\n </v-button>\n</ng-template>\n<ng-template #editNoteButton let-obs=\"obs\">\n <v-button\n [disabled]=\"obs.disabled || !obs.valid\"\n (clickEvent)=\"emitNoteData()\"\n mdiIcon=\"pencil\"\n type=\"success\"\n >\n {{ 'dossier.notes.modifyNote' | translate }}\n </v-button>\n</ng-template>\n\n<ng-template #form>\n <ng-container *ngIf=\"showForm$ | async\">\n <v-form (valueChange)=\"formValueChange($event)\">\n <v-input\n type=\"textarea\"\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'dossier.notes.input.content' | translate\"\n name=\"content\"\n [fullWidth]=\"true\"\n [rows]=\"10\"\n [defaultValue]=\"customData?.summaryTranslationKey || ''\"\n >\n </v-input>\n </v-form>\n </ng-container>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.buttons,.add-note-title{width:100%;display:flex;flex-direction:row;justify-content:space-between}.add-note-title{justify-content:center}\n"] }]
|
|
2447
|
+
}], ctorParameters: function () { return [{ type: NotesService }, { type: i3$2.ModalService }]; }, propDecorators: { noteModal: [{
|
|
2448
|
+
type: ViewChild,
|
|
2449
|
+
args: ['noteModal']
|
|
2450
|
+
}], customData: [{
|
|
2451
|
+
type: Input
|
|
2452
|
+
}], createNoteEvent: [{
|
|
2453
|
+
type: Output
|
|
2454
|
+
}], editNoteEvent: [{
|
|
2455
|
+
type: Output
|
|
2456
|
+
}] } });
|
|
2457
|
+
|
|
2458
|
+
/*
|
|
2459
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
2460
|
+
*
|
|
2461
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2462
|
+
* you may not use this file except in compliance with the License.
|
|
2463
|
+
* You may obtain a copy of the License at
|
|
2464
|
+
*
|
|
2465
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2466
|
+
*
|
|
2467
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2468
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2469
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2470
|
+
* See the License for the specific language governing permissions and
|
|
2471
|
+
* limitations under the License.
|
|
2472
|
+
*/
|
|
2473
|
+
class DossierDetailTabNotesComponent {
|
|
2474
|
+
constructor(notesService, permissionService, promptService, route, toastrService, translateService) {
|
|
2475
|
+
this.notesService = notesService;
|
|
2476
|
+
this.permissionService = permissionService;
|
|
2477
|
+
this.promptService = promptService;
|
|
2478
|
+
this.route = route;
|
|
2479
|
+
this.toastrService = toastrService;
|
|
2480
|
+
this.translateService = translateService;
|
|
2481
|
+
this.timelineItems = [];
|
|
2482
|
+
this.loading$ = new BehaviorSubject(true);
|
|
2483
|
+
this.fields$ = new BehaviorSubject([]);
|
|
2484
|
+
this.customData$ = new BehaviorSubject({});
|
|
2485
|
+
this.documentId$ = this.route.params.pipe(map(params => params.documentId));
|
|
2486
|
+
this.actions = [
|
|
2487
|
+
{ id: 'edit', label: 'Edit', icon: 'mdi-pencil', callback: this.editNote.bind(this) },
|
|
2488
|
+
{ id: 'delete', label: 'Delete', icon: 'mdi-delete', callback: this.deleteNote.bind(this) },
|
|
2489
|
+
];
|
|
2490
|
+
this.canAdd$ = this.documentId$.pipe(switchMap$1((identifier) => this.permissionService.requestPermission(CAN_ADD_NOTE_PERMISSION, {
|
|
2491
|
+
resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocument,
|
|
2492
|
+
identifier,
|
|
2493
|
+
})));
|
|
2494
|
+
this.currentPageAndSize$ = new BehaviorSubject({
|
|
2495
|
+
page: 0,
|
|
2496
|
+
size: 10,
|
|
2497
|
+
});
|
|
2498
|
+
this.pageSizes$ = new BehaviorSubject({
|
|
2499
|
+
collectionSize: 0,
|
|
2500
|
+
});
|
|
2501
|
+
this.pagination$ = combineLatest([
|
|
2502
|
+
this.currentPageAndSize$,
|
|
2503
|
+
this.pageSizes$,
|
|
2504
|
+
]).pipe(map(([currentPage, sizes]) => ({ ...currentPage, ...sizes, page: (currentPage.page ?? 0) + 1 })));
|
|
2505
|
+
this.notes$ = combineLatest([
|
|
2506
|
+
this.documentId$,
|
|
2507
|
+
this.currentPageAndSize$,
|
|
2508
|
+
this.notesService.refresh$,
|
|
2509
|
+
this.notesService.refresh$,
|
|
2510
|
+
]).pipe(tap$1(() => (this.timelineItems = [])), switchMap$1(([documentId, currentPage]) => this.notesService.getDocumentNotes(documentId, {
|
|
2511
|
+
page: currentPage.page,
|
|
2512
|
+
size: currentPage.size,
|
|
2513
|
+
})), tap$1((res) => {
|
|
2514
|
+
this.timelineItems = [];
|
|
2515
|
+
this.pageSizes$.pipe(take$1(1)).subscribe(sizes => {
|
|
2516
|
+
this.pageSizes$.next({ ...sizes, collectionSize: res.totalElements });
|
|
2517
|
+
});
|
|
2518
|
+
}), switchMap$1(res => combineLatest([
|
|
2519
|
+
of(res),
|
|
2520
|
+
...res.content.map(note => this.permissionService.requestPermission(CAN_DELETE_NOTE_PERMISSION, {
|
|
2521
|
+
resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.note,
|
|
2522
|
+
identifier: note.id,
|
|
2523
|
+
})),
|
|
2524
|
+
...res.content.map(note => this.permissionService.requestPermission(CAN_EDIT_NOTE_PERMISSION, {
|
|
2525
|
+
resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.note,
|
|
2526
|
+
identifier: note.id,
|
|
2527
|
+
})),
|
|
2528
|
+
])), map(combinedResults => {
|
|
2529
|
+
const permissionResults = combinedResults.filter((curr, index) => index !== 0);
|
|
2530
|
+
const halfIndex = Math.ceil(permissionResults.length / 2);
|
|
2531
|
+
const deletePermissions = permissionResults.slice(0, halfIndex);
|
|
2532
|
+
const editPermissions = permissionResults.slice(halfIndex);
|
|
2533
|
+
return combinedResults[0].content.map((note, index) => {
|
|
2534
|
+
const noteCreatedDate = moment(note.createdDate).locale(this.translateService.currentLang);
|
|
2535
|
+
this.timelineItems.push(new TimelineItemImpl(noteCreatedDate.format('DD MMM YYYY'), noteCreatedDate.format('HH:mm'), note.createdByUserFullName, noteCreatedDate.fromNow(), note.content, {}, { id: note.id }, [
|
|
2536
|
+
...(deletePermissions[index] ? ['delete'] : []),
|
|
2537
|
+
...(editPermissions[index] ? ['edit'] : []),
|
|
2538
|
+
]));
|
|
2539
|
+
return {
|
|
2540
|
+
...note,
|
|
2541
|
+
};
|
|
2542
|
+
});
|
|
2543
|
+
}), tap$1(() => this.loading$.next(false)));
|
|
2544
|
+
}
|
|
2545
|
+
ngOnInit() {
|
|
2546
|
+
this.translateService.onLangChange.subscribe(() => {
|
|
2547
|
+
this.notesService.refresh();
|
|
2548
|
+
});
|
|
2549
|
+
}
|
|
2550
|
+
paginationClicked(newPageNumber) {
|
|
2551
|
+
this.currentPageAndSize$.pipe(take$1(1)).subscribe(currentPage => {
|
|
2552
|
+
this.currentPageAndSize$.next({ ...currentPage, page: newPageNumber - 1 });
|
|
2553
|
+
});
|
|
2554
|
+
}
|
|
2555
|
+
showAddModal() {
|
|
2556
|
+
this.customData$.next({});
|
|
2557
|
+
this.notesService.setModalType('add');
|
|
2558
|
+
this.notesService.showModal();
|
|
2559
|
+
}
|
|
2560
|
+
createNewNote(content) {
|
|
2561
|
+
this.documentId$
|
|
2562
|
+
.pipe(take$1(1), switchMap$1((documentId) => this.notesService.createDocumentNote(documentId, content)))
|
|
2563
|
+
.subscribe(() => {
|
|
2564
|
+
this.notesService.refresh();
|
|
2565
|
+
this.notesService.hideModal();
|
|
2566
|
+
});
|
|
2567
|
+
}
|
|
2568
|
+
editNoteEvent(content) {
|
|
2569
|
+
this.notesService.updateNote(content.data.customData.id, content.formData).subscribe(() => {
|
|
2570
|
+
this.notesService.refresh();
|
|
2571
|
+
this.notesService.hideModal();
|
|
2572
|
+
this.toastrService.success(this.translateService.instant('dossier.notes.editedMessage'));
|
|
2573
|
+
});
|
|
2574
|
+
}
|
|
2575
|
+
editNote(data) {
|
|
2576
|
+
this.customData$.next(data);
|
|
2577
|
+
this.notesService.setModalType('modify');
|
|
2578
|
+
this.notesService.showModal();
|
|
2579
|
+
}
|
|
2580
|
+
deleteNote(data) {
|
|
2581
|
+
this.promptService.openPrompt({
|
|
2582
|
+
headerText: this.translateService.instant('dossier.notes.deleteConfirmation.title'),
|
|
2583
|
+
bodyText: this.translateService.instant('dossier.notes.deleteConfirmation.description'),
|
|
2584
|
+
cancelButtonText: this.translateService.instant('dossier.deleteConfirmation.cancel'),
|
|
2585
|
+
confirmButtonText: this.translateService.instant('dossier.deleteConfirmation.delete'),
|
|
2586
|
+
cancelMdiIcon: 'cancel',
|
|
2587
|
+
confirmMdiIcon: 'delete',
|
|
2588
|
+
cancelButtonType: 'secondary',
|
|
2589
|
+
confirmButtonType: 'primary',
|
|
2590
|
+
closeOnConfirm: true,
|
|
2591
|
+
closeOnCancel: true,
|
|
2592
|
+
confirmCallBackFunction: () => {
|
|
2593
|
+
this.notesService.deleteNote(data.customData.id).subscribe(() => {
|
|
2594
|
+
this.notesService.refresh();
|
|
2595
|
+
this.toastrService.success(this.translateService.instant('dossier.notes.deleteConfirmation.deletedMessage'));
|
|
2596
|
+
});
|
|
2597
|
+
},
|
|
2598
|
+
});
|
|
2599
|
+
}
|
|
2600
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabNotesComponent, deps: [{ token: NotesService }, { token: i7.PermissionService }, { token: i3$2.PromptService }, { token: i1$1.ActivatedRoute }, { token: i3$4.ToastrService }, { token: i6.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2601
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabNotesComponent, selector: "valtimo-dossier-detail-tab-notes", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<div\n *ngIf=\"{\n canAdd: canAdd$ | async,\n notes: notes$ | async,\n pagination: pagination$ | async,\n loading: loading$ | async\n } as obs\"\n class=\"notes\"\n>\n <button\n *ngIf=\"obs.canAdd\"\n [disabled]=\"obs.loading\"\n (click)=\"showAddModal()\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n class=\"btn btn-space btn-primary mr-1 add-note\"\n type=\"button\"\n >\n <span>{{ 'dossier.notes.addNote' | translate }}</span>\n\n <i class=\"ml-1 icon mdi mdi-plus\"></i>\n </button>\n\n <div *ngIf=\"timelineItems\">\n <valtimo-timeline [actions]=\"actions\" [items]=\"timelineItems\"></valtimo-timeline>\n </div>\n\n <valtimo-spinner\n [useBootstrapSpinner]=\"false\"\n name=\"auditSpinner\"\n bdColor=\"rgba(125, 125, 125, 0.35)\"\n color=\"#264251\"\n type=\"square-jelly-box\"\n >\n </valtimo-spinner>\n\n <div *ngIf=\"obs.pagination\" class=\"d-flex justify-content-end row mr-0 ml-0\">\n <ngb-pagination\n *ngIf=\"obs.pagination.collectionSize > obs.pagination.size\"\n [collectionSize]=\"obs.pagination.collectionSize\"\n [maxSize]=\"obs.pagination.size\"\n [pageSize]=\"obs.pagination.size\"\n [rotate]=\"true\"\n [(page)]=\"obs.pagination.page\"\n (pageChange)=\"paginationClicked($event)\"\n ></ngb-pagination>\n </div>\n</div>\n\n<valtimo-note-modal\n [customData]=\"customData$ | async\"\n (createNoteEvent)=\"createNewNote($event)\"\n (editNoteEvent)=\"editNoteEvent($event)\"\n></valtimo-note-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.notes{position:relative}.add-note{position:absolute;right:0}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.TimelineComponent, selector: "valtimo-timeline", inputs: ["items", "actions"] }, { kind: "component", type: i3$2.SpinnerComponent, selector: "valtimo-spinner", inputs: ["useBootstrapSpinner", "name", "type", "size", "color", "bdColor", "fullScreen", "noMarginTop"] }, { kind: "component", type: i10.NgbPagination, selector: "ngb-pagination", inputs: ["disabled", "boundaryLinks", "directionLinks", "ellipses", "rotate", "collectionSize", "maxSize", "page", "pageSize", "size"], outputs: ["pageChange"] }, { kind: "component", type: NoteModalComponent, selector: "valtimo-note-modal", inputs: ["customData"], outputs: ["createNoteEvent", "editNoteEvent"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
2602
|
+
}
|
|
2603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabNotesComponent, decorators: [{
|
|
2604
|
+
type: Component,
|
|
2605
|
+
args: [{ selector: 'valtimo-dossier-detail-tab-notes', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<div\n *ngIf=\"{\n canAdd: canAdd$ | async,\n notes: notes$ | async,\n pagination: pagination$ | async,\n loading: loading$ | async\n } as obs\"\n class=\"notes\"\n>\n <button\n *ngIf=\"obs.canAdd\"\n [disabled]=\"obs.loading\"\n (click)=\"showAddModal()\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n class=\"btn btn-space btn-primary mr-1 add-note\"\n type=\"button\"\n >\n <span>{{ 'dossier.notes.addNote' | translate }}</span>\n\n <i class=\"ml-1 icon mdi mdi-plus\"></i>\n </button>\n\n <div *ngIf=\"timelineItems\">\n <valtimo-timeline [actions]=\"actions\" [items]=\"timelineItems\"></valtimo-timeline>\n </div>\n\n <valtimo-spinner\n [useBootstrapSpinner]=\"false\"\n name=\"auditSpinner\"\n bdColor=\"rgba(125, 125, 125, 0.35)\"\n color=\"#264251\"\n type=\"square-jelly-box\"\n >\n </valtimo-spinner>\n\n <div *ngIf=\"obs.pagination\" class=\"d-flex justify-content-end row mr-0 ml-0\">\n <ngb-pagination\n *ngIf=\"obs.pagination.collectionSize > obs.pagination.size\"\n [collectionSize]=\"obs.pagination.collectionSize\"\n [maxSize]=\"obs.pagination.size\"\n [pageSize]=\"obs.pagination.size\"\n [rotate]=\"true\"\n [(page)]=\"obs.pagination.page\"\n (pageChange)=\"paginationClicked($event)\"\n ></ngb-pagination>\n </div>\n</div>\n\n<valtimo-note-modal\n [customData]=\"customData$ | async\"\n (createNoteEvent)=\"createNewNote($event)\"\n (editNoteEvent)=\"editNoteEvent($event)\"\n></valtimo-note-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.notes{position:relative}.add-note{position:absolute;right:0}\n"] }]
|
|
2606
|
+
}], ctorParameters: function () { return [{ type: NotesService }, { type: i7.PermissionService }, { type: i3$2.PromptService }, { type: i1$1.ActivatedRoute }, { type: i3$4.ToastrService }, { type: i6.TranslateService }]; } });
|
|
2607
|
+
|
|
2608
|
+
/*
|
|
2609
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
2610
|
+
*
|
|
2611
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2612
|
+
* you may not use this file except in compliance with the License.
|
|
2613
|
+
* You may obtain a copy of the License at
|
|
2614
|
+
*
|
|
2615
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2616
|
+
*
|
|
2617
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2618
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2619
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2620
|
+
* See the License for the specific language governing permissions and
|
|
2621
|
+
* limitations under the License.
|
|
2622
|
+
*/
|
|
2623
|
+
class DossierDetailTabZaakobjectenComponent {
|
|
2624
|
+
constructor(route, zaakobjectenService, modalService) {
|
|
2625
|
+
this.route = route;
|
|
2626
|
+
this.zaakobjectenService = zaakobjectenService;
|
|
2627
|
+
this.modalService = modalService;
|
|
2628
|
+
this.documentId$ = this.route.params.pipe(map(params => params.documentId));
|
|
2629
|
+
this.objecttypes$ = this.documentId$.pipe(switchMap(documentId => this.zaakobjectenService.getDocumentObjectTypes(documentId)));
|
|
2630
|
+
this.objecttypeSelectItems$ = this.objecttypes$.pipe(map(objecttypes => objecttypes.map(type => ({ id: type.url, text: type.name || '-' }))));
|
|
2631
|
+
this.selectedObjecttypeUrl$ = new BehaviorSubject(null);
|
|
2632
|
+
this.objects$ = combineLatest([
|
|
2633
|
+
this.documentId$,
|
|
2634
|
+
this.selectedObjecttypeUrl$,
|
|
2635
|
+
]).pipe(switchMap(([documentId, selectedObjecttypeUrl]) => documentId && selectedObjecttypeUrl
|
|
2636
|
+
? this.zaakobjectenService
|
|
2637
|
+
.getDocumentObjectsOfType(documentId, selectedObjecttypeUrl)
|
|
2638
|
+
.pipe(map(objects => objects.map(object => ({ ...object, title: object.title || '-' }))))
|
|
2639
|
+
: of(null)));
|
|
2640
|
+
this.columns$ = new BehaviorSubject([
|
|
2641
|
+
{
|
|
2642
|
+
labelTranslationKey: 'dossier.zaakobjecten.index',
|
|
2643
|
+
dataKey: 'index',
|
|
2644
|
+
},
|
|
2645
|
+
{
|
|
2646
|
+
labelTranslationKey: 'dossier.zaakobjecten.registrationAt',
|
|
2647
|
+
dataKey: 'registrationAt',
|
|
2648
|
+
},
|
|
2649
|
+
{
|
|
2650
|
+
labelTranslationKey: 'dossier.zaakobjecten.title',
|
|
2651
|
+
dataKey: 'title',
|
|
2652
|
+
},
|
|
2653
|
+
]);
|
|
2654
|
+
this.objectForm$ = new BehaviorSubject(null);
|
|
2655
|
+
this.objectName$ = new BehaviorSubject('');
|
|
2656
|
+
this.noFormDefinitionComponent$ = new BehaviorSubject(false);
|
|
2657
|
+
}
|
|
2658
|
+
selectObjectType(objectTypeUrl) {
|
|
2659
|
+
this.selectedObjecttypeUrl$.next(objectTypeUrl);
|
|
2660
|
+
}
|
|
2661
|
+
rowClicked(object, objectTypeSelectItems) {
|
|
2662
|
+
this.documentId$.pipe(take$1(1)).subscribe(documentId => {
|
|
2663
|
+
this.zaakobjectenService.getObjectTypeForm(documentId, object.url).subscribe(res => {
|
|
2664
|
+
const definition = res.formDefinition;
|
|
2665
|
+
definition.components = definition.components.map(component => ({
|
|
2666
|
+
...component,
|
|
2667
|
+
disabled: true,
|
|
2668
|
+
}));
|
|
2669
|
+
this.setModalData(objectTypeSelectItems, definition);
|
|
2670
|
+
}, () => {
|
|
2671
|
+
this.setModalData(objectTypeSelectItems);
|
|
2672
|
+
});
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
hide() {
|
|
2676
|
+
this.modalService.closeModal(() => {
|
|
2677
|
+
this.objectName$.next('');
|
|
2678
|
+
this.objectForm$.next(null);
|
|
2679
|
+
});
|
|
2680
|
+
}
|
|
2681
|
+
show() {
|
|
2682
|
+
this.modalService.openModal(this.viewZaakobjectModal);
|
|
2683
|
+
}
|
|
2684
|
+
getObjectTypeName(objectTypeSelectItems) {
|
|
2685
|
+
const selectedObjectTypeUrl = this.selectedObjecttypeUrl$.getValue();
|
|
2686
|
+
const currentTypeSelectItem = objectTypeSelectItems.find(selectItem => selectItem.id === selectedObjectTypeUrl);
|
|
2687
|
+
return currentTypeSelectItem.text;
|
|
2688
|
+
}
|
|
2689
|
+
setModalData(objectTypeSelectItems, definition) {
|
|
2690
|
+
if (definition) {
|
|
2691
|
+
this.objectForm$.next(definition);
|
|
2692
|
+
this.noFormDefinitionComponent$.next(false);
|
|
2693
|
+
}
|
|
2694
|
+
else {
|
|
2695
|
+
this.noFormDefinitionComponent$.next(true);
|
|
2696
|
+
}
|
|
2697
|
+
this.objectName$.next(this.getObjectTypeName(objectTypeSelectItems));
|
|
2698
|
+
this.show();
|
|
2699
|
+
}
|
|
2700
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabZaakobjectenComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: ZaakobjectenService }, { token: i3$2.ModalService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2701
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierDetailTabZaakobjectenComponent, selector: "valtimo-dossier-detail-tab-zaakobjecten", viewQueries: [{ propertyName: "viewZaakobjectModal", first: true, predicate: ["viewZaakobjectModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n objecttypeSelectItems: objecttypeSelectItems$ | async,\n objects: objects$ | async,\n columns: columns$ | async,\n selectedObjectTypeUrl: selectedObjecttypeUrl$ | async\n } as obs\"\n>\n <v-select\n [items]=\"obs.objecttypeSelectItems\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objecttypes\"\n [title]=\"'dossier.zaakobjecten.objecttype' | translate\"\n [placeholder]=\"'dossier.zaakobjecten.objecttypePlaceholder' | translate\"\n [loading]=\"!obs.objecttypeSelectItems\"\n (selectedChange)=\"selectObjectType($event)\"\n ></v-select>\n <v-input-label\n titleTranslationKey=\"dossier.zaakobjecten.objecten\"\n [largeMargin]=\"!!obs.selectedObjectTypeUrl\"\n ></v-input-label>\n <v-paragraph *ngIf=\"!obs.selectedObjectTypeUrl\">{{\n 'dossier.zaakobjecten.objectenPlaceholder' | translate\n }}</v-paragraph>\n <v-table\n *ngIf=\"obs.selectedObjectTypeUrl\"\n [loading]=\"!obs.objects\"\n [items]=\"obs.objects\"\n [columns]=\"obs.columns\"\n [showEditButtons]=\"true\"\n [amountOfLoadingRows]=\"2\"\n [itemsTranslationKey]=\"'pluginManagement.tableItemsText'\"\n [showPagination]=\"false\"\n editButtonTranslationKey=\"dossier.zaakobjecten.objectType.viewObject\"\n (editButtonClicked)=\"rowClicked($event, obs.objecttypeSelectItems)\"\n ></v-table>\n</ng-container>\n\n<v-modal #viewZaakobjectModal (closeEvent)=\"hide()\" [hideFooter]=\"true\" [maxWidthPx]=\"750\">\n <div role=\"header\">\n <v-title [margin]=\"false\" type=\"h2\" [fullWidth]=\"true\" [center]=\"true\">{{\n objectName$ | async\n }}</v-title>\n </div>\n\n <div role=\"content\">\n <valtimo-form-io\n *ngIf=\"(noFormDefinitionComponent$ | async) === false\"\n [form]=\"objectForm$ | async\"\n ></valtimo-form-io>\n <v-paragraph *ngIf=\"noFormDefinitionComponent$ | async\" [center]=\"true\">{{\n 'dossier.zaakobjecten.noFormDefinitionComponent' | translate\n }}</v-paragraph>\n </div>\n</v-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i3$2.SelectComponent, selector: "v-select", inputs: ["items", "defaultSelection", "defaultSelectionId", "defaultSelectionIds", "disabled", "multiple", "margin", "widthInPx", "notFoundText", "clearAllText", "clearText", "name", "title", "titleTranslationKey", "clearSelectionSubject$", "tooltip", "required", "loading", "loadingText", "placeholder", "smallMargin", "carbonTheme"], outputs: ["selectedChange"] }, { kind: "component", type: i3$2.InputLabelComponent, selector: "v-input-label", inputs: ["name", "tooltip", "largeMargin", "small", "title", "titleTranslationKey", "required", "disabled", "carbonTheme"] }, { kind: "component", type: i3$2.ParagraphComponent, selector: "v-paragraph", inputs: ["center", "fullWidth", "margin", "italic", "loading"] }, { kind: "component", type: i3$2.TableComponent, selector: "v-table", inputs: ["items", "columns", "loading", "showEditButtons", "showPagination", "editButtonTranslationKey", "itemsTranslationKey", "noResultsTranslationKey", "mobileBreakpointPx", "amountOfLoadingRows", "collectionSize", "page", "size"], outputs: ["editButtonClicked", "paginationSizeSet", "paginationPageSet"] }, { kind: "component", type: i3$2.VModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx", "hideFooter"], outputs: ["closeEvent"] }, { kind: "component", type: i3$2.TitleComponent, selector: "v-title", inputs: ["type", "margin", "fullWidth", "center"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
2702
|
+
}
|
|
2703
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierDetailTabZaakobjectenComponent, decorators: [{
|
|
2704
|
+
type: Component,
|
|
2705
|
+
args: [{ selector: 'valtimo-dossier-detail-tab-zaakobjecten', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n objecttypeSelectItems: objecttypeSelectItems$ | async,\n objects: objects$ | async,\n columns: columns$ | async,\n selectedObjectTypeUrl: selectedObjecttypeUrl$ | async\n } as obs\"\n>\n <v-select\n [items]=\"obs.objecttypeSelectItems\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objecttypes\"\n [title]=\"'dossier.zaakobjecten.objecttype' | translate\"\n [placeholder]=\"'dossier.zaakobjecten.objecttypePlaceholder' | translate\"\n [loading]=\"!obs.objecttypeSelectItems\"\n (selectedChange)=\"selectObjectType($event)\"\n ></v-select>\n <v-input-label\n titleTranslationKey=\"dossier.zaakobjecten.objecten\"\n [largeMargin]=\"!!obs.selectedObjectTypeUrl\"\n ></v-input-label>\n <v-paragraph *ngIf=\"!obs.selectedObjectTypeUrl\">{{\n 'dossier.zaakobjecten.objectenPlaceholder' | translate\n }}</v-paragraph>\n <v-table\n *ngIf=\"obs.selectedObjectTypeUrl\"\n [loading]=\"!obs.objects\"\n [items]=\"obs.objects\"\n [columns]=\"obs.columns\"\n [showEditButtons]=\"true\"\n [amountOfLoadingRows]=\"2\"\n [itemsTranslationKey]=\"'pluginManagement.tableItemsText'\"\n [showPagination]=\"false\"\n editButtonTranslationKey=\"dossier.zaakobjecten.objectType.viewObject\"\n (editButtonClicked)=\"rowClicked($event, obs.objecttypeSelectItems)\"\n ></v-table>\n</ng-container>\n\n<v-modal #viewZaakobjectModal (closeEvent)=\"hide()\" [hideFooter]=\"true\" [maxWidthPx]=\"750\">\n <div role=\"header\">\n <v-title [margin]=\"false\" type=\"h2\" [fullWidth]=\"true\" [center]=\"true\">{{\n objectName$ | async\n }}</v-title>\n </div>\n\n <div role=\"content\">\n <valtimo-form-io\n *ngIf=\"(noFormDefinitionComponent$ | async) === false\"\n [form]=\"objectForm$ | async\"\n ></valtimo-form-io>\n <v-paragraph *ngIf=\"noFormDefinitionComponent$ | async\" [center]=\"true\">{{\n 'dossier.zaakobjecten.noFormDefinitionComponent' | translate\n }}</v-paragraph>\n </div>\n</v-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
2706
|
+
}], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: ZaakobjectenService }, { type: i3$2.ModalService }]; }, propDecorators: { viewZaakobjectModal: [{
|
|
2707
|
+
type: ViewChild,
|
|
2708
|
+
args: ['viewZaakobjectModal']
|
|
2709
|
+
}] } });
|
|
2710
|
+
|
|
2711
|
+
/*
|
|
2712
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
2713
|
+
*
|
|
2714
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2715
|
+
* you may not use this file except in compliance with the License.
|
|
2716
|
+
* You may obtain a copy of the License at
|
|
2717
|
+
*
|
|
2718
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2719
|
+
*
|
|
2720
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2721
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2722
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2723
|
+
* See the License for the specific language governing permissions and
|
|
2724
|
+
* limitations under the License.
|
|
2725
|
+
*/
|
|
2726
|
+
class DossierProcessStartModalComponent {
|
|
2727
|
+
constructor(route, router, processService, documentService, processLinkService, formFlowService, userProviderService, logger) {
|
|
2728
|
+
this.route = route;
|
|
2729
|
+
this.router = router;
|
|
2730
|
+
this.processService = processService;
|
|
2731
|
+
this.documentService = documentService;
|
|
2732
|
+
this.processLinkService = processLinkService;
|
|
2733
|
+
this.formFlowService = formFlowService;
|
|
2734
|
+
this.userProviderService = userProviderService;
|
|
2735
|
+
this.logger = logger;
|
|
2736
|
+
this.formFlowComplete = new EventEmitter();
|
|
2737
|
+
}
|
|
2738
|
+
ngOnInit() {
|
|
2739
|
+
this.isUserAdmin();
|
|
2740
|
+
}
|
|
2741
|
+
loadProcessLink() {
|
|
2742
|
+
this.processLinkId = null;
|
|
2743
|
+
this.formDefinition = null;
|
|
2744
|
+
this.formFlowInstanceId = null;
|
|
2745
|
+
this.processService
|
|
2746
|
+
.getProcessDefinitionStartProcessLink(this.processDefinitionId, null, this.documentDefinitionName)
|
|
2747
|
+
.pipe(take$1(1))
|
|
2748
|
+
.subscribe(startProcessResult => {
|
|
2749
|
+
if (startProcessResult) {
|
|
2750
|
+
switch (startProcessResult.type) {
|
|
2751
|
+
case 'form':
|
|
2752
|
+
this.formDefinition = startProcessResult.properties.prefilledForm;
|
|
2753
|
+
this.processLinkId = startProcessResult.processLinkId;
|
|
2754
|
+
break;
|
|
2755
|
+
case 'form-flow':
|
|
2756
|
+
this.formFlowInstanceId = startProcessResult.properties.formFlowInstanceId;
|
|
2757
|
+
break;
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2760
|
+
this.modal.show();
|
|
2761
|
+
});
|
|
2762
|
+
}
|
|
2763
|
+
gotoProcessLinkScreen() {
|
|
2764
|
+
this.modal.hide();
|
|
2765
|
+
this.router.navigate(['process-links'], { queryParams: { process: this.processDefinitionKey } });
|
|
2766
|
+
}
|
|
2767
|
+
get modalTitle() {
|
|
2768
|
+
return `Start - ${this.processName}`;
|
|
2769
|
+
}
|
|
2770
|
+
openModal(processDocumentDefinition) {
|
|
2771
|
+
this.processDefinitionKey = processDocumentDefinition.id.processDefinitionKey;
|
|
2772
|
+
this.processDefinitionId = processDocumentDefinition.latestVersionId;
|
|
2773
|
+
this.documentDefinitionName = processDocumentDefinition.id.documentDefinitionId.name;
|
|
2774
|
+
this.processName = processDocumentDefinition.processName;
|
|
2775
|
+
this.options = new FormioOptionsImpl();
|
|
2776
|
+
this.options.disableAlerts = true;
|
|
2777
|
+
const formioBeforeSubmit = function (submission, callback) {
|
|
2778
|
+
callback(null, submission);
|
|
2779
|
+
};
|
|
2780
|
+
this.options.setHooks(formioBeforeSubmit);
|
|
2781
|
+
this.loadProcessLink();
|
|
2782
|
+
}
|
|
2783
|
+
onSubmit(submission) {
|
|
2784
|
+
this.formioSubmission = submission;
|
|
2785
|
+
this.processLinkService.submitForm(this.processLinkId, submission.data).subscribe({
|
|
2786
|
+
next: (formSubmissionResult) => {
|
|
2787
|
+
this.submitCompleted(formSubmissionResult);
|
|
2788
|
+
},
|
|
2789
|
+
error: errors => {
|
|
2790
|
+
this.form.showErrors(errors);
|
|
2791
|
+
},
|
|
2792
|
+
});
|
|
2793
|
+
}
|
|
2794
|
+
formFlowSubmitted() {
|
|
2795
|
+
this.formFlowComplete.emit(null);
|
|
2796
|
+
this.modal.hide();
|
|
2797
|
+
}
|
|
2798
|
+
isUserAdmin() {
|
|
2799
|
+
this.userProviderService.getUserSubject().subscribe(userIdentity => {
|
|
2800
|
+
this.isAdmin = userIdentity.roles.includes('ROLE_ADMIN');
|
|
2801
|
+
}, error => {
|
|
2802
|
+
this.isAdmin = false;
|
|
2803
|
+
});
|
|
2804
|
+
}
|
|
2805
|
+
submitCompleted(formSubmissionResult) {
|
|
2806
|
+
this.modal.hide();
|
|
2807
|
+
this.router.navigate([
|
|
2808
|
+
'dossiers',
|
|
2809
|
+
this.documentDefinitionName,
|
|
2810
|
+
'document',
|
|
2811
|
+
formSubmissionResult.documentId,
|
|
2812
|
+
'summary',
|
|
2813
|
+
]);
|
|
2814
|
+
}
|
|
2815
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierProcessStartModalComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i1$1.Router }, { token: i2$2.ProcessService }, { token: i2$1.DocumentService }, { token: i3$5.ProcessLinkService }, { token: i3$5.FormFlowService }, { token: i6$1.UserProviderService }, { token: i1$2.NGXLogger }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2816
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierProcessStartModalComponent, selector: "valtimo-dossier-process-start-modal", outputs: { formFlowComplete: "formFlowComplete" }, viewQueries: [{ propertyName: "form", first: true, predicate: ["form"], descendants: true }, { propertyName: "modal", first: true, predicate: ["processStartModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal #processStartModal elementId=\"processStartModal\" [title]=\"modalTitle\">\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io #form [form]=\"formDefinition\" [options]=\"options\" (submit)=\"onSubmit($event)\">\n </valtimo-form-io>\n </div>\n <div body *ngIf=\"formFlowInstanceId\">\n <valtimo-form-flow\n [formFlowInstanceId]=\"formFlowInstanceId\"\n (formFlowComplete)=\"formFlowSubmitted()\"\n ></valtimo-form-flow>\n </div>\n <div body *ngIf=\"!formFlowInstanceId && !formDefinition && isAdmin\">\n <div\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'formManagement.noFormDefinitionFoundAdmin'\"\n ></div>\n <div class=\"mb-0 mt-4 p-3 text-center\">\n <button\n (click)=\"gotoProcessLinkScreen()\"\n class=\"btn btn-secondary btn-space\"\n id=\"process-link-button\"\n type=\"button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | translate }}\n </button>\n </div>\n </div>\n <div body *ngIf=\"!formFlowInstanceId && !formDefinition && !isAdmin\">\n <div\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'formManagement.noFormDefinitionFoundUser'\"\n ></div>\n </div>\n</valtimo-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#processStartModal .formio-component-submit{text-align:right}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.FormioComponent, selector: "valtimo-form-io", inputs: ["form", "options", "submission", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i3$2.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "directive", type: i6.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: i3$5.FormFlowComponent, selector: "valtimo-form-flow", inputs: ["formIoFormData", "formFlowInstanceId"], outputs: ["formFlowComplete"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
2817
|
+
}
|
|
2818
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierProcessStartModalComponent, decorators: [{
|
|
2819
|
+
type: Component,
|
|
2820
|
+
args: [{ selector: 'valtimo-dossier-process-start-modal', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal #processStartModal elementId=\"processStartModal\" [title]=\"modalTitle\">\n <div body *ngIf=\"formDefinition\">\n <valtimo-form-io #form [form]=\"formDefinition\" [options]=\"options\" (submit)=\"onSubmit($event)\">\n </valtimo-form-io>\n </div>\n <div body *ngIf=\"formFlowInstanceId\">\n <valtimo-form-flow\n [formFlowInstanceId]=\"formFlowInstanceId\"\n (formFlowComplete)=\"formFlowSubmitted()\"\n ></valtimo-form-flow>\n </div>\n <div body *ngIf=\"!formFlowInstanceId && !formDefinition && isAdmin\">\n <div\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'formManagement.noFormDefinitionFoundAdmin'\"\n ></div>\n <div class=\"mb-0 mt-4 p-3 text-center\">\n <button\n (click)=\"gotoProcessLinkScreen()\"\n class=\"btn btn-secondary btn-space\"\n id=\"process-link-button\"\n type=\"button\"\n >\n {{ 'formManagement.gotoProcessLinksButton' | translate }}\n </button>\n </div>\n </div>\n <div body *ngIf=\"!formFlowInstanceId && !formDefinition && !isAdmin\">\n <div\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'formManagement.noFormDefinitionFoundUser'\"\n ></div>\n </div>\n</valtimo-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */#processStartModal .formio-component-submit{text-align:right}\n"] }]
|
|
2821
|
+
}], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: i2$2.ProcessService }, { type: i2$1.DocumentService }, { type: i3$5.ProcessLinkService }, { type: i3$5.FormFlowService }, { type: i6$1.UserProviderService }, { type: i1$2.NGXLogger }]; }, propDecorators: { form: [{
|
|
2822
|
+
type: ViewChild,
|
|
2823
|
+
args: ['form', { static: false }]
|
|
2824
|
+
}], modal: [{
|
|
2825
|
+
type: ViewChild,
|
|
2826
|
+
args: ['processStartModal', { static: false }]
|
|
2827
|
+
}], formFlowComplete: [{
|
|
2828
|
+
type: Output
|
|
2829
|
+
}] } });
|
|
2830
|
+
|
|
2831
|
+
/*
|
|
2832
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
2833
|
+
*
|
|
2834
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2835
|
+
* you may not use this file except in compliance with the License.
|
|
2836
|
+
* You may obtain a copy of the License at
|
|
2837
|
+
*
|
|
2838
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2839
|
+
*
|
|
2840
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2841
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2842
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2843
|
+
* See the License for the specific language governing permissions and
|
|
2844
|
+
* limitations under the License.
|
|
2845
|
+
*/
|
|
2846
|
+
class DossierListActionsComponent {
|
|
2847
|
+
constructor(documentService, listService) {
|
|
2848
|
+
this.documentService = documentService;
|
|
2849
|
+
this.listService = listService;
|
|
2850
|
+
this.formFlowComplete = new EventEmitter();
|
|
2851
|
+
this.associatedProcessDocumentDefinitions$ = this.listService.documentDefinitionName$.pipe(switchMap(documentDefinitionName => documentDefinitionName
|
|
2852
|
+
? this.documentService.findProcessDocumentDefinitions(documentDefinitionName)
|
|
2853
|
+
: of([])), map(processDocumentDefinitions => processDocumentDefinitions.filter(definition => definition.canInitializeDocument)), tap(processDocumentDefinitions => {
|
|
2854
|
+
this._cachedAssociatedProcessDocumentDefinitions = processDocumentDefinitions;
|
|
2855
|
+
}));
|
|
2856
|
+
this.disableStartDossierButton$ = this.associatedProcessDocumentDefinitions$.pipe(map(definitions => definitions.length === 0 || this.loading));
|
|
2857
|
+
this.selectedProcessDocumentDefinition = null;
|
|
2858
|
+
this.modalListenerAdded = false;
|
|
2859
|
+
this._cachedAssociatedProcessDocumentDefinitions = [];
|
|
2860
|
+
}
|
|
2861
|
+
ngOnInit() {
|
|
2862
|
+
this.modalListenerAdded = false;
|
|
2863
|
+
}
|
|
2864
|
+
startDossier() {
|
|
2865
|
+
const associatedProcessDocumentDefinitions = this._cachedAssociatedProcessDocumentDefinitions;
|
|
2866
|
+
if (associatedProcessDocumentDefinitions.length > 1) {
|
|
2867
|
+
$('#startProcess').modal('show');
|
|
2868
|
+
}
|
|
2869
|
+
else {
|
|
2870
|
+
this.selectedProcessDocumentDefinition = associatedProcessDocumentDefinitions[0];
|
|
2871
|
+
this.showStartProcessModal();
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
selectProcess(processDocumentDefinition) {
|
|
2875
|
+
const modal = $('#startProcess');
|
|
2876
|
+
if (!this.modalListenerAdded) {
|
|
2877
|
+
modal.on('hidden.bs.modal', this.showStartProcessModal.bind(this));
|
|
2878
|
+
this.modalListenerAdded = true;
|
|
2879
|
+
}
|
|
2880
|
+
this.selectedProcessDocumentDefinition = processDocumentDefinition;
|
|
2881
|
+
modal.modal('hide');
|
|
2882
|
+
}
|
|
2883
|
+
onFormFlowComplete() {
|
|
2884
|
+
this.formFlowComplete.emit(null);
|
|
2885
|
+
}
|
|
2886
|
+
showStartProcessModal() {
|
|
2887
|
+
if (this.selectedProcessDocumentDefinition !== null) {
|
|
2888
|
+
this.processStart.openModal(this.selectedProcessDocumentDefinition);
|
|
2889
|
+
this.selectedProcessDocumentDefinition = null;
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListActionsComponent, deps: [{ token: i2$1.DocumentService }, { token: DossierListService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2893
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierListActionsComponent, selector: "valtimo-dossier-list-actions", inputs: { loading: "loading" }, outputs: { formFlowComplete: "formFlowComplete" }, viewQueries: [{ propertyName: "processStart", first: true, predicate: ["processStartModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngIf=\"associatedProcessDocumentDefinitions$ | async as associatedProcessDocumentDefinitions\">\n <div\n class=\"modal fade\"\n id=\"startProcess\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-labelledby=\"startProcessLabel\"\n aria-hidden=\"true\"\n >\n <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h3 class=\"modal-title\" id=\"startProcessLabel\">\n {{ 'dashboard.startProcess.title' | translate }}\n </h3>\n\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"table-responsive\">\n <table class=\"table m-0\">\n <tr\n *ngFor=\"let processDocumentDefinition of associatedProcessDocumentDefinitions\"\n (click)=\"selectProcess(processDocumentDefinition)\"\n style=\"cursor: pointer\"\n >\n <td>{{ processDocumentDefinition.processName }}</td>\n </tr>\n </table>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">\n {{ 'cta.close' | translate }}\n </button>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<valtimo-dossier-process-start-modal\n #processStartModal\n (formFlowComplete)=\"onFormFlowComplete()\"\n></valtimo-dossier-process-start-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: DossierProcessStartModalComponent, selector: "valtimo-dossier-process-start-modal", outputs: ["formFlowComplete"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
2894
|
+
}
|
|
2895
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListActionsComponent, decorators: [{
|
|
2896
|
+
type: Component,
|
|
2897
|
+
args: [{ selector: 'valtimo-dossier-list-actions', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngIf=\"associatedProcessDocumentDefinitions$ | async as associatedProcessDocumentDefinitions\">\n <div\n class=\"modal fade\"\n id=\"startProcess\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-labelledby=\"startProcessLabel\"\n aria-hidden=\"true\"\n >\n <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h3 class=\"modal-title\" id=\"startProcessLabel\">\n {{ 'dashboard.startProcess.title' | translate }}\n </h3>\n\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"table-responsive\">\n <table class=\"table m-0\">\n <tr\n *ngFor=\"let processDocumentDefinition of associatedProcessDocumentDefinitions\"\n (click)=\"selectProcess(processDocumentDefinition)\"\n style=\"cursor: pointer\"\n >\n <td>{{ processDocumentDefinition.processName }}</td>\n </tr>\n </table>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">\n {{ 'cta.close' | translate }}\n </button>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<valtimo-dossier-process-start-modal\n #processStartModal\n (formFlowComplete)=\"onFormFlowComplete()\"\n></valtimo-dossier-process-start-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
2898
|
+
}], ctorParameters: function () { return [{ type: i2$1.DocumentService }, { type: DossierListService }]; }, propDecorators: { processStart: [{
|
|
2899
|
+
type: ViewChild,
|
|
2900
|
+
args: ['processStartModal']
|
|
2901
|
+
}], loading: [{
|
|
2902
|
+
type: Input
|
|
2903
|
+
}], formFlowComplete: [{
|
|
2904
|
+
type: Output
|
|
2905
|
+
}] } });
|
|
2906
|
+
|
|
2907
|
+
/*
|
|
2908
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
2909
|
+
*
|
|
2910
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2911
|
+
* you may not use this file except in compliance with the License.
|
|
2912
|
+
* You may obtain a copy of the License at
|
|
2913
|
+
*
|
|
2914
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2915
|
+
*
|
|
2916
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2917
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2918
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2919
|
+
* See the License for the specific language governing permissions and
|
|
2920
|
+
* limitations under the License.
|
|
2921
|
+
*/
|
|
2922
|
+
class DossierListComponent {
|
|
2923
|
+
constructor(assigneeService, breadcrumbService, bulkAssignService, columnService, configService, documentService, listService, pageTitleService, paginationService, parameterService, route, router, searchService, translateService, permissionService) {
|
|
2924
|
+
this.assigneeService = assigneeService;
|
|
2925
|
+
this.breadcrumbService = breadcrumbService;
|
|
2926
|
+
this.bulkAssignService = bulkAssignService;
|
|
2927
|
+
this.columnService = columnService;
|
|
2928
|
+
this.configService = configService;
|
|
2929
|
+
this.documentService = documentService;
|
|
2930
|
+
this.listService = listService;
|
|
2931
|
+
this.pageTitleService = pageTitleService;
|
|
2932
|
+
this.paginationService = paginationService;
|
|
2933
|
+
this.parameterService = parameterService;
|
|
2934
|
+
this.route = route;
|
|
2935
|
+
this.router = router;
|
|
2936
|
+
this.searchService = searchService;
|
|
2937
|
+
this.translateService = translateService;
|
|
2938
|
+
this.permissionService = permissionService;
|
|
2939
|
+
this.activeTab = null;
|
|
2940
|
+
this.loadingFields = true;
|
|
2941
|
+
this.loadingPagination = true;
|
|
2942
|
+
this.loadingSearchFields = true;
|
|
2943
|
+
this.loadingAssigneeFilter = true;
|
|
2944
|
+
this.loadingDocumentItems = true;
|
|
2945
|
+
this.visibleDossierTabs = null;
|
|
2946
|
+
this.defaultTabs = [
|
|
2947
|
+
DossierListTab.ALL,
|
|
2948
|
+
DossierListTab.MINE,
|
|
2949
|
+
DossierListTab.OPEN,
|
|
2950
|
+
];
|
|
2951
|
+
this.tableTranslations = {
|
|
2952
|
+
select: {
|
|
2953
|
+
single: 'dossier.select.single',
|
|
2954
|
+
multiple: 'dossier.select.multiple',
|
|
2955
|
+
},
|
|
2956
|
+
pagination: {
|
|
2957
|
+
itemsPerPage: 'dossier.pagination.itemsPerPage',
|
|
2958
|
+
totalItem: 'dossier.pagination.totalItem',
|
|
2959
|
+
totalItems: 'dossier.pagination.totalItems',
|
|
2960
|
+
},
|
|
2961
|
+
};
|
|
2962
|
+
this.noResultsMessage$ = new BehaviorSubject({
|
|
2963
|
+
description: 'dossier.noResults.ALL.description',
|
|
2964
|
+
isSearchResult: false,
|
|
2965
|
+
title: 'dossier.noResults.ALL.title',
|
|
2966
|
+
});
|
|
2967
|
+
this.showAssignModal$ = new BehaviorSubject(false);
|
|
2968
|
+
this.showChangePageModal$ = new BehaviorSubject(false);
|
|
2969
|
+
this.showChangeTabModal$ = new BehaviorSubject(false);
|
|
2970
|
+
this.searchFields$ = this.searchService.documentSearchFields$.pipe(tap(() => {
|
|
2971
|
+
this.loadingSearchFields = false;
|
|
2972
|
+
}));
|
|
2973
|
+
this.documentDefinitionName$ = this.listService.documentDefinitionName$;
|
|
2974
|
+
this.canCreateDocument$ = this.documentDefinitionName$.pipe(switchMap(documentDefinitionName => this.permissionService.requestPermission(CAN_CREATE_CASE_PERMISSION, {
|
|
2975
|
+
resource: DOSSIER_DETAIL_PERMISSION_RESOURCE.jsonSchemaDocumentDefinition,
|
|
2976
|
+
identifier: documentDefinitionName,
|
|
2977
|
+
})));
|
|
2978
|
+
this.selectedDocumentIds$ = new BehaviorSubject([]);
|
|
2979
|
+
this.schema$ = this.listService.documentDefinitionName$.pipe(switchMap(documentDefinitionName => this.documentService.getDocumentDefinition(documentDefinitionName)), map(documentDefinition => documentDefinition?.schema), tap(schema => {
|
|
2980
|
+
if (schema?.title) {
|
|
2981
|
+
this.pageTitleService.setCustomPageTitle(schema?.title, true);
|
|
2982
|
+
}
|
|
2983
|
+
}));
|
|
2984
|
+
this.searchFieldValues$ = this.parameterService.searchFieldValues$;
|
|
2985
|
+
this.assigneeFilter$ = this.assigneeService.assigneeFilter$.pipe(tap(assigneeFilter => (this.activeTab = assigneeFilter)));
|
|
2986
|
+
this.paginationChange$ = new BehaviorSubject(null);
|
|
2987
|
+
this.tabChange$ = new BehaviorSubject(null);
|
|
2988
|
+
this._pagination$ = this.paginationService.pagination$.pipe(tap(pagination => {
|
|
2989
|
+
this.pagination = pagination;
|
|
2990
|
+
this.loadingPagination = false;
|
|
2991
|
+
}));
|
|
2992
|
+
this._hasEnvColumnConfig$ = this.listService.hasEnvColumnConfig$;
|
|
2993
|
+
this._hasApiColumnConfig$ = new BehaviorSubject(false);
|
|
2994
|
+
this._canHaveAssignee$ = this.assigneeService.canHaveAssignee$;
|
|
2995
|
+
this._columns$ = this.listService.documentDefinitionName$.pipe(switchMap(documentDefinitionName => this.columnService.getDefinitionColumns(documentDefinitionName)), map(res => {
|
|
2996
|
+
this._hasApiColumnConfig$.next(res.hasApiConfig);
|
|
2997
|
+
return res.columns;
|
|
2998
|
+
}), tap(columns => {
|
|
2999
|
+
this.listService.documentDefinitionName$.pipe(take(1)).subscribe(_ => {
|
|
3000
|
+
this.paginationService.setPagination(columns);
|
|
3001
|
+
});
|
|
3002
|
+
}));
|
|
3003
|
+
this.fields$ = combineLatest([
|
|
3004
|
+
this._canHaveAssignee$,
|
|
3005
|
+
this._columns$,
|
|
3006
|
+
this._hasEnvColumnConfig$,
|
|
3007
|
+
this._hasApiColumnConfig$,
|
|
3008
|
+
this.translateService.stream('key'),
|
|
3009
|
+
]).pipe(tap(([canHaveAssignee]) => {
|
|
3010
|
+
this.canHaveAssignee = canHaveAssignee;
|
|
3011
|
+
}), map(([canHaveAssignee, columns, hasEnvConfig, hasApiConfig]) => {
|
|
3012
|
+
const filteredAssigneeColumns = this.assigneeService.filterAssigneeColumns(columns, canHaveAssignee);
|
|
3013
|
+
const listFields = this.columnService.mapDefinitionColumnsToListFields(filteredAssigneeColumns, hasEnvConfig, hasApiConfig);
|
|
3014
|
+
const fieldsToReturn = this.assigneeService.addAssigneeListField(columns, listFields, canHaveAssignee);
|
|
3015
|
+
return fieldsToReturn;
|
|
3016
|
+
}), tap(listFields => {
|
|
3017
|
+
const defaultListField = listFields.find(field => field.default);
|
|
3018
|
+
// set default sort state if no pagination query parameters for sorting are available
|
|
3019
|
+
this.parameterService.queryPaginationParams$
|
|
3020
|
+
.pipe(take(1))
|
|
3021
|
+
.subscribe(queryPaginationParams => {
|
|
3022
|
+
if (defaultListField && !queryPaginationParams?.sort?.isSorting) {
|
|
3023
|
+
const sortDirection = typeof defaultListField.default === 'string' ? defaultListField.default : 'DESC';
|
|
3024
|
+
this.paginationService.sortChanged({
|
|
3025
|
+
isSorting: true,
|
|
3026
|
+
state: { name: defaultListField.key, direction: sortDirection },
|
|
3027
|
+
});
|
|
3028
|
+
}
|
|
3029
|
+
});
|
|
3030
|
+
}), tap(() => {
|
|
3031
|
+
this.loadingFields = false;
|
|
3032
|
+
}));
|
|
3033
|
+
this._documentSearchRequest$ = combineLatest([this._pagination$, this.listService.documentDefinitionName$]).pipe(filter(([pagination]) => !!pagination), map(([pagination, documentDefinitionName]) => {
|
|
3034
|
+
const page = pagination.page - 1;
|
|
3035
|
+
return new AdvancedDocumentSearchRequestImpl(documentDefinitionName, page >= 0 ? page : 0, pagination.size, pagination.sort);
|
|
3036
|
+
}));
|
|
3037
|
+
this.documentItems$ = this.listService.checkRefresh$.pipe(switchMap(() => combineLatest([
|
|
3038
|
+
this._documentSearchRequest$,
|
|
3039
|
+
this.assigneeFilter$,
|
|
3040
|
+
this.searchFieldValues$,
|
|
3041
|
+
this.listService.forceRefresh$,
|
|
3042
|
+
this._hasEnvColumnConfig$,
|
|
3043
|
+
this._hasApiColumnConfig$,
|
|
3044
|
+
])), distinctUntilChanged(([prevSearchRequest, prevAssigneeFilter, prevSearchFieldValues, prevForceRefresh], [currSearchRequest, currAssigneeFilter, currSearchFieldValues, currForceRefresh]) => isEqual({
|
|
3045
|
+
...prevSearchRequest,
|
|
3046
|
+
assignee: prevAssigneeFilter,
|
|
3047
|
+
...prevSearchFieldValues,
|
|
3048
|
+
forceRefresh: prevForceRefresh,
|
|
3049
|
+
}, {
|
|
3050
|
+
...currSearchRequest,
|
|
3051
|
+
assignee: currAssigneeFilter,
|
|
3052
|
+
...currSearchFieldValues,
|
|
3053
|
+
forceRefresh: currForceRefresh,
|
|
3054
|
+
})), switchMap(([documentSearchRequest, assigneeFilter, searchValues, _, hasEnvColumnConfig, hasApiColumnConfig,]) => {
|
|
3055
|
+
const obsEnv = of(hasEnvColumnConfig);
|
|
3056
|
+
const obsApi = of(hasApiColumnConfig);
|
|
3057
|
+
if ((Object.keys(searchValues) || []).length > 0) {
|
|
3058
|
+
return forkJoin({
|
|
3059
|
+
documents: hasEnvColumnConfig || !hasApiColumnConfig
|
|
3060
|
+
? this.documentService.getDocumentsSearch(documentSearchRequest, 'AND', assigneeFilter, this.searchService.mapSearchValuesToFilters(searchValues))
|
|
3061
|
+
: this.documentService.getSpecifiedDocumentsSearch(documentSearchRequest, 'AND', assigneeFilter, this.searchService.mapSearchValuesToFilters(searchValues)),
|
|
3062
|
+
hasEnvColumnConfig: obsEnv,
|
|
3063
|
+
hasApiColumnConfig: obsApi,
|
|
3064
|
+
isSearchResult: of(true),
|
|
3065
|
+
});
|
|
3066
|
+
}
|
|
3067
|
+
return forkJoin({
|
|
3068
|
+
documents: hasEnvColumnConfig || !hasApiColumnConfig
|
|
3069
|
+
? this.documentService.getDocumentsSearch(documentSearchRequest, 'AND', assigneeFilter)
|
|
3070
|
+
: this.documentService.getSpecifiedDocumentsSearch(documentSearchRequest, 'AND', assigneeFilter),
|
|
3071
|
+
hasEnvColumnConfig: obsEnv,
|
|
3072
|
+
hasApiColumnConfig: obsApi,
|
|
3073
|
+
isSearchResult: of(false),
|
|
3074
|
+
});
|
|
3075
|
+
}), map((res) => {
|
|
3076
|
+
this.paginationService.setCollectionSize(res.documents);
|
|
3077
|
+
this.paginationService.checkPage(res.documents);
|
|
3078
|
+
this.updateNoResultsMessage(res.isSearchResult);
|
|
3079
|
+
return this.listService.mapDocuments(res.documents, res.hasEnvColumnConfig, res.hasApiColumnConfig);
|
|
3080
|
+
}), tap(() => {
|
|
3081
|
+
this.loadingAssigneeFilter = false;
|
|
3082
|
+
this.loadingDocumentItems = false;
|
|
3083
|
+
}));
|
|
3084
|
+
}
|
|
3085
|
+
ngOnInit() {
|
|
3086
|
+
this.setVisibleTabs();
|
|
3087
|
+
this.openDocumentDefinitionNameSubscription();
|
|
3088
|
+
}
|
|
3089
|
+
ngOnDestroy() {
|
|
3090
|
+
this._documentDefinitionNameSubscription?.unsubscribe();
|
|
3091
|
+
this.pageTitleService.enableReset();
|
|
3092
|
+
}
|
|
3093
|
+
trackByIndex(index) {
|
|
3094
|
+
return index;
|
|
3095
|
+
}
|
|
3096
|
+
search(searchFieldValues) {
|
|
3097
|
+
this.searchService.search(searchFieldValues);
|
|
3098
|
+
}
|
|
3099
|
+
rowClick(document) {
|
|
3100
|
+
this.listService.documentDefinitionName$.pipe(take(1)).subscribe(documentDefinitionName => {
|
|
3101
|
+
this.breadcrumbService.cacheQueryParams(`/dossiers/${documentDefinitionName}`, this.route.snapshot.queryParams);
|
|
3102
|
+
this.router.navigate([
|
|
3103
|
+
`/dossiers/${documentDefinitionName}/document/${document.id}/${DefaultTabs.summary}`,
|
|
3104
|
+
]);
|
|
3105
|
+
});
|
|
3106
|
+
}
|
|
3107
|
+
tabChange(tab) {
|
|
3108
|
+
if (!this.activeTab) {
|
|
3109
|
+
this.activeTab = tab;
|
|
3110
|
+
this.updateNoResultsMessage(false);
|
|
3111
|
+
return;
|
|
3112
|
+
}
|
|
3113
|
+
if (this.activeTab.toLowerCase() === tab.toLowerCase()) {
|
|
3114
|
+
return;
|
|
3115
|
+
}
|
|
3116
|
+
if (this.carbonList.model.selectedRowsCount()) {
|
|
3117
|
+
this.showChangeTabModal$.next(true);
|
|
3118
|
+
this.tabChange$.next(tab);
|
|
3119
|
+
return;
|
|
3120
|
+
}
|
|
3121
|
+
this.onChangeTabConfirm(tab);
|
|
3122
|
+
}
|
|
3123
|
+
onChangeTabCancel() {
|
|
3124
|
+
if (!this.tabsComponent) {
|
|
3125
|
+
return;
|
|
3126
|
+
}
|
|
3127
|
+
const prevTab = this.tabsComponent.tabs.find((tab) => tab.id === this.activeTab);
|
|
3128
|
+
if (!prevTab) {
|
|
3129
|
+
return;
|
|
3130
|
+
}
|
|
3131
|
+
this.tabsComponent.tabs.find((tab) => tab.active).active = false;
|
|
3132
|
+
prevTab.active = true;
|
|
3133
|
+
}
|
|
3134
|
+
pageChange(page) {
|
|
3135
|
+
if (this.carbonList?.model.selectedRowsCount()) {
|
|
3136
|
+
this.showChangePageModal$.next(true);
|
|
3137
|
+
this.paginationChange$.next({ page, size: this.pagination.size });
|
|
3138
|
+
return;
|
|
3139
|
+
}
|
|
3140
|
+
this.paginationService.pageChange(page);
|
|
3141
|
+
}
|
|
3142
|
+
pageSizeChange(size) {
|
|
3143
|
+
if (this.carbonList?.model.selectedRowsCount()) {
|
|
3144
|
+
this.showChangePageModal$.next(true);
|
|
3145
|
+
this.paginationChange$.next({ page: this.pagination.page, size });
|
|
3146
|
+
return;
|
|
3147
|
+
}
|
|
3148
|
+
this.paginationService.pageSizeChange(size);
|
|
3149
|
+
}
|
|
3150
|
+
sortChanged(newSortState) {
|
|
3151
|
+
this.paginationService.sortChanged(newSortState);
|
|
3152
|
+
}
|
|
3153
|
+
onChangeTabConfirm(tab) {
|
|
3154
|
+
this.loadingAssigneeFilter = true;
|
|
3155
|
+
this.activeTab = tab;
|
|
3156
|
+
this.updateNoResultsMessage(false);
|
|
3157
|
+
this.paginationService.setPage(1);
|
|
3158
|
+
this.assigneeService.setAssigneeFilter(tab);
|
|
3159
|
+
}
|
|
3160
|
+
showAssignModal() {
|
|
3161
|
+
this.selectedDocumentIds$.next(this.carbonList.selectedItems.map((document) => document.id));
|
|
3162
|
+
this.showAssignModal$.next(true);
|
|
3163
|
+
}
|
|
3164
|
+
onCloseEvent(assigneeId, documentIds) {
|
|
3165
|
+
this.showAssignModal$.next(false);
|
|
3166
|
+
if (!assigneeId) {
|
|
3167
|
+
return;
|
|
3168
|
+
}
|
|
3169
|
+
this.bulkAssignService.bulkAssign(assigneeId, documentIds).subscribe(() => {
|
|
3170
|
+
this.forceRefresh();
|
|
3171
|
+
});
|
|
3172
|
+
}
|
|
3173
|
+
onChangePageConfirm(pagination) {
|
|
3174
|
+
if (pagination.size !== this.pagination.size) {
|
|
3175
|
+
this.paginationService.pageSizeChange(pagination.size);
|
|
3176
|
+
return;
|
|
3177
|
+
}
|
|
3178
|
+
this.paginationService.pageChange(pagination.page);
|
|
3179
|
+
}
|
|
3180
|
+
startDossier() {
|
|
3181
|
+
this.listActionsComponent.startDossier();
|
|
3182
|
+
}
|
|
3183
|
+
forceRefresh() {
|
|
3184
|
+
this.listService.forceRefresh();
|
|
3185
|
+
}
|
|
3186
|
+
openDocumentDefinitionNameSubscription() {
|
|
3187
|
+
this._documentDefinitionNameSubscription = this.route.params
|
|
3188
|
+
.pipe(map((params) => params?.documentDefinitionName), filter(docDefName => !!docDefName), distinctUntilChanged())
|
|
3189
|
+
.subscribe(documentDefinitonName => {
|
|
3190
|
+
if (this._previousDocumentDefinitionName) {
|
|
3191
|
+
this.parameterService.clearParameters();
|
|
3192
|
+
this.parameterService.clearSearchFieldValues();
|
|
3193
|
+
}
|
|
3194
|
+
this._previousDocumentDefinitionName = documentDefinitonName;
|
|
3195
|
+
this.setLoading();
|
|
3196
|
+
this.paginationService.clearPagination();
|
|
3197
|
+
this.assigneeService.resetAssigneeFilter();
|
|
3198
|
+
this.listService.setDocumentDefinitionName(documentDefinitonName);
|
|
3199
|
+
});
|
|
3200
|
+
}
|
|
3201
|
+
setLoading() {
|
|
3202
|
+
this.loadingFields = true;
|
|
3203
|
+
this.loadingPagination = true;
|
|
3204
|
+
this.loadingSearchFields = true;
|
|
3205
|
+
this.loadingAssigneeFilter = true;
|
|
3206
|
+
this.loadingDocumentItems = true;
|
|
3207
|
+
}
|
|
3208
|
+
setVisibleTabs() {
|
|
3209
|
+
this.visibleDossierTabs = this.configService.config?.visibleDossierListTabs || null;
|
|
3210
|
+
}
|
|
3211
|
+
updateNoResultsMessage(isSearchResult) {
|
|
3212
|
+
this.noResultsMessage$.next(isSearchResult
|
|
3213
|
+
? {
|
|
3214
|
+
description: 'dossier.noResults.search.description',
|
|
3215
|
+
isSearchResult,
|
|
3216
|
+
title: 'dossier.noResults.search.title',
|
|
3217
|
+
}
|
|
3218
|
+
: {
|
|
3219
|
+
description: `dossier.noResults.${this.activeTab ?? 'ALL'}.description`,
|
|
3220
|
+
isSearchResult,
|
|
3221
|
+
title: `dossier.noResults.${this.activeTab ?? 'ALL'}.title`,
|
|
3222
|
+
});
|
|
3223
|
+
}
|
|
3224
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListComponent, deps: [{ token: DossierListAssigneeService }, { token: i3$2.BreadcrumbService }, { token: DossierBulkAssignService }, { token: DossierColumnService }, { token: i1.ConfigService }, { token: i2$1.DocumentService }, { token: DossierListService }, { token: i3$2.PageTitleService }, { token: DossierListPaginationService }, { token: DossierParameterService }, { token: i1$1.ActivatedRoute }, { token: i1$1.Router }, { token: DossierListSearchService }, { token: i6.TranslateService }, { token: i7.PermissionService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3225
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierListComponent, selector: "valtimo-dossier-list", providers: [
|
|
3226
|
+
DossierListService,
|
|
3227
|
+
DossierColumnService,
|
|
3228
|
+
DossierListAssigneeService,
|
|
3229
|
+
DossierParameterService,
|
|
3230
|
+
DossierListPaginationService,
|
|
3231
|
+
DossierListSearchService,
|
|
3232
|
+
], viewQueries: [{ propertyName: "carbonList", first: true, predicate: CarbonListComponent, descendants: true }, { propertyName: "listActionsComponent", first: true, predicate: DossierListActionsComponent, descendants: true }, { propertyName: "tabsComponent", first: true, predicate: Tabs, descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n fields: fields$ | async,\n documentItems: documentItems$ | async,\n noResultsMessage: noResultsMessage$ | async,\n searchFields: searchFields$ | async,\n schema: schema$ | async,\n showAssignModal: showAssignModal$ | async,\n selectedDocumentIds: selectedDocumentIds$ | async,\n loaded:\n !loadingFields &&\n !loadingPagination &&\n !loadingSearchFields &&\n !loadingAssigneeFilter &&\n !loadingDocumentItems\n } as obs\"\n>\n <div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-dossier-list-actions\n [loading]=\"!obs.loaded\"\n (formFlowComplete)=\"forceRefresh()\"\n ></valtimo-dossier-list-actions>\n <ng-container *ngTemplateOutlet=\"searchFields; context: {obs: obs}\"></ng-container>\n\n <ng-container *ngIf=\"obs.loaded; else loading\">\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"bulkAssignModal; context: {obs: obs}\"></ng-container>\n\n <ng-container *ngTemplateOutlet=\"changePageModal\"></ng-container>\n\n <ng-container *ngTemplateOutlet=\"changeTabModal\"></ng-container>\n</ng-container>\n\n<ng-template #searchFields let-obs=\"obs\">\n <div class=\"mb-3\">\n <valtimo-search-fields\n [searchFields]=\"obs.searchFields\"\n (doSearch)=\"search($event)\"\n [documentDefinitionName]=\"documentDefinitionName$ | async\"\n [defaultValues]=\"searchFieldValues$ | async\"\n [inputDisabled]=\"!obs.loaded\"\n ></valtimo-search-fields>\n </div>\n</ng-template>\n\n<ng-template #list let-obs=\"obs\">\n <valtimo-carbon-list\n [fields]=\"obs.fields\"\n [header]=\"false\"\n [initialSortState]=\"pagination.sort\"\n [items]=\"obs.documentItems\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"dossierList\"\n [showSelectionColumn]=\"canHaveAssignee\"\n [tableTranslations]=\"tableTranslations\"\n (paginationClicked)=\"pageChange($event)\"\n (paginationSet)=\"pageSizeChange($event)\"\n (rowClicked)=\"rowClick($event)\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <ng-container carbonToolbarActions>\n <button cdsButton=\"primary\" (click)=\"showAssignModal()\">\n {{ 'dossier.bulkAssign.assign' | translate }}\n </button>\n </ng-container>\n\n <div carbonToolbarContent>\n <ng-container *ngTemplateOutlet=\"dossierListActions\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"obs.noResultsMessage.isSearchResult ? null : dossierListActions\"\n [description]=\"obs.noResultsMessage.description | translate\"\n [title]=\"obs.noResultsMessage.title | translate\"\n ></valtimo-no-results>\n\n <div tabs *ngIf=\"canHaveAssignee\">\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n </div>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #tabs>\n <ng-container *ngIf=\"assigneeFilter$ | async as assigneeFilter\">\n <cds-tabs\n *ngIf=\"!visibleDossierTabs; else configuredTabs\"\n type=\"contained\"\n data-carbon-theme=\"g10\"\n class=\"dossier-list-tabs\"\n >\n <cds-tab\n *ngFor=\"let tab of defaultTabs; trackBy: trackByIndex\"\n [active]=\"assigneeFilter === tab\"\n heading=\"{{ 'dossier.tabs.' + tab | translate }}\"\n [id]=\"tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n </ng-container>\n</ng-template>\n\n<ng-template #configuredTabs>\n <ng-container *ngIf=\"assigneeFilter$ | async as assigneeFilter\">\n <cds-tabs type=\"contained\" class=\"dossier-list-tabs\">\n <cds-tab\n *ngFor=\"let tab of visibleDossierTabs; trackBy: trackByIndex\"\n [active]=\"assigneeFilter === tab\"\n heading=\"{{ 'dossier.tabs.' + tab | translate }}\"\n [id]=\"tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n </ng-container>\n</ng-template>\n\n<ng-template #loading\n ><valtimo-carbon-list [loading]=\"true\">\n <div tabs *ngIf=\"canHaveAssignee\">\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n </div> </valtimo-carbon-list\n></ng-template>\n\n<ng-template #bulkAssignModal let-obs=\"obs\">\n <valtimo-dossier-bulk-assign-modal\n [documentIds]=\"obs.selectedDocumentIds\"\n [open]=\"obs.showAssignModal\"\n (closeEvent)=\"onCloseEvent($event, obs.selectedDocumentIds)\"\n ></valtimo-dossier-bulk-assign-modal>\n</ng-template>\n\n<ng-template #changePageModal>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"dossier.changePageModal.confirm\"\n contentTranslationKey=\"dossier.changePageModal.content\"\n [outputOnConfirm]=\"paginationChange$ | async\"\n [showModalSubject$]=\"showChangePageModal$\"\n titleTranslationKey=\"dossier.changePageModal.title\"\n (confirmEvent)=\"onChangePageConfirm($event)\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #changeTabModal>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"dossier.changeTabModal.confirm\"\n contentTranslationKey=\"dossier.changeTabModal.content\"\n [outputOnConfirm]=\"tabChange$ | async\"\n [showModalSubject$]=\"showChangeTabModal$\"\n titleTranslationKey=\"dossier.changeTabModal.title\"\n (cancelEvent)=\"onChangeTabCancel()\"\n (confirmEvent)=\"onChangeTabConfirm($event)\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #dossierListActions>\n <button\n *ngIf=\"canCreateDocument$ | async\"\n cdsButton=\"primary\"\n [disabled]=\"listActionsComponent?.disableStartDossierButton$ | async\"\n (click)=\"startDossier()\"\n >\n {{ 'Start Dossier' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n", styles: [".dossier-list-tabs cds-tab{display:none}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$2.SearchFieldsComponent, selector: "valtimo-search-fields", inputs: ["loading", "searchFields", "documentDefinitionName", "setValuesSubject$", "defaultValues", "inputDisabled"], outputs: ["doSearch"] }, { kind: "directive", type: i4.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i4.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i3$2.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm"], outputs: ["confirmEvent", "cancelEvent"] }, { kind: "component", type: i4.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i4.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive"], outputs: ["selected"] }, { kind: "component", type: i3$2.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "header", "initialSortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: i3$2.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title"] }, { kind: "component", type: DossierBulkAssignModalComponent, selector: "valtimo-dossier-bulk-assign-modal", inputs: ["documentIds", "open"], outputs: ["closeEvent"] }, { kind: "component", type: DossierListActionsComponent, selector: "valtimo-dossier-list-actions", inputs: ["loading"], outputs: ["formFlowComplete"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
3233
|
+
}
|
|
3234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierListComponent, decorators: [{
|
|
3235
|
+
type: Component,
|
|
3236
|
+
args: [{ selector: 'valtimo-dossier-list', providers: [
|
|
3237
|
+
DossierListService,
|
|
3238
|
+
DossierColumnService,
|
|
3239
|
+
DossierListAssigneeService,
|
|
3240
|
+
DossierParameterService,
|
|
3241
|
+
DossierListPaginationService,
|
|
3242
|
+
DossierListSearchService,
|
|
3243
|
+
], template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n fields: fields$ | async,\n documentItems: documentItems$ | async,\n noResultsMessage: noResultsMessage$ | async,\n searchFields: searchFields$ | async,\n schema: schema$ | async,\n showAssignModal: showAssignModal$ | async,\n selectedDocumentIds: selectedDocumentIds$ | async,\n loaded:\n !loadingFields &&\n !loadingPagination &&\n !loadingSearchFields &&\n !loadingAssigneeFilter &&\n !loadingDocumentItems\n } as obs\"\n>\n <div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-dossier-list-actions\n [loading]=\"!obs.loaded\"\n (formFlowComplete)=\"forceRefresh()\"\n ></valtimo-dossier-list-actions>\n <ng-container *ngTemplateOutlet=\"searchFields; context: {obs: obs}\"></ng-container>\n\n <ng-container *ngIf=\"obs.loaded; else loading\">\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"bulkAssignModal; context: {obs: obs}\"></ng-container>\n\n <ng-container *ngTemplateOutlet=\"changePageModal\"></ng-container>\n\n <ng-container *ngTemplateOutlet=\"changeTabModal\"></ng-container>\n</ng-container>\n\n<ng-template #searchFields let-obs=\"obs\">\n <div class=\"mb-3\">\n <valtimo-search-fields\n [searchFields]=\"obs.searchFields\"\n (doSearch)=\"search($event)\"\n [documentDefinitionName]=\"documentDefinitionName$ | async\"\n [defaultValues]=\"searchFieldValues$ | async\"\n [inputDisabled]=\"!obs.loaded\"\n ></valtimo-search-fields>\n </div>\n</ng-template>\n\n<ng-template #list let-obs=\"obs\">\n <valtimo-carbon-list\n [fields]=\"obs.fields\"\n [header]=\"false\"\n [initialSortState]=\"pagination.sort\"\n [items]=\"obs.documentItems\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"dossierList\"\n [showSelectionColumn]=\"canHaveAssignee\"\n [tableTranslations]=\"tableTranslations\"\n (paginationClicked)=\"pageChange($event)\"\n (paginationSet)=\"pageSizeChange($event)\"\n (rowClicked)=\"rowClick($event)\"\n (sortChanged)=\"sortChanged($event)\"\n >\n <ng-container carbonToolbarActions>\n <button cdsButton=\"primary\" (click)=\"showAssignModal()\">\n {{ 'dossier.bulkAssign.assign' | translate }}\n </button>\n </ng-container>\n\n <div carbonToolbarContent>\n <ng-container *ngTemplateOutlet=\"dossierListActions\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"obs.noResultsMessage.isSearchResult ? null : dossierListActions\"\n [description]=\"obs.noResultsMessage.description | translate\"\n [title]=\"obs.noResultsMessage.title | translate\"\n ></valtimo-no-results>\n\n <div tabs *ngIf=\"canHaveAssignee\">\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n </div>\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #tabs>\n <ng-container *ngIf=\"assigneeFilter$ | async as assigneeFilter\">\n <cds-tabs\n *ngIf=\"!visibleDossierTabs; else configuredTabs\"\n type=\"contained\"\n data-carbon-theme=\"g10\"\n class=\"dossier-list-tabs\"\n >\n <cds-tab\n *ngFor=\"let tab of defaultTabs; trackBy: trackByIndex\"\n [active]=\"assigneeFilter === tab\"\n heading=\"{{ 'dossier.tabs.' + tab | translate }}\"\n [id]=\"tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n </ng-container>\n</ng-template>\n\n<ng-template #configuredTabs>\n <ng-container *ngIf=\"assigneeFilter$ | async as assigneeFilter\">\n <cds-tabs type=\"contained\" class=\"dossier-list-tabs\">\n <cds-tab\n *ngFor=\"let tab of visibleDossierTabs; trackBy: trackByIndex\"\n [active]=\"assigneeFilter === tab\"\n heading=\"{{ 'dossier.tabs.' + tab | translate }}\"\n [id]=\"tab\"\n (selected)=\"tabChange(tab)\"\n ></cds-tab>\n </cds-tabs>\n </ng-container>\n</ng-template>\n\n<ng-template #loading\n ><valtimo-carbon-list [loading]=\"true\">\n <div tabs *ngIf=\"canHaveAssignee\">\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n </div> </valtimo-carbon-list\n></ng-template>\n\n<ng-template #bulkAssignModal let-obs=\"obs\">\n <valtimo-dossier-bulk-assign-modal\n [documentIds]=\"obs.selectedDocumentIds\"\n [open]=\"obs.showAssignModal\"\n (closeEvent)=\"onCloseEvent($event, obs.selectedDocumentIds)\"\n ></valtimo-dossier-bulk-assign-modal>\n</ng-template>\n\n<ng-template #changePageModal>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"dossier.changePageModal.confirm\"\n contentTranslationKey=\"dossier.changePageModal.content\"\n [outputOnConfirm]=\"paginationChange$ | async\"\n [showModalSubject$]=\"showChangePageModal$\"\n titleTranslationKey=\"dossier.changePageModal.title\"\n (confirmEvent)=\"onChangePageConfirm($event)\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #changeTabModal>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"dossier.changeTabModal.confirm\"\n contentTranslationKey=\"dossier.changeTabModal.content\"\n [outputOnConfirm]=\"tabChange$ | async\"\n [showModalSubject$]=\"showChangeTabModal$\"\n titleTranslationKey=\"dossier.changeTabModal.title\"\n (cancelEvent)=\"onChangeTabCancel()\"\n (confirmEvent)=\"onChangeTabConfirm($event)\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #dossierListActions>\n <button\n *ngIf=\"canCreateDocument$ | async\"\n cdsButton=\"primary\"\n [disabled]=\"listActionsComponent?.disableStartDossierButton$ | async\"\n (click)=\"startDossier()\"\n >\n {{ 'Start Dossier' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n", styles: [".dossier-list-tabs cds-tab{display:none}\n"] }]
|
|
3244
|
+
}], ctorParameters: function () { return [{ type: DossierListAssigneeService }, { type: i3$2.BreadcrumbService }, { type: DossierBulkAssignService }, { type: DossierColumnService }, { type: i1.ConfigService }, { type: i2$1.DocumentService }, { type: DossierListService }, { type: i3$2.PageTitleService }, { type: DossierListPaginationService }, { type: DossierParameterService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: DossierListSearchService }, { type: i6.TranslateService }, { type: i7.PermissionService }]; }, propDecorators: { carbonList: [{
|
|
3245
|
+
type: ViewChild,
|
|
3246
|
+
args: [CarbonListComponent]
|
|
3247
|
+
}], listActionsComponent: [{
|
|
3248
|
+
type: ViewChild,
|
|
3249
|
+
args: [DossierListActionsComponent]
|
|
3250
|
+
}], tabsComponent: [{
|
|
3251
|
+
type: ViewChild,
|
|
3252
|
+
args: [Tabs]
|
|
3253
|
+
}] } });
|
|
3254
|
+
|
|
3255
|
+
/*
|
|
3256
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
3257
|
+
*
|
|
3258
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3259
|
+
* you may not use this file except in compliance with the License.
|
|
3260
|
+
* You may obtain a copy of the License at
|
|
3261
|
+
*
|
|
3262
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3263
|
+
*
|
|
3264
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3265
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3266
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3267
|
+
* See the License for the specific language governing permissions and
|
|
3268
|
+
* limitations under the License.
|
|
3269
|
+
*/
|
|
3270
|
+
moment.locale(localStorage.getItem('langKey') || '');
|
|
3271
|
+
class DossierUpdateComponent {
|
|
3272
|
+
constructor(taskService, documentService, route, toastr, location, dossierService) {
|
|
3273
|
+
this.taskService = taskService;
|
|
3274
|
+
this.documentService = documentService;
|
|
3275
|
+
this.route = route;
|
|
3276
|
+
this.toastr = toastr;
|
|
3277
|
+
this.location = location;
|
|
3278
|
+
this.customDefinitions = {};
|
|
3279
|
+
const snapshot = this.route.snapshot.paramMap;
|
|
3280
|
+
this.documentDefinitionName = snapshot.get('documentDefinitionName') || '';
|
|
3281
|
+
this.documentId = snapshot.get('documentId') || '';
|
|
3282
|
+
this.taskId = snapshot.get('taskId') || '';
|
|
3283
|
+
this.implementationDefinitions = dossierService.getImplementationEnvironmentDefinitions(this.documentDefinitionName);
|
|
3284
|
+
this.loadDocumentDefinition(this.documentDefinitionName);
|
|
3285
|
+
this.loadDocument(this.documentId);
|
|
3286
|
+
}
|
|
3287
|
+
ngOnInit() {
|
|
3288
|
+
this.getTask(this.taskId);
|
|
3289
|
+
if (this.implementationDefinitions.definitions.detail.summary) {
|
|
3290
|
+
this.customDefinitions = this.implementationDefinitions.definitions.detail.summary;
|
|
3291
|
+
}
|
|
3292
|
+
}
|
|
3293
|
+
loadDocumentDefinition(name) {
|
|
3294
|
+
this.documentService.getDocumentDefinition(name).subscribe(definition => {
|
|
3295
|
+
this.schema = definition.schema;
|
|
3296
|
+
});
|
|
3297
|
+
}
|
|
3298
|
+
loadDocument(id) {
|
|
3299
|
+
this.documentService.getDocument(id).subscribe(document => {
|
|
3300
|
+
this.document = document;
|
|
3301
|
+
});
|
|
3302
|
+
}
|
|
3303
|
+
getTask(id) {
|
|
3304
|
+
this.taskService.getTask(id).subscribe(task => {
|
|
3305
|
+
this.task = task;
|
|
3306
|
+
this.task.task.created = moment(this.task.task.created).format('DD MMM YYYY HH:mm');
|
|
3307
|
+
this.page = {
|
|
3308
|
+
title: this.task.task.name,
|
|
3309
|
+
subtitle: `Created ${moment(this.task.task.created).fromNow()}`,
|
|
3310
|
+
};
|
|
3311
|
+
});
|
|
3312
|
+
}
|
|
3313
|
+
reset() {
|
|
3314
|
+
this.loadDocument(this.documentId);
|
|
3315
|
+
}
|
|
3316
|
+
back() {
|
|
3317
|
+
this.location.back();
|
|
3318
|
+
}
|
|
3319
|
+
save() {
|
|
3320
|
+
const document = {
|
|
3321
|
+
documentId: this.document.id,
|
|
3322
|
+
content: this.document.content,
|
|
3323
|
+
versionBasedOn: this.document.version,
|
|
3324
|
+
};
|
|
3325
|
+
this.documentService.modifyDocument(document).subscribe(result => {
|
|
3326
|
+
this.document = result.document;
|
|
3327
|
+
this.toastr.success('Document aangepast');
|
|
3328
|
+
this.location.back();
|
|
3329
|
+
});
|
|
3330
|
+
}
|
|
3331
|
+
submit(data) {
|
|
3332
|
+
// merge document content with formdata
|
|
3333
|
+
const mergedData = Object.assign({}, this.document.content, data);
|
|
3334
|
+
const documentData = {
|
|
3335
|
+
request: {
|
|
3336
|
+
documentId: this.document.id,
|
|
3337
|
+
content: mergedData,
|
|
3338
|
+
versionBasedOn: this.document.version,
|
|
3339
|
+
},
|
|
3340
|
+
taskId: this.task.task.id,
|
|
3341
|
+
};
|
|
3342
|
+
this.documentService.modifyDocumentAndCompleteTask(documentData).subscribe(result => {
|
|
3343
|
+
this.toastr.success(this.task.task.name + ' has successfully been completed');
|
|
3344
|
+
this.location.back();
|
|
3345
|
+
});
|
|
3346
|
+
}
|
|
3347
|
+
returnZero() {
|
|
3348
|
+
return 0;
|
|
3349
|
+
}
|
|
3350
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierUpdateComponent, deps: [{ token: i3$1.TaskService }, { token: i2$1.DocumentService }, { token: i1$1.ActivatedRoute }, { token: i3$4.ToastrService }, { token: i3.Location }, { token: DossierService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3351
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DossierUpdateComponent, selector: "valtimo-dossier-update", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget [title]=\"page?.title\" [subtitle]=\"page?.subtitle\" [divider]=\"true\">\n <div class=\"card-body\">\n <!--view with custom definitions-->\n <div *ngIf=\"this.customDefinitions\">\n <div\n class=\"mb-4\"\n *ngFor=\"let definition of this.customDefinitions | keyvalue: returnZero\"\n ></div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-sm-12\">\n <div class=\"text-right\">\n <button\n class=\"btn btn-space btn-default float-left\"\n type=\"button\"\n (click)=\"back()\"\n id=\"back-button\"\n >\n Back\n </button>\n <button\n class=\"btn btn-space btn-secondary\"\n type=\"button\"\n (click)=\"reset()\"\n id=\"reset-button\"\n >\n Reset\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n type=\"button\"\n (click)=\"save()\"\n id=\"save-button\"\n >\n Save\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n type=\"submit\"\n (click)=\"submit({})\"\n id=\"submit-button\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <valtimo-camunda-form\n *ngIf=\"task?.formFields && !this.customDefinitions\"\n (submitted)=\"submit($event)\"\n [formFields]=\"task.formFields\"\n [componentName]=\"task.formLocation\"\n ></valtimo-camunda-form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: i3$2.CamundaFormComponent, selector: "valtimo-camunda-form", inputs: ["componentName", "formFields"], outputs: ["submitted"] }, { kind: "pipe", type: i3.KeyValuePipe, name: "keyvalue" }] }); }
|
|
3352
|
+
}
|
|
3353
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierUpdateComponent, decorators: [{
|
|
3354
|
+
type: Component,
|
|
3355
|
+
args: [{ selector: 'valtimo-dossier-update', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget [title]=\"page?.title\" [subtitle]=\"page?.subtitle\" [divider]=\"true\">\n <div class=\"card-body\">\n <!--view with custom definitions-->\n <div *ngIf=\"this.customDefinitions\">\n <div\n class=\"mb-4\"\n *ngFor=\"let definition of this.customDefinitions | keyvalue: returnZero\"\n ></div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-sm-12\">\n <div class=\"text-right\">\n <button\n class=\"btn btn-space btn-default float-left\"\n type=\"button\"\n (click)=\"back()\"\n id=\"back-button\"\n >\n Back\n </button>\n <button\n class=\"btn btn-space btn-secondary\"\n type=\"button\"\n (click)=\"reset()\"\n id=\"reset-button\"\n >\n Reset\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n type=\"button\"\n (click)=\"save()\"\n id=\"save-button\"\n >\n Save\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n type=\"submit\"\n (click)=\"submit({})\"\n id=\"submit-button\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <valtimo-camunda-form\n *ngIf=\"task?.formFields && !this.customDefinitions\"\n (submitted)=\"submit($event)\"\n [formFields]=\"task.formFields\"\n [componentName]=\"task.formLocation\"\n ></valtimo-camunda-form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n" }]
|
|
3356
|
+
}], ctorParameters: function () { return [{ type: i3$1.TaskService }, { type: i2$1.DocumentService }, { type: i1$1.ActivatedRoute }, { type: i3$4.ToastrService }, { type: i3.Location }, { type: DossierService }]; } });
|
|
3357
|
+
|
|
3358
|
+
/*
|
|
3359
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
3360
|
+
*
|
|
3361
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3362
|
+
* you may not use this file except in compliance with the License.
|
|
3363
|
+
* You may obtain a copy of the License at
|
|
3364
|
+
*
|
|
3365
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3366
|
+
*
|
|
3367
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3368
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3369
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3370
|
+
* See the License for the specific language governing permissions and
|
|
3371
|
+
* limitations under the License.
|
|
3372
|
+
*/
|
|
3373
|
+
const routes = [
|
|
3374
|
+
{
|
|
3375
|
+
path: 'dossiers/:documentDefinitionName',
|
|
3376
|
+
component: DossierListComponent,
|
|
3377
|
+
canActivate: [AuthGuardService],
|
|
3378
|
+
data: { title: 'Dossiers', roles: [ROLE_USER], customPageTitle: true },
|
|
3379
|
+
},
|
|
3380
|
+
{
|
|
3381
|
+
path: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
|
|
3382
|
+
component: DossierDetailComponent,
|
|
3383
|
+
canActivate: [AuthGuardService],
|
|
3384
|
+
data: {
|
|
3385
|
+
title: 'Dossier details',
|
|
3386
|
+
parentPath: 'dossiers/:documentDefinitionName',
|
|
3387
|
+
roles: [ROLE_USER],
|
|
3388
|
+
},
|
|
3389
|
+
},
|
|
3390
|
+
{
|
|
3391
|
+
path: 'dossiers/:documentDefinitionName/document/:documentId/:tab/tasks/:taskId',
|
|
3392
|
+
component: DossierUpdateComponent,
|
|
3393
|
+
canActivate: [AuthGuardService],
|
|
3394
|
+
data: {
|
|
3395
|
+
title: 'Task details',
|
|
3396
|
+
parentPath: 'dossiers/:documentDefinitionName/document/:documentId/:tab',
|
|
3397
|
+
roles: [ROLE_USER],
|
|
3398
|
+
},
|
|
3399
|
+
},
|
|
3400
|
+
];
|
|
3401
|
+
class DossierRoutingModule {
|
|
3402
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3403
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DossierRoutingModule, imports: [CommonModule, i1$1.RouterModule], exports: [RouterModule] }); }
|
|
3404
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
|
|
3405
|
+
}
|
|
3406
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierRoutingModule, decorators: [{
|
|
3407
|
+
type: NgModule,
|
|
3408
|
+
args: [{
|
|
3409
|
+
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
3410
|
+
exports: [RouterModule],
|
|
3411
|
+
}]
|
|
3412
|
+
}] });
|
|
3413
|
+
|
|
3414
|
+
/*
|
|
3415
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
3416
|
+
*
|
|
3417
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3418
|
+
* you may not use this file except in compliance with the License.
|
|
3419
|
+
* You may obtain a copy of the License at
|
|
3420
|
+
*
|
|
3421
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3422
|
+
*
|
|
3423
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3424
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3425
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3426
|
+
* See the License for the specific language governing permissions and
|
|
3427
|
+
* limitations under the License.
|
|
3428
|
+
*/
|
|
3429
|
+
class DossierModule {
|
|
3430
|
+
static forRoot(tabsFactory) {
|
|
3431
|
+
return {
|
|
3432
|
+
ngModule: DossierModule,
|
|
3433
|
+
providers: [
|
|
3434
|
+
DossierService,
|
|
3435
|
+
DossierBulkAssignService,
|
|
3436
|
+
TabService,
|
|
3437
|
+
{
|
|
3438
|
+
provide: TAB_MAP,
|
|
3439
|
+
useFactory: tabsFactory,
|
|
3440
|
+
},
|
|
3441
|
+
],
|
|
3442
|
+
};
|
|
3443
|
+
}
|
|
3444
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3445
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DossierModule, declarations: [DossierBulkAssignModalComponent,
|
|
3446
|
+
DossierListComponent,
|
|
3447
|
+
DossierListActionsComponent,
|
|
3448
|
+
DossierDetailComponent,
|
|
3449
|
+
DossierDetailTabSummaryComponent,
|
|
3450
|
+
DossierDetailTabProgressComponent,
|
|
3451
|
+
DossierDetailTabAuditComponent,
|
|
3452
|
+
DossierDetailTabDocumentsComponent,
|
|
3453
|
+
DossierDetailTabContactMomentsComponent,
|
|
3454
|
+
DossierDetailTabZaakobjectenComponent,
|
|
3455
|
+
DossierDetailTabNotesComponent,
|
|
3456
|
+
DossierUpdateComponent,
|
|
3457
|
+
DossierProcessStartModalComponent,
|
|
3458
|
+
DossierSupportingProcessStartModalComponent,
|
|
3459
|
+
DossierDetailTabObjectTypeComponent,
|
|
3460
|
+
DossierDetailTabDocumentenApiDocumentsComponent,
|
|
3461
|
+
DossierDetailTabS3DocumentsComponent,
|
|
3462
|
+
DossierAssignUserComponent,
|
|
3463
|
+
NoteModalComponent], imports: [CommonModule,
|
|
3464
|
+
DossierRoutingModule,
|
|
3465
|
+
ListModule,
|
|
3466
|
+
WidgetModule,
|
|
3467
|
+
BpmnJsDiagramModule,
|
|
3468
|
+
TimelineModule,
|
|
3469
|
+
CamundaFormModule,
|
|
3470
|
+
ProcessModule,
|
|
3471
|
+
FilterSidebarModule,
|
|
3472
|
+
NgbButtonsModule,
|
|
3473
|
+
DataListModule,
|
|
3474
|
+
FormsModule,
|
|
3475
|
+
ReactiveFormsModule,
|
|
3476
|
+
FormModule,
|
|
3477
|
+
FormIoModule,
|
|
3478
|
+
ModalModule,
|
|
3479
|
+
SpinnerModule, i6.TranslateModule, TaskModule,
|
|
3480
|
+
ModalModule,
|
|
3481
|
+
NgbTooltipModule,
|
|
3482
|
+
UploaderModule,
|
|
3483
|
+
DropzoneModule,
|
|
3484
|
+
NgbPaginationModule,
|
|
3485
|
+
ConfigModule,
|
|
3486
|
+
SelectModule,
|
|
3487
|
+
InputLabelModule,
|
|
3488
|
+
ParagraphModule,
|
|
3489
|
+
TableModule,
|
|
3490
|
+
VModalModule,
|
|
3491
|
+
TitleModule,
|
|
3492
|
+
ButtonModule,
|
|
3493
|
+
DocumentenApiMetadataModalModule,
|
|
3494
|
+
SearchableDropdownSelectModule,
|
|
3495
|
+
SearchFieldsModule,
|
|
3496
|
+
PageModule,
|
|
3497
|
+
FormModule,
|
|
3498
|
+
InputModule,
|
|
3499
|
+
FormModule$1,
|
|
3500
|
+
NgbModule,
|
|
3501
|
+
LoadingModule,
|
|
3502
|
+
ButtonModule$1,
|
|
3503
|
+
IconModule,
|
|
3504
|
+
FormLinkModule,
|
|
3505
|
+
ModalModule$1,
|
|
3506
|
+
SelectModule$1,
|
|
3507
|
+
ConfirmationModalModule,
|
|
3508
|
+
DropdownModule,
|
|
3509
|
+
TabsModule,
|
|
3510
|
+
ComboBoxModule,
|
|
3511
|
+
CarbonListModule], exports: [DossierListComponent, DossierDetailComponent] }); }
|
|
3512
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierModule, imports: [CommonModule,
|
|
3513
|
+
DossierRoutingModule,
|
|
3514
|
+
ListModule,
|
|
3515
|
+
WidgetModule,
|
|
3516
|
+
BpmnJsDiagramModule,
|
|
3517
|
+
TimelineModule,
|
|
3518
|
+
CamundaFormModule,
|
|
3519
|
+
ProcessModule,
|
|
3520
|
+
FilterSidebarModule,
|
|
3521
|
+
NgbButtonsModule,
|
|
3522
|
+
DataListModule,
|
|
3523
|
+
FormsModule,
|
|
3524
|
+
ReactiveFormsModule,
|
|
3525
|
+
FormModule,
|
|
3526
|
+
FormIoModule,
|
|
3527
|
+
ModalModule,
|
|
3528
|
+
SpinnerModule,
|
|
3529
|
+
TranslateModule.forRoot({
|
|
3530
|
+
loader: {
|
|
3531
|
+
provide: TranslateLoader,
|
|
3532
|
+
useFactory: HttpLoaderFactory,
|
|
3533
|
+
deps: [HttpClient],
|
|
3534
|
+
},
|
|
3535
|
+
}),
|
|
3536
|
+
TaskModule,
|
|
3537
|
+
ModalModule,
|
|
3538
|
+
NgbTooltipModule,
|
|
3539
|
+
UploaderModule,
|
|
3540
|
+
DropzoneModule,
|
|
3541
|
+
NgbPaginationModule,
|
|
3542
|
+
ConfigModule,
|
|
3543
|
+
SelectModule,
|
|
3544
|
+
InputLabelModule,
|
|
3545
|
+
ParagraphModule,
|
|
3546
|
+
TableModule,
|
|
3547
|
+
VModalModule,
|
|
3548
|
+
TitleModule,
|
|
3549
|
+
ButtonModule,
|
|
3550
|
+
DocumentenApiMetadataModalModule,
|
|
3551
|
+
SearchableDropdownSelectModule,
|
|
3552
|
+
SearchFieldsModule,
|
|
3553
|
+
PageModule,
|
|
3554
|
+
FormModule,
|
|
3555
|
+
InputModule,
|
|
3556
|
+
FormModule$1,
|
|
3557
|
+
NgbModule,
|
|
3558
|
+
LoadingModule,
|
|
3559
|
+
ButtonModule$1,
|
|
3560
|
+
IconModule,
|
|
3561
|
+
FormLinkModule,
|
|
3562
|
+
ModalModule$1,
|
|
3563
|
+
SelectModule$1,
|
|
3564
|
+
ConfirmationModalModule,
|
|
3565
|
+
DropdownModule,
|
|
3566
|
+
TabsModule,
|
|
3567
|
+
ComboBoxModule,
|
|
3568
|
+
CarbonListModule] }); }
|
|
3569
|
+
}
|
|
3570
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DossierModule, decorators: [{
|
|
3571
|
+
type: NgModule,
|
|
3572
|
+
args: [{
|
|
3573
|
+
declarations: [
|
|
3574
|
+
DossierBulkAssignModalComponent,
|
|
3575
|
+
DossierListComponent,
|
|
3576
|
+
DossierListActionsComponent,
|
|
3577
|
+
DossierDetailComponent,
|
|
3578
|
+
DossierDetailTabSummaryComponent,
|
|
3579
|
+
DossierDetailTabProgressComponent,
|
|
3580
|
+
DossierDetailTabAuditComponent,
|
|
3581
|
+
DossierDetailTabDocumentsComponent,
|
|
3582
|
+
DossierDetailTabContactMomentsComponent,
|
|
3583
|
+
DossierDetailTabZaakobjectenComponent,
|
|
3584
|
+
DossierDetailTabNotesComponent,
|
|
3585
|
+
DossierUpdateComponent,
|
|
3586
|
+
DossierProcessStartModalComponent,
|
|
3587
|
+
DossierSupportingProcessStartModalComponent,
|
|
3588
|
+
DossierDetailTabObjectTypeComponent,
|
|
3589
|
+
DossierDetailTabDocumentenApiDocumentsComponent,
|
|
3590
|
+
DossierDetailTabS3DocumentsComponent,
|
|
3591
|
+
DossierAssignUserComponent,
|
|
3592
|
+
NoteModalComponent,
|
|
3593
|
+
],
|
|
3594
|
+
imports: [
|
|
3595
|
+
CommonModule,
|
|
3596
|
+
DossierRoutingModule,
|
|
3597
|
+
ListModule,
|
|
3598
|
+
WidgetModule,
|
|
3599
|
+
BpmnJsDiagramModule,
|
|
3600
|
+
TimelineModule,
|
|
3601
|
+
CamundaFormModule,
|
|
3602
|
+
ProcessModule,
|
|
3603
|
+
FilterSidebarModule,
|
|
3604
|
+
NgbButtonsModule,
|
|
3605
|
+
DataListModule,
|
|
3606
|
+
FormsModule,
|
|
3607
|
+
ReactiveFormsModule,
|
|
3608
|
+
FormModule,
|
|
3609
|
+
FormIoModule,
|
|
3610
|
+
ModalModule,
|
|
3611
|
+
SpinnerModule,
|
|
3612
|
+
TranslateModule.forRoot({
|
|
3613
|
+
loader: {
|
|
3614
|
+
provide: TranslateLoader,
|
|
3615
|
+
useFactory: HttpLoaderFactory,
|
|
3616
|
+
deps: [HttpClient],
|
|
3617
|
+
},
|
|
3618
|
+
}),
|
|
3619
|
+
TaskModule,
|
|
3620
|
+
ModalModule,
|
|
3621
|
+
NgbTooltipModule,
|
|
3622
|
+
UploaderModule,
|
|
3623
|
+
DropzoneModule,
|
|
3624
|
+
NgbPaginationModule,
|
|
3625
|
+
ConfigModule,
|
|
3626
|
+
SelectModule,
|
|
3627
|
+
InputLabelModule,
|
|
3628
|
+
ParagraphModule,
|
|
3629
|
+
TableModule,
|
|
3630
|
+
VModalModule,
|
|
3631
|
+
TitleModule,
|
|
3632
|
+
ButtonModule,
|
|
3633
|
+
DocumentenApiMetadataModalModule,
|
|
3634
|
+
SearchableDropdownSelectModule,
|
|
3635
|
+
SearchFieldsModule,
|
|
3636
|
+
PageModule,
|
|
3637
|
+
FormModule,
|
|
3638
|
+
InputModule,
|
|
3639
|
+
FormModule$1,
|
|
3640
|
+
NgbModule,
|
|
3641
|
+
LoadingModule,
|
|
3642
|
+
ButtonModule$1,
|
|
3643
|
+
IconModule,
|
|
3644
|
+
FormLinkModule,
|
|
3645
|
+
ModalModule$1,
|
|
3646
|
+
SelectModule$1,
|
|
3647
|
+
ConfirmationModalModule,
|
|
3648
|
+
DropdownModule,
|
|
3649
|
+
TabsModule,
|
|
3650
|
+
ComboBoxModule,
|
|
3651
|
+
CarbonListModule,
|
|
3652
|
+
],
|
|
3653
|
+
exports: [DossierListComponent, DossierDetailComponent],
|
|
3654
|
+
}]
|
|
3655
|
+
}] });
|
|
3656
|
+
|
|
3657
|
+
/*
|
|
3658
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
3659
|
+
*
|
|
3660
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3661
|
+
* you may not use this file except in compliance with the License.
|
|
3662
|
+
* You may obtain a copy of the License at
|
|
3663
|
+
*
|
|
3664
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3665
|
+
*
|
|
3666
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3667
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3668
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3669
|
+
* See the License for the specific language governing permissions and
|
|
3670
|
+
* limitations under the License.
|
|
3671
|
+
*/
|
|
3672
|
+
/*
|
|
3673
|
+
* Public API Surface of dossier
|
|
3674
|
+
*/
|
|
3675
|
+
|
|
3676
|
+
/**
|
|
3677
|
+
* Generated bundle index. Do not edit.
|
|
3678
|
+
*/
|
|
3679
|
+
|
|
3680
|
+
export { DEFAULT_TABS, DefaultTabs, DossierBulkAssignModalComponent, DossierBulkAssignService, DossierColumnService, DossierDetailComponent, DossierDetailTabAuditComponent, DossierDetailTabContactMomentsComponent, DossierDetailTabDocumentsComponent, DossierDetailTabNotesComponent, DossierDetailTabProgressComponent, DossierDetailTabSummaryComponent, DossierDetailTabZaakobjectenComponent, DossierListAssigneeService, DossierListComponent, DossierListPaginationService, DossierListSearchService, DossierListService, DossierModule, DossierParameterService, DossierService, FileSortService, TAB_MAP, TabImpl, TabLoaderImpl, TabService, ZaakobjectenService };
|
|
3681
|
+
//# sourceMappingURL=valtimo-dossier.mjs.map
|