@valtimo/object-management 10.8.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm2020 → esm2022}/lib/components/object-management-detail-container/object-management-detail-container.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/components/object-management-detail-container/tabs/object-management-detail/object-management-detail.component.mjs +4 -4
- package/esm2022/lib/components/object-management-detail-container/tabs/object-management-list-columns/object-management-list-columns.component.mjs +446 -0
- package/esm2022/lib/components/object-management-detail-container/tabs/object-management-list-search-fields/object-management-list-search-fields.component.mjs +341 -0
- package/{esm2020 → esm2022}/lib/components/object-management-list/object-management-list.component.mjs +4 -4
- package/esm2022/lib/components/object-management-modal/object-management-modal.component.mjs +146 -0
- package/esm2022/lib/components/object-management-upload-modal/object-management-upload-modal.component.mjs +184 -0
- package/{esm2020 → esm2022}/lib/object-management-routing.module.mjs +5 -5
- package/esm2022/lib/object-management.module.mjs +141 -0
- package/{esm2020 → esm2022}/lib/services/object-management-state.service.mjs +4 -4
- package/{esm2020 → esm2022}/lib/services/object-management.service.mjs +4 -4
- package/{esm2020 → esm2022}/lib/services/tab.service.mjs +4 -4
- package/{fesm2020 → fesm2022}/valtimo-object-management.mjs +110 -109
- package/fesm2022/valtimo-object-management.mjs.map +1 -0
- package/lib/components/object-management-detail-container/object-management-detail-container.component.d.ts +1 -1
- package/lib/components/object-management-detail-container/tabs/object-management-detail/object-management-detail.component.d.ts +1 -1
- package/lib/components/object-management-detail-container/tabs/object-management-list-columns/object-management-list-columns.component.d.ts +2 -3
- package/lib/components/object-management-detail-container/tabs/object-management-list-search-fields/object-management-list-search-fields.component.d.ts +1 -1
- package/lib/components/object-management-list/object-management-list.component.d.ts +1 -1
- package/lib/components/object-management-modal/object-management-modal.component.d.ts +3 -3
- package/lib/components/object-management-upload-modal/object-management-upload-modal.component.d.ts +3 -3
- package/lib/models/object-management.model.d.ts +1 -1
- package/lib/object-management.module.d.ts +3 -4
- package/package.json +8 -14
- package/esm2020/lib/components/object-management-detail-container/tabs/object-management-list-columns/object-management-list-columns.component.mjs +0 -447
- package/esm2020/lib/components/object-management-detail-container/tabs/object-management-list-search-fields/object-management-list-search-fields.component.mjs +0 -342
- package/esm2020/lib/components/object-management-modal/object-management-modal.component.mjs +0 -146
- package/esm2020/lib/components/object-management-upload-modal/object-management-upload-modal.component.mjs +0 -185
- package/esm2020/lib/object-management.module.mjs +0 -142
- package/fesm2015/valtimo-object-management.mjs +0 -1590
- package/fesm2015/valtimo-object-management.mjs.map +0 -1
- package/fesm2020/valtimo-object-management.mjs.map +0 -1
- /package/{esm2020 → esm2022}/lib/models/object-management.model.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/services/tab.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/valtimo-object-management.mjs +0 -0
|
@@ -1,1590 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Component, ViewChild, Input, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/common/http';
|
|
4
|
-
import * as i4 from '@valtimo/config';
|
|
5
|
-
import { ROLE_ADMIN } from '@valtimo/config';
|
|
6
|
-
import * as i2 from '@angular/router';
|
|
7
|
-
import { RouterModule } from '@angular/router';
|
|
8
|
-
import * as i6 from '@angular/common';
|
|
9
|
-
import { CommonModule } from '@angular/common';
|
|
10
|
-
import { AuthGuardService } from '@valtimo/security';
|
|
11
|
-
import { Subject, BehaviorSubject, map, combineLatest, delay, filter, switchMap, tap, startWith, of } from 'rxjs';
|
|
12
|
-
import { take, catchError, tap as tap$1, switchMap as switchMap$1 } from 'rxjs/operators';
|
|
13
|
-
import * as i7 from '@valtimo/components';
|
|
14
|
-
import { DropzoneModule, WidgetModule, ListModule, CarbonMultiInputModule, ConfirmationModalModule, SpinnerModule, ModalModule as ModalModule$2, ValtimoCdsModalDirectiveModule } from '@valtimo/components';
|
|
15
|
-
import * as i8 from 'carbon-components-angular';
|
|
16
|
-
import { InputModule as InputModule$1, ButtonModule as ButtonModule$1, ModalModule as ModalModule$1, NotificationModule, LoadingModule, DropdownModule, CheckboxModule, LinkModule, IconModule } from 'carbon-components-angular';
|
|
17
|
-
import * as i3 from '@valtimo/form';
|
|
18
|
-
import * as i4$1 from '@valtimo/plugin';
|
|
19
|
-
import * as i5 from '@valtimo/user-interface';
|
|
20
|
-
import { ModalModule, TitleModule, ButtonModule, FormModule, InputModule, SelectModule, TooltipIconModule } from '@valtimo/user-interface';
|
|
21
|
-
import * as i3$1 from '@ngx-translate/core';
|
|
22
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
23
|
-
import * as i10 from '@angular/forms';
|
|
24
|
-
import { FormGroup, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
25
|
-
import * as i5$1 from '@angular/platform-browser';
|
|
26
|
-
import * as i3$2 from '@valtimo/form-management';
|
|
27
|
-
|
|
28
|
-
/*
|
|
29
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
30
|
-
*
|
|
31
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
32
|
-
* you may not use this file except in compliance with the License.
|
|
33
|
-
* You may obtain a copy of the License at
|
|
34
|
-
*
|
|
35
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
36
|
-
*
|
|
37
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
38
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
39
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
40
|
-
* See the License for the specific language governing permissions and
|
|
41
|
-
* limitations under the License.
|
|
42
|
-
*/
|
|
43
|
-
class ObjectManagementService {
|
|
44
|
-
constructor(http, configService) {
|
|
45
|
-
this.http = http;
|
|
46
|
-
this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;
|
|
47
|
-
}
|
|
48
|
-
getAllObjects() {
|
|
49
|
-
return this.http.get(`${this.valtimoEndpointUri}v1/object/management/configuration`);
|
|
50
|
-
}
|
|
51
|
-
getObjectById(id) {
|
|
52
|
-
return this.http.get(`${this.valtimoEndpointUri}v1/object/management/configuration/${id}`);
|
|
53
|
-
}
|
|
54
|
-
createObject(payload) {
|
|
55
|
-
return this.http.post(`${this.valtimoEndpointUri}v1/object/management/configuration`, payload);
|
|
56
|
-
}
|
|
57
|
-
editObject(payload) {
|
|
58
|
-
return this.http.put(`${this.valtimoEndpointUri}v1/object/management/configuration`, payload);
|
|
59
|
-
}
|
|
60
|
-
getSearchList(ownerId) {
|
|
61
|
-
return this.http.get(`${this.valtimoEndpointUri}v1/search/list-column/${ownerId}`);
|
|
62
|
-
}
|
|
63
|
-
postSearchList(ownerId, request) {
|
|
64
|
-
return this.http.post(`${this.valtimoEndpointUri}v1/search/list-column/${ownerId}`, Object.assign(Object.assign({}, request), { ownerId }));
|
|
65
|
-
}
|
|
66
|
-
putSearchList(ownerId, columnKey, request) {
|
|
67
|
-
return this.http.put(`${this.valtimoEndpointUri}v1/search/list-column/${ownerId}/${columnKey}`, Object.assign(Object.assign({}, request), { ownerId }));
|
|
68
|
-
}
|
|
69
|
-
putSearchListColumns(ownerId, request) {
|
|
70
|
-
return this.http.put(`${this.valtimoEndpointUri}v1/search/list-column/${ownerId}/search-list-columns`, [...request]);
|
|
71
|
-
}
|
|
72
|
-
deleteSearchList(ownerId, columnKey) {
|
|
73
|
-
return this.http.delete(`${this.valtimoEndpointUri}v1/search/list-column/${ownerId}/${columnKey}`);
|
|
74
|
-
}
|
|
75
|
-
getSearchField(ownerId) {
|
|
76
|
-
return this.http.get(`${this.valtimoEndpointUri}v1/search/field/${ownerId}`);
|
|
77
|
-
}
|
|
78
|
-
postSearchField(ownerId, request) {
|
|
79
|
-
return this.http.post(`${this.valtimoEndpointUri}v1/search/field/${ownerId}`, Object.assign(Object.assign({}, request), { ownerId }));
|
|
80
|
-
}
|
|
81
|
-
putSearchField(ownerId, key, request) {
|
|
82
|
-
return this.http.put(`${this.valtimoEndpointUri}v1/search/field/${ownerId}/${key}`, Object.assign(Object.assign({}, request), { ownerId }));
|
|
83
|
-
}
|
|
84
|
-
putSearchFields(ownerId, request) {
|
|
85
|
-
return this.http.put(`${this.valtimoEndpointUri}v1/search/field/${ownerId}/fields`, [...request]);
|
|
86
|
-
}
|
|
87
|
-
deleteSearchField(ownerId, key) {
|
|
88
|
-
return this.http.delete(`${this.valtimoEndpointUri}v1/search/field/${ownerId}/${key}`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
ObjectManagementService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementService, deps: [{ token: i1.HttpClient }, { token: i4.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
92
|
-
ObjectManagementService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementService, providedIn: 'root' });
|
|
93
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementService, decorators: [{
|
|
94
|
-
type: Injectable,
|
|
95
|
-
args: [{
|
|
96
|
-
providedIn: 'root',
|
|
97
|
-
}]
|
|
98
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i4.ConfigService }]; } });
|
|
99
|
-
|
|
100
|
-
/*
|
|
101
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
102
|
-
*
|
|
103
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
104
|
-
* you may not use this file except in compliance with the License.
|
|
105
|
-
* You may obtain a copy of the License at
|
|
106
|
-
*
|
|
107
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
108
|
-
*
|
|
109
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
110
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
111
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
112
|
-
* See the License for the specific language governing permissions and
|
|
113
|
-
* limitations under the License.
|
|
114
|
-
*/
|
|
115
|
-
var TabEnum;
|
|
116
|
-
(function (TabEnum) {
|
|
117
|
-
TabEnum["GENERAL"] = "general";
|
|
118
|
-
TabEnum["LIST"] = "list";
|
|
119
|
-
TabEnum["SEARCH"] = "search";
|
|
120
|
-
})(TabEnum || (TabEnum = {}));
|
|
121
|
-
|
|
122
|
-
/*
|
|
123
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
124
|
-
*
|
|
125
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
126
|
-
* you may not use this file except in compliance with the License.
|
|
127
|
-
* You may obtain a copy of the License at
|
|
128
|
-
*
|
|
129
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
130
|
-
*
|
|
131
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
132
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
133
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
134
|
-
* See the License for the specific language governing permissions and
|
|
135
|
-
* limitations under the License.
|
|
136
|
-
*/
|
|
137
|
-
class ObjectManagementStateService {
|
|
138
|
-
constructor() {
|
|
139
|
-
this._showModal$ = new Subject();
|
|
140
|
-
this._hideModal$ = new Subject();
|
|
141
|
-
this._refresh$ = new BehaviorSubject(null);
|
|
142
|
-
this._modalType$ = new BehaviorSubject('add');
|
|
143
|
-
}
|
|
144
|
-
get showModal$() {
|
|
145
|
-
return this._showModal$.asObservable();
|
|
146
|
-
}
|
|
147
|
-
get hideModal$() {
|
|
148
|
-
return this._hideModal$.asObservable();
|
|
149
|
-
}
|
|
150
|
-
get refresh$() {
|
|
151
|
-
return this._refresh$.asObservable();
|
|
152
|
-
}
|
|
153
|
-
get modalType$() {
|
|
154
|
-
return this._modalType$.asObservable();
|
|
155
|
-
}
|
|
156
|
-
showModal() {
|
|
157
|
-
this._showModal$.next(null);
|
|
158
|
-
}
|
|
159
|
-
hideModal() {
|
|
160
|
-
this._hideModal$.next(null);
|
|
161
|
-
}
|
|
162
|
-
refresh() {
|
|
163
|
-
this._refresh$.next(null);
|
|
164
|
-
}
|
|
165
|
-
setModalType(type) {
|
|
166
|
-
this._modalType$.next(type);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
ObjectManagementStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
170
|
-
ObjectManagementStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementStateService, providedIn: 'root' });
|
|
171
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementStateService, decorators: [{
|
|
172
|
-
type: Injectable,
|
|
173
|
-
args: [{
|
|
174
|
-
providedIn: 'root',
|
|
175
|
-
}]
|
|
176
|
-
}], ctorParameters: function () { return []; } });
|
|
177
|
-
|
|
178
|
-
/*
|
|
179
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
180
|
-
*
|
|
181
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
182
|
-
* you may not use this file except in compliance with the License.
|
|
183
|
-
* You may obtain a copy of the License at
|
|
184
|
-
*
|
|
185
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
186
|
-
*
|
|
187
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
188
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
189
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
-
* See the License for the specific language governing permissions and
|
|
191
|
-
* limitations under the License.
|
|
192
|
-
*/
|
|
193
|
-
class TabService {
|
|
194
|
-
constructor() {
|
|
195
|
-
this._currentTab$ = new BehaviorSubject(TabEnum.GENERAL);
|
|
196
|
-
}
|
|
197
|
-
get currentTab$() {
|
|
198
|
-
return this._currentTab$.asObservable();
|
|
199
|
-
}
|
|
200
|
-
set currentTab(tab) {
|
|
201
|
-
this._currentTab$.next(tab);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
TabService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TabService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
205
|
-
TabService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TabService, providedIn: 'root' });
|
|
206
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TabService, decorators: [{
|
|
207
|
-
type: Injectable,
|
|
208
|
-
args: [{
|
|
209
|
-
providedIn: 'root',
|
|
210
|
-
}]
|
|
211
|
-
}] });
|
|
212
|
-
|
|
213
|
-
/*
|
|
214
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
215
|
-
*
|
|
216
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
217
|
-
* you may not use this file except in compliance with the License.
|
|
218
|
-
* You may obtain a copy of the License at
|
|
219
|
-
*
|
|
220
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
221
|
-
*
|
|
222
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
223
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
224
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
225
|
-
* See the License for the specific language governing permissions and
|
|
226
|
-
* limitations under the License.
|
|
227
|
-
*/
|
|
228
|
-
class ObjectManagementModalComponent {
|
|
229
|
-
constructor(objectManagementState, objectManagementService, formService, pluginManagementService, modalService) {
|
|
230
|
-
this.objectManagementState = objectManagementState;
|
|
231
|
-
this.objectManagementService = objectManagementService;
|
|
232
|
-
this.formService = formService;
|
|
233
|
-
this.pluginManagementService = pluginManagementService;
|
|
234
|
-
this.modalService = modalService;
|
|
235
|
-
this.valid$ = new BehaviorSubject(false);
|
|
236
|
-
this.showForm$ = this.modalService.modalVisible$;
|
|
237
|
-
this.modalType$ = this.objectManagementState.modalType$;
|
|
238
|
-
this.formData$ = new BehaviorSubject(null);
|
|
239
|
-
this.selectedObjecttype$ = new BehaviorSubject(null);
|
|
240
|
-
this.formDefinitions$ = this.formService
|
|
241
|
-
.getAllFormDefinitions()
|
|
242
|
-
.pipe(map(results => results === null || results === void 0 ? void 0 : results.map(configuration => ({
|
|
243
|
-
id: configuration.name,
|
|
244
|
-
text: configuration.name,
|
|
245
|
-
}))));
|
|
246
|
-
this.configurationInstances$ = this.pluginManagementService
|
|
247
|
-
.getAllPluginConfigurations()
|
|
248
|
-
.pipe(map(configurations => configurations));
|
|
249
|
-
this.objectsApiConfigurations$ = this.configurationInstances$.pipe(map(configurations => {
|
|
250
|
-
const filteredObjectsApiConfigurations = configurations.filter(configuration => { var _a; return ((_a = configuration === null || configuration === void 0 ? void 0 : configuration.pluginDefinition) === null || _a === void 0 ? void 0 : _a.key) === 'objectenapi'; });
|
|
251
|
-
return filteredObjectsApiConfigurations.map(configuration => ({
|
|
252
|
-
id: configuration.id,
|
|
253
|
-
text: configuration.title,
|
|
254
|
-
}));
|
|
255
|
-
}));
|
|
256
|
-
this.objecttypesApiConfigurations$ = this.configurationInstances$.pipe(map(configurations => {
|
|
257
|
-
const filteredObjecttypesApiConfigurations = configurations.filter(configuration => { var _a; return ((_a = configuration === null || configuration === void 0 ? void 0 : configuration.pluginDefinition) === null || _a === void 0 ? void 0 : _a.key) === 'objecttypenapi'; });
|
|
258
|
-
return filteredObjecttypesApiConfigurations.map(configuration => ({
|
|
259
|
-
id: configuration.id,
|
|
260
|
-
text: configuration.title,
|
|
261
|
-
properties: configuration.properties,
|
|
262
|
-
}));
|
|
263
|
-
}));
|
|
264
|
-
}
|
|
265
|
-
ngAfterViewInit() {
|
|
266
|
-
this.openShowSubscription();
|
|
267
|
-
this.openHideSubscription();
|
|
268
|
-
}
|
|
269
|
-
ngOnDestroy() {
|
|
270
|
-
var _a, _b;
|
|
271
|
-
(_a = this.showSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
272
|
-
(_b = this.hideSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
273
|
-
}
|
|
274
|
-
hide() {
|
|
275
|
-
this.formData$.next(null);
|
|
276
|
-
this.valid$.next(false);
|
|
277
|
-
this.modalService.closeModal();
|
|
278
|
-
}
|
|
279
|
-
cancel() {
|
|
280
|
-
this.hide();
|
|
281
|
-
}
|
|
282
|
-
save() {
|
|
283
|
-
combineLatest([this.valid$, this.formData$, this.modalType$])
|
|
284
|
-
.pipe(take(1))
|
|
285
|
-
.subscribe(([valid, formData, modalType]) => {
|
|
286
|
-
if (valid) {
|
|
287
|
-
if (modalType === 'add') {
|
|
288
|
-
this.objectManagementService.createObject(Object.assign({}, formData)).subscribe(() => {
|
|
289
|
-
this.objectManagementState.refresh();
|
|
290
|
-
this.objectManagementState.hideModal();
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
else if (modalType === 'edit') {
|
|
294
|
-
this.objectManagementService.editObject(Object.assign({}, formData)).subscribe(() => {
|
|
295
|
-
this.objectManagementState.refresh();
|
|
296
|
-
this.objectManagementState.hideModal();
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
openShowSubscription() {
|
|
303
|
-
this.showSubscription = this.objectManagementState.showModal$.subscribe(() => {
|
|
304
|
-
this.show();
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
openHideSubscription() {
|
|
308
|
-
this.hideSubscription = this.objectManagementState.hideModal$.subscribe(() => {
|
|
309
|
-
this.hide();
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
show() {
|
|
313
|
-
this.objectManagementState.modalType$.pipe(take(1)).subscribe(modalType => {
|
|
314
|
-
if (modalType === 'edit' || modalType === 'add') {
|
|
315
|
-
this.modalService.openModal(this.objectManagementModal);
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
formValueChange(data) {
|
|
320
|
-
if (data.showInDataMenu === '') {
|
|
321
|
-
data.showInDataMenu = false;
|
|
322
|
-
}
|
|
323
|
-
this.formData$.next(data);
|
|
324
|
-
this.setValid(data);
|
|
325
|
-
}
|
|
326
|
-
setValid(data) {
|
|
327
|
-
this.valid$.next(!!(data.title &&
|
|
328
|
-
data.objectenApiPluginConfigurationId &&
|
|
329
|
-
data.objecttypenApiPluginConfigurationId &&
|
|
330
|
-
data.objecttypeId &&
|
|
331
|
-
data.objecttypeVersion));
|
|
332
|
-
}
|
|
333
|
-
selectObjectType(objecttype) {
|
|
334
|
-
this.selectedObjecttype$.next(objecttype);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
ObjectManagementModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementModalComponent, deps: [{ token: ObjectManagementStateService }, { token: ObjectManagementService }, { token: i3.FormService }, { token: i4$1.PluginManagementService }, { token: i5.ModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
338
|
-
ObjectManagementModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ObjectManagementModalComponent, selector: "valtimo-object-management-modal", inputs: { prefillObject$: "prefillObject$" }, viewQueries: [{ propertyName: "objectManagementModal", first: true, predicate: ["objectManagementModal"], 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 #objectManagementModal\n *ngIf=\"{\n disabled: disabled$ | async,\n valid: valid$ | async,\n modalType: modalType$ | async,\n prefillObject: prefillObject$ | async\n } as obs\"\n>\n <div role=\"header\">\n <div class=\"add-title\">\n <v-title [margin]=\"false\">{{\n (obs.modalType === 'add'\n ? 'objectManagement.createObjecttype'\n : 'objectManagement.editObjecttype'\n ) | translate\n }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <ng-container\n *ngTemplateOutlet=\"\n form;\n context: {prefillObject: obs.prefillObject, modalType: obs.modalType}\n \"\n ></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <v-button (clickEvent)=\"cancel()\" [disabled]=\"obs.disabled\" type=\"secondary\">\n {{ 'objectManagement.cancel' | translate }}\n </v-button>\n <v-button\n (clickEvent)=\"save()\"\n [disabled]=\"obs.disabled || !obs.valid\"\n mdiIcon=\"plus\"\n type=\"success\"\n >\n {{\n (obs.modalType === 'add' ? 'objectManagement.add' : 'objectManagement.edit') | translate\n }}\n </v-button>\n </div>\n </div>\n</v-modal>\n\n<ng-template #form let-prefillObject=\"prefillObject\" let-modalType=\"modalType\">\n <ng-container *ngIf=\"showForm$ | async\">\n <v-form (valueChange)=\"formValueChange($event)\">\n <v-input\n *ngIf=\"modalType === 'edit'\"\n hidden\n [disabled]=\"true\"\n [defaultValue]=\"prefillObject?.id\"\n name=\"id\"\n ></v-input>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.title' | translate\"\n [tooltip]=\"'objectManagement.tooltips.title' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.title\"\n name=\"title\"\n ></v-input>\n\n <ng-container\n *ngIf=\"{\n connectionInstances: configurationInstances$ | async,\n objectsApiConfigurations: objectsApiConfigurations$ | async,\n objecttypesApiConfigurations: objecttypesApiConfigurations$ | async\n } as objectObs\"\n >\n <v-select\n [items]=\"objectObs.objectsApiConfigurations\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objectenApiPluginConfigurationId\"\n [title]=\"'objectManagement.labels.objects' | translate\"\n [defaultSelectionId]=\"prefillObject?.objectenApiPluginConfigurationId\"\n [required]=\"true\"\n ></v-select>\n\n <v-select\n [items]=\"objectObs.objecttypesApiConfigurations\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objecttypenApiPluginConfigurationId\"\n [title]=\"'objectManagement.labels.objecttypes' | translate\"\n [defaultSelectionId]=\"prefillObject?.objecttypenApiPluginConfigurationId\"\n [required]=\"true\"\n (selectedChange)=\"selectObjectType($event)\"\n ></v-select>\n </ng-container>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.objecttypeId' | translate\"\n [tooltip]=\"'objectManagement.tooltips.objecttypeId' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.objecttypeId\"\n name=\"objecttypeId\"\n ></v-input>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.objecttypeVersion' | translate\"\n [tooltip]=\"'objectManagement.tooltips.objecttypeVersion' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.objecttypeVersion\"\n [min]=\"1\"\n type=\"number\"\n name=\"objecttypeVersion\"\n ></v-input>\n\n <ng-container *ngIf=\"{formDefinitions: formDefinitions$ | async} as formObs\">\n <v-select\n [items]=\"formObs.formDefinitions\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"formDefinitionView\"\n [title]=\"'objectManagement.labels.formDefinitionView' | translate\"\n [tooltip]=\"'objectManagement.tooltips.formDefinitionView' | translate\"\n [defaultSelectionId]=\"prefillObject?.formDefinitionView\"\n ></v-select>\n\n <v-select\n [items]=\"formObs.formDefinitions\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"formDefinitionEdit\"\n [title]=\"'objectManagement.labels.formDefinitionEdit' | translate\"\n [tooltip]=\"'objectManagement.tooltips.formDefinitionEdit' | translate\"\n [defaultSelectionId]=\"prefillObject?.formDefinitionEdit\"\n ></v-select>\n </ng-container>\n\n <v-input\n [margin]=\"true\"\n type=\"checkbox\"\n [title]=\"'objectManagement.labels.showInDataMenu' | translate\"\n [tooltip]=\"'objectManagement.tooltips.showInDataMenu' | translate\"\n name=\"showInDataMenu\"\n [defaultValue]=\"prefillObject?.showInDataMenu\"\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{width:100%;display:flex;flex-direction:row;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.ModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx", "hideFooter"], outputs: ["closeEvent"] }, { kind: "component", type: i5.TitleComponent, selector: "v-title", inputs: ["type", "margin", "fullWidth", "center"] }, { kind: "component", type: i5.ButtonComponent, selector: "v-button", inputs: ["type", "mdiIcon", "disabled", "title", "titleTranslationKey"], outputs: ["clickEvent"] }, { kind: "component", type: i5.FormComponent, selector: "v-form", inputs: ["className"], outputs: ["valueChange"] }, { kind: "component", type: i5.InputComponent, selector: "v-input", inputs: ["name", "type", "title", "titleTranslationKey", "defaultValue", "widthPx", "fullWidth", "margin", "smallMargin", "disabled", "step", "min", "maxLength", "tooltip", "required", "hideNumberSpinBox", "smallLabel", "rows", "clear$"], outputs: ["valueChange"] }, { kind: "component", type: i5.SelectComponent, selector: "v-select", inputs: ["items", "defaultSelection", "defaultSelectionId", "defaultSelectionIds", "clearable", "disabled", "multiple", "margin", "widthInPx", "notFoundText", "clearAllText", "name", "title", "titleTranslationKey", "clearSelectionSubject$", "tooltip", "required", "loading", "loadingText", "placeholder", "smallMargin"], outputs: ["selectedChange", "clear"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] });
|
|
339
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementModalComponent, decorators: [{
|
|
340
|
-
type: Component,
|
|
341
|
-
args: [{ selector: 'valtimo-object-management-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 #objectManagementModal\n *ngIf=\"{\n disabled: disabled$ | async,\n valid: valid$ | async,\n modalType: modalType$ | async,\n prefillObject: prefillObject$ | async\n } as obs\"\n>\n <div role=\"header\">\n <div class=\"add-title\">\n <v-title [margin]=\"false\">{{\n (obs.modalType === 'add'\n ? 'objectManagement.createObjecttype'\n : 'objectManagement.editObjecttype'\n ) | translate\n }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <ng-container\n *ngTemplateOutlet=\"\n form;\n context: {prefillObject: obs.prefillObject, modalType: obs.modalType}\n \"\n ></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <v-button (clickEvent)=\"cancel()\" [disabled]=\"obs.disabled\" type=\"secondary\">\n {{ 'objectManagement.cancel' | translate }}\n </v-button>\n <v-button\n (clickEvent)=\"save()\"\n [disabled]=\"obs.disabled || !obs.valid\"\n mdiIcon=\"plus\"\n type=\"success\"\n >\n {{\n (obs.modalType === 'add' ? 'objectManagement.add' : 'objectManagement.edit') | translate\n }}\n </v-button>\n </div>\n </div>\n</v-modal>\n\n<ng-template #form let-prefillObject=\"prefillObject\" let-modalType=\"modalType\">\n <ng-container *ngIf=\"showForm$ | async\">\n <v-form (valueChange)=\"formValueChange($event)\">\n <v-input\n *ngIf=\"modalType === 'edit'\"\n hidden\n [disabled]=\"true\"\n [defaultValue]=\"prefillObject?.id\"\n name=\"id\"\n ></v-input>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.title' | translate\"\n [tooltip]=\"'objectManagement.tooltips.title' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.title\"\n name=\"title\"\n ></v-input>\n\n <ng-container\n *ngIf=\"{\n connectionInstances: configurationInstances$ | async,\n objectsApiConfigurations: objectsApiConfigurations$ | async,\n objecttypesApiConfigurations: objecttypesApiConfigurations$ | async\n } as objectObs\"\n >\n <v-select\n [items]=\"objectObs.objectsApiConfigurations\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objectenApiPluginConfigurationId\"\n [title]=\"'objectManagement.labels.objects' | translate\"\n [defaultSelectionId]=\"prefillObject?.objectenApiPluginConfigurationId\"\n [required]=\"true\"\n ></v-select>\n\n <v-select\n [items]=\"objectObs.objecttypesApiConfigurations\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objecttypenApiPluginConfigurationId\"\n [title]=\"'objectManagement.labels.objecttypes' | translate\"\n [defaultSelectionId]=\"prefillObject?.objecttypenApiPluginConfigurationId\"\n [required]=\"true\"\n (selectedChange)=\"selectObjectType($event)\"\n ></v-select>\n </ng-container>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.objecttypeId' | translate\"\n [tooltip]=\"'objectManagement.tooltips.objecttypeId' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.objecttypeId\"\n name=\"objecttypeId\"\n ></v-input>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.objecttypeVersion' | translate\"\n [tooltip]=\"'objectManagement.tooltips.objecttypeVersion' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.objecttypeVersion\"\n [min]=\"1\"\n type=\"number\"\n name=\"objecttypeVersion\"\n ></v-input>\n\n <ng-container *ngIf=\"{formDefinitions: formDefinitions$ | async} as formObs\">\n <v-select\n [items]=\"formObs.formDefinitions\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"formDefinitionView\"\n [title]=\"'objectManagement.labels.formDefinitionView' | translate\"\n [tooltip]=\"'objectManagement.tooltips.formDefinitionView' | translate\"\n [defaultSelectionId]=\"prefillObject?.formDefinitionView\"\n ></v-select>\n\n <v-select\n [items]=\"formObs.formDefinitions\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"formDefinitionEdit\"\n [title]=\"'objectManagement.labels.formDefinitionEdit' | translate\"\n [tooltip]=\"'objectManagement.tooltips.formDefinitionEdit' | translate\"\n [defaultSelectionId]=\"prefillObject?.formDefinitionEdit\"\n ></v-select>\n </ng-container>\n\n <v-input\n [margin]=\"true\"\n type=\"checkbox\"\n [title]=\"'objectManagement.labels.showInDataMenu' | translate\"\n [tooltip]=\"'objectManagement.tooltips.showInDataMenu' | translate\"\n name=\"showInDataMenu\"\n [defaultValue]=\"prefillObject?.showInDataMenu\"\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{width:100%;display:flex;flex-direction:row;justify-content:space-between}\n"] }]
|
|
342
|
-
}], ctorParameters: function () { return [{ type: ObjectManagementStateService }, { type: ObjectManagementService }, { type: i3.FormService }, { type: i4$1.PluginManagementService }, { type: i5.ModalService }]; }, propDecorators: { objectManagementModal: [{
|
|
343
|
-
type: ViewChild,
|
|
344
|
-
args: ['objectManagementModal']
|
|
345
|
-
}], prefillObject$: [{
|
|
346
|
-
type: Input
|
|
347
|
-
}] } });
|
|
348
|
-
|
|
349
|
-
/*
|
|
350
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
351
|
-
*
|
|
352
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
353
|
-
* you may not use this file except in compliance with the License.
|
|
354
|
-
* You may obtain a copy of the License at
|
|
355
|
-
*
|
|
356
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
357
|
-
*
|
|
358
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
359
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
360
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
361
|
-
* See the License for the specific language governing permissions and
|
|
362
|
-
* limitations under the License.
|
|
363
|
-
*/
|
|
364
|
-
class ObjectManagementDetailComponent {
|
|
365
|
-
constructor(objectManagementService, objectManagementState) {
|
|
366
|
-
this.objectManagementService = objectManagementService;
|
|
367
|
-
this.objectManagementState = objectManagementState;
|
|
368
|
-
this.loading$ = new BehaviorSubject(false);
|
|
369
|
-
}
|
|
370
|
-
downloadDefinition(object) {
|
|
371
|
-
this.loading$.next(true);
|
|
372
|
-
const dataString = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(object, null, 2));
|
|
373
|
-
const downloadAnchorElement = document.getElementById('downloadAnchorElement');
|
|
374
|
-
downloadAnchorElement.setAttribute('href', dataString);
|
|
375
|
-
downloadAnchorElement.setAttribute('download', `${object.id}.json`);
|
|
376
|
-
downloadAnchorElement.click();
|
|
377
|
-
this.loading$.next(false);
|
|
378
|
-
}
|
|
379
|
-
showEditModal() {
|
|
380
|
-
this.loading$.next(true);
|
|
381
|
-
this.objectManagementState.setModalType('edit');
|
|
382
|
-
this.objectManagementState.showModal();
|
|
383
|
-
this.loading$.next(false);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
ObjectManagementDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementDetailComponent, deps: [{ token: ObjectManagementService }, { token: ObjectManagementStateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
387
|
-
ObjectManagementDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ObjectManagementDetailComponent, selector: "valtimo-object-management-detail", inputs: { object$: "object$" }, 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 id=\"object-datail-content\"\n class=\"pt-0\"\n *ngIf=\"{\n object: object$ | async,\n loading: loading$ | async\n } as obs\"\n>\n <ng-container\n *ngTemplateOutlet=\"buttons; context: {object: obs.object, loading: obs.loading}\"\n ></ng-container>\n <div class=\"clearfix\"></div>\n <ng-container\n *ngTemplateOutlet=\"widget; context: {object: obs.object, loading: obs.loading}\"\n ></ng-container>\n</div>\n\n<ng-template #buttons let-object=\"object\" let-loading=\"loading\">\n <div class=\"btn-group mt-m3px mb-3 pr-2 float-right\">\n <button\n (click)=\"downloadDefinition(object)\"\n cdsButton=\"secondary\"\n size=\"md\"\n [disabled]=\"loading\"\n class=\"ml-3\"\n >\n {{ 'objectManagement.download' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"download\" size=\"16\"></svg>\n </button>\n <a id=\"downloadAnchorElement\" class=\"d-none\"></a>\n <button\n (click)=\"showEditModal()\"\n cdsButton=\"primary\"\n size=\"md\"\n [disabled]=\"loading\"\n class=\"ml-3\"\n >\n {{ 'objectManagement.editObjecttype' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"edit\" size=\"16\"></svg>\n </button>\n </div>\n</ng-template>\n\n<ng-template #widget let-object=\"object\">\n <valtimo-widget>\n <div class=\"row bg-white mt-5 mb-2 pl-2 pr-2\">\n <div class=\"col-5 bg-red\">\n <textarea class=\"w-100 object-schema\" disabled rows=\"25\">{{ object | json }}</textarea>\n </div>\n </div>\n </valtimo-widget>\n</ng-template>\n\n<valtimo-object-management-modal [prefillObject$]=\"object$\"></valtimo-object-management-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 */.row{margin:0}.object-schema{resize:none}valtimo-widget::ng-deep .card-border.card-full-default{border:none}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i7.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "directive", type: i8.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i8.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: ObjectManagementModalComponent, selector: "valtimo-object-management-modal", inputs: ["prefillObject$"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.JsonPipe, name: "json" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] });
|
|
388
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementDetailComponent, decorators: [{
|
|
389
|
-
type: Component,
|
|
390
|
-
args: [{ selector: 'valtimo-object-management-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 id=\"object-datail-content\"\n class=\"pt-0\"\n *ngIf=\"{\n object: object$ | async,\n loading: loading$ | async\n } as obs\"\n>\n <ng-container\n *ngTemplateOutlet=\"buttons; context: {object: obs.object, loading: obs.loading}\"\n ></ng-container>\n <div class=\"clearfix\"></div>\n <ng-container\n *ngTemplateOutlet=\"widget; context: {object: obs.object, loading: obs.loading}\"\n ></ng-container>\n</div>\n\n<ng-template #buttons let-object=\"object\" let-loading=\"loading\">\n <div class=\"btn-group mt-m3px mb-3 pr-2 float-right\">\n <button\n (click)=\"downloadDefinition(object)\"\n cdsButton=\"secondary\"\n size=\"md\"\n [disabled]=\"loading\"\n class=\"ml-3\"\n >\n {{ 'objectManagement.download' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"download\" size=\"16\"></svg>\n </button>\n <a id=\"downloadAnchorElement\" class=\"d-none\"></a>\n <button\n (click)=\"showEditModal()\"\n cdsButton=\"primary\"\n size=\"md\"\n [disabled]=\"loading\"\n class=\"ml-3\"\n >\n {{ 'objectManagement.editObjecttype' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"edit\" size=\"16\"></svg>\n </button>\n </div>\n</ng-template>\n\n<ng-template #widget let-object=\"object\">\n <valtimo-widget>\n <div class=\"row bg-white mt-5 mb-2 pl-2 pr-2\">\n <div class=\"col-5 bg-red\">\n <textarea class=\"w-100 object-schema\" disabled rows=\"25\">{{ object | json }}</textarea>\n </div>\n </div>\n </valtimo-widget>\n</ng-template>\n\n<valtimo-object-management-modal [prefillObject$]=\"object$\"></valtimo-object-management-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 */.row{margin:0}.object-schema{resize:none}valtimo-widget::ng-deep .card-border.card-full-default{border:none}\n"] }]
|
|
391
|
-
}], ctorParameters: function () { return [{ type: ObjectManagementService }, { type: ObjectManagementStateService }]; }, propDecorators: { object$: [{
|
|
392
|
-
type: Input
|
|
393
|
-
}] } });
|
|
394
|
-
|
|
395
|
-
/*
|
|
396
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
397
|
-
*
|
|
398
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
399
|
-
* you may not use this file except in compliance with the License.
|
|
400
|
-
* You may obtain a copy of the License at
|
|
401
|
-
*
|
|
402
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
403
|
-
*
|
|
404
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
405
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
406
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
407
|
-
* See the License for the specific language governing permissions and
|
|
408
|
-
* limitations under the License.
|
|
409
|
-
*/
|
|
410
|
-
class ObjectManagementListColumnsComponent {
|
|
411
|
-
constructor(objectManagementService, route, translateService, configService, sanitizer) {
|
|
412
|
-
this.objectManagementService = objectManagementService;
|
|
413
|
-
this.route = route;
|
|
414
|
-
this.translateService = translateService;
|
|
415
|
-
this.configService = configService;
|
|
416
|
-
this.sanitizer = sanitizer;
|
|
417
|
-
this.downloadName$ = new BehaviorSubject('');
|
|
418
|
-
this.downloadUrl$ = new BehaviorSubject(undefined);
|
|
419
|
-
this.loading$ = new BehaviorSubject(true);
|
|
420
|
-
this.currentModalType$ = new BehaviorSubject('create');
|
|
421
|
-
this.showModal$ = new BehaviorSubject(false);
|
|
422
|
-
this.modalShowing$ = this.showModal$.pipe(delay(250));
|
|
423
|
-
this.disableInput$ = new BehaviorSubject(false);
|
|
424
|
-
this.showDeleteModal$ = new Subject();
|
|
425
|
-
this.deleteRowIndex$ = new BehaviorSubject(0);
|
|
426
|
-
this.defaultEnumValues$ = new BehaviorSubject(undefined);
|
|
427
|
-
this.INVALID_KEY = 'invalid';
|
|
428
|
-
this.formGroup = new FormGroup({
|
|
429
|
-
title: new FormControl(''),
|
|
430
|
-
key: new FormControl('', Validators.required),
|
|
431
|
-
path: new FormControl('', Validators.required),
|
|
432
|
-
dateFormat: new FormControl(''),
|
|
433
|
-
displayType: new FormControl({
|
|
434
|
-
key: this.INVALID_KEY,
|
|
435
|
-
}),
|
|
436
|
-
sortable: new FormControl(false),
|
|
437
|
-
defaultSort: new FormControl({
|
|
438
|
-
key: this.INVALID_KEY,
|
|
439
|
-
}),
|
|
440
|
-
enum: new FormControl([]),
|
|
441
|
-
});
|
|
442
|
-
this.DISPLAY_TYPES = [
|
|
443
|
-
'string',
|
|
444
|
-
'date',
|
|
445
|
-
'boolean',
|
|
446
|
-
'enum',
|
|
447
|
-
'arrayCount',
|
|
448
|
-
'underscoresToSpaces',
|
|
449
|
-
];
|
|
450
|
-
this.COLUMNS = [
|
|
451
|
-
{
|
|
452
|
-
viewType: 'string',
|
|
453
|
-
sortable: false,
|
|
454
|
-
propertyName: 'title',
|
|
455
|
-
translationKey: 'title',
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
viewType: 'string',
|
|
459
|
-
sortable: false,
|
|
460
|
-
propertyName: 'key',
|
|
461
|
-
translationKey: 'key',
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
viewType: 'string',
|
|
465
|
-
sortable: false,
|
|
466
|
-
propertyName: 'path',
|
|
467
|
-
translationKey: 'path',
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
viewType: 'string',
|
|
471
|
-
sortable: false,
|
|
472
|
-
propertyName: 'displayType',
|
|
473
|
-
translationKey: 'displayType',
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
viewType: 'string',
|
|
477
|
-
sortable: false,
|
|
478
|
-
propertyName: 'displayTypeParameters',
|
|
479
|
-
translationKey: 'displayTypeParameters',
|
|
480
|
-
},
|
|
481
|
-
{
|
|
482
|
-
viewType: 'string',
|
|
483
|
-
sortable: false,
|
|
484
|
-
propertyName: 'sortable',
|
|
485
|
-
translationKey: 'sortable',
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
viewType: 'string',
|
|
489
|
-
sortable: false,
|
|
490
|
-
propertyName: 'defaultSort',
|
|
491
|
-
translationKey: 'defaultSort',
|
|
492
|
-
},
|
|
493
|
-
];
|
|
494
|
-
this.cachedObjectManagementListColumns = [];
|
|
495
|
-
this.refreshObjectManagementListColumns$ = new BehaviorSubject(null);
|
|
496
|
-
this.objectManagementFields$ = this.translateService
|
|
497
|
-
.stream('key')
|
|
498
|
-
.pipe(map(() => this.COLUMNS.map(column => (Object.assign(Object.assign({ key: column.propertyName, label: this.translateService.instant(`listColumn.${column.translationKey}`), sortable: column.sortable }, (column.viewType && { viewType: column.viewType })), (column.enum && { enum: column.enum }))))));
|
|
499
|
-
this.objectId$ = this.route.params.pipe(map(params => params.id || ''), filter(objectId => !!objectId));
|
|
500
|
-
this.objectManagementListColumns$ = combineLatest([
|
|
501
|
-
this.objectId$,
|
|
502
|
-
this.refreshObjectManagementListColumns$,
|
|
503
|
-
]).pipe(switchMap(([objectId]) => this.objectManagementService.getSearchList(objectId)), tap(objectManagementListColumns => {
|
|
504
|
-
this.objectId$.pipe(take(1)).subscribe(objectId => {
|
|
505
|
-
if (objectManagementListColumns &&
|
|
506
|
-
Array.isArray(objectManagementListColumns) &&
|
|
507
|
-
objectManagementListColumns.length > 0) {
|
|
508
|
-
this.setDownload(objectId, objectManagementListColumns);
|
|
509
|
-
}
|
|
510
|
-
});
|
|
511
|
-
}), tap(objectManagementListColumns => {
|
|
512
|
-
this.cachedObjectManagementListColumns = objectManagementListColumns;
|
|
513
|
-
this.loading$.next(false);
|
|
514
|
-
this.enableInput();
|
|
515
|
-
}));
|
|
516
|
-
this.translatedObjectManagementListColumns$ = combineLatest([this.objectManagementListColumns$, this.translateService.stream('key')]).pipe(map(([columns]) => columns.map(column => {
|
|
517
|
-
var _a;
|
|
518
|
-
return (Object.assign(Object.assign({}, column), { title: column.title || '-', sortable: column.sortable
|
|
519
|
-
? this.translateService.instant('listColumn.sortableYes')
|
|
520
|
-
: this.translateService.instant('listColumn.sortableNo'), defaultSort: (column.defaultSort === 'ASC' &&
|
|
521
|
-
this.translateService.instant('listColumn.sortableAsc')) ||
|
|
522
|
-
(column.defaultSort === 'DESC' &&
|
|
523
|
-
this.translateService.instant('listColumn.sortableDesc')) ||
|
|
524
|
-
'-', displayType: this.translateService.instant(`listColumnDisplayType.${(_a = column === null || column === void 0 ? void 0 : column.displayType) === null || _a === void 0 ? void 0 : _a.type}`), displayTypeParameters: this.getDisplayTypeParametersView(column.displayType.displayTypeParameters) }));
|
|
525
|
-
})));
|
|
526
|
-
this.disableDefaultSort$ = combineLatest([
|
|
527
|
-
this.currentModalType$,
|
|
528
|
-
this.formGroup.valueChanges,
|
|
529
|
-
]).pipe(map(([currentModalType]) => currentModalType === 'create' &&
|
|
530
|
-
this.cachedObjectManagementListColumns.find(column => !!column.defaultSort)), startWith(false));
|
|
531
|
-
this.showDateFormat$ = this.formGroup.valueChanges.pipe(map(formValues => { var _a; return ((_a = formValues.displayType) === null || _a === void 0 ? void 0 : _a.key) === this.DISPLAY_TYPES[1]; }), tap(showDateFormat => {
|
|
532
|
-
if (showDateFormat === false && !!this.formGroup.value.dateFormat) {
|
|
533
|
-
this.formGroup.patchValue({ dateFormat: '' });
|
|
534
|
-
}
|
|
535
|
-
}), startWith(false));
|
|
536
|
-
this.showEnum$ = this.formGroup.valueChanges.pipe(map(formValues => {
|
|
537
|
-
var _a, _b;
|
|
538
|
-
return !!(((_a = formValues.displayType) === null || _a === void 0 ? void 0 : _a.key) === this.DISPLAY_TYPES[3] ||
|
|
539
|
-
((_b = formValues.displayType) === null || _b === void 0 ? void 0 : _b.key) === this.DISPLAY_TYPES[2]);
|
|
540
|
-
}), tap(showEnum => {
|
|
541
|
-
const enumValue = this.formGroup.value.enum;
|
|
542
|
-
if (showEnum === false && Array.isArray(enumValue) && enumValue.length > 0) {
|
|
543
|
-
this.formGroup.patchValue({ enum: [] });
|
|
544
|
-
}
|
|
545
|
-
}), startWith(false));
|
|
546
|
-
this.isYesNo$ = this.formGroup.valueChanges.pipe(map(formValues => { var _a; return ((_a = formValues.displayType) === null || _a === void 0 ? void 0 : _a.key) === this.DISPLAY_TYPES[2]; }));
|
|
547
|
-
this.selectedViewTypeItemIndex$ = new BehaviorSubject(0);
|
|
548
|
-
this.viewTypeItems$ = combineLatest([
|
|
549
|
-
this.selectedViewTypeItemIndex$,
|
|
550
|
-
this.translateService.stream('key'),
|
|
551
|
-
]).pipe(map(([selectedViewTypeItemIndex]) => [
|
|
552
|
-
{
|
|
553
|
-
content: this.translateService.instant(`listColumnDisplayType.select`),
|
|
554
|
-
key: this.INVALID_KEY,
|
|
555
|
-
},
|
|
556
|
-
...this.DISPLAY_TYPES.map(type => ({
|
|
557
|
-
content: this.translateService.instant(`listColumnDisplayType.${type}`),
|
|
558
|
-
key: type,
|
|
559
|
-
})),
|
|
560
|
-
].map((item, index) => (Object.assign(Object.assign({}, item), { selected: index === selectedViewTypeItemIndex })))));
|
|
561
|
-
this.selectedSortItemIndex$ = new BehaviorSubject(0);
|
|
562
|
-
this.sortItems$ = combineLatest([
|
|
563
|
-
this.selectedSortItemIndex$,
|
|
564
|
-
this.translateService.stream('key'),
|
|
565
|
-
]).pipe(map(([selectedSortItemIndex]) => [
|
|
566
|
-
{
|
|
567
|
-
content: this.translateService.instant(`listColumn.selectDefaultSort`),
|
|
568
|
-
key: this.INVALID_KEY,
|
|
569
|
-
},
|
|
570
|
-
{
|
|
571
|
-
content: this.translateService.instant(`listColumn.sortableAsc`),
|
|
572
|
-
key: 'ASC',
|
|
573
|
-
},
|
|
574
|
-
{
|
|
575
|
-
content: this.translateService.instant(`listColumn.sortableDesc`),
|
|
576
|
-
key: 'DESC',
|
|
577
|
-
},
|
|
578
|
-
].map((item, index) => (Object.assign(Object.assign({}, item), { selected: index === selectedSortItemIndex })))));
|
|
579
|
-
this.validKey$ = combineLatest([this.formGroup.valueChanges, this.currentModalType$]).pipe(map(([formValues, currentModalType]) => {
|
|
580
|
-
const existingKeys = this.cachedObjectManagementListColumns.map(column => column.key);
|
|
581
|
-
return currentModalType === 'create' ? !existingKeys.includes(formValues.key) : true;
|
|
582
|
-
}), startWith(false));
|
|
583
|
-
this.valid$ = combineLatest([this.formGroup.valueChanges, this.validKey$]).pipe(map(([formValues, validKey]) => {
|
|
584
|
-
var _a, _b;
|
|
585
|
-
return !!(((_a = formValues.displayType) === null || _a === void 0 ? void 0 : _a.key) !== this.INVALID_KEY &&
|
|
586
|
-
formValues.path &&
|
|
587
|
-
validKey &&
|
|
588
|
-
(formValues.displayType.key === 'enum' ? ((_b = formValues.enum) === null || _b === void 0 ? void 0 : _b.length) > 0 : true));
|
|
589
|
-
}), startWith(false));
|
|
590
|
-
}
|
|
591
|
-
openModal(modalType) {
|
|
592
|
-
this.showModal$.next(true);
|
|
593
|
-
this.currentModalType$.next(modalType);
|
|
594
|
-
if (modalType === 'create') {
|
|
595
|
-
this.formGroup.controls['key'].enable();
|
|
596
|
-
this.resetFormGroup();
|
|
597
|
-
}
|
|
598
|
-
else if (modalType === 'edit') {
|
|
599
|
-
this.formGroup.controls['key'].disable();
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
closeModal() {
|
|
603
|
-
this.showModal$.next(false);
|
|
604
|
-
}
|
|
605
|
-
deleteRow(searchListColumnRowIndex, clickEvent) {
|
|
606
|
-
clickEvent.stopPropagation();
|
|
607
|
-
this.showDeleteModal$.next(true);
|
|
608
|
-
this.deleteRowIndex$.next(searchListColumnRowIndex);
|
|
609
|
-
}
|
|
610
|
-
deleteRowConfirmation(searchListColumnRowIndex) {
|
|
611
|
-
const columnKey = this.getColumnKey(searchListColumnRowIndex);
|
|
612
|
-
if (columnKey) {
|
|
613
|
-
this.disableInput();
|
|
614
|
-
this.objectId$
|
|
615
|
-
.pipe(take(1), switchMap(objectId => this.objectManagementService.deleteSearchList(objectId, columnKey)), tap(() => this.refreshObjectManagementListColumns()), catchError(() => {
|
|
616
|
-
this.enableInput();
|
|
617
|
-
return of(null);
|
|
618
|
-
}))
|
|
619
|
-
.subscribe();
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
getColumnKey(searchListColumnRowIndex) {
|
|
623
|
-
var _a;
|
|
624
|
-
return (_a = this.cachedObjectManagementListColumns[searchListColumnRowIndex]) === null || _a === void 0 ? void 0 : _a.key;
|
|
625
|
-
}
|
|
626
|
-
moveRow(searchListColumnRowIndex, moveUp, clickEvent, objectId) {
|
|
627
|
-
const objectManagementListColumns = [...this.cachedObjectManagementListColumns];
|
|
628
|
-
const searchListColumnRow = objectManagementListColumns[searchListColumnRowIndex];
|
|
629
|
-
clickEvent.stopPropagation();
|
|
630
|
-
const searchListColumnIndex = objectManagementListColumns.findIndex(field => field.key === searchListColumnRow.key);
|
|
631
|
-
const foundSearchListColumn = Object.assign({}, objectManagementListColumns[searchListColumnIndex]);
|
|
632
|
-
const filteredSearchListColumns = objectManagementListColumns.filter(field => field.key !== searchListColumnRow.key);
|
|
633
|
-
const multipleSearchListColumns = objectManagementListColumns.length > 1;
|
|
634
|
-
if (multipleSearchListColumns && moveUp && searchListColumnIndex > 0) {
|
|
635
|
-
const searchListColumnBeforeKey = `${objectManagementListColumns[searchListColumnIndex - 1].key}`;
|
|
636
|
-
const searchListColumnBeforeIndex = filteredSearchListColumns.findIndex(field => field.key === searchListColumnBeforeKey);
|
|
637
|
-
filteredSearchListColumns.splice(searchListColumnBeforeIndex, 0, foundSearchListColumn);
|
|
638
|
-
this.updateObjectManagementListColumn(objectId, filteredSearchListColumns);
|
|
639
|
-
}
|
|
640
|
-
else if (multipleSearchListColumns &&
|
|
641
|
-
!moveUp &&
|
|
642
|
-
searchListColumnIndex < objectManagementListColumns.length) {
|
|
643
|
-
const caseListColumnAfterKey = `${objectManagementListColumns[searchListColumnIndex + 1].key}`;
|
|
644
|
-
const caseListColumnAfterIndex = filteredSearchListColumns.findIndex(field => field.key === caseListColumnAfterKey);
|
|
645
|
-
filteredSearchListColumns.splice(caseListColumnAfterIndex + 1, 0, foundSearchListColumn);
|
|
646
|
-
this.updateObjectManagementListColumn(objectId, filteredSearchListColumns);
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
saveCasListColumns() {
|
|
650
|
-
this.disableInput();
|
|
651
|
-
this.currentModalType$.pipe(take(1)).subscribe(currentModalType => {
|
|
652
|
-
if (currentModalType === 'create') {
|
|
653
|
-
this.addColumn();
|
|
654
|
-
}
|
|
655
|
-
else {
|
|
656
|
-
this.updateColumn();
|
|
657
|
-
}
|
|
658
|
-
});
|
|
659
|
-
}
|
|
660
|
-
enumValueChange(value) {
|
|
661
|
-
this.formGroup.patchValue({ enum: value });
|
|
662
|
-
}
|
|
663
|
-
columnRowClicked(row) {
|
|
664
|
-
this.resetFormGroup();
|
|
665
|
-
combineLatest([this.viewTypeItems$, this.sortItems$])
|
|
666
|
-
.pipe(take(1))
|
|
667
|
-
.subscribe(([viewTypeItems, sortItems]) => {
|
|
668
|
-
var _a, _b, _c, _d;
|
|
669
|
-
const column = this.cachedObjectManagementListColumns.find(cachedColumn => cachedColumn.key === row.key);
|
|
670
|
-
const viewTypeItem = viewTypeItems.find(item => item.key === column.displayType.type);
|
|
671
|
-
const viewTypeItemIndex = viewTypeItems.findIndex(item => item.key === column.displayType.type);
|
|
672
|
-
const sortItem = sortItems.find(item => item.key === column.defaultSort);
|
|
673
|
-
const sortItemIndex = sortItems.findIndex(item => item.key === column.defaultSort);
|
|
674
|
-
const enumValues = (_b = (_a = column === null || column === void 0 ? void 0 : column.displayType) === null || _a === void 0 ? void 0 : _a.displayTypeParameters) === null || _b === void 0 ? void 0 : _b.enum;
|
|
675
|
-
const mappedEnumValues = [];
|
|
676
|
-
const columnDateFormat = (_d = (_c = column === null || column === void 0 ? void 0 : column.displayType) === null || _c === void 0 ? void 0 : _c.displayTypeParameters) === null || _d === void 0 ? void 0 : _d.dateFormat;
|
|
677
|
-
this.selectedViewTypeItemIndex$.next(viewTypeItemIndex);
|
|
678
|
-
if (sortItem) {
|
|
679
|
-
this.selectedSortItemIndex$.next(sortItemIndex);
|
|
680
|
-
}
|
|
681
|
-
if (enumValues) {
|
|
682
|
-
Object.keys(enumValues).forEach(key => {
|
|
683
|
-
mappedEnumValues.push({ key, value: enumValues[key] });
|
|
684
|
-
});
|
|
685
|
-
this.defaultEnumValues$.next(mappedEnumValues);
|
|
686
|
-
}
|
|
687
|
-
else {
|
|
688
|
-
this.defaultEnumValues$.next([{ key: '', value: '' }]);
|
|
689
|
-
}
|
|
690
|
-
this.formGroup.patchValue(Object.assign({ key: column.key, title: column.title, path: column.path, sortable: column.sortable,
|
|
691
|
-
// @ts-ignore
|
|
692
|
-
displayType: Object.assign({}, viewTypeItem),
|
|
693
|
-
// @ts-ignore
|
|
694
|
-
defaultSort: sortItem ? Object.assign({}, sortItem) : Object.assign({}, sortItems[0]) }, (columnDateFormat && {
|
|
695
|
-
dateFormat: columnDateFormat,
|
|
696
|
-
})));
|
|
697
|
-
this.openModal('edit');
|
|
698
|
-
});
|
|
699
|
-
}
|
|
700
|
-
updateObjectManagementListColumn(objectId, listColumn) {
|
|
701
|
-
this.disableInput();
|
|
702
|
-
this.objectManagementService
|
|
703
|
-
.putSearchListColumns(objectId, listColumn)
|
|
704
|
-
.pipe(tap(() => {
|
|
705
|
-
this.refreshObjectManagementListColumns();
|
|
706
|
-
localStorage.setItem(`list-search-${objectId}`, null);
|
|
707
|
-
}), catchError(() => {
|
|
708
|
-
this.enableInput();
|
|
709
|
-
return of(null);
|
|
710
|
-
}))
|
|
711
|
-
.subscribe();
|
|
712
|
-
}
|
|
713
|
-
addColumn() {
|
|
714
|
-
const formValue = this.formGroup.value;
|
|
715
|
-
this.objectId$
|
|
716
|
-
.pipe(take(1), switchMap(objectId => this.objectManagementService.postSearchList(objectId, this.mapFormValuesToColumn(formValue))), tap(() => {
|
|
717
|
-
this.closeModal();
|
|
718
|
-
this.refreshObjectManagementListColumns();
|
|
719
|
-
}), catchError(() => {
|
|
720
|
-
this.enableInput();
|
|
721
|
-
return of(null);
|
|
722
|
-
}))
|
|
723
|
-
.subscribe();
|
|
724
|
-
}
|
|
725
|
-
getDisplayTypeParametersView(displayTypeParameters) {
|
|
726
|
-
if (displayTypeParameters === null || displayTypeParameters === void 0 ? void 0 : displayTypeParameters.dateFormat) {
|
|
727
|
-
return displayTypeParameters.dateFormat;
|
|
728
|
-
}
|
|
729
|
-
else if (displayTypeParameters === null || displayTypeParameters === void 0 ? void 0 : displayTypeParameters.enum) {
|
|
730
|
-
return Object.keys(displayTypeParameters.enum).reduce((acc, curr) => {
|
|
731
|
-
const keyValuePairString = `${curr}: ${displayTypeParameters.enum[curr]}`;
|
|
732
|
-
if (!acc) {
|
|
733
|
-
return `${keyValuePairString}`;
|
|
734
|
-
}
|
|
735
|
-
return `${acc}, ${keyValuePairString}`;
|
|
736
|
-
}, '');
|
|
737
|
-
}
|
|
738
|
-
return '-';
|
|
739
|
-
}
|
|
740
|
-
updateColumn() {
|
|
741
|
-
this.objectId$
|
|
742
|
-
.pipe(take(1), switchMap(objectId => this.objectManagementService.putSearchList(objectId, this.formGroup.value.key, this.mapFormValuesToColumn(this.formGroup.value))), tap(() => {
|
|
743
|
-
this.closeModal();
|
|
744
|
-
this.refreshObjectManagementListColumns();
|
|
745
|
-
}), catchError(() => {
|
|
746
|
-
this.enableInput();
|
|
747
|
-
return of(null);
|
|
748
|
-
}))
|
|
749
|
-
.subscribe();
|
|
750
|
-
}
|
|
751
|
-
setDownload(objectId, ObjectManagementListColumns) {
|
|
752
|
-
this.downloadName$.next(`${objectId}.json`);
|
|
753
|
-
this.downloadUrl$.next(this.sanitizer.bypassSecurityTrustUrl('data:text/json;charset=UTF-8,' +
|
|
754
|
-
encodeURIComponent(JSON.stringify(ObjectManagementListColumns, null, 2))));
|
|
755
|
-
}
|
|
756
|
-
disableInput() {
|
|
757
|
-
this.disableInput$.next(true);
|
|
758
|
-
this.formGroup.disable();
|
|
759
|
-
}
|
|
760
|
-
enableInput() {
|
|
761
|
-
this.disableInput$.next(false);
|
|
762
|
-
this.formGroup.enable();
|
|
763
|
-
}
|
|
764
|
-
refreshObjectManagementListColumns() {
|
|
765
|
-
this.refreshObjectManagementListColumns$.next(null);
|
|
766
|
-
}
|
|
767
|
-
resetFormGroup() {
|
|
768
|
-
this.formGroup.reset();
|
|
769
|
-
combineLatest([this.sortItems$, this.viewTypeItems$])
|
|
770
|
-
.pipe(take(1))
|
|
771
|
-
.subscribe(([sortItems, viewTypeItems]) => {
|
|
772
|
-
this.defaultEnumValues$.next([{ key: '', value: '' }]);
|
|
773
|
-
this.selectedViewTypeItemIndex$.next(0);
|
|
774
|
-
// @ts-ignore
|
|
775
|
-
this.formGroup.patchValue({ displayType: viewTypeItems[0] });
|
|
776
|
-
this.selectedSortItemIndex$.next(0);
|
|
777
|
-
// @ts-ignore
|
|
778
|
-
this.formGroup.patchValue({ defaultSort: sortItems[0] });
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
mapFormValuesToColumn(formValue) {
|
|
782
|
-
var _a, _b, _c;
|
|
783
|
-
return Object.assign(Object.assign({ key: formValue.key, sortable: formValue.sortable }, (((_a = formValue.defaultSort) === null || _a === void 0 ? void 0 : _a.key) !== this.INVALID_KEY && {
|
|
784
|
-
defaultSort: (_b = formValue.defaultSort) === null || _b === void 0 ? void 0 : _b.key,
|
|
785
|
-
})), { title: formValue.title || '', path: formValue.path, displayType: {
|
|
786
|
-
type: (_c = formValue.displayType) === null || _c === void 0 ? void 0 : _c.key,
|
|
787
|
-
displayTypeParameters: Object.assign(Object.assign({}, (formValue.dateFormat && { dateFormat: formValue.dateFormat })), (Array.isArray(formValue.enum) &&
|
|
788
|
-
formValue.enum.length > 0 && {
|
|
789
|
-
enum: formValue.enum.reduce((acc, curr) => (Object.assign(Object.assign({}, acc), { [curr.key]: curr.value })), {}),
|
|
790
|
-
})),
|
|
791
|
-
} });
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
ObjectManagementListColumnsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementListColumnsComponent, deps: [{ token: ObjectManagementService }, { token: i2.ActivatedRoute }, { token: i3$1.TranslateService }, { token: i4.ConfigService }, { token: i5$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
795
|
-
ObjectManagementListColumnsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ObjectManagementListColumnsComponent, selector: "valtimo-object-management-list-columns", viewQueries: [{ propertyName: "moveRowButtonsTemplateRef", first: true, predicate: ["moveRowButtons"], 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<ng-container\n *ngIf=\"{\n listColumn: translatedObjectManagementListColumns$ | async,\n fields: objectManagementFields$ | async,\n objectId: objectId$ | async,\n downloadUrl: downloadUrl$ | async,\n downloadName: downloadName$ | async,\n loading: loading$ | async\n } as obs\"\n>\n <div class=\"container-fluid pr-0 pl-0\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3 mr-2\">\n <ng-container *ngTemplateOutlet=\"buttons; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"!obs.loading; else loading\">\n <ng-container *ngIf=\"obs.listColumn?.length > 0; else noConfigWarning\">\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"createEditModal\"></ng-container>\n <ng-container *ngTemplateOutlet=\"deleteModal\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #buttons let-obs=\"obs\">\n <a\n cdsLink\n class=\"center-link\"\n [href]=\"obs.downloadUrl\"\n [download]=\"obs.downloadName\"\n [disabled]=\"\n !obs.downloadUrl ||\n !obs.downloadName ||\n obs.listColumn?.length < 1 ||\n obs.disableInput ||\n obs.loading\n \"\n >\n {{ 'listColumn.downloadButtonText' | translate }}\n </a>\n <button\n (click)=\"openModal('create')\"\n cdsButton=\"primary\"\n size=\"md\"\n [disabled]=\"obs.loading\"\n class=\"ml-3\"\n >\n {{ 'listColumn.addButtonText' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #moveRowButtons let-index=\"index\" let-length=\"length\">\n <div\n class=\"move-row-buttons\"\n *ngIf=\"{\n disableInput: disableInput$ | async,\n objectId: objectId$ | async\n } as obs\"\n >\n <i\n class=\"mdi mdi-delete btn btn-outline-danger mr-1\"\n (click)=\"deleteRow(index, $event)\"\n [ngClass]=\"{'disabled disabled-move-row-button': obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-up-bold btn btn-outline-primary mr-1\"\n (click)=\"moveRow(index, true, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === 0 || obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-down-bold btn btn-outline-secondary\"\n (click)=\"moveRow(index, false, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === length - 1 || obs.disableInput}\"\n ></i>\n </div>\n</ng-template>\n\n<ng-template #list let-obs=\"obs\">\n <valtimo-list\n [items]=\"obs.listColumn\"\n [fields]=\"obs.fields\"\n [viewMode]=\"false\"\n [header]=\"false\"\n *ngIf=\"obs.listColumn; else loading\"\n [lastColumnTemplate]=\"moveRowButtonsTemplateRef\"\n (rowClicked)=\"columnRowClicked($event)\"\n >\n </valtimo-list>\n</ng-template>\n\n<ng-template #createEditModal>\n <cds-modal\n *ngIf=\"{\n type: currentModalType$ | async,\n show: showModal$ | async,\n valid: valid$ | async,\n disableInput: disableInput$ | async,\n validKey: validKey$ | async,\n disableDefaultSort: disableDefaultSort$ | async,\n showEnum: showEnum$ | async,\n isYesNo: isYesNo$ | async\n } as modalObs\"\n [open]=\"modalObs.show\"\n >\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{\n modalObs.type === 'create'\n ? ('listColumn.addButtonText' | translate)\n : ('listColumn.editColumnTitle' | translate)\n }}\n </h3>\n </cds-modal-header>\n <section cdsModalContent>\n <ng-container *ngTemplateOutlet=\"modalContent; context: {modalObs: modalObs}\"></ng-container>\n </section>\n <ng-container *ngTemplateOutlet=\"modalFooter; context: {modalObs: modalObs}\"></ng-container>\n </cds-modal>\n</ng-template>\n\n<ng-template #modalContent let-modalObs=\"modalObs\">\n <form [formGroup]=\"formGroup\" class=\"list-column-form\">\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.titleTitle' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.titleTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"title\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"modalObs.disableInput || modalObs.type === 'edit'\"\n [invalid]=\"modalObs.validKey === false\"\n [invalidText]=\"'listColumn.uniqueKeyWarning' | translate\"\n >\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.key' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.keyTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"key\" [invalid]=\"modalObs.validKey === false\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.path' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.objectsApiPathTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"path\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'listColumn.displayType' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.displayTypeTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown formControlName=\"displayType\" [disabled]=\"modalObs.disableInput\">\n <cds-dropdown-list [items]=\"viewTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\" *ngIf=\"showDateFormat$ | async\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.dateFormat' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.dateFormatTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"dateFormat\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\" *ngIf=\"modalObs.showEnum || modalObs.isYesNo\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{\n modalObs.isYesNo\n ? ('listColumn.enumTitleOptional' | translate)\n : ('listColumn.enumTitle' | translate)\n }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.enumTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <valtimo-carbon-multi-input\n *ngIf=\"(showModal$ | async) || (modalShowing$ | async)\"\n type=\"keyValue\"\n (valueChange)=\"enumValueChange($event)\"\n [defaultValues]=\"defaultEnumValues$ | async\"\n ></valtimo-carbon-multi-input>\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-checkbox formControlName=\"sortable\"\n >{{ 'listColumn.sortable' | translate }}\n </cds-checkbox>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput || modalObs.disableDefaultSort\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'listColumn.defaultSortTitle' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.defaultSortTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown\n formControlName=\"defaultSort\"\n [disabled]=\"modalObs.disableInput || modalObs.disableDefaultSort\"\n >\n <cds-dropdown-list [items]=\"sortItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n </form>\n</ng-template>\n\n<ng-template #modalFooter let-modalObs=\"modalObs\">\n <cds-modal-footer>\n <ng-container>\n <button\n cdsButton=\"secondary\"\n [attr.modal-primary-focus]=\"true\"\n (click)=\"closeModal()\"\n [disabled]=\"modalObs.disableInput\"\n >\n {{ 'listColumn.close' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n [disabled]=\"modalObs.valid === false\"\n (click)=\"saveCasListColumns()\"\n [disabled]=\"\n modalObs.disableInput || modalObs.valid === false || modalObs.validKey === false\n \"\n >\n {{ 'listColumn.save' | translate }}\n </button>\n </ng-container>\n </cds-modal-footer>\n</ng-template>\n\n<ng-template #deleteModal>\n <valtimo-confirmation-modal\n [showModalSubject$]=\"showDeleteModal$\"\n [outputOnConfirm]=\"deleteRowIndex$ | async\"\n (confirmEvent)=\"deleteRowConfirmation($event)\"\n confirmButtonTextTranslationKey=\"listColumn.deleteColumn\"\n titleTranslationKey=\"listColumn.deleteColumn\"\n contentTranslationKey=\"listColumn.deleteColumnConfirmation\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #noConfigWarning>\n <div class=\"pl-2 pr-2 pb-2\">\n <cds-notification\n [notificationObj]=\"{\n type: 'info',\n title: 'listColumn.noConfigWarningTitle' | translate,\n showClose: false\n }\"\n >\n </cds-notification>\n </div>\n</ng-template>\n\n<ng-template #loading>\n <div class=\"loading-icon\"><cds-loading></cds-loading></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 */::ng-deep .tab-container{min-height:unset!important}::ng-deep .cds--inline-notification{max-width:100%}.label-with-tooltip{display:flex;align-items:center}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:1rem}.display-type-dropdown{width:300px}.list-column-form{margin-bottom:3rem}.select-label{padding-bottom:.5rem;width:250px}.loading-icon{width:100%;display:flex;align-items:center;justify-content:center}.center-link{display:flex;align-items:center}::ng-deep .move-row-buttons{display:flex;flex-direction:row;justify-content:flex-end;padding-right:13px}\n"], dependencies: [{ kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i7.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState", "lastColumnTemplate"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: i8.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i8.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i8.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i5.TooltipIconComponent, selector: "v-tooltip-icon", inputs: ["tooltip", "disabled"] }, { kind: "component", type: i7.CarbonMultiInputComponent, selector: "valtimo-carbon-multi-input", inputs: ["name", "title", "titleTranslationKey", "type", "initialAmountOfRows", "minimumAmountOfRows", "maxRows", "addRowText", "addRowTranslationKey", "deleteRowText", "deleteRowTranslationKey", "disabled", "defaultValues", "margin", "tooltip", "required", "keyColumnTitle", "valueColumnTitle", "dropdownColumnTitle", "hideDeleteButton", "hideAddButton", "dropdownItems", "dropdownWidth", "fullWidth"], outputs: ["valueChange", "allValuesValidEvent"] }, { kind: "component", type: i8.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i8.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i8.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i8.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i8.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "component", type: i8.Notification, selector: "cds-notification, cds-inline-notification, ibm-notification, ibm-inline-notification", inputs: ["notificationObj"] }, { kind: "component", type: i8.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "component", type: i8.Dropdown, selector: "cds-dropdown, ibm-dropdown", inputs: ["id", "label", "helperText", "placeholder", "displayValue", "clearText", "size", "type", "theme", "disabled", "skeleton", "inline", "disableArrowKeys", "invalid", "invalidText", "warn", "warnText", "appendInline", "scrollableContainer", "itemValueKey", "selectionFeedback", "menuButtonLabel", "selectedLabel", "dropUp"], outputs: ["selected", "onClose", "close"] }, { kind: "component", type: i8.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "component", type: i8.Checkbox, selector: "cds-checkbox, ibm-checkbox", inputs: ["disabled", "skeleton", "hideLabel", "name", "id", "required", "value", "ariaLabel", "ariaLabelledby", "indeterminate", "checked"], outputs: ["click", "checkedChange", "indeterminateChange"] }, { kind: "directive", type: i8.Link, selector: "[cdsLink], [ibmLink]", inputs: ["inline", "disabled"] }, { kind: "directive", type: i8.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "directive", type: i10.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i10.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: i10.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i10.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i10.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i10.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i7.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm"], outputs: ["confirmEvent"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] });
|
|
796
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementListColumnsComponent, decorators: [{
|
|
797
|
-
type: Component,
|
|
798
|
-
args: [{ selector: 'valtimo-object-management-list-columns', 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<ng-container\n *ngIf=\"{\n listColumn: translatedObjectManagementListColumns$ | async,\n fields: objectManagementFields$ | async,\n objectId: objectId$ | async,\n downloadUrl: downloadUrl$ | async,\n downloadName: downloadName$ | async,\n loading: loading$ | async\n } as obs\"\n>\n <div class=\"container-fluid pr-0 pl-0\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3 mr-2\">\n <ng-container *ngTemplateOutlet=\"buttons; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"!obs.loading; else loading\">\n <ng-container *ngIf=\"obs.listColumn?.length > 0; else noConfigWarning\">\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"createEditModal\"></ng-container>\n <ng-container *ngTemplateOutlet=\"deleteModal\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #buttons let-obs=\"obs\">\n <a\n cdsLink\n class=\"center-link\"\n [href]=\"obs.downloadUrl\"\n [download]=\"obs.downloadName\"\n [disabled]=\"\n !obs.downloadUrl ||\n !obs.downloadName ||\n obs.listColumn?.length < 1 ||\n obs.disableInput ||\n obs.loading\n \"\n >\n {{ 'listColumn.downloadButtonText' | translate }}\n </a>\n <button\n (click)=\"openModal('create')\"\n cdsButton=\"primary\"\n size=\"md\"\n [disabled]=\"obs.loading\"\n class=\"ml-3\"\n >\n {{ 'listColumn.addButtonText' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #moveRowButtons let-index=\"index\" let-length=\"length\">\n <div\n class=\"move-row-buttons\"\n *ngIf=\"{\n disableInput: disableInput$ | async,\n objectId: objectId$ | async\n } as obs\"\n >\n <i\n class=\"mdi mdi-delete btn btn-outline-danger mr-1\"\n (click)=\"deleteRow(index, $event)\"\n [ngClass]=\"{'disabled disabled-move-row-button': obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-up-bold btn btn-outline-primary mr-1\"\n (click)=\"moveRow(index, true, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === 0 || obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-down-bold btn btn-outline-secondary\"\n (click)=\"moveRow(index, false, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === length - 1 || obs.disableInput}\"\n ></i>\n </div>\n</ng-template>\n\n<ng-template #list let-obs=\"obs\">\n <valtimo-list\n [items]=\"obs.listColumn\"\n [fields]=\"obs.fields\"\n [viewMode]=\"false\"\n [header]=\"false\"\n *ngIf=\"obs.listColumn; else loading\"\n [lastColumnTemplate]=\"moveRowButtonsTemplateRef\"\n (rowClicked)=\"columnRowClicked($event)\"\n >\n </valtimo-list>\n</ng-template>\n\n<ng-template #createEditModal>\n <cds-modal\n *ngIf=\"{\n type: currentModalType$ | async,\n show: showModal$ | async,\n valid: valid$ | async,\n disableInput: disableInput$ | async,\n validKey: validKey$ | async,\n disableDefaultSort: disableDefaultSort$ | async,\n showEnum: showEnum$ | async,\n isYesNo: isYesNo$ | async\n } as modalObs\"\n [open]=\"modalObs.show\"\n >\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{\n modalObs.type === 'create'\n ? ('listColumn.addButtonText' | translate)\n : ('listColumn.editColumnTitle' | translate)\n }}\n </h3>\n </cds-modal-header>\n <section cdsModalContent>\n <ng-container *ngTemplateOutlet=\"modalContent; context: {modalObs: modalObs}\"></ng-container>\n </section>\n <ng-container *ngTemplateOutlet=\"modalFooter; context: {modalObs: modalObs}\"></ng-container>\n </cds-modal>\n</ng-template>\n\n<ng-template #modalContent let-modalObs=\"modalObs\">\n <form [formGroup]=\"formGroup\" class=\"list-column-form\">\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.titleTitle' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.titleTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"title\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"modalObs.disableInput || modalObs.type === 'edit'\"\n [invalid]=\"modalObs.validKey === false\"\n [invalidText]=\"'listColumn.uniqueKeyWarning' | translate\"\n >\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.key' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.keyTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"key\" [invalid]=\"modalObs.validKey === false\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.path' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.objectsApiPathTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"path\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'listColumn.displayType' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.displayTypeTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown formControlName=\"displayType\" [disabled]=\"modalObs.disableInput\">\n <cds-dropdown-list [items]=\"viewTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\" *ngIf=\"showDateFormat$ | async\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.dateFormat' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.dateFormatTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"dateFormat\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\" *ngIf=\"modalObs.showEnum || modalObs.isYesNo\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{\n modalObs.isYesNo\n ? ('listColumn.enumTitleOptional' | translate)\n : ('listColumn.enumTitle' | translate)\n }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.enumTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <valtimo-carbon-multi-input\n *ngIf=\"(showModal$ | async) || (modalShowing$ | async)\"\n type=\"keyValue\"\n (valueChange)=\"enumValueChange($event)\"\n [defaultValues]=\"defaultEnumValues$ | async\"\n ></valtimo-carbon-multi-input>\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-checkbox formControlName=\"sortable\"\n >{{ 'listColumn.sortable' | translate }}\n </cds-checkbox>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput || modalObs.disableDefaultSort\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'listColumn.defaultSortTitle' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.defaultSortTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown\n formControlName=\"defaultSort\"\n [disabled]=\"modalObs.disableInput || modalObs.disableDefaultSort\"\n >\n <cds-dropdown-list [items]=\"sortItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n </form>\n</ng-template>\n\n<ng-template #modalFooter let-modalObs=\"modalObs\">\n <cds-modal-footer>\n <ng-container>\n <button\n cdsButton=\"secondary\"\n [attr.modal-primary-focus]=\"true\"\n (click)=\"closeModal()\"\n [disabled]=\"modalObs.disableInput\"\n >\n {{ 'listColumn.close' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n [disabled]=\"modalObs.valid === false\"\n (click)=\"saveCasListColumns()\"\n [disabled]=\"\n modalObs.disableInput || modalObs.valid === false || modalObs.validKey === false\n \"\n >\n {{ 'listColumn.save' | translate }}\n </button>\n </ng-container>\n </cds-modal-footer>\n</ng-template>\n\n<ng-template #deleteModal>\n <valtimo-confirmation-modal\n [showModalSubject$]=\"showDeleteModal$\"\n [outputOnConfirm]=\"deleteRowIndex$ | async\"\n (confirmEvent)=\"deleteRowConfirmation($event)\"\n confirmButtonTextTranslationKey=\"listColumn.deleteColumn\"\n titleTranslationKey=\"listColumn.deleteColumn\"\n contentTranslationKey=\"listColumn.deleteColumnConfirmation\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #noConfigWarning>\n <div class=\"pl-2 pr-2 pb-2\">\n <cds-notification\n [notificationObj]=\"{\n type: 'info',\n title: 'listColumn.noConfigWarningTitle' | translate,\n showClose: false\n }\"\n >\n </cds-notification>\n </div>\n</ng-template>\n\n<ng-template #loading>\n <div class=\"loading-icon\"><cds-loading></cds-loading></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 */::ng-deep .tab-container{min-height:unset!important}::ng-deep .cds--inline-notification{max-width:100%}.label-with-tooltip{display:flex;align-items:center}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:1rem}.display-type-dropdown{width:300px}.list-column-form{margin-bottom:3rem}.select-label{padding-bottom:.5rem;width:250px}.loading-icon{width:100%;display:flex;align-items:center;justify-content:center}.center-link{display:flex;align-items:center}::ng-deep .move-row-buttons{display:flex;flex-direction:row;justify-content:flex-end;padding-right:13px}\n"] }]
|
|
799
|
-
}], ctorParameters: function () { return [{ type: ObjectManagementService }, { type: i2.ActivatedRoute }, { type: i3$1.TranslateService }, { type: i4.ConfigService }, { type: i5$1.DomSanitizer }]; }, propDecorators: { moveRowButtonsTemplateRef: [{
|
|
800
|
-
type: ViewChild,
|
|
801
|
-
args: ['moveRowButtons']
|
|
802
|
-
}] } });
|
|
803
|
-
|
|
804
|
-
/*
|
|
805
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
806
|
-
*
|
|
807
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
808
|
-
* you may not use this file except in compliance with the License.
|
|
809
|
-
* You may obtain a copy of the License at
|
|
810
|
-
*
|
|
811
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
812
|
-
*
|
|
813
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
814
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
815
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
816
|
-
* See the License for the specific language governing permissions and
|
|
817
|
-
* limitations under the License.
|
|
818
|
-
*/
|
|
819
|
-
class ObjectManagementListSearchFieldsComponent {
|
|
820
|
-
constructor(objectManagementService, route, translateService, configService, sanitizer) {
|
|
821
|
-
this.objectManagementService = objectManagementService;
|
|
822
|
-
this.route = route;
|
|
823
|
-
this.translateService = translateService;
|
|
824
|
-
this.configService = configService;
|
|
825
|
-
this.sanitizer = sanitizer;
|
|
826
|
-
this.downloadName$ = new BehaviorSubject('');
|
|
827
|
-
this.downloadUrl$ = new BehaviorSubject(undefined);
|
|
828
|
-
this.loading$ = new BehaviorSubject(true);
|
|
829
|
-
this.currentModalType$ = new BehaviorSubject('create');
|
|
830
|
-
this.showModal$ = new BehaviorSubject(false);
|
|
831
|
-
this.disableInput$ = new BehaviorSubject(false);
|
|
832
|
-
this.showDeleteModal$ = new Subject();
|
|
833
|
-
this.deleteRowIndex$ = new BehaviorSubject(0);
|
|
834
|
-
this.INVALID_KEY = 'invalid';
|
|
835
|
-
this.formGroup = new FormGroup({
|
|
836
|
-
title: new FormControl(''),
|
|
837
|
-
key: new FormControl('', Validators.required),
|
|
838
|
-
path: new FormControl('', Validators.required),
|
|
839
|
-
dataType: new FormControl({
|
|
840
|
-
key: this.INVALID_KEY,
|
|
841
|
-
}),
|
|
842
|
-
fieldType: new FormControl({
|
|
843
|
-
key: this.INVALID_KEY,
|
|
844
|
-
}),
|
|
845
|
-
});
|
|
846
|
-
this.COLUMNS = [
|
|
847
|
-
{
|
|
848
|
-
viewType: 'string',
|
|
849
|
-
sortable: false,
|
|
850
|
-
propertyName: 'title',
|
|
851
|
-
translationKey: 'title',
|
|
852
|
-
},
|
|
853
|
-
{
|
|
854
|
-
viewType: 'string',
|
|
855
|
-
sortable: false,
|
|
856
|
-
propertyName: 'key',
|
|
857
|
-
translationKey: 'key',
|
|
858
|
-
},
|
|
859
|
-
{
|
|
860
|
-
viewType: 'string',
|
|
861
|
-
sortable: false,
|
|
862
|
-
propertyName: 'path',
|
|
863
|
-
translationKey: 'path',
|
|
864
|
-
},
|
|
865
|
-
{
|
|
866
|
-
viewType: 'string',
|
|
867
|
-
sortable: false,
|
|
868
|
-
propertyName: 'dataType',
|
|
869
|
-
translationKey: 'dataType',
|
|
870
|
-
},
|
|
871
|
-
{
|
|
872
|
-
viewType: 'string',
|
|
873
|
-
sortable: false,
|
|
874
|
-
propertyName: 'fieldType',
|
|
875
|
-
translationKey: 'fieldType',
|
|
876
|
-
},
|
|
877
|
-
];
|
|
878
|
-
this.DATA_TYPES = [
|
|
879
|
-
'text',
|
|
880
|
-
'number',
|
|
881
|
-
'date',
|
|
882
|
-
'datetime',
|
|
883
|
-
'boolean',
|
|
884
|
-
];
|
|
885
|
-
this.FIELD_TYPES = ['single', 'range'];
|
|
886
|
-
this.cachedObjectManagementListSearchFields = [];
|
|
887
|
-
this.refreshObjectManagementListSearchFields$ = new BehaviorSubject(null);
|
|
888
|
-
this.objectManagementFields$ = this.translateService
|
|
889
|
-
.stream('key')
|
|
890
|
-
.pipe(map(() => this.COLUMNS.map(column => (Object.assign({ key: column.propertyName, label: this.translateService.instant(`searchFieldsOverview.${column.translationKey}`), sortable: column.sortable }, (column.viewType && { viewType: column.viewType }))))));
|
|
891
|
-
this.objectId$ = this.route.params.pipe(map(params => params.id || ''), filter(objectId => !!objectId));
|
|
892
|
-
this.objectManagementListSearchFields$ = combineLatest([
|
|
893
|
-
this.objectId$,
|
|
894
|
-
this.refreshObjectManagementListSearchFields$,
|
|
895
|
-
]).pipe(switchMap(([objectId]) => this.objectManagementService.getSearchField(objectId)), tap(objectManagementListSearchFields => {
|
|
896
|
-
this.objectId$.pipe(take(1)).subscribe(objectId => {
|
|
897
|
-
if (objectManagementListSearchFields &&
|
|
898
|
-
Array.isArray(objectManagementListSearchFields) &&
|
|
899
|
-
objectManagementListSearchFields.length > 0) {
|
|
900
|
-
this.setDownload(objectId, objectManagementListSearchFields);
|
|
901
|
-
}
|
|
902
|
-
});
|
|
903
|
-
}), tap(objectManagementListSearchFields => {
|
|
904
|
-
this.cachedObjectManagementListSearchFields = objectManagementListSearchFields;
|
|
905
|
-
this.loading$.next(false);
|
|
906
|
-
this.enableInput();
|
|
907
|
-
}));
|
|
908
|
-
this.translatedObjectManagementListSearchFields$ = combineLatest([
|
|
909
|
-
this.objectManagementListSearchFields$,
|
|
910
|
-
this.translateService.stream('key'),
|
|
911
|
-
]).pipe(map(([columns]) => columns.map(column => {
|
|
912
|
-
var _a, _b;
|
|
913
|
-
return (Object.assign(Object.assign({}, column), { title: column.title || '-', dataType: this.translateService.instant(`searchFields.${(_a = column === null || column === void 0 ? void 0 : column.dataType) === null || _a === void 0 ? void 0 : _a.toLowerCase()}`), fieldType: this.translateService.instant(`searchFieldsOverview.${(_b = column === null || column === void 0 ? void 0 : column.fieldType) === null || _b === void 0 ? void 0 : _b.toLowerCase()}`) }));
|
|
914
|
-
})));
|
|
915
|
-
this.selectedDataTypeItemIndex$ = new BehaviorSubject(0);
|
|
916
|
-
this.dataTypeItems$ = combineLatest([
|
|
917
|
-
this.selectedDataTypeItemIndex$,
|
|
918
|
-
this.translateService.stream('key'),
|
|
919
|
-
]).pipe(map(([selectedDataTypeItemIndex]) => [
|
|
920
|
-
{
|
|
921
|
-
content: this.translateService.instant(`searchFieldDataType.select`),
|
|
922
|
-
key: this.INVALID_KEY,
|
|
923
|
-
},
|
|
924
|
-
...this.DATA_TYPES.map(type => ({
|
|
925
|
-
content: this.translateService.instant(`searchFields.${type}`),
|
|
926
|
-
key: type.toUpperCase(),
|
|
927
|
-
})),
|
|
928
|
-
].map((item, index) => (Object.assign(Object.assign({}, item), { selected: index === selectedDataTypeItemIndex })))));
|
|
929
|
-
this.selectedFieldTypeItemIndex$ = new BehaviorSubject(0);
|
|
930
|
-
this.fieldTypeItems$ = combineLatest([
|
|
931
|
-
this.selectedFieldTypeItemIndex$,
|
|
932
|
-
this.translateService.stream('key'),
|
|
933
|
-
]).pipe(map(([selectedFieldTypeItemIndex]) => [
|
|
934
|
-
{
|
|
935
|
-
content: this.translateService.instant(`searchFieldFieldType.select`),
|
|
936
|
-
key: this.INVALID_KEY,
|
|
937
|
-
},
|
|
938
|
-
...this.FIELD_TYPES.map(type => ({
|
|
939
|
-
content: this.translateService.instant(`searchFieldsOverview.${type}`),
|
|
940
|
-
key: type.toUpperCase(),
|
|
941
|
-
})),
|
|
942
|
-
].map((item, index) => (Object.assign(Object.assign({}, item), { selected: index === selectedFieldTypeItemIndex })))));
|
|
943
|
-
this.validKey$ = combineLatest([this.formGroup.valueChanges, this.currentModalType$]).pipe(map(([formValues, currentModalType]) => {
|
|
944
|
-
const existingKeys = this.cachedObjectManagementListSearchFields.map(column => column.key);
|
|
945
|
-
return currentModalType === 'create' ? !existingKeys.includes(formValues.key) : true;
|
|
946
|
-
}), startWith(false));
|
|
947
|
-
this.valid$ = combineLatest([this.formGroup.valueChanges, this.validKey$]).pipe(map(([formValues, validKey]) => !!(formValues.path && validKey)), startWith(false));
|
|
948
|
-
}
|
|
949
|
-
openModal(modalType) {
|
|
950
|
-
this.showModal$.next(true);
|
|
951
|
-
this.currentModalType$.next(modalType);
|
|
952
|
-
if (modalType === 'create') {
|
|
953
|
-
this.formGroup.controls['key'].enable();
|
|
954
|
-
this.resetFormGroup();
|
|
955
|
-
}
|
|
956
|
-
else if (modalType === 'edit') {
|
|
957
|
-
this.formGroup.controls['key'].disable();
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
closeModal() {
|
|
961
|
-
this.showModal$.next(false);
|
|
962
|
-
}
|
|
963
|
-
deleteRow(listSearchFieldRowIndex, clickEvent) {
|
|
964
|
-
clickEvent.stopPropagation();
|
|
965
|
-
this.showDeleteModal$.next(true);
|
|
966
|
-
this.deleteRowIndex$.next(listSearchFieldRowIndex);
|
|
967
|
-
}
|
|
968
|
-
deleteRowConfirmation(listSearchFieldRowIndex) {
|
|
969
|
-
const columnKey = this.getColumnKey(listSearchFieldRowIndex);
|
|
970
|
-
if (columnKey) {
|
|
971
|
-
this.disableInput();
|
|
972
|
-
this.objectId$
|
|
973
|
-
.pipe(take(1), switchMap(objectId => this.objectManagementService.deleteSearchField(objectId, columnKey)), tap(() => this.refreshObjectManagementListSearchFields()), catchError(() => {
|
|
974
|
-
this.enableInput();
|
|
975
|
-
return of(null);
|
|
976
|
-
}))
|
|
977
|
-
.subscribe();
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
getColumnKey(listSearchFieldRowIndex) {
|
|
981
|
-
var _a;
|
|
982
|
-
return (_a = this.cachedObjectManagementListSearchFields[listSearchFieldRowIndex]) === null || _a === void 0 ? void 0 : _a.key;
|
|
983
|
-
}
|
|
984
|
-
moveRow(listSearchFieldRowIndex, moveUp, clickEvent, objectId) {
|
|
985
|
-
const objectManagementListSearchFields = [...this.cachedObjectManagementListSearchFields];
|
|
986
|
-
const listSearchFieldRow = objectManagementListSearchFields[listSearchFieldRowIndex];
|
|
987
|
-
clickEvent.stopPropagation();
|
|
988
|
-
const listSearchFieldIndex = objectManagementListSearchFields.findIndex(field => field.key === listSearchFieldRow.key);
|
|
989
|
-
const foundListSearchField = Object.assign({}, objectManagementListSearchFields[listSearchFieldIndex]);
|
|
990
|
-
const filteredListSearchField = objectManagementListSearchFields.filter(field => field.key !== listSearchFieldRow.key);
|
|
991
|
-
const multipleListSearchFields = objectManagementListSearchFields.length > 1;
|
|
992
|
-
if (multipleListSearchFields && moveUp && listSearchFieldIndex > 0) {
|
|
993
|
-
const listSearchFieldBeforeKey = `${objectManagementListSearchFields[listSearchFieldIndex - 1].key}`;
|
|
994
|
-
const listSearchFieldBeforeIndex = filteredListSearchField.findIndex(field => field.key === listSearchFieldBeforeKey);
|
|
995
|
-
filteredListSearchField.splice(listSearchFieldBeforeIndex, 0, foundListSearchField);
|
|
996
|
-
this.updateObjectManagementListSearchField(objectId, filteredListSearchField);
|
|
997
|
-
}
|
|
998
|
-
else if (multipleListSearchFields &&
|
|
999
|
-
!moveUp &&
|
|
1000
|
-
listSearchFieldIndex < objectManagementListSearchFields.length) {
|
|
1001
|
-
const caseListColumnAfterKey = `${objectManagementListSearchFields[listSearchFieldIndex + 1].key}`;
|
|
1002
|
-
const caseListColumnAfterIndex = filteredListSearchField.findIndex(field => field.key === caseListColumnAfterKey);
|
|
1003
|
-
filteredListSearchField.splice(caseListColumnAfterIndex + 1, 0, foundListSearchField);
|
|
1004
|
-
this.updateObjectManagementListSearchField(objectId, filteredListSearchField);
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
saveListSearchFields() {
|
|
1008
|
-
this.disableInput();
|
|
1009
|
-
this.currentModalType$.pipe(take(1)).subscribe(currentModalType => {
|
|
1010
|
-
if (currentModalType === 'create') {
|
|
1011
|
-
this.addSearchField();
|
|
1012
|
-
}
|
|
1013
|
-
else {
|
|
1014
|
-
this.updateSearchField();
|
|
1015
|
-
}
|
|
1016
|
-
});
|
|
1017
|
-
}
|
|
1018
|
-
columnRowClicked(row) {
|
|
1019
|
-
this.resetFormGroup();
|
|
1020
|
-
combineLatest([this.dataTypeItems$, this.fieldTypeItems$])
|
|
1021
|
-
.pipe(take(1))
|
|
1022
|
-
.subscribe(([dataTypeItems, fieldTypeItems]) => {
|
|
1023
|
-
const column = this.cachedObjectManagementListSearchFields.find(cachedColumn => cachedColumn.key === row.key);
|
|
1024
|
-
const dataTypeItem = dataTypeItems.find(item => item.key === column.dataType);
|
|
1025
|
-
const dataTypeItemIndex = dataTypeItems.findIndex(item => item.key === column.dataType);
|
|
1026
|
-
const fieldTypeItem = fieldTypeItems.find(item => item.key === column.fieldType);
|
|
1027
|
-
const fieldTypeItemIndex = fieldTypeItems.findIndex(item => item.key === column.fieldType);
|
|
1028
|
-
this.selectedDataTypeItemIndex$.next(dataTypeItemIndex);
|
|
1029
|
-
this.selectedFieldTypeItemIndex$.next(fieldTypeItemIndex);
|
|
1030
|
-
this.formGroup.patchValue({
|
|
1031
|
-
key: column.key,
|
|
1032
|
-
title: column.title,
|
|
1033
|
-
path: column.path,
|
|
1034
|
-
// @ts-ignore
|
|
1035
|
-
dataType: Object.assign({}, dataTypeItem),
|
|
1036
|
-
// @ts-ignore
|
|
1037
|
-
fieldType: Object.assign({}, fieldTypeItem),
|
|
1038
|
-
});
|
|
1039
|
-
this.openModal('edit');
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
1042
|
-
updateObjectManagementListSearchField(objectId, searchField) {
|
|
1043
|
-
this.disableInput();
|
|
1044
|
-
this.objectManagementService
|
|
1045
|
-
.putSearchFields(objectId, searchField)
|
|
1046
|
-
.pipe(tap(() => {
|
|
1047
|
-
this.refreshObjectManagementListSearchFields();
|
|
1048
|
-
localStorage.setItem(`list-search-fields${objectId}`, null);
|
|
1049
|
-
}), catchError(() => {
|
|
1050
|
-
this.enableInput();
|
|
1051
|
-
return of(null);
|
|
1052
|
-
}))
|
|
1053
|
-
.subscribe();
|
|
1054
|
-
}
|
|
1055
|
-
addSearchField() {
|
|
1056
|
-
const formValue = this.formGroup.value;
|
|
1057
|
-
this.objectId$
|
|
1058
|
-
.pipe(take(1), switchMap(objectId => this.objectManagementService.postSearchField(objectId, this.mapFormValuesToColumn(formValue))), tap(() => {
|
|
1059
|
-
this.closeModal();
|
|
1060
|
-
this.refreshObjectManagementListSearchFields();
|
|
1061
|
-
}), catchError(() => {
|
|
1062
|
-
this.enableInput();
|
|
1063
|
-
return of(null);
|
|
1064
|
-
}))
|
|
1065
|
-
.subscribe();
|
|
1066
|
-
}
|
|
1067
|
-
updateSearchField() {
|
|
1068
|
-
this.objectId$
|
|
1069
|
-
.pipe(take(1), switchMap(objectId => this.objectManagementService.putSearchField(objectId, this.formGroup.value.key, this.mapFormValuesToColumn(this.formGroup.value))), tap(() => {
|
|
1070
|
-
this.closeModal();
|
|
1071
|
-
this.refreshObjectManagementListSearchFields();
|
|
1072
|
-
}), catchError(() => {
|
|
1073
|
-
this.enableInput();
|
|
1074
|
-
return of(null);
|
|
1075
|
-
}))
|
|
1076
|
-
.subscribe();
|
|
1077
|
-
}
|
|
1078
|
-
setDownload(objectId, ObjectManagementSearchFields) {
|
|
1079
|
-
this.downloadName$.next(`${objectId}.json`);
|
|
1080
|
-
this.downloadUrl$.next(this.sanitizer.bypassSecurityTrustUrl('data:text/json;charset=UTF-8,' +
|
|
1081
|
-
encodeURIComponent(JSON.stringify(ObjectManagementSearchFields, null, 2))));
|
|
1082
|
-
}
|
|
1083
|
-
disableInput() {
|
|
1084
|
-
this.disableInput$.next(true);
|
|
1085
|
-
this.formGroup.disable();
|
|
1086
|
-
}
|
|
1087
|
-
enableInput() {
|
|
1088
|
-
this.disableInput$.next(false);
|
|
1089
|
-
this.formGroup.enable();
|
|
1090
|
-
}
|
|
1091
|
-
refreshObjectManagementListSearchFields() {
|
|
1092
|
-
this.refreshObjectManagementListSearchFields$.next(null);
|
|
1093
|
-
}
|
|
1094
|
-
resetFormGroup() {
|
|
1095
|
-
this.formGroup.reset();
|
|
1096
|
-
this.selectedDataTypeItemIndex$.next(0);
|
|
1097
|
-
this.selectedFieldTypeItemIndex$.next(0);
|
|
1098
|
-
}
|
|
1099
|
-
mapFormValuesToColumn(formValue) {
|
|
1100
|
-
return {
|
|
1101
|
-
key: formValue.key,
|
|
1102
|
-
title: formValue.title || '',
|
|
1103
|
-
path: formValue.path,
|
|
1104
|
-
dataType: formValue.dataType.key,
|
|
1105
|
-
fieldType: formValue.fieldType.key,
|
|
1106
|
-
};
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
ObjectManagementListSearchFieldsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementListSearchFieldsComponent, deps: [{ token: ObjectManagementService }, { token: i2.ActivatedRoute }, { token: i3$1.TranslateService }, { token: i4.ConfigService }, { token: i5$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
1110
|
-
ObjectManagementListSearchFieldsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ObjectManagementListSearchFieldsComponent, selector: "valtimo-object-management-list-search-fields", viewQueries: [{ propertyName: "moveRowButtonsTemplateRef", first: true, predicate: ["moveRowButtons"], 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<ng-container\n *ngIf=\"{\n searchFields: translatedObjectManagementListSearchFields$ | async,\n fields: objectManagementFields$ | async,\n objectId: objectId$ | async,\n downloadUrl: downloadUrl$ | async,\n downloadName: downloadName$ | async,\n loading: loading$ | async\n } as obs\"\n>\n <div class=\"container-fluid pr-0 pl-0\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3 mr-2\">\n <ng-container *ngTemplateOutlet=\"buttons; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"!obs.loading; else loading\">\n <ng-container *ngIf=\"obs.searchFields?.length > 0; else noConfigWarning\">\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"createEditModal\"></ng-container>\n <ng-container *ngTemplateOutlet=\"deleteModal\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #buttons let-obs=\"obs\">\n <a\n cdsLink\n class=\"center-link\"\n [href]=\"obs.downloadUrl\"\n [download]=\"obs.downloadName\"\n [disabled]=\"\n !obs.downloadUrl ||\n !obs.downloadName ||\n obs.searchFields?.length < 1 ||\n obs.disableInput ||\n obs.loading\n \"\n >\n {{ 'searchFieldsOverview.download' | translate }}\n </a>\n <button\n (click)=\"openModal('create')\"\n cdsButton=\"primary\"\n size=\"md\"\n [disabled]=\"obs.loading\"\n class=\"ml-3\"\n >\n {{ 'searchFieldsOverview.add' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #moveRowButtons let-index=\"index\" let-length=\"length\">\n <div\n class=\"move-row-buttons\"\n *ngIf=\"{\n disableInput: disableInput$ | async,\n objectId: objectId$ | async\n } as obs\"\n >\n <i\n class=\"mdi mdi-delete btn btn-outline-danger mr-1\"\n (click)=\"deleteRow(index, $event)\"\n [ngClass]=\"{'disabled disabled-move-row-button': obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-up-bold btn btn-outline-primary mr-1\"\n (click)=\"moveRow(index, true, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === 0 || obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-down-bold btn btn-outline-secondary\"\n (click)=\"moveRow(index, false, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === length - 1 || obs.disableInput}\"\n ></i>\n </div>\n</ng-template>\n\n<ng-template #list let-obs=\"obs\">\n <valtimo-list\n [items]=\"obs.searchFields\"\n [fields]=\"obs.fields\"\n [viewMode]=\"false\"\n [header]=\"false\"\n *ngIf=\"obs.searchFields; else loading\"\n [lastColumnTemplate]=\"moveRowButtonsTemplateRef\"\n (rowClicked)=\"columnRowClicked($event)\"\n >\n </valtimo-list>\n</ng-template>\n\n<ng-template #createEditModal>\n <cds-modal\n valtimoCdsModal\n *ngIf=\"{\n type: currentModalType$ | async,\n show: showModal$ | async,\n valid: valid$ | async,\n disableInput: disableInput$ | async,\n validKey: validKey$ | async\n } as modalObs\"\n [open]=\"modalObs.show\"\n >\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{\n modalObs.type === 'create'\n ? ('searchFieldsOverview.add' | translate)\n : ('searchFieldsOverview.edit' | translate)\n }}\n </h3>\n </cds-modal-header>\n <section cdsModalContent>\n <ng-container *ngTemplateOutlet=\"modalContent; context: {modalObs: modalObs}\"></ng-container>\n </section>\n <ng-container *ngTemplateOutlet=\"modalFooter; context: {modalObs: modalObs}\"></ng-container>\n </cds-modal>\n</ng-template>\n\n<ng-template #modalContent let-modalObs=\"modalObs\">\n <form [formGroup]=\"formGroup\" class=\"list-column-form\">\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'searchFieldsOverview.title' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.title' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"title\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"modalObs.disableInput || modalObs.type === 'edit'\"\n [invalid]=\"modalObs.validKey === false\"\n [invalidText]=\"'searchFieldsOverview.uniqueKeyWarning' | translate\"\n >\n <span class=\"label-with-tooltip\">\n {{ 'searchFieldsOverview.key' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.key' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"key\" [invalid]=\"modalObs.validKey === false\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'searchFieldsOverview.path' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.objectsApiPath' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"path\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'searchFieldsOverview.dataType' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.dataType' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown formControlName=\"dataType\" [disabled]=\"modalObs.disableInput\">\n <cds-dropdown-list [items]=\"dataTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'searchFieldsOverview.fieldType' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.fieldType' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown formControlName=\"fieldType\" [disabled]=\"modalObs.disableInput\">\n <cds-dropdown-list [items]=\"fieldTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n </form>\n</ng-template>\n\n<ng-template #modalFooter let-modalObs=\"modalObs\">\n <cds-modal-footer>\n <ng-container>\n <button\n cdsButton=\"secondary\"\n [attr.modal-primary-focus]=\"true\"\n (click)=\"closeModal()\"\n [disabled]=\"modalObs.disableInput\"\n >\n {{ 'searchFieldsOverview.close' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n [disabled]=\"modalObs.valid === false\"\n (click)=\"saveListSearchFields()\"\n [disabled]=\"\n modalObs.disableInput || modalObs.valid === false || modalObs.validKey === false\n \"\n >\n {{ 'searchFieldsOverview.save' | translate }}\n </button>\n </ng-container>\n </cds-modal-footer>\n</ng-template>\n\n<ng-template #deleteModal>\n <valtimo-confirmation-modal\n [showModalSubject$]=\"showDeleteModal$\"\n [outputOnConfirm]=\"deleteRowIndex$ | async\"\n (confirmEvent)=\"deleteRowConfirmation($event)\"\n confirmButtonTextTranslationKey=\"searchFieldsOverview.deleteSearchField\"\n titleTranslationKey=\"searchFieldsOverview.searchField\"\n contentTranslationKey=\"searchFieldsOverview.deleteSearchFieldConfirmation\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #noConfigWarning>\n <div class=\"pl-2 pr-2 pb-2\">\n <cds-notification\n [notificationObj]=\"{\n type: 'info',\n title: 'searchFieldsOverview.noSearchFieldsConfiguredWarningTitle' | translate,\n showClose: false\n }\"\n >\n </cds-notification>\n </div>\n</ng-template>\n\n<ng-template #loading>\n <div class=\"loading-icon\"><cds-loading></cds-loading></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 */::ng-deep .tab-container{min-height:unset!important}::ng-deep .cds--inline-notification{max-width:100%}.label-with-tooltip{display:flex;align-items:center}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:1rem}.display-type-dropdown{width:300px}.list-column-form{margin-bottom:3rem}.select-label{padding-bottom:.5rem;width:250px}.loading-icon{width:100%;display:flex;align-items:center;justify-content:center}.center-link{display:flex;align-items:center}::ng-deep .move-row-buttons{display:flex;flex-direction:row;justify-content:flex-end;padding-right:13px}\n"], dependencies: [{ kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i7.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState", "lastColumnTemplate"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: i8.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i8.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i8.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i5.TooltipIconComponent, selector: "v-tooltip-icon", inputs: ["tooltip", "disabled"] }, { kind: "component", type: i8.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i8.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i8.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i8.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i8.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "component", type: i8.Notification, selector: "cds-notification, cds-inline-notification, ibm-notification, ibm-inline-notification", inputs: ["notificationObj"] }, { kind: "component", type: i8.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "component", type: i8.Dropdown, selector: "cds-dropdown, ibm-dropdown", inputs: ["id", "label", "helperText", "placeholder", "displayValue", "clearText", "size", "type", "theme", "disabled", "skeleton", "inline", "disableArrowKeys", "invalid", "invalidText", "warn", "warnText", "appendInline", "scrollableContainer", "itemValueKey", "selectionFeedback", "menuButtonLabel", "selectedLabel", "dropUp"], outputs: ["selected", "onClose", "close"] }, { kind: "component", type: i8.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "directive", type: i8.Link, selector: "[cdsLink], [ibmLink]", inputs: ["inline", "disabled"] }, { kind: "directive", type: i8.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "directive", type: i10.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i10.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: i10.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i10.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i10.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i10.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i7.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm"], outputs: ["confirmEvent"] }, { kind: "directive", type: i7.ValtimoCdsModalDirective, selector: "[valtimoCdsModal]" }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] });
|
|
1111
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementListSearchFieldsComponent, decorators: [{
|
|
1112
|
-
type: Component,
|
|
1113
|
-
args: [{ selector: 'valtimo-object-management-list-search-fields', 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<ng-container\n *ngIf=\"{\n searchFields: translatedObjectManagementListSearchFields$ | async,\n fields: objectManagementFields$ | async,\n objectId: objectId$ | async,\n downloadUrl: downloadUrl$ | async,\n downloadName: downloadName$ | async,\n loading: loading$ | async\n } as obs\"\n>\n <div class=\"container-fluid pr-0 pl-0\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3 mr-2\">\n <ng-container *ngTemplateOutlet=\"buttons; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"!obs.loading; else loading\">\n <ng-container *ngIf=\"obs.searchFields?.length > 0; else noConfigWarning\">\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"createEditModal\"></ng-container>\n <ng-container *ngTemplateOutlet=\"deleteModal\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #buttons let-obs=\"obs\">\n <a\n cdsLink\n class=\"center-link\"\n [href]=\"obs.downloadUrl\"\n [download]=\"obs.downloadName\"\n [disabled]=\"\n !obs.downloadUrl ||\n !obs.downloadName ||\n obs.searchFields?.length < 1 ||\n obs.disableInput ||\n obs.loading\n \"\n >\n {{ 'searchFieldsOverview.download' | translate }}\n </a>\n <button\n (click)=\"openModal('create')\"\n cdsButton=\"primary\"\n size=\"md\"\n [disabled]=\"obs.loading\"\n class=\"ml-3\"\n >\n {{ 'searchFieldsOverview.add' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #moveRowButtons let-index=\"index\" let-length=\"length\">\n <div\n class=\"move-row-buttons\"\n *ngIf=\"{\n disableInput: disableInput$ | async,\n objectId: objectId$ | async\n } as obs\"\n >\n <i\n class=\"mdi mdi-delete btn btn-outline-danger mr-1\"\n (click)=\"deleteRow(index, $event)\"\n [ngClass]=\"{'disabled disabled-move-row-button': obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-up-bold btn btn-outline-primary mr-1\"\n (click)=\"moveRow(index, true, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === 0 || obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-down-bold btn btn-outline-secondary\"\n (click)=\"moveRow(index, false, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === length - 1 || obs.disableInput}\"\n ></i>\n </div>\n</ng-template>\n\n<ng-template #list let-obs=\"obs\">\n <valtimo-list\n [items]=\"obs.searchFields\"\n [fields]=\"obs.fields\"\n [viewMode]=\"false\"\n [header]=\"false\"\n *ngIf=\"obs.searchFields; else loading\"\n [lastColumnTemplate]=\"moveRowButtonsTemplateRef\"\n (rowClicked)=\"columnRowClicked($event)\"\n >\n </valtimo-list>\n</ng-template>\n\n<ng-template #createEditModal>\n <cds-modal\n valtimoCdsModal\n *ngIf=\"{\n type: currentModalType$ | async,\n show: showModal$ | async,\n valid: valid$ | async,\n disableInput: disableInput$ | async,\n validKey: validKey$ | async\n } as modalObs\"\n [open]=\"modalObs.show\"\n >\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{\n modalObs.type === 'create'\n ? ('searchFieldsOverview.add' | translate)\n : ('searchFieldsOverview.edit' | translate)\n }}\n </h3>\n </cds-modal-header>\n <section cdsModalContent>\n <ng-container *ngTemplateOutlet=\"modalContent; context: {modalObs: modalObs}\"></ng-container>\n </section>\n <ng-container *ngTemplateOutlet=\"modalFooter; context: {modalObs: modalObs}\"></ng-container>\n </cds-modal>\n</ng-template>\n\n<ng-template #modalContent let-modalObs=\"modalObs\">\n <form [formGroup]=\"formGroup\" class=\"list-column-form\">\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'searchFieldsOverview.title' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.title' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"title\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"modalObs.disableInput || modalObs.type === 'edit'\"\n [invalid]=\"modalObs.validKey === false\"\n [invalidText]=\"'searchFieldsOverview.uniqueKeyWarning' | translate\"\n >\n <span class=\"label-with-tooltip\">\n {{ 'searchFieldsOverview.key' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.key' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"key\" [invalid]=\"modalObs.validKey === false\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'searchFieldsOverview.path' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.objectsApiPath' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"path\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'searchFieldsOverview.dataType' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.dataType' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown formControlName=\"dataType\" [disabled]=\"modalObs.disableInput\">\n <cds-dropdown-list [items]=\"dataTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'searchFieldsOverview.fieldType' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.fieldType' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown formControlName=\"fieldType\" [disabled]=\"modalObs.disableInput\">\n <cds-dropdown-list [items]=\"fieldTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n </form>\n</ng-template>\n\n<ng-template #modalFooter let-modalObs=\"modalObs\">\n <cds-modal-footer>\n <ng-container>\n <button\n cdsButton=\"secondary\"\n [attr.modal-primary-focus]=\"true\"\n (click)=\"closeModal()\"\n [disabled]=\"modalObs.disableInput\"\n >\n {{ 'searchFieldsOverview.close' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n [disabled]=\"modalObs.valid === false\"\n (click)=\"saveListSearchFields()\"\n [disabled]=\"\n modalObs.disableInput || modalObs.valid === false || modalObs.validKey === false\n \"\n >\n {{ 'searchFieldsOverview.save' | translate }}\n </button>\n </ng-container>\n </cds-modal-footer>\n</ng-template>\n\n<ng-template #deleteModal>\n <valtimo-confirmation-modal\n [showModalSubject$]=\"showDeleteModal$\"\n [outputOnConfirm]=\"deleteRowIndex$ | async\"\n (confirmEvent)=\"deleteRowConfirmation($event)\"\n confirmButtonTextTranslationKey=\"searchFieldsOverview.deleteSearchField\"\n titleTranslationKey=\"searchFieldsOverview.searchField\"\n contentTranslationKey=\"searchFieldsOverview.deleteSearchFieldConfirmation\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #noConfigWarning>\n <div class=\"pl-2 pr-2 pb-2\">\n <cds-notification\n [notificationObj]=\"{\n type: 'info',\n title: 'searchFieldsOverview.noSearchFieldsConfiguredWarningTitle' | translate,\n showClose: false\n }\"\n >\n </cds-notification>\n </div>\n</ng-template>\n\n<ng-template #loading>\n <div class=\"loading-icon\"><cds-loading></cds-loading></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 */::ng-deep .tab-container{min-height:unset!important}::ng-deep .cds--inline-notification{max-width:100%}.label-with-tooltip{display:flex;align-items:center}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:1rem}.display-type-dropdown{width:300px}.list-column-form{margin-bottom:3rem}.select-label{padding-bottom:.5rem;width:250px}.loading-icon{width:100%;display:flex;align-items:center;justify-content:center}.center-link{display:flex;align-items:center}::ng-deep .move-row-buttons{display:flex;flex-direction:row;justify-content:flex-end;padding-right:13px}\n"] }]
|
|
1114
|
-
}], ctorParameters: function () { return [{ type: ObjectManagementService }, { type: i2.ActivatedRoute }, { type: i3$1.TranslateService }, { type: i4.ConfigService }, { type: i5$1.DomSanitizer }]; }, propDecorators: { moveRowButtonsTemplateRef: [{
|
|
1115
|
-
type: ViewChild,
|
|
1116
|
-
args: ['moveRowButtons']
|
|
1117
|
-
}] } });
|
|
1118
|
-
|
|
1119
|
-
/*
|
|
1120
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1121
|
-
*
|
|
1122
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1123
|
-
* you may not use this file except in compliance with the License.
|
|
1124
|
-
* You may obtain a copy of the License at
|
|
1125
|
-
*
|
|
1126
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1127
|
-
*
|
|
1128
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1129
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1130
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1131
|
-
* See the License for the specific language governing permissions and
|
|
1132
|
-
* limitations under the License.
|
|
1133
|
-
*/
|
|
1134
|
-
class ObjectManagementDetailContainerComponent {
|
|
1135
|
-
constructor(objectManagementState, objectManagementService, route, configService, tabService, pageTitleService) {
|
|
1136
|
-
this.objectManagementState = objectManagementState;
|
|
1137
|
-
this.objectManagementService = objectManagementService;
|
|
1138
|
-
this.route = route;
|
|
1139
|
-
this.configService = configService;
|
|
1140
|
-
this.tabService = tabService;
|
|
1141
|
-
this.pageTitleService = pageTitleService;
|
|
1142
|
-
this.TabEnum = TabEnum;
|
|
1143
|
-
this.objectId$ = this.route.params.pipe(map(params => params.id || ''), filter(id => !!id));
|
|
1144
|
-
this.object$ = combineLatest([this.objectId$, this.objectManagementState.refresh$]).pipe(switchMap(([object]) => this.objectManagementService.getObjectById(object)), tap$1(object => {
|
|
1145
|
-
this.pageTitleService.setCustomPageTitle(object.title);
|
|
1146
|
-
}));
|
|
1147
|
-
this.caseListColumn = this.configService.config.featureToggles.caseListColumn;
|
|
1148
|
-
}
|
|
1149
|
-
ngOnInit() {
|
|
1150
|
-
this.openCurrentTabSubscription();
|
|
1151
|
-
}
|
|
1152
|
-
displayBodyComponent(tab) {
|
|
1153
|
-
this.tabService.currentTab = tab;
|
|
1154
|
-
}
|
|
1155
|
-
openCurrentTabSubscription() {
|
|
1156
|
-
this.tabSubscription = this.tabService.currentTab$.subscribe(value => (this.currentTab = value));
|
|
1157
|
-
}
|
|
1158
|
-
ngOnDestroy() {
|
|
1159
|
-
var _a;
|
|
1160
|
-
this.tabService.currentTab = TabEnum.GENERAL;
|
|
1161
|
-
(_a = this.tabSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
ObjectManagementDetailContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementDetailContainerComponent, deps: [{ token: ObjectManagementStateService }, { token: ObjectManagementService }, { token: i2.ActivatedRoute }, { token: i4.ConfigService }, { token: TabService }, { token: i7.PageTitleService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1165
|
-
ObjectManagementDetailContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ObjectManagementDetailContainerComponent, selector: "valtimo-object-management-detail-container", 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>\n <ng-container *ngTemplateOutlet=\"title\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tabContent\"></ng-container>\n </valtimo-widget>\n </div>\n </div>\n</div>\n\n<ng-template #title>\n <ng-container *ngIf=\"object$ | async as object\">\n <div class=\"bg-light dossier-header\" *ngIf=\"object.showInDataMenu\">\n <h3 class=\"dossier-title\">\n <div *ngIf=\"object.showInDataMenu\" class=\"pull-right\">\n <span class=\"badge badge-pill badge-info increase-size\">{{\n 'objectManagement.visibleInMenu' | translate\n }}</span>\n </div>\n </h3>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #tabs>\n <ul class=\"nav nav-tabs\">\n <li class=\"nav-item\">\n <a\n id=\"general-tab\"\n class=\"nav-link clickable active\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.GENERAL)\"\n >\n {{ 'objectManagement.tabs.general' | translate }}\n </a>\n </li>\n <li class=\"nav-item\">\n <a\n id=\"search-tab\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.SEARCH)\"\n >\n {{ 'objectManagement.tabs.searchFields' | translate }}\n </a>\n </li>\n <li class=\"nav-item\" *ngIf=\"caseListColumn\">\n <a\n id=\"list-tab\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.LIST)\"\n >\n {{ 'objectManagement.tabs.list' | translate }}\n </a>\n </li>\n </ul>\n</ng-template>\n\n<ng-template #tabContent>\n <div class=\"pt-3 bg-white position-relative tab-container\">\n <div *ngIf=\"currentTab && currentTab === TabEnum.GENERAL\">\n <valtimo-object-management-detail [object$]=\"object$\"></valtimo-object-management-detail>\n </div>\n <div *ngIf=\"currentTab && currentTab === TabEnum.SEARCH\">\n <valtimo-object-management-list-search-fields></valtimo-object-management-list-search-fields>\n </div>\n <div *ngIf=\"currentTab && currentTab === TabEnum.LIST\">\n <valtimo-object-management-list-columns></valtimo-object-management-list-columns>\n </div>\n </div>\n</ng-template>\n", styles: [".tab-container{min-height:300px}.dossier-header{height:80px;padding-top:21px;padding-left:18px;padding-right:18px;border-bottom:1px solid rgba(0,0,0,.125)}.dossier-title{margin-top:0;margin-bottom:7px}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i7.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: ObjectManagementDetailComponent, selector: "valtimo-object-management-detail", inputs: ["object$"] }, { kind: "component", type: ObjectManagementListColumnsComponent, selector: "valtimo-object-management-list-columns" }, { kind: "component", type: ObjectManagementListSearchFieldsComponent, selector: "valtimo-object-management-list-search-fields" }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] });
|
|
1166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementDetailContainerComponent, decorators: [{
|
|
1167
|
-
type: Component,
|
|
1168
|
-
args: [{ selector: 'valtimo-object-management-detail-container', 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>\n <ng-container *ngTemplateOutlet=\"title\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tabContent\"></ng-container>\n </valtimo-widget>\n </div>\n </div>\n</div>\n\n<ng-template #title>\n <ng-container *ngIf=\"object$ | async as object\">\n <div class=\"bg-light dossier-header\" *ngIf=\"object.showInDataMenu\">\n <h3 class=\"dossier-title\">\n <div *ngIf=\"object.showInDataMenu\" class=\"pull-right\">\n <span class=\"badge badge-pill badge-info increase-size\">{{\n 'objectManagement.visibleInMenu' | translate\n }}</span>\n </div>\n </h3>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #tabs>\n <ul class=\"nav nav-tabs\">\n <li class=\"nav-item\">\n <a\n id=\"general-tab\"\n class=\"nav-link clickable active\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.GENERAL)\"\n >\n {{ 'objectManagement.tabs.general' | translate }}\n </a>\n </li>\n <li class=\"nav-item\">\n <a\n id=\"search-tab\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.SEARCH)\"\n >\n {{ 'objectManagement.tabs.searchFields' | translate }}\n </a>\n </li>\n <li class=\"nav-item\" *ngIf=\"caseListColumn\">\n <a\n id=\"list-tab\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.LIST)\"\n >\n {{ 'objectManagement.tabs.list' | translate }}\n </a>\n </li>\n </ul>\n</ng-template>\n\n<ng-template #tabContent>\n <div class=\"pt-3 bg-white position-relative tab-container\">\n <div *ngIf=\"currentTab && currentTab === TabEnum.GENERAL\">\n <valtimo-object-management-detail [object$]=\"object$\"></valtimo-object-management-detail>\n </div>\n <div *ngIf=\"currentTab && currentTab === TabEnum.SEARCH\">\n <valtimo-object-management-list-search-fields></valtimo-object-management-list-search-fields>\n </div>\n <div *ngIf=\"currentTab && currentTab === TabEnum.LIST\">\n <valtimo-object-management-list-columns></valtimo-object-management-list-columns>\n </div>\n </div>\n</ng-template>\n", styles: [".tab-container{min-height:300px}.dossier-header{height:80px;padding-top:21px;padding-left:18px;padding-right:18px;border-bottom:1px solid rgba(0,0,0,.125)}.dossier-title{margin-top:0;margin-bottom:7px}\n"] }]
|
|
1169
|
-
}], ctorParameters: function () { return [{ type: ObjectManagementStateService }, { type: ObjectManagementService }, { type: i2.ActivatedRoute }, { type: i4.ConfigService }, { type: TabService }, { type: i7.PageTitleService }]; } });
|
|
1170
|
-
|
|
1171
|
-
/*
|
|
1172
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1173
|
-
*
|
|
1174
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1175
|
-
* you may not use this file except in compliance with the License.
|
|
1176
|
-
* You may obtain a copy of the License at
|
|
1177
|
-
*
|
|
1178
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1179
|
-
*
|
|
1180
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1181
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1182
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1183
|
-
* See the License for the specific language governing permissions and
|
|
1184
|
-
* limitations under the License.
|
|
1185
|
-
*/
|
|
1186
|
-
class ObjectManagementUploadModalComponent {
|
|
1187
|
-
constructor(objectManagementState, objectManagementService, formManagementService, pluginManagementService, modalService, translateService) {
|
|
1188
|
-
this.objectManagementState = objectManagementState;
|
|
1189
|
-
this.objectManagementService = objectManagementService;
|
|
1190
|
-
this.formManagementService = formManagementService;
|
|
1191
|
-
this.pluginManagementService = pluginManagementService;
|
|
1192
|
-
this.modalService = modalService;
|
|
1193
|
-
this.translateService = translateService;
|
|
1194
|
-
this.clear$ = new Subject();
|
|
1195
|
-
this.jsonString$ = new BehaviorSubject('');
|
|
1196
|
-
this.error$ = new BehaviorSubject('');
|
|
1197
|
-
this.disabled$ = new BehaviorSubject(false);
|
|
1198
|
-
this.showForm$ = this.modalService.modalVisible$;
|
|
1199
|
-
this.file$ = new BehaviorSubject(undefined);
|
|
1200
|
-
}
|
|
1201
|
-
ngAfterViewInit() {
|
|
1202
|
-
this.openShowSubscription();
|
|
1203
|
-
this.openFileSubscription();
|
|
1204
|
-
this.openHideSubscription();
|
|
1205
|
-
}
|
|
1206
|
-
ngOnDestroy() {
|
|
1207
|
-
var _a, _b;
|
|
1208
|
-
(_a = this.showSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1209
|
-
(_b = this.hideSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
1210
|
-
this.fileSubscription.unsubscribe();
|
|
1211
|
-
}
|
|
1212
|
-
hide() {
|
|
1213
|
-
this.modalService.closeModal();
|
|
1214
|
-
}
|
|
1215
|
-
cancel() {
|
|
1216
|
-
this.hide();
|
|
1217
|
-
}
|
|
1218
|
-
setFile(file) {
|
|
1219
|
-
this.clearError();
|
|
1220
|
-
this.file$.next(file);
|
|
1221
|
-
}
|
|
1222
|
-
uploadDefinition() {
|
|
1223
|
-
this.disable();
|
|
1224
|
-
this.jsonString$.pipe(take(1)).subscribe(objecttypeDefinition => {
|
|
1225
|
-
this.objectManagementService
|
|
1226
|
-
.createObject(Object.assign({}, JSON.parse(objecttypeDefinition)))
|
|
1227
|
-
.subscribe(() => {
|
|
1228
|
-
this.objectManagementState.refresh();
|
|
1229
|
-
this.objectManagementState.hideModal();
|
|
1230
|
-
});
|
|
1231
|
-
this.closeErrorSubscription();
|
|
1232
|
-
this.clearError();
|
|
1233
|
-
this.enable();
|
|
1234
|
-
this.hide();
|
|
1235
|
-
});
|
|
1236
|
-
}
|
|
1237
|
-
openErrorSubscription(errorCode) {
|
|
1238
|
-
this.closeErrorSubscription();
|
|
1239
|
-
this.errorSubscription = this.translateService.stream(errorCode).subscribe(error => {
|
|
1240
|
-
this.error$.next(error);
|
|
1241
|
-
});
|
|
1242
|
-
}
|
|
1243
|
-
closeErrorSubscription() {
|
|
1244
|
-
if (this.errorSubscription) {
|
|
1245
|
-
this.errorSubscription.unsubscribe();
|
|
1246
|
-
}
|
|
1247
|
-
}
|
|
1248
|
-
openFileSubscription() {
|
|
1249
|
-
this.fileSubscription = this.file$.subscribe(file => {
|
|
1250
|
-
if (file) {
|
|
1251
|
-
const reader = new FileReader();
|
|
1252
|
-
reader.onloadend = () => {
|
|
1253
|
-
const result = reader.result.toString();
|
|
1254
|
-
if (this.isValidJsonObjecttype(result)) {
|
|
1255
|
-
this.jsonString$.next(result);
|
|
1256
|
-
}
|
|
1257
|
-
else {
|
|
1258
|
-
this.clearJsonString();
|
|
1259
|
-
}
|
|
1260
|
-
};
|
|
1261
|
-
reader.readAsText(file);
|
|
1262
|
-
}
|
|
1263
|
-
else {
|
|
1264
|
-
this.clearJsonString();
|
|
1265
|
-
}
|
|
1266
|
-
});
|
|
1267
|
-
}
|
|
1268
|
-
openShowSubscription() {
|
|
1269
|
-
this.showSubscription = this.objectManagementState.showModal$.subscribe(() => {
|
|
1270
|
-
this.show();
|
|
1271
|
-
this.clearJsonString();
|
|
1272
|
-
this.clearError();
|
|
1273
|
-
this.clearDropzone();
|
|
1274
|
-
});
|
|
1275
|
-
}
|
|
1276
|
-
openHideSubscription() {
|
|
1277
|
-
this.hideSubscription = this.objectManagementState.hideModal$.subscribe(() => {
|
|
1278
|
-
this.hide();
|
|
1279
|
-
});
|
|
1280
|
-
}
|
|
1281
|
-
show() {
|
|
1282
|
-
this.objectManagementState.modalType$.pipe(take(1)).subscribe(modalType => {
|
|
1283
|
-
if (modalType === 'upload') {
|
|
1284
|
-
this.modalService.openModal(this.objectManagementUploadModal);
|
|
1285
|
-
}
|
|
1286
|
-
});
|
|
1287
|
-
}
|
|
1288
|
-
clearError() {
|
|
1289
|
-
this.error$.next('');
|
|
1290
|
-
}
|
|
1291
|
-
clearJsonString() {
|
|
1292
|
-
this.jsonString$.next('');
|
|
1293
|
-
}
|
|
1294
|
-
clearDropzone() {
|
|
1295
|
-
this.clear$.next(null);
|
|
1296
|
-
}
|
|
1297
|
-
isValidJsonObjecttype(string) {
|
|
1298
|
-
var _a;
|
|
1299
|
-
const jsonObjecttype = JSON.parse(string);
|
|
1300
|
-
const isValid = this.validateObject(jsonObjecttype, [
|
|
1301
|
-
'title',
|
|
1302
|
-
'objecttypenApiPluginConfigurationId',
|
|
1303
|
-
'objecttypeId',
|
|
1304
|
-
'objecttypeVersion',
|
|
1305
|
-
'objectenApiPluginConfigurationId',
|
|
1306
|
-
'showInDataMenu',
|
|
1307
|
-
]);
|
|
1308
|
-
const isObjecttypeTitleUnique = !((_a = this.objecttypes) === null || _a === void 0 ? void 0 : _a.find(objecttype => objecttype.title === jsonObjecttype.title));
|
|
1309
|
-
if (isValid && isObjecttypeTitleUnique) {
|
|
1310
|
-
return true;
|
|
1311
|
-
}
|
|
1312
|
-
else if (isValid && !isObjecttypeTitleUnique) {
|
|
1313
|
-
this.clearDropzone();
|
|
1314
|
-
this.openErrorSubscription('dropzone.error.objecttypeAlreadyExists');
|
|
1315
|
-
return false;
|
|
1316
|
-
}
|
|
1317
|
-
else if (!isValid && isObjecttypeTitleUnique) {
|
|
1318
|
-
this.clearDropzone();
|
|
1319
|
-
this.openErrorSubscription('dropzone.error.invalidObjecttypeDef');
|
|
1320
|
-
return false;
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
validateObject(obj, requiredKeys) {
|
|
1324
|
-
const objKeys = Object.keys(obj);
|
|
1325
|
-
return requiredKeys.every(key => objKeys.includes(key));
|
|
1326
|
-
}
|
|
1327
|
-
disable() {
|
|
1328
|
-
this.disabled$.next(true);
|
|
1329
|
-
}
|
|
1330
|
-
enable() {
|
|
1331
|
-
this.disabled$.next(false);
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
ObjectManagementUploadModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementUploadModalComponent, deps: [{ token: ObjectManagementStateService }, { token: ObjectManagementService }, { token: i3$2.FormManagementService }, { token: i4$1.PluginManagementService }, { token: i5.ModalService }, { token: i3$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1335
|
-
ObjectManagementUploadModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ObjectManagementUploadModalComponent, selector: "valtimo-object-management-upload-modal", inputs: { objecttypes: "objecttypes" }, viewQueries: [{ propertyName: "objectManagementUploadModal", first: true, predicate: ["objectManagementUploadModal"], 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 #objectManagementUploadModal\n *ngIf=\"{\n disabled: disabled$ | async,\n jsonString: jsonString$ | async,\n error: error$ | async\n } as obs\"\n>\n <div role=\"header\">\n <div class=\"add-title\">\n <v-title [margin]=\"false\">{{ 'objectManagement.uploadObjecttype' | translate }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <ng-container *ngTemplateOutlet=\"uploadForm\"></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <v-button (clickEvent)=\"cancel()\" [disabled]=\"obs.disabled\" type=\"secondary\">\n {{ 'objectManagement.cancel' | translate }}\n </v-button>\n <v-button\n (clickEvent)=\"uploadDefinition()\"\n [disabled]=\"obs.jsonString === '' || obs.disabled\"\n mdiIcon=\"plus\"\n type=\"success\"\n >\n {{ 'Upload' | translate }}\n </v-button>\n </div>\n </div>\n</v-modal>\n\n<ng-template #uploadForm>\n <ng-container *ngIf=\"showForm$ | async\">\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.objecttypeDef' | translate\"\n [externalError$]=\"error$\"\n [maxFiles]=\"1\"\n ></valtimo-dropzone>\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{width:100%;display:flex;flex-direction:row;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i7.DropzoneComponent, selector: "valtimo-dropzone", inputs: ["title", "hideTitle", "subtitle", "externalError$", "maxFileSize", "showMaxFileSize", "acceptedFiles", "clear$", "disabled", "hideFilePreview", "uploading", "camera", "maxFiles"], outputs: ["fileSelected"] }, { kind: "component", type: i5.ModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx", "hideFooter"], outputs: ["closeEvent"] }, { kind: "component", type: i5.TitleComponent, selector: "v-title", inputs: ["type", "margin", "fullWidth", "center"] }, { kind: "component", type: i5.ButtonComponent, selector: "v-button", inputs: ["type", "mdiIcon", "disabled", "title", "titleTranslationKey"], outputs: ["clickEvent"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] });
|
|
1336
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementUploadModalComponent, decorators: [{
|
|
1337
|
-
type: Component,
|
|
1338
|
-
args: [{ selector: 'valtimo-object-management-upload-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 #objectManagementUploadModal\n *ngIf=\"{\n disabled: disabled$ | async,\n jsonString: jsonString$ | async,\n error: error$ | async\n } as obs\"\n>\n <div role=\"header\">\n <div class=\"add-title\">\n <v-title [margin]=\"false\">{{ 'objectManagement.uploadObjecttype' | translate }}</v-title>\n </div>\n </div>\n <div role=\"content\">\n <ng-container *ngTemplateOutlet=\"uploadForm\"></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <v-button (clickEvent)=\"cancel()\" [disabled]=\"obs.disabled\" type=\"secondary\">\n {{ 'objectManagement.cancel' | translate }}\n </v-button>\n <v-button\n (clickEvent)=\"uploadDefinition()\"\n [disabled]=\"obs.jsonString === '' || obs.disabled\"\n mdiIcon=\"plus\"\n type=\"success\"\n >\n {{ 'Upload' | translate }}\n </v-button>\n </div>\n </div>\n</v-modal>\n\n<ng-template #uploadForm>\n <ng-container *ngIf=\"showForm$ | async\">\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.objecttypeDef' | translate\"\n [externalError$]=\"error$\"\n [maxFiles]=\"1\"\n ></valtimo-dropzone>\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{width:100%;display:flex;flex-direction:row;justify-content:space-between}\n"] }]
|
|
1339
|
-
}], ctorParameters: function () { return [{ type: ObjectManagementStateService }, { type: ObjectManagementService }, { type: i3$2.FormManagementService }, { type: i4$1.PluginManagementService }, { type: i5.ModalService }, { type: i3$1.TranslateService }]; }, propDecorators: { objectManagementUploadModal: [{
|
|
1340
|
-
type: ViewChild,
|
|
1341
|
-
args: ['objectManagementUploadModal']
|
|
1342
|
-
}], objecttypes: [{
|
|
1343
|
-
type: Input
|
|
1344
|
-
}] } });
|
|
1345
|
-
|
|
1346
|
-
/*
|
|
1347
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1348
|
-
*
|
|
1349
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1350
|
-
* you may not use this file except in compliance with the License.
|
|
1351
|
-
* You may obtain a copy of the License at
|
|
1352
|
-
*
|
|
1353
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1354
|
-
*
|
|
1355
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1356
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1357
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1358
|
-
* See the License for the specific language governing permissions and
|
|
1359
|
-
* limitations under the License.
|
|
1360
|
-
*/
|
|
1361
|
-
class ObjectManagementListComponent {
|
|
1362
|
-
constructor(objectManagementService, objectManagementState, translateService, router) {
|
|
1363
|
-
this.objectManagementService = objectManagementService;
|
|
1364
|
-
this.objectManagementState = objectManagementState;
|
|
1365
|
-
this.translateService = translateService;
|
|
1366
|
-
this.router = router;
|
|
1367
|
-
this.loading$ = new BehaviorSubject(true);
|
|
1368
|
-
this.fields$ = new BehaviorSubject([]);
|
|
1369
|
-
this.objecttypesInstances$ = combineLatest([
|
|
1370
|
-
this.translateService.stream('key'),
|
|
1371
|
-
this.objectManagementState.refresh$,
|
|
1372
|
-
]).pipe(tap$1(() => this.setFields()), switchMap$1(() => this.objectManagementService.getAllObjects()), tap$1(() => this.loading$.next(false)));
|
|
1373
|
-
}
|
|
1374
|
-
showAddModal() {
|
|
1375
|
-
this.objectManagementState.setModalType('add');
|
|
1376
|
-
this.objectManagementState.showModal();
|
|
1377
|
-
}
|
|
1378
|
-
showUploadModal() {
|
|
1379
|
-
this.objectManagementState.setModalType('upload');
|
|
1380
|
-
this.objectManagementState.showModal();
|
|
1381
|
-
}
|
|
1382
|
-
redirectToDetails(objectManagement) {
|
|
1383
|
-
this.router.navigate(['/object-management/object', objectManagement.id]);
|
|
1384
|
-
}
|
|
1385
|
-
setFields() {
|
|
1386
|
-
const keys = ['title'];
|
|
1387
|
-
this.fields$.next(keys.map(key => ({
|
|
1388
|
-
label: `${this.translateService.instant(`objectManagement.labels.${key}`)}`,
|
|
1389
|
-
key,
|
|
1390
|
-
})));
|
|
1391
|
-
}
|
|
1392
|
-
}
|
|
1393
|
-
ObjectManagementListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementListComponent, deps: [{ token: ObjectManagementService }, { token: ObjectManagementStateService }, { token: i3$1.TranslateService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
1394
|
-
ObjectManagementListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ObjectManagementListComponent, selector: "valtimo-object-management-list", 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 pt-0\" *ngIf=\"{loading: loading$ | async} as obs\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <div class=\"text-right mt-m3px mb-3\">\n <button (click)=\"showUploadModal()\" class=\"btn btn-secondary btn-space\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'objectManagement.uploadObjecttype' | translate }}\n </button>\n <button (click)=\"showAddModal()\" type=\"button\" class=\"btn btn-space btn-primary mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n {{ 'objectManagement.createObjecttype' | translate }}\n </button>\n </div>\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #list let-obs=\"obs\">\n <ng-container *ngIf=\"fields$ | async as fields\">\n <ng-container *ngIf=\"objecttypesInstances$ | async as objecttypesInstances\">\n <valtimo-widget *ngIf=\"obs.loading === false\">\n <valtimo-list\n [items]=\"objecttypesInstances\"\n [fields]=\"fields\"\n [viewMode]=\"true\"\n [header]=\"true\"\n paginationIdentifier=\"objecttypesList\"\n (rowClicked)=\"redirectToDetails($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">\n {{ 'objectManagement.title' | translate }}\n <sup class=\"ml-1 badge badge-pill badge-primary\">{{\n objecttypesInstances?.length || 0\n }}</sup>\n </h3>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<valtimo-object-management-upload-modal\n [objecttypes]=\"objecttypesInstances$ | async\"\n></valtimo-object-management-upload-modal>\n<valtimo-object-management-modal></valtimo-object-management-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: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i7.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: i7.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState", "lastColumnTemplate"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: ObjectManagementModalComponent, selector: "valtimo-object-management-modal", inputs: ["prefillObject$"] }, { kind: "component", type: ObjectManagementUploadModalComponent, selector: "valtimo-object-management-upload-modal", inputs: ["objecttypes"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] });
|
|
1395
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementListComponent, decorators: [{
|
|
1396
|
-
type: Component,
|
|
1397
|
-
args: [{ selector: 'valtimo-object-management-list', 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 pt-0\" *ngIf=\"{loading: loading$ | async} as obs\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <div class=\"text-right mt-m3px mb-3\">\n <button (click)=\"showUploadModal()\" class=\"btn btn-secondary btn-space\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'objectManagement.uploadObjecttype' | translate }}\n </button>\n <button (click)=\"showAddModal()\" type=\"button\" class=\"btn btn-space btn-primary mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n {{ 'objectManagement.createObjecttype' | translate }}\n </button>\n </div>\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #list let-obs=\"obs\">\n <ng-container *ngIf=\"fields$ | async as fields\">\n <ng-container *ngIf=\"objecttypesInstances$ | async as objecttypesInstances\">\n <valtimo-widget *ngIf=\"obs.loading === false\">\n <valtimo-list\n [items]=\"objecttypesInstances\"\n [fields]=\"fields\"\n [viewMode]=\"true\"\n [header]=\"true\"\n paginationIdentifier=\"objecttypesList\"\n (rowClicked)=\"redirectToDetails($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">\n {{ 'objectManagement.title' | translate }}\n <sup class=\"ml-1 badge badge-pill badge-primary\">{{\n objecttypesInstances?.length || 0\n }}</sup>\n </h3>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<valtimo-object-management-upload-modal\n [objecttypes]=\"objecttypesInstances$ | async\"\n></valtimo-object-management-upload-modal>\n<valtimo-object-management-modal></valtimo-object-management-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"] }]
|
|
1398
|
-
}], ctorParameters: function () { return [{ type: ObjectManagementService }, { type: ObjectManagementStateService }, { type: i3$1.TranslateService }, { type: i2.Router }]; } });
|
|
1399
|
-
|
|
1400
|
-
/*
|
|
1401
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1402
|
-
*
|
|
1403
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1404
|
-
* you may not use this file except in compliance with the License.
|
|
1405
|
-
* You may obtain a copy of the License at
|
|
1406
|
-
*
|
|
1407
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1408
|
-
*
|
|
1409
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1410
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1411
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1412
|
-
* See the License for the specific language governing permissions and
|
|
1413
|
-
* limitations under the License.
|
|
1414
|
-
*/
|
|
1415
|
-
const routes = [
|
|
1416
|
-
{
|
|
1417
|
-
path: 'object-management',
|
|
1418
|
-
canActivate: [AuthGuardService],
|
|
1419
|
-
component: ObjectManagementListComponent,
|
|
1420
|
-
data: { title: 'Objects', roles: [ROLE_ADMIN] },
|
|
1421
|
-
},
|
|
1422
|
-
{
|
|
1423
|
-
path: 'object-management/object/:id',
|
|
1424
|
-
canActivate: [AuthGuardService],
|
|
1425
|
-
component: ObjectManagementDetailContainerComponent,
|
|
1426
|
-
data: { title: 'Object', roles: [ROLE_ADMIN], customPageTitle: true },
|
|
1427
|
-
},
|
|
1428
|
-
];
|
|
1429
|
-
class ObjectManagementRoutingModule {
|
|
1430
|
-
}
|
|
1431
|
-
ObjectManagementRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1432
|
-
ObjectManagementRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementRoutingModule, imports: [CommonModule, i2.RouterModule], exports: [RouterModule] });
|
|
1433
|
-
ObjectManagementRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] });
|
|
1434
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementRoutingModule, decorators: [{
|
|
1435
|
-
type: NgModule,
|
|
1436
|
-
args: [{
|
|
1437
|
-
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
1438
|
-
exports: [RouterModule],
|
|
1439
|
-
declarations: [],
|
|
1440
|
-
}]
|
|
1441
|
-
}] });
|
|
1442
|
-
|
|
1443
|
-
/*
|
|
1444
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1445
|
-
*
|
|
1446
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1447
|
-
* you may not use this file except in compliance with the License.
|
|
1448
|
-
* You may obtain a copy of the License at
|
|
1449
|
-
*
|
|
1450
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1451
|
-
*
|
|
1452
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1453
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1454
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1455
|
-
* See the License for the specific language governing permissions and
|
|
1456
|
-
* limitations under the License.
|
|
1457
|
-
*/
|
|
1458
|
-
class ObjectManagementModule {
|
|
1459
|
-
}
|
|
1460
|
-
ObjectManagementModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1461
|
-
ObjectManagementModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementModule, declarations: [ObjectManagementListComponent,
|
|
1462
|
-
ObjectManagementDetailContainerComponent,
|
|
1463
|
-
ObjectManagementDetailComponent,
|
|
1464
|
-
ObjectManagementListColumnsComponent,
|
|
1465
|
-
ObjectManagementModalComponent,
|
|
1466
|
-
ObjectManagementUploadModalComponent,
|
|
1467
|
-
ObjectManagementListSearchFieldsComponent], imports: [CommonModule,
|
|
1468
|
-
DropzoneModule,
|
|
1469
|
-
WidgetModule,
|
|
1470
|
-
ListModule,
|
|
1471
|
-
TranslateModule,
|
|
1472
|
-
ObjectManagementRoutingModule,
|
|
1473
|
-
ModalModule,
|
|
1474
|
-
TitleModule,
|
|
1475
|
-
ButtonModule,
|
|
1476
|
-
FormModule,
|
|
1477
|
-
InputModule,
|
|
1478
|
-
SelectModule,
|
|
1479
|
-
InputModule$1,
|
|
1480
|
-
ButtonModule$1,
|
|
1481
|
-
TooltipIconModule,
|
|
1482
|
-
CarbonMultiInputModule,
|
|
1483
|
-
ModalModule$1,
|
|
1484
|
-
NotificationModule,
|
|
1485
|
-
LoadingModule,
|
|
1486
|
-
DropdownModule,
|
|
1487
|
-
CheckboxModule,
|
|
1488
|
-
LinkModule,
|
|
1489
|
-
IconModule,
|
|
1490
|
-
ReactiveFormsModule,
|
|
1491
|
-
ConfirmationModalModule,
|
|
1492
|
-
SpinnerModule,
|
|
1493
|
-
ModalModule$2,
|
|
1494
|
-
ValtimoCdsModalDirectiveModule] });
|
|
1495
|
-
ObjectManagementModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementModule, imports: [CommonModule,
|
|
1496
|
-
DropzoneModule,
|
|
1497
|
-
WidgetModule,
|
|
1498
|
-
ListModule,
|
|
1499
|
-
TranslateModule,
|
|
1500
|
-
ObjectManagementRoutingModule,
|
|
1501
|
-
ModalModule,
|
|
1502
|
-
TitleModule,
|
|
1503
|
-
ButtonModule,
|
|
1504
|
-
FormModule,
|
|
1505
|
-
InputModule,
|
|
1506
|
-
SelectModule,
|
|
1507
|
-
InputModule$1,
|
|
1508
|
-
ButtonModule$1,
|
|
1509
|
-
TooltipIconModule,
|
|
1510
|
-
CarbonMultiInputModule,
|
|
1511
|
-
ModalModule$1,
|
|
1512
|
-
NotificationModule,
|
|
1513
|
-
LoadingModule,
|
|
1514
|
-
DropdownModule,
|
|
1515
|
-
CheckboxModule,
|
|
1516
|
-
LinkModule,
|
|
1517
|
-
IconModule,
|
|
1518
|
-
ReactiveFormsModule,
|
|
1519
|
-
ConfirmationModalModule,
|
|
1520
|
-
SpinnerModule,
|
|
1521
|
-
ModalModule$2,
|
|
1522
|
-
ValtimoCdsModalDirectiveModule] });
|
|
1523
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ObjectManagementModule, decorators: [{
|
|
1524
|
-
type: NgModule,
|
|
1525
|
-
args: [{
|
|
1526
|
-
declarations: [
|
|
1527
|
-
ObjectManagementListComponent,
|
|
1528
|
-
ObjectManagementDetailContainerComponent,
|
|
1529
|
-
ObjectManagementDetailComponent,
|
|
1530
|
-
ObjectManagementListColumnsComponent,
|
|
1531
|
-
ObjectManagementModalComponent,
|
|
1532
|
-
ObjectManagementUploadModalComponent,
|
|
1533
|
-
ObjectManagementListSearchFieldsComponent,
|
|
1534
|
-
],
|
|
1535
|
-
imports: [
|
|
1536
|
-
CommonModule,
|
|
1537
|
-
DropzoneModule,
|
|
1538
|
-
WidgetModule,
|
|
1539
|
-
ListModule,
|
|
1540
|
-
TranslateModule,
|
|
1541
|
-
ObjectManagementRoutingModule,
|
|
1542
|
-
ModalModule,
|
|
1543
|
-
TitleModule,
|
|
1544
|
-
ButtonModule,
|
|
1545
|
-
FormModule,
|
|
1546
|
-
InputModule,
|
|
1547
|
-
SelectModule,
|
|
1548
|
-
InputModule$1,
|
|
1549
|
-
ButtonModule$1,
|
|
1550
|
-
TooltipIconModule,
|
|
1551
|
-
CarbonMultiInputModule,
|
|
1552
|
-
ModalModule$1,
|
|
1553
|
-
NotificationModule,
|
|
1554
|
-
LoadingModule,
|
|
1555
|
-
DropdownModule,
|
|
1556
|
-
CheckboxModule,
|
|
1557
|
-
LinkModule,
|
|
1558
|
-
IconModule,
|
|
1559
|
-
ReactiveFormsModule,
|
|
1560
|
-
ConfirmationModalModule,
|
|
1561
|
-
SpinnerModule,
|
|
1562
|
-
ModalModule$2,
|
|
1563
|
-
ValtimoCdsModalDirectiveModule,
|
|
1564
|
-
],
|
|
1565
|
-
exports: [],
|
|
1566
|
-
}]
|
|
1567
|
-
}] });
|
|
1568
|
-
|
|
1569
|
-
/*
|
|
1570
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
1571
|
-
*
|
|
1572
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1573
|
-
* you may not use this file except in compliance with the License.
|
|
1574
|
-
* You may obtain a copy of the License at
|
|
1575
|
-
*
|
|
1576
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1577
|
-
*
|
|
1578
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1579
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
1580
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1581
|
-
* See the License for the specific language governing permissions and
|
|
1582
|
-
* limitations under the License.
|
|
1583
|
-
*/
|
|
1584
|
-
|
|
1585
|
-
/**
|
|
1586
|
-
* Generated bundle index. Do not edit.
|
|
1587
|
-
*/
|
|
1588
|
-
|
|
1589
|
-
export { ObjectManagementModule, ObjectManagementService };
|
|
1590
|
-
//# sourceMappingURL=valtimo-object-management.mjs.map
|