@valtimo/iko 13.0.1-next-minor.81
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/README.md +31 -0
- package/fesm2022/valtimo-iko.mjs +4272 -0
- package/fesm2022/valtimo-iko.mjs.map +1 -0
- package/index.d.ts +6 -0
- package/lib/components/iko-details/iko-details.component.d.ts +25 -0
- package/lib/components/iko-details/iko-details.component.d.ts.map +1 -0
- package/lib/components/iko-list/iko-list.component.d.ts +23 -0
- package/lib/components/iko-list/iko-list.component.d.ts.map +1 -0
- package/lib/components/iko-management/iko-management.component.d.ts +42 -0
- package/lib/components/iko-management/iko-management.component.d.ts.map +1 -0
- package/lib/components/iko-management/upload-modal/iko-management-upload-modal.component.d.ts +49 -0
- package/lib/components/iko-management/upload-modal/iko-management-upload-modal.component.d.ts.map +1 -0
- package/lib/components/iko-management/upload-modal/iko-management-upload.constants.d.ts +13 -0
- package/lib/components/iko-management/upload-modal/iko-management-upload.constants.d.ts.map +1 -0
- package/lib/components/iko-management/upload-modal/step/iko-management-upload-step.component.d.ts +9 -0
- package/lib/components/iko-management/upload-modal/step/iko-management-upload-step.component.d.ts.map +1 -0
- package/lib/components/iko-management/view-modal/iko-management-view-modal.component.d.ts +32 -0
- package/lib/components/iko-management/view-modal/iko-management-view-modal.component.d.ts.map +1 -0
- package/lib/components/iko-management-api/iko-management-api.component.d.ts +39 -0
- package/lib/components/iko-management-api/iko-management-api.component.d.ts.map +1 -0
- package/lib/components/iko-management-api/repository-modal/iko-management-repository-modal.component.d.ts +44 -0
- package/lib/components/iko-management-api/repository-modal/iko-management-repository-modal.component.d.ts.map +1 -0
- package/lib/components/iko-management-details/components/list/iko-management-list.component.d.ts +58 -0
- package/lib/components/iko-management-details/components/list/iko-management-list.component.d.ts.map +1 -0
- package/lib/components/iko-management-details/components/list-modal/list-modal.component.d.ts +67 -0
- package/lib/components/iko-management-details/components/list-modal/list-modal.component.d.ts.map +1 -0
- package/lib/components/iko-management-details/components/search-actions/iko-management-search-actions.component.d.ts +46 -0
- package/lib/components/iko-management-details/components/search-actions/iko-management-search-actions.component.d.ts.map +1 -0
- package/lib/components/iko-management-details/components/search-actions/search-action-modal/search-action-modal.component.d.ts +32 -0
- package/lib/components/iko-management-details/components/search-actions/search-action-modal/search-action-modal.component.d.ts.map +1 -0
- package/lib/components/iko-management-details/components/search-fields/iko-management-search-fields.component.d.ts +44 -0
- package/lib/components/iko-management-details/components/search-fields/iko-management-search-fields.component.d.ts.map +1 -0
- package/lib/components/iko-management-details/components/search-fields/search-field-modal/search-field-modal.component.d.ts +73 -0
- package/lib/components/iko-management-details/components/search-fields/search-field-modal/search-field-modal.component.d.ts.map +1 -0
- package/lib/components/iko-management-details/components/tab-detail-modal/iko-management-tab-details-modal.component.d.ts +42 -0
- package/lib/components/iko-management-details/components/tab-detail-modal/iko-management-tab-details-modal.component.d.ts.map +1 -0
- package/lib/components/iko-management-details/components/tabs/iko-management-tabs.component.d.ts +61 -0
- package/lib/components/iko-management-details/components/tabs/iko-management-tabs.component.d.ts.map +1 -0
- package/lib/components/iko-management-details/components/widgets/iko-management-widgets.component.d.ts +30 -0
- package/lib/components/iko-management-details/components/widgets/iko-management-widgets.component.d.ts.map +1 -0
- package/lib/components/iko-management-details/iko-management-details.component.d.ts +35 -0
- package/lib/components/iko-management-details/iko-management-details.component.d.ts.map +1 -0
- package/lib/components/iko-management-properties/iko-management-properties.component.d.ts +28 -0
- package/lib/components/iko-management-properties/iko-management-properties.component.d.ts.map +1 -0
- package/lib/components/iko-search/iko-search.component.d.ts +34 -0
- package/lib/components/iko-search/iko-search.component.d.ts.map +1 -0
- package/lib/components/tabs/iko-widget/iko-widget.component.d.ts +24 -0
- package/lib/components/tabs/iko-widget/iko-widget.component.d.ts.map +1 -0
- package/lib/components/tabs/tabs.constants.d.ts +5 -0
- package/lib/components/tabs/tabs.constants.d.ts.map +1 -0
- package/lib/components/widget-collection/iko-widget-collection.component.d.ts +23 -0
- package/lib/components/widget-collection/iko-widget-collection.component.d.ts.map +1 -0
- package/lib/components/widget-collection/index.d.ts +2 -0
- package/lib/components/widget-collection/index.d.ts.map +1 -0
- package/lib/components/widget-custom/iko-widget-custom.component.d.ts +12 -0
- package/lib/components/widget-custom/iko-widget-custom.component.d.ts.map +1 -0
- package/lib/components/widget-custom/index.d.ts +2 -0
- package/lib/components/widget-custom/index.d.ts.map +1 -0
- package/lib/components/widget-field/iko-widget-field.component.d.ts +20 -0
- package/lib/components/widget-field/iko-widget-field.component.d.ts.map +1 -0
- package/lib/components/widget-field/index.d.ts +2 -0
- package/lib/components/widget-field/index.d.ts.map +1 -0
- package/lib/components/widget-formio/iko-widget-formio.component.d.ts +14 -0
- package/lib/components/widget-formio/iko-widget-formio.component.d.ts.map +1 -0
- package/lib/components/widget-formio/index.d.ts +2 -0
- package/lib/components/widget-formio/index.d.ts.map +1 -0
- package/lib/components/widget-interactive-table/iko-widget-interactive-table.component.d.ts +31 -0
- package/lib/components/widget-interactive-table/iko-widget-interactive-table.component.d.ts.map +1 -0
- package/lib/components/widget-interactive-table/index.d.ts +2 -0
- package/lib/components/widget-interactive-table/index.d.ts.map +1 -0
- package/lib/components/widget-table/iko-widget-table.component.d.ts +26 -0
- package/lib/components/widget-table/iko-widget-table.component.d.ts.map +1 -0
- package/lib/components/widget-table/index.d.ts +2 -0
- package/lib/components/widget-table/index.d.ts.map +1 -0
- package/lib/constants/iko-management.constants.d.ts +4 -0
- package/lib/constants/iko-management.constants.d.ts.map +1 -0
- package/lib/constants/index.d.ts +2 -0
- package/lib/constants/index.d.ts.map +1 -0
- package/lib/iko-routing.module.d.ts +9 -0
- package/lib/iko-routing.module.d.ts.map +1 -0
- package/lib/iko.module.d.ts +15 -0
- package/lib/iko.module.d.ts.map +1 -0
- package/lib/models/iko-management-list.model.d.ts +26 -0
- package/lib/models/iko-management-list.model.d.ts.map +1 -0
- package/lib/models/iko-management.model.d.ts +139 -0
- package/lib/models/iko-management.model.d.ts.map +1 -0
- package/lib/models/iko-menu.model.d.ts +19 -0
- package/lib/models/iko-menu.model.d.ts.map +1 -0
- package/lib/models/iko-search-field.model.d.ts +40 -0
- package/lib/models/iko-search-field.model.d.ts.map +1 -0
- package/lib/models/iko-widget.model.d.ts +6 -0
- package/lib/models/iko-widget.model.d.ts.map +1 -0
- package/lib/models/iko.model.d.ts +51 -0
- package/lib/models/iko.model.d.ts.map +1 -0
- package/lib/models/index.d.ts +7 -0
- package/lib/models/index.d.ts.map +1 -0
- package/lib/services/iko-api.service.d.ts +36 -0
- package/lib/services/iko-api.service.d.ts.map +1 -0
- package/lib/services/iko-management-api.service.d.ts +63 -0
- package/lib/services/iko-management-api.service.d.ts.map +1 -0
- package/lib/services/iko-management-widget-api.service.d.ts +23 -0
- package/lib/services/iko-management-widget-api.service.d.ts.map +1 -0
- package/lib/services/iko-menu.service.d.ts +13 -0
- package/lib/services/iko-menu.service.d.ts.map +1 -0
- package/lib/services/iko-tab.service.d.ts +21 -0
- package/lib/services/iko-tab.service.d.ts.map +1 -0
- package/lib/services/index.d.ts +6 -0
- package/lib/services/index.d.ts.map +1 -0
- package/package.json +23 -0
- package/public-api.d.ts +2 -0
- package/public-api.d.ts.map +1 -0
- package/valtimo-iko.d.ts.map +1 -0
|
@@ -0,0 +1,4272 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, ViewChild, ViewContainerRef, signal, computed, effect, EventEmitter, Output, Inject, NgModule } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/common';
|
|
4
|
+
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
5
|
+
import * as i2 from '@valtimo/shared';
|
|
6
|
+
import { BaseApiService, InterceptorSkipHeader, getDisplayTypeParametersView, ROLE_ADMIN, IKO_TOKEN } from '@valtimo/shared';
|
|
7
|
+
import * as i1$3 from '@angular/router';
|
|
8
|
+
import { RouterModule } from '@angular/router';
|
|
9
|
+
import { AuthGuardService } from '@valtimo/security';
|
|
10
|
+
import * as i1$2 from '@valtimo/components';
|
|
11
|
+
import { CarbonListModule, FormIoModule, RenderInPageHeaderDirective, SelectModule, runAfterCarbonModalClosed, CARBON_CONSTANTS, ValtimoCdsModalDirective, AutoKeyInputComponent, ConfirmationModalModule, ViewType, ValuePathSelectorPrefix, InputLabelModule, CarbonMultiInputModule } from '@valtimo/components';
|
|
12
|
+
import * as i6 from 'carbon-components-angular';
|
|
13
|
+
import { InputModule, PaginationModule, TilesModule, ButtonModule, ModalModule, TabsModule, IconModule, LayerModule, TooltipModule, DropdownModule, LoadingModule, ToggleModule, NumberModule, ProgressBarModule, CheckboxModule, FileUploaderModule, NotificationModule } from 'carbon-components-angular';
|
|
14
|
+
import { BehaviorSubject, filter, of, switchMap, combineLatest, tap, map as map$1, startWith, take, distinctUntilChanged, Subscription, delay } from 'rxjs';
|
|
15
|
+
import * as i2$1 from '@valtimo/layout';
|
|
16
|
+
import { WidgetCollectionComponent, WidgetCustomComponent, WidgetFieldComponent, WidgetFormioComponent, WidgetInteractiveTableComponent, WidgetTableComponent, WidgetType, WidgetContainerComponent, ManagementWidgetDetailsComponent, WIDGET_MANAGEMENT_SERVICE, WidgetManagementComponent } from '@valtimo/layout';
|
|
17
|
+
import * as i4$1 from '@ngx-translate/core';
|
|
18
|
+
import { TranslateModule, TranslatePipe } from '@ngx-translate/core';
|
|
19
|
+
import * as i1 from '@angular/common/http';
|
|
20
|
+
import { HttpParams } from '@angular/common/http';
|
|
21
|
+
import { map, take as take$1 } from 'rxjs/operators';
|
|
22
|
+
import * as i1$1 from 'ngx-logger';
|
|
23
|
+
import { isEqual } from 'lodash';
|
|
24
|
+
import * as i3 from '@valtimo/case';
|
|
25
|
+
import { CaseListActionsComponent, CaseListService } from '@valtimo/case';
|
|
26
|
+
import * as i1$4 from '@angular/forms';
|
|
27
|
+
import { Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
28
|
+
import { Information16, TrashCan16, InformationFilled16, Upload16, Search16 } from '@carbon/icons';
|
|
29
|
+
import { toObservable } from '@angular/core/rxjs-interop';
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
33
|
+
*
|
|
34
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
35
|
+
* you may not use this file except in compliance with the License.
|
|
36
|
+
* You may obtain a copy of the License at
|
|
37
|
+
*
|
|
38
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
39
|
+
*
|
|
40
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
41
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
42
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
43
|
+
* See the License for the specific language governing permissions and
|
|
44
|
+
* limitations under the License.
|
|
45
|
+
*/
|
|
46
|
+
class IkoApiService extends BaseApiService {
|
|
47
|
+
get cachedMenuItems$() {
|
|
48
|
+
return this._cachedMenuItems$.asObservable();
|
|
49
|
+
}
|
|
50
|
+
setCachedMenuItems(items) {
|
|
51
|
+
this._cachedMenuItems$.next(items);
|
|
52
|
+
}
|
|
53
|
+
constructor(httpClient, configService, globalNotificationService) {
|
|
54
|
+
super(httpClient, configService);
|
|
55
|
+
this.httpClient = httpClient;
|
|
56
|
+
this.configService = configService;
|
|
57
|
+
this.globalNotificationService = globalNotificationService;
|
|
58
|
+
this._cachedMenuItems$ = new BehaviorSubject([]);
|
|
59
|
+
}
|
|
60
|
+
getIkoDataAggregates(key, title, page = 0, size = 10000, sort = 'title,asc') {
|
|
61
|
+
const params = new URLSearchParams();
|
|
62
|
+
if (key)
|
|
63
|
+
params.append('key', key);
|
|
64
|
+
if (title)
|
|
65
|
+
params.append('title', title);
|
|
66
|
+
params.append('page', page.toString());
|
|
67
|
+
params.append('size', size.toString());
|
|
68
|
+
params.append('sort', sort);
|
|
69
|
+
return this.httpClient.get(this.getApiUrl(`/v1/iko-data-aggregate?${params.toString()}`));
|
|
70
|
+
}
|
|
71
|
+
getIkoDetailTabs(ikoDataAggregateKey) {
|
|
72
|
+
return this.httpClient.get(this.getApiUrl(`/v1/iko-data-aggregate/${ikoDataAggregateKey}/tab`));
|
|
73
|
+
}
|
|
74
|
+
getIkoDataRequests(ikoDataAggregateKey) {
|
|
75
|
+
return this.httpClient.get(this.getApiUrl(`/v1/iko-data-aggregate/${ikoDataAggregateKey}/data-request`));
|
|
76
|
+
}
|
|
77
|
+
getIkoWidget(ikoDataAggregateKey, tabKey) {
|
|
78
|
+
return this.httpClient.get(this.getApiUrl(`/v1/iko-data-aggregate/${ikoDataAggregateKey}/tab/${tabKey}/widget`));
|
|
79
|
+
}
|
|
80
|
+
getIkoWidgetData(ikoDataAggregateKey, tabKey, widgetId, id) {
|
|
81
|
+
return this.httpClient.get(this.getApiUrl(`/v1/iko-data-aggregate/${ikoDataAggregateKey}/tab/${tabKey}/widget/${widgetId}/data?id=${id}`));
|
|
82
|
+
}
|
|
83
|
+
searchIkoDataRequest(ikoKey, paramKey, filters) {
|
|
84
|
+
return this.httpClient.post(this.getApiUrl(`/v1/iko-data-aggregate/${ikoKey}/data-request/${paramKey}/search`), filters);
|
|
85
|
+
}
|
|
86
|
+
handleAction(action, resolved = null) {
|
|
87
|
+
if (!action)
|
|
88
|
+
return;
|
|
89
|
+
const navigateTo = this.resolveProperty(action?.navigateTo, resolved);
|
|
90
|
+
if (navigateTo) {
|
|
91
|
+
this.navigateTo(navigateTo);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const caseDefinitionKey = this.resolveProperty(action?.caseDefinitionKey, resolved);
|
|
95
|
+
if (caseDefinitionKey)
|
|
96
|
+
this.startCase(caseDefinitionKey);
|
|
97
|
+
const processDefinitionKey = this.resolveProperty(action?.processDefinitionKey, resolved);
|
|
98
|
+
if (processDefinitionKey) {
|
|
99
|
+
this.globalNotificationService.showToast({
|
|
100
|
+
title: 'An unexpected error occurred',
|
|
101
|
+
caption: `Unsupported action: Start process ${processDefinitionKey}`,
|
|
102
|
+
type: 'error',
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
navigateTo(navigateTo) {
|
|
107
|
+
if (navigateTo.startsWith(window.location.origin) || navigateTo.startsWith('/')) {
|
|
108
|
+
window.open(navigateTo, '_self');
|
|
109
|
+
}
|
|
110
|
+
else if (navigateTo.startsWith('http')) {
|
|
111
|
+
window.open(navigateTo, '_blank');
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this.globalNotificationService.showToast({
|
|
115
|
+
title: 'An unexpected error occurred',
|
|
116
|
+
caption: `Unable to navigate to ${navigateTo}`,
|
|
117
|
+
type: 'error',
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
startCase(caseDefinitionKey) {
|
|
122
|
+
this.globalNotificationService.showToast({
|
|
123
|
+
title: 'Test',
|
|
124
|
+
caption: `Start case ${caseDefinitionKey}`,
|
|
125
|
+
type: 'info',
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
resolveProperty(property, resolved) {
|
|
129
|
+
return property ? (resolved ? resolved[property] : property) : null;
|
|
130
|
+
}
|
|
131
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoApiService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }, { token: i2.GlobalNotificationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
132
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoApiService, providedIn: 'root' }); }
|
|
133
|
+
}
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoApiService, decorators: [{
|
|
135
|
+
type: Injectable,
|
|
136
|
+
args: [{
|
|
137
|
+
providedIn: 'root',
|
|
138
|
+
}]
|
|
139
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ConfigService }, { type: i2.GlobalNotificationService }] });
|
|
140
|
+
|
|
141
|
+
/*
|
|
142
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
143
|
+
*
|
|
144
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
145
|
+
* you may not use this file except in compliance with the License.
|
|
146
|
+
* You may obtain a copy of the License at
|
|
147
|
+
*
|
|
148
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
149
|
+
*
|
|
150
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
151
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
152
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
153
|
+
* See the License for the specific language governing permissions and
|
|
154
|
+
* limitations under the License.
|
|
155
|
+
*/
|
|
156
|
+
class IkoTabService {
|
|
157
|
+
get activeTab$() {
|
|
158
|
+
return this._activeTab$.pipe(filter(tab => !!tab));
|
|
159
|
+
}
|
|
160
|
+
get activeTabKey$() {
|
|
161
|
+
return this.activeTab$.pipe(map(tab => tab.key));
|
|
162
|
+
}
|
|
163
|
+
get dataAggregateKey$() {
|
|
164
|
+
return this._dataAggregateKey$.pipe(filter(key => !!key));
|
|
165
|
+
}
|
|
166
|
+
get entryId$() {
|
|
167
|
+
return this._entryId$.pipe(filter(key => !!key));
|
|
168
|
+
}
|
|
169
|
+
constructor(logger) {
|
|
170
|
+
this.logger = logger;
|
|
171
|
+
this._activeTab$ = new BehaviorSubject(null);
|
|
172
|
+
this._dataAggregateKey$ = new BehaviorSubject(null);
|
|
173
|
+
this._entryId$ = new BehaviorSubject(null);
|
|
174
|
+
}
|
|
175
|
+
setActiveTab(tab) {
|
|
176
|
+
this._activeTab$.next(tab);
|
|
177
|
+
this.logger.debug(`Active IKO tab set to ${JSON.stringify(tab)}`);
|
|
178
|
+
}
|
|
179
|
+
setDataAggregateKey(key) {
|
|
180
|
+
this._dataAggregateKey$.next(key);
|
|
181
|
+
this.logger.debug(`Active IKO data aggregate key set to ${key}`);
|
|
182
|
+
}
|
|
183
|
+
setEntryId(id) {
|
|
184
|
+
this._entryId$.next(id);
|
|
185
|
+
this.logger.debug(`Active IKO entry id set to ${id}`);
|
|
186
|
+
}
|
|
187
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoTabService, deps: [{ token: i1$1.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
188
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoTabService, providedIn: 'root' }); }
|
|
189
|
+
}
|
|
190
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoTabService, decorators: [{
|
|
191
|
+
type: Injectable,
|
|
192
|
+
args: [{ providedIn: 'root' }]
|
|
193
|
+
}], ctorParameters: () => [{ type: i1$1.NGXLogger }] });
|
|
194
|
+
|
|
195
|
+
/*
|
|
196
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
197
|
+
*
|
|
198
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
199
|
+
* you may not use this file except in compliance with the License.
|
|
200
|
+
* You may obtain a copy of the License at
|
|
201
|
+
*
|
|
202
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
203
|
+
*
|
|
204
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
205
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
206
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
207
|
+
* See the License for the specific language governing permissions and
|
|
208
|
+
* limitations under the License.
|
|
209
|
+
*/
|
|
210
|
+
class IkoManagementApiService extends BaseApiService {
|
|
211
|
+
constructor(httpClient, configService) {
|
|
212
|
+
super(httpClient, configService);
|
|
213
|
+
this.httpClient = httpClient;
|
|
214
|
+
this.configService = configService;
|
|
215
|
+
}
|
|
216
|
+
getIkoDataAggregates(key, title, page = 0, size = 100, sort = 'title,asc') {
|
|
217
|
+
let params = new HttpParams().set('page', page).set('size', size).set('sort', sort);
|
|
218
|
+
if (key)
|
|
219
|
+
params = params.set('key', key);
|
|
220
|
+
if (title)
|
|
221
|
+
params = params.set('title', title);
|
|
222
|
+
return this.httpClient.get(this.getApiUrl('/v1/iko-data-aggregate'), { params });
|
|
223
|
+
}
|
|
224
|
+
getIkoDataAggregate(key) {
|
|
225
|
+
return this.httpClient.get(this.getApiUrl(`/v1/iko-data-aggregate/${key}`));
|
|
226
|
+
}
|
|
227
|
+
createIkoDataAggregate(key, body) {
|
|
228
|
+
return this.httpClient.post(this.getApiUrl(`management/v1/iko-data-aggregate/${key}`), body);
|
|
229
|
+
}
|
|
230
|
+
updateIkoDataAggregate(key, body) {
|
|
231
|
+
return this.httpClient.put(this.getApiUrl(`management/v1/iko-data-aggregate/${key}`), body);
|
|
232
|
+
}
|
|
233
|
+
deleteIkoDataAggregate(key) {
|
|
234
|
+
return this.httpClient.delete(this.getApiUrl(`management/v1/iko-data-aggregate/${key}`));
|
|
235
|
+
}
|
|
236
|
+
exportIKOConfiguration(key) {
|
|
237
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/iko-data-aggregate/${key}/export`), { observe: 'response', responseType: 'blob', headers: InterceptorSkipHeader });
|
|
238
|
+
}
|
|
239
|
+
importConfigurationZip(file) {
|
|
240
|
+
return this.httpClient.post(this.getApiUrl(`management/v1/iko-data-aggregate/import`), file);
|
|
241
|
+
}
|
|
242
|
+
getIkoRepositoryPropertyFields(type) {
|
|
243
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/iko-property-fields/${type}/repository-config`));
|
|
244
|
+
}
|
|
245
|
+
getIkoDataAggregatePropertyFields(type) {
|
|
246
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/iko-property-fields/${type}/data-aggregate`));
|
|
247
|
+
}
|
|
248
|
+
getIkoDataAggregateType(key) {
|
|
249
|
+
return this.httpClient.get(this.getApiUrl(`/management/v1/iko/${key}`));
|
|
250
|
+
}
|
|
251
|
+
getManagementIkoDataAggregates(key, title, ikoRepositoryConfigKey, page = 0, size = 100, sort = 'title,asc') {
|
|
252
|
+
let params = new HttpParams().set('page', page).set('size', size).set('sort', sort);
|
|
253
|
+
if (key)
|
|
254
|
+
params = params.set('key', key);
|
|
255
|
+
if (title)
|
|
256
|
+
params = params.set('title', title);
|
|
257
|
+
if (ikoRepositoryConfigKey)
|
|
258
|
+
params = params.set('ikoRepositoryConfigKey', ikoRepositoryConfigKey);
|
|
259
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/iko-data-aggregate`), { params });
|
|
260
|
+
}
|
|
261
|
+
getManagementIkoDataRequests(aggregateKey) {
|
|
262
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/iko-data-aggregate/${aggregateKey}/data-request`));
|
|
263
|
+
}
|
|
264
|
+
getIkoDataRequest(aggregateKey, key) {
|
|
265
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/iko-data-aggregate/${aggregateKey}/data-request/${key}`));
|
|
266
|
+
}
|
|
267
|
+
createIkoDataRequest(aggregateKey, key, body) {
|
|
268
|
+
return this.httpClient.post(this.getApiUrl(`management/v1/iko-data-aggregate/${aggregateKey}/data-request/${key}`), body);
|
|
269
|
+
}
|
|
270
|
+
updateIkoDataRequests(aggregateKey, body) {
|
|
271
|
+
return this.httpClient.put(this.getApiUrl(`management/v1/iko-data-aggregate/${aggregateKey}/data-request`), body);
|
|
272
|
+
}
|
|
273
|
+
updateIkoDataRequest(aggregateKey, actionKey, body) {
|
|
274
|
+
return this.httpClient.put(this.getApiUrl(`management/v1/iko-data-aggregate/${aggregateKey}/data-request/${actionKey}`), body);
|
|
275
|
+
}
|
|
276
|
+
deleteIkoDataRequest(aggregateKey, key) {
|
|
277
|
+
return this.httpClient.delete(this.getApiUrl(`management/v1/iko-data-aggregate/${aggregateKey}/data-request/${key}`));
|
|
278
|
+
}
|
|
279
|
+
getIkoDataRequestPropertyFields(type) {
|
|
280
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/iko-property-fields/${type}/data-request`));
|
|
281
|
+
}
|
|
282
|
+
getIkoRepositoryConfigs() {
|
|
283
|
+
return this.httpClient.get(this.getApiUrl(`/management/v1/iko`));
|
|
284
|
+
}
|
|
285
|
+
getIkoRepositoryConfig(key) {
|
|
286
|
+
return this.httpClient.get(this.getApiUrl(`/management/v1/iko/${key}`));
|
|
287
|
+
}
|
|
288
|
+
createIkoRepositoryConfig(key, body) {
|
|
289
|
+
return this.httpClient.post(this.getApiUrl(`management/v1/iko/${key}`), body);
|
|
290
|
+
}
|
|
291
|
+
updateIkoRepositoryConfig(key, body) {
|
|
292
|
+
return this.httpClient.put(this.getApiUrl(`/management/v1/iko/${key}`), body);
|
|
293
|
+
}
|
|
294
|
+
deleteIkoRepositoryConfig(key) {
|
|
295
|
+
return this.httpClient.delete(this.getApiUrl(`/management/v1/iko/${key}`));
|
|
296
|
+
}
|
|
297
|
+
getIkoRepositoryConfigPropertyFields(type) {
|
|
298
|
+
return this.httpClient.get(this.getApiUrl(`/management/v1/iko-property-fields/${type}/repository-config`));
|
|
299
|
+
}
|
|
300
|
+
getIkoRepositoryTypes() {
|
|
301
|
+
return this.httpClient.get(this.getApiUrl(`/management/v1/iko-types`));
|
|
302
|
+
}
|
|
303
|
+
getIkoTabs(aggregateKey) {
|
|
304
|
+
return this.httpClient.get(this.getApiUrl(`/v1/iko-data-aggregate/${aggregateKey}/tab`));
|
|
305
|
+
}
|
|
306
|
+
getIkoTab(aggregateKey, tabKey) {
|
|
307
|
+
return this.httpClient.get(this.getApiUrl(`/management/v1/iko-data-aggregate/${aggregateKey}/tab/${tabKey}`));
|
|
308
|
+
}
|
|
309
|
+
createIkoTab(aggregateKey, tabKey, body) {
|
|
310
|
+
return this.httpClient.post(this.getApiUrl(`/management/v1/iko-data-aggregate/${aggregateKey}/tab/${tabKey}`), body);
|
|
311
|
+
}
|
|
312
|
+
updateIkoTabs(aggregateKey, body) {
|
|
313
|
+
return this.httpClient.put(this.getApiUrl(`/management/v1/iko-data-aggregate/${aggregateKey}/tab`), body);
|
|
314
|
+
}
|
|
315
|
+
updateIkoTab(aggregateKey, tabKey, body) {
|
|
316
|
+
return this.httpClient.put(this.getApiUrl(`/management/v1/iko-data-aggregate/${aggregateKey}/tab/${tabKey}`), body);
|
|
317
|
+
}
|
|
318
|
+
deleteIkoTab(aggregateKey, tabKey) {
|
|
319
|
+
return this.httpClient.delete(this.getApiUrl(`/management/v1/iko-data-aggregate/${aggregateKey}/tab/${tabKey}`));
|
|
320
|
+
}
|
|
321
|
+
getIkoWidget(aggregateKey, tabKey, widgetKey) {
|
|
322
|
+
return this.httpClient.get(this.getApiUrl(`/v1/iko-data-aggregate/${aggregateKey}/tab/${tabKey}/widget/${widgetKey}`));
|
|
323
|
+
}
|
|
324
|
+
getIkoSearchFields(aggregateKey, requestKey) {
|
|
325
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/iko-data-aggregate/${aggregateKey}/data-request/${requestKey}/search-field`));
|
|
326
|
+
}
|
|
327
|
+
getIkoSearchField(aggregateKey, requestKey, key) {
|
|
328
|
+
return this.httpClient.get(this.getApiUrl(`/v1/iko-data-aggregate/${aggregateKey}/data-request/${requestKey}/search-field/${key}`));
|
|
329
|
+
}
|
|
330
|
+
createIkoSearchField(aggregateKey, requestKey, key, body) {
|
|
331
|
+
return this.httpClient.post(this.getApiUrl(`management/v1/iko-data-aggregate/${aggregateKey}/data-request/${requestKey}/search-field/${key}`), body);
|
|
332
|
+
}
|
|
333
|
+
updateIkoSearchFields(aggregateKey, requestKey, body) {
|
|
334
|
+
return this.httpClient.put(this.getApiUrl(`management/v1/iko-data-aggregate/${aggregateKey}/data-request/${requestKey}/search-field`), body);
|
|
335
|
+
}
|
|
336
|
+
updateIkoSearchField(aggregateKey, requestKey, fieldKey, body) {
|
|
337
|
+
return this.httpClient.put(this.getApiUrl(`management/v1/iko-data-aggregate/${aggregateKey}/data-request/${requestKey}/search-field/${fieldKey}`), body);
|
|
338
|
+
}
|
|
339
|
+
deleteIkoSearchField(aggregateKey, requestKey, key) {
|
|
340
|
+
return this.httpClient.delete(this.getApiUrl(`management/v1/iko-data-aggregate/${aggregateKey}/data-request/${requestKey}/search-field/${key}`));
|
|
341
|
+
}
|
|
342
|
+
getIkoListColumns(aggregateKey) {
|
|
343
|
+
return this.httpClient.get(this.getApiUrl(`/management/v1/iko-data-aggregate/${aggregateKey}/column`));
|
|
344
|
+
}
|
|
345
|
+
getIkoListColumn(aggregateKey, columnKey) {
|
|
346
|
+
return this.httpClient.get(this.getApiUrl(`/management/v1/iko-data-aggregate/${aggregateKey}/column/${columnKey}`));
|
|
347
|
+
}
|
|
348
|
+
createIkoListColumn(aggregateKey, columnKey, body) {
|
|
349
|
+
return this.httpClient.post(this.getApiUrl(`/management/v1/iko-data-aggregate/${aggregateKey}/column/${columnKey}`), body);
|
|
350
|
+
}
|
|
351
|
+
updateListColumn(aggregateKey, columnKey, body) {
|
|
352
|
+
return this.httpClient.put(this.getApiUrl(`/management/v1/iko-data-aggregate/${aggregateKey}/column/${columnKey}`), body);
|
|
353
|
+
}
|
|
354
|
+
updateIkoListColumnOrder(aggregateKey, body) {
|
|
355
|
+
return this.httpClient.put(this.getApiUrl(`/management/v1/iko-data-aggregate/${aggregateKey}/column`), body);
|
|
356
|
+
}
|
|
357
|
+
deleteIkoListColumn(aggregateKey, columnKey) {
|
|
358
|
+
return this.httpClient.delete(this.getApiUrl(`/management/v1/iko-data-aggregate/${aggregateKey}/column/${columnKey}`));
|
|
359
|
+
}
|
|
360
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementApiService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
361
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementApiService, providedIn: 'root' }); }
|
|
362
|
+
}
|
|
363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementApiService, decorators: [{
|
|
364
|
+
type: Injectable,
|
|
365
|
+
args: [{
|
|
366
|
+
providedIn: 'root',
|
|
367
|
+
}]
|
|
368
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ConfigService }] });
|
|
369
|
+
|
|
370
|
+
/*
|
|
371
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
372
|
+
*
|
|
373
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
374
|
+
* you may not use this file except in compliance with the License.
|
|
375
|
+
* You may obtain a copy of the License at
|
|
376
|
+
*
|
|
377
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
378
|
+
*
|
|
379
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
380
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
381
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
382
|
+
* See the License for the specific language governing permissions and
|
|
383
|
+
* limitations under the License.
|
|
384
|
+
*/
|
|
385
|
+
class IkoMenuService {
|
|
386
|
+
constructor(ikoApiService) {
|
|
387
|
+
this.ikoApiService = ikoApiService;
|
|
388
|
+
this.appendIkoMenuItems = (menuItems) => {
|
|
389
|
+
const ikoExists = menuItems.some(item => item.title === 'IKO');
|
|
390
|
+
if (ikoExists)
|
|
391
|
+
return of(menuItems);
|
|
392
|
+
return this.ikoApiService.getIkoDataAggregates().pipe(map(ikoItems => {
|
|
393
|
+
this.ikoApiService.setCachedMenuItems(ikoItems.content);
|
|
394
|
+
let updatedMenuItems = [...menuItems];
|
|
395
|
+
if (ikoItems.content?.length) {
|
|
396
|
+
const ikoSubMenu = ikoItems.content.map((item, index) => ({
|
|
397
|
+
link: ['/iko', item.key],
|
|
398
|
+
title: item.title,
|
|
399
|
+
sequence: index,
|
|
400
|
+
show: true,
|
|
401
|
+
}));
|
|
402
|
+
const ikoMenu = {
|
|
403
|
+
title: 'IKO',
|
|
404
|
+
iconClass: 'icon mdi mdi-account',
|
|
405
|
+
show: true,
|
|
406
|
+
sequence: this.getIkoSequenceAfterCases(menuItems),
|
|
407
|
+
children: ikoSubMenu,
|
|
408
|
+
};
|
|
409
|
+
updatedMenuItems = [...menuItems, ikoMenu].sort((a, b) => a.sequence - b.sequence);
|
|
410
|
+
}
|
|
411
|
+
const adminMenuItem = updatedMenuItems.find(item => item.title.toUpperCase().includes('ADMIN') && !item.title.toUpperCase().includes('IKO'));
|
|
412
|
+
if (adminMenuItem && !adminMenuItem.children.some(item => item.title === 'IKO')) {
|
|
413
|
+
adminMenuItem.children = [
|
|
414
|
+
...adminMenuItem.children,
|
|
415
|
+
{
|
|
416
|
+
title: 'IKO',
|
|
417
|
+
show: true,
|
|
418
|
+
sequence: this.getIkoSequenceAfterCases(adminMenuItem.children ?? []),
|
|
419
|
+
link: ['/iko-management'],
|
|
420
|
+
},
|
|
421
|
+
].sort((a, b) => a.sequence - b.sequence);
|
|
422
|
+
}
|
|
423
|
+
return updatedMenuItems;
|
|
424
|
+
}));
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
getIkoSequenceAfterCases(menuItems) {
|
|
428
|
+
const casesItem = menuItems.find(item => item.title === 'Cases' || item.title === 'Dossiers');
|
|
429
|
+
return Number(casesItem?.sequence ?? 0) + 0.5;
|
|
430
|
+
}
|
|
431
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoMenuService, deps: [{ token: IkoApiService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
432
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoMenuService, providedIn: 'root' }); }
|
|
433
|
+
}
|
|
434
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoMenuService, decorators: [{
|
|
435
|
+
type: Injectable,
|
|
436
|
+
args: [{ providedIn: 'root' }]
|
|
437
|
+
}], ctorParameters: () => [{ type: IkoApiService }] });
|
|
438
|
+
|
|
439
|
+
class IkoWidgetManagementApiService extends BaseApiService {
|
|
440
|
+
get _params() {
|
|
441
|
+
return this._params$.getValue();
|
|
442
|
+
}
|
|
443
|
+
get params$() {
|
|
444
|
+
return this._params$.pipe(filter(params => !!params));
|
|
445
|
+
}
|
|
446
|
+
constructor(httpClient, configService) {
|
|
447
|
+
super(httpClient, configService);
|
|
448
|
+
this.httpClient = httpClient;
|
|
449
|
+
this.configService = configService;
|
|
450
|
+
this._params$ = new BehaviorSubject(null);
|
|
451
|
+
}
|
|
452
|
+
initParams(serviceParams) {
|
|
453
|
+
if (!isEqual(serviceParams, this._params))
|
|
454
|
+
this._params$.next(serviceParams);
|
|
455
|
+
}
|
|
456
|
+
getWidgetConfiguration() {
|
|
457
|
+
return this.params$.pipe(filter((params) => !!params), switchMap((params) => this.httpClient.get(this.getApiUrl(`management/v1/iko-data-aggregate/${params?.aggregateKey}/tab/${params?.widgetTabKey}/widget`))));
|
|
458
|
+
}
|
|
459
|
+
updateWidgetConfiguration(widgets) {
|
|
460
|
+
return this.params$.pipe(filter((params) => !!params), switchMap((params) => this.httpClient.put(this.getApiUrl(`management/v1/iko-data-aggregate/${params?.aggregateKey}/tab/${params?.widgetTabKey}/widget`), widgets)));
|
|
461
|
+
}
|
|
462
|
+
deleteWidget(widget) {
|
|
463
|
+
return this.params$.pipe(filter((params) => !!params), switchMap((params) => this.httpClient.delete(this.getApiUrl(`management/v1/iko-data-aggregate/${params?.aggregateKey}/tab/${params?.widgetTabKey}/widget/${widget.key}`))));
|
|
464
|
+
}
|
|
465
|
+
updateWidget(widget) {
|
|
466
|
+
return this.params$.pipe(filter((params) => !!params), switchMap((params) => this.httpClient.put(this.getApiUrl(`management/v1/iko-data-aggregate/${params?.aggregateKey}/tab/${params?.widgetTabKey}/widget/${widget.key}`), widget)));
|
|
467
|
+
}
|
|
468
|
+
createWidget(widget) {
|
|
469
|
+
return this.params$.pipe(filter((params) => !!params), switchMap((params) => this.httpClient.post(this.getApiUrl(`management/v1/iko-data-aggregate/${params?.aggregateKey}/tab/${params?.widgetTabKey}/widget/${widget.key}`), widget)));
|
|
470
|
+
}
|
|
471
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetManagementApiService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
472
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetManagementApiService }); }
|
|
473
|
+
}
|
|
474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetManagementApiService, decorators: [{
|
|
475
|
+
type: Injectable
|
|
476
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ConfigService }] });
|
|
477
|
+
|
|
478
|
+
/*
|
|
479
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
480
|
+
*
|
|
481
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
482
|
+
* you may not use this file except in compliance with the License.
|
|
483
|
+
* You may obtain a copy of the License at
|
|
484
|
+
*
|
|
485
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
486
|
+
*
|
|
487
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
488
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
489
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
490
|
+
* See the License for the specific language governing permissions and
|
|
491
|
+
* limitations under the License.
|
|
492
|
+
*/
|
|
493
|
+
|
|
494
|
+
/*
|
|
495
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
496
|
+
*
|
|
497
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
498
|
+
* you may not use this file except in compliance with the License.
|
|
499
|
+
* You may obtain a copy of the License at
|
|
500
|
+
*
|
|
501
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
502
|
+
*
|
|
503
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
504
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
505
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
506
|
+
* See the License for the specific language governing permissions and
|
|
507
|
+
* limitations under the License.
|
|
508
|
+
*/
|
|
509
|
+
class IkoWidgetCollectionComponent {
|
|
510
|
+
set widgetConfiguration(value) {
|
|
511
|
+
if (!value)
|
|
512
|
+
return;
|
|
513
|
+
this.widgetConfiguration$.next(value);
|
|
514
|
+
}
|
|
515
|
+
set widgetParams(value) {
|
|
516
|
+
this._widgetParams$.next(value);
|
|
517
|
+
}
|
|
518
|
+
constructor(ikoApiService, widgetLayoutService) {
|
|
519
|
+
this.ikoApiService = ikoApiService;
|
|
520
|
+
this.widgetLayoutService = widgetLayoutService;
|
|
521
|
+
this._widgetParams$ = new BehaviorSubject(null);
|
|
522
|
+
this.widgetConfiguration$ = new BehaviorSubject(null);
|
|
523
|
+
this._queryParams$ = new BehaviorSubject(null);
|
|
524
|
+
this.widgetData$ = combineLatest([
|
|
525
|
+
this.widgetConfiguration$,
|
|
526
|
+
this._widgetParams$,
|
|
527
|
+
]).pipe(switchMap(([widgetConfiguration, widgetParams]) => !widgetParams || !widgetConfiguration
|
|
528
|
+
? of(null)
|
|
529
|
+
: this.ikoApiService.getIkoWidgetData(widgetParams.dataAggregateKey, widgetParams.tabKey, widgetConfiguration.key, widgetParams.entryId)), tap(() => this.widgetLayoutService.setWidgetDataLoaded(this.widgetUuid)));
|
|
530
|
+
}
|
|
531
|
+
onPaginationEvent(event) {
|
|
532
|
+
this._queryParams$.next(`page=${event.currentPage - 1}&size=${event.pageLength}`);
|
|
533
|
+
}
|
|
534
|
+
onWidgetActionClick(action) {
|
|
535
|
+
this.ikoApiService.handleAction(action);
|
|
536
|
+
}
|
|
537
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetCollectionComponent, deps: [{ token: IkoApiService }, { token: i2$1.WidgetLayoutService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
538
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: IkoWidgetCollectionComponent, isStandalone: true, selector: "valtimo-iko-widget-collection", inputs: { widgetConfiguration: "widgetConfiguration", widgetParams: "widgetParams", widgetUuid: "widgetUuid" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-collection\n *ngIf=\"{\n widgetConfiguration: widgetConfiguration$ | async,\n widgetData: widgetData$ | async,\n } as obs\"\n [widgetConfiguration]=\"obs.widgetConfiguration\"\n [widgetData]=\"obs.widgetData\"\n (paginationEvent)=\"onPaginationEvent($event)\"\n>\n @if (obs.widgetConfiguration?.actions?.length >= 1) {\n <button cdsButton=\"ghost\" (click)=\"onWidgetActionClick(obs.widgetConfiguration?.actions[0])\">\n {{ obs.widgetConfiguration?.actions[0].name }}\n </button>\n }\n</valtimo-widget-collection>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: InputModule }, { kind: "ngmodule", type: PaginationModule }, { kind: "ngmodule", type: TilesModule }, { kind: "ngmodule", type: CarbonListModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: WidgetCollectionComponent, selector: "valtimo-widget-collection", inputs: ["widgetConfiguration", "widgetData"], outputs: ["paginationEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
539
|
+
}
|
|
540
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetCollectionComponent, decorators: [{
|
|
541
|
+
type: Component,
|
|
542
|
+
args: [{ selector: 'valtimo-iko-widget-collection', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
|
543
|
+
CommonModule,
|
|
544
|
+
InputModule,
|
|
545
|
+
PaginationModule,
|
|
546
|
+
TilesModule,
|
|
547
|
+
CarbonListModule,
|
|
548
|
+
TranslateModule,
|
|
549
|
+
ButtonModule,
|
|
550
|
+
WidgetCollectionComponent,
|
|
551
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-collection\n *ngIf=\"{\n widgetConfiguration: widgetConfiguration$ | async,\n widgetData: widgetData$ | async,\n } as obs\"\n [widgetConfiguration]=\"obs.widgetConfiguration\"\n [widgetData]=\"obs.widgetData\"\n (paginationEvent)=\"onPaginationEvent($event)\"\n>\n @if (obs.widgetConfiguration?.actions?.length >= 1) {\n <button cdsButton=\"ghost\" (click)=\"onWidgetActionClick(obs.widgetConfiguration?.actions[0])\">\n {{ obs.widgetConfiguration?.actions[0].name }}\n </button>\n }\n</valtimo-widget-collection>\n" }]
|
|
552
|
+
}], ctorParameters: () => [{ type: IkoApiService }, { type: i2$1.WidgetLayoutService }], propDecorators: { widgetConfiguration: [{
|
|
553
|
+
type: Input
|
|
554
|
+
}], widgetParams: [{
|
|
555
|
+
type: Input
|
|
556
|
+
}], widgetUuid: [{
|
|
557
|
+
type: Input
|
|
558
|
+
}] } });
|
|
559
|
+
|
|
560
|
+
/*
|
|
561
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
562
|
+
*
|
|
563
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
564
|
+
* you may not use this file except in compliance with the License.
|
|
565
|
+
* You may obtain a copy of the License at
|
|
566
|
+
*
|
|
567
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
568
|
+
*
|
|
569
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
570
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
571
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
572
|
+
* See the License for the specific language governing permissions and
|
|
573
|
+
* limitations under the License.
|
|
574
|
+
*/
|
|
575
|
+
|
|
576
|
+
/*
|
|
577
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
578
|
+
*
|
|
579
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
580
|
+
* you may not use this file except in compliance with the License.
|
|
581
|
+
* You may obtain a copy of the License at
|
|
582
|
+
*
|
|
583
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
584
|
+
*
|
|
585
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
586
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
587
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
588
|
+
* See the License for the specific language governing permissions and
|
|
589
|
+
* limitations under the License.
|
|
590
|
+
*/
|
|
591
|
+
class IkoWidgetCustomComponent {
|
|
592
|
+
constructor() {
|
|
593
|
+
this._widgetConfigSubject$ = new BehaviorSubject(null);
|
|
594
|
+
}
|
|
595
|
+
set widgetConfiguration(value) {
|
|
596
|
+
if (!value)
|
|
597
|
+
return;
|
|
598
|
+
this._widgetConfigSubject$.next(value);
|
|
599
|
+
}
|
|
600
|
+
get widgetConfig$() {
|
|
601
|
+
return this._widgetConfigSubject$.pipe(filter(config => config !== null));
|
|
602
|
+
}
|
|
603
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetCustomComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
604
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoWidgetCustomComponent, isStandalone: true, selector: "valtimo-iko-widget-custom", inputs: { widgetConfiguration: "widgetConfiguration", widgetUuid: "widgetUuid" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-custom\n *ngIf=\"widgetConfig$ | async as widgetConfig\"\n [widgetConfiguration]=\"widgetConfig\"\n [widgetUuid]=\"widgetUuid\"\n>\n</valtimo-widget-custom>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: WidgetCustomComponent, selector: "valtimo-widget-custom", inputs: ["widgetConfiguration", "widgetUuid"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
605
|
+
}
|
|
606
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetCustomComponent, decorators: [{
|
|
607
|
+
type: Component,
|
|
608
|
+
args: [{ selector: 'valtimo-iko-widget-custom', standalone: true, imports: [CommonModule, CarbonListModule, TranslateModule, ButtonModule, WidgetCustomComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-custom\n *ngIf=\"widgetConfig$ | async as widgetConfig\"\n [widgetConfiguration]=\"widgetConfig\"\n [widgetUuid]=\"widgetUuid\"\n>\n</valtimo-widget-custom>\n" }]
|
|
609
|
+
}], propDecorators: { widgetConfiguration: [{
|
|
610
|
+
type: Input
|
|
611
|
+
}], widgetUuid: [{
|
|
612
|
+
type: Input
|
|
613
|
+
}] } });
|
|
614
|
+
|
|
615
|
+
/*
|
|
616
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
617
|
+
*
|
|
618
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
619
|
+
* you may not use this file except in compliance with the License.
|
|
620
|
+
* You may obtain a copy of the License at
|
|
621
|
+
*
|
|
622
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
623
|
+
*
|
|
624
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
625
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
626
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
627
|
+
* See the License for the specific language governing permissions and
|
|
628
|
+
* limitations under the License.
|
|
629
|
+
*/
|
|
630
|
+
|
|
631
|
+
/*
|
|
632
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
633
|
+
*
|
|
634
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
635
|
+
* you may not use this file except in compliance with the License.
|
|
636
|
+
* You may obtain a copy of the License at
|
|
637
|
+
*
|
|
638
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
639
|
+
*
|
|
640
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
641
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
642
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
643
|
+
* See the License for the specific language governing permissions and
|
|
644
|
+
* limitations under the License.
|
|
645
|
+
*/
|
|
646
|
+
class IkoWidgetFieldComponent {
|
|
647
|
+
set widgetConfiguration(value) {
|
|
648
|
+
if (!value)
|
|
649
|
+
return;
|
|
650
|
+
this.widgetConfiguration$.next(value);
|
|
651
|
+
}
|
|
652
|
+
set widgetParams(value) {
|
|
653
|
+
this._widgetParams$.next(value);
|
|
654
|
+
}
|
|
655
|
+
constructor(ikoApiService, widgetLayoutService) {
|
|
656
|
+
this.ikoApiService = ikoApiService;
|
|
657
|
+
this.widgetLayoutService = widgetLayoutService;
|
|
658
|
+
this._widgetParams$ = new BehaviorSubject(null);
|
|
659
|
+
this.widgetConfiguration$ = new BehaviorSubject(null);
|
|
660
|
+
this.widgetData$ = combineLatest([
|
|
661
|
+
this.widgetConfiguration$,
|
|
662
|
+
this._widgetParams$,
|
|
663
|
+
]).pipe(switchMap(([widgetConfiguration, widgetParams]) => !widgetParams || !widgetConfiguration
|
|
664
|
+
? of(null)
|
|
665
|
+
: this.ikoApiService.getIkoWidgetData(widgetParams.dataAggregateKey, widgetParams.tabKey, widgetConfiguration.key, widgetParams.entryId)), tap(() => this.widgetLayoutService.setWidgetDataLoaded(this.widgetUuid)));
|
|
666
|
+
}
|
|
667
|
+
onWidgetActionClick(action) {
|
|
668
|
+
this.ikoApiService.handleAction(action);
|
|
669
|
+
}
|
|
670
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetFieldComponent, deps: [{ token: IkoApiService }, { token: i2$1.WidgetLayoutService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
671
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoWidgetFieldComponent, isStandalone: true, selector: "valtimo-iko-widget-field", inputs: { widgetConfiguration: "widgetConfiguration", widgetParams: "widgetParams", widgetUuid: "widgetUuid" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-field\n [widgetConfiguration]=\"widgetConfiguration$ | async\"\n [widgetData]=\"widgetData$ | async\"\n>\n</valtimo-widget-field>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: InputModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: CarbonListModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: WidgetFieldComponent, selector: "valtimo-widget-field", inputs: ["widgetConfiguration", "widgetData", "compact"], outputs: ["noVisibleFieldsEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
672
|
+
}
|
|
673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetFieldComponent, decorators: [{
|
|
674
|
+
type: Component,
|
|
675
|
+
args: [{ selector: 'valtimo-iko-widget-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
676
|
+
CommonModule,
|
|
677
|
+
InputModule,
|
|
678
|
+
TranslateModule,
|
|
679
|
+
CarbonListModule,
|
|
680
|
+
ButtonModule,
|
|
681
|
+
WidgetFieldComponent,
|
|
682
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-field\n [widgetConfiguration]=\"widgetConfiguration$ | async\"\n [widgetData]=\"widgetData$ | async\"\n>\n</valtimo-widget-field>\n" }]
|
|
683
|
+
}], ctorParameters: () => [{ type: IkoApiService }, { type: i2$1.WidgetLayoutService }], propDecorators: { widgetConfiguration: [{
|
|
684
|
+
type: Input
|
|
685
|
+
}], widgetParams: [{
|
|
686
|
+
type: Input
|
|
687
|
+
}], widgetUuid: [{
|
|
688
|
+
type: Input
|
|
689
|
+
}] } });
|
|
690
|
+
|
|
691
|
+
/*
|
|
692
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
693
|
+
*
|
|
694
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
695
|
+
* you may not use this file except in compliance with the License.
|
|
696
|
+
* You may obtain a copy of the License at
|
|
697
|
+
*
|
|
698
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
699
|
+
*
|
|
700
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
701
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
702
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
703
|
+
* See the License for the specific language governing permissions and
|
|
704
|
+
* limitations under the License.
|
|
705
|
+
*/
|
|
706
|
+
|
|
707
|
+
/*
|
|
708
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
709
|
+
*
|
|
710
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
711
|
+
* you may not use this file except in compliance with the License.
|
|
712
|
+
* You may obtain a copy of the License at
|
|
713
|
+
*
|
|
714
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
715
|
+
*
|
|
716
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
717
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
718
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
719
|
+
* See the License for the specific language governing permissions and
|
|
720
|
+
* limitations under the License.
|
|
721
|
+
*/
|
|
722
|
+
// TODO: remove component, document id is required, which makes no sense for iko
|
|
723
|
+
class IkoWidgetFormioComponent {
|
|
724
|
+
set widgetConfiguration(value) {
|
|
725
|
+
if (!value)
|
|
726
|
+
return;
|
|
727
|
+
this._widgetConfigurationSubject$.next(value);
|
|
728
|
+
}
|
|
729
|
+
get widgetConfiguration$() {
|
|
730
|
+
return this._widgetConfigurationSubject$.pipe(filter(config => !!config));
|
|
731
|
+
}
|
|
732
|
+
constructor(layoutService) {
|
|
733
|
+
this.layoutService = layoutService;
|
|
734
|
+
this._widgetConfigurationSubject$ = new BehaviorSubject(null);
|
|
735
|
+
}
|
|
736
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetFormioComponent, deps: [{ token: i2$1.WidgetLayoutService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
737
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoWidgetFormioComponent, isStandalone: true, selector: "valtimo-iko-widget-formio", inputs: { widgetConfiguration: "widgetConfiguration", widgetUuid: "widgetUuid" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-formio\n [widgetConfiguration]=\"widgetConfiguration$ | async\"\n [widgetUuid]=\"widgetUuid\"\n>\n</valtimo-widget-formio>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: FormIoModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: WidgetFormioComponent, selector: "valtimo-widget-formio", inputs: ["documentId", "widgetConfiguration", "widgetUuid", "refreshForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
738
|
+
}
|
|
739
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetFormioComponent, decorators: [{
|
|
740
|
+
type: Component,
|
|
741
|
+
args: [{ selector: 'valtimo-iko-widget-formio', standalone: true, imports: [CommonModule, TranslateModule, FormIoModule, ButtonModule, WidgetFormioComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-formio\n [widgetConfiguration]=\"widgetConfiguration$ | async\"\n [widgetUuid]=\"widgetUuid\"\n>\n</valtimo-widget-formio>\n" }]
|
|
742
|
+
}], ctorParameters: () => [{ type: i2$1.WidgetLayoutService }], propDecorators: { widgetConfiguration: [{
|
|
743
|
+
type: Input
|
|
744
|
+
}], widgetUuid: [{
|
|
745
|
+
type: Input
|
|
746
|
+
}] } });
|
|
747
|
+
|
|
748
|
+
/*
|
|
749
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
750
|
+
*
|
|
751
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
752
|
+
* you may not use this file except in compliance with the License.
|
|
753
|
+
* You may obtain a copy of the License at
|
|
754
|
+
*
|
|
755
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
756
|
+
*
|
|
757
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
758
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
759
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
760
|
+
* See the License for the specific language governing permissions and
|
|
761
|
+
* limitations under the License.
|
|
762
|
+
*/
|
|
763
|
+
|
|
764
|
+
/*
|
|
765
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
766
|
+
*
|
|
767
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
768
|
+
* you may not use this file except in compliance with the License.
|
|
769
|
+
* You may obtain a copy of the License at
|
|
770
|
+
*
|
|
771
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
772
|
+
*
|
|
773
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
774
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
775
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
776
|
+
* See the License for the specific language governing permissions and
|
|
777
|
+
* limitations under the License.
|
|
778
|
+
*/
|
|
779
|
+
class IkoWidgetInteractiveTableComponent {
|
|
780
|
+
set widgetConfiguration(value) {
|
|
781
|
+
this._widgetConfiguration = value;
|
|
782
|
+
this.widgetConfiguration$.next(value);
|
|
783
|
+
}
|
|
784
|
+
get widgetConfiguration() {
|
|
785
|
+
return this._widgetConfiguration;
|
|
786
|
+
}
|
|
787
|
+
set widgetParams(value) {
|
|
788
|
+
this._widgetParams$.next(value);
|
|
789
|
+
}
|
|
790
|
+
constructor(ikoApiService, widgetLayoutService, listService) {
|
|
791
|
+
this.ikoApiService = ikoApiService;
|
|
792
|
+
this.widgetLayoutService = widgetLayoutService;
|
|
793
|
+
this.listService = listService;
|
|
794
|
+
this.widgetConfiguration$ = new BehaviorSubject(null);
|
|
795
|
+
this._widgetParams$ = new BehaviorSubject(null);
|
|
796
|
+
this._queryParams$ = new BehaviorSubject(null);
|
|
797
|
+
this.widgetData$ = combineLatest([
|
|
798
|
+
this.widgetConfiguration$,
|
|
799
|
+
this._widgetParams$,
|
|
800
|
+
this.listService.forceRefresh$,
|
|
801
|
+
]).pipe(switchMap(([widgetConfiguration, widgetParams]) => !widgetParams || !widgetConfiguration
|
|
802
|
+
? of(null)
|
|
803
|
+
: this.ikoApiService.getIkoWidgetData(widgetParams.dataAggregateKey, widgetParams.tabKey, widgetConfiguration.key, widgetParams.entryId)), tap(() => this.widgetLayoutService.setWidgetDataLoaded(this.widgetUuid)));
|
|
804
|
+
}
|
|
805
|
+
onPaginationEvent(event) {
|
|
806
|
+
this._queryParams$.next(`page=${event.currentPage - 1}&size=${event.pageLength}`);
|
|
807
|
+
}
|
|
808
|
+
onRowClickEvent(event, widgetConfiguration) {
|
|
809
|
+
this.ikoApiService.handleAction(widgetConfiguration.properties.rowClickAction, event.resolved);
|
|
810
|
+
}
|
|
811
|
+
onActionEvent(action) {
|
|
812
|
+
this.ikoApiService.handleAction(action);
|
|
813
|
+
}
|
|
814
|
+
onCaseStartEvent(caseDefintion) {
|
|
815
|
+
this.listService.setCaseDefinitionKey(caseDefintion.caseDefinitionKey);
|
|
816
|
+
this.listActionsComponent.startCase();
|
|
817
|
+
}
|
|
818
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetInteractiveTableComponent, deps: [{ token: IkoApiService }, { token: i2$1.WidgetLayoutService }, { token: i3.CaseListService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
819
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoWidgetInteractiveTableComponent, isStandalone: true, selector: "valtimo-iko-widget-interactive-table", inputs: { widgetConfiguration: "widgetConfiguration", widgetUuid: "widgetUuid", widgetParams: "widgetParams" }, providers: [CaseListService], viewQueries: [{ propertyName: "listActionsComponent", first: true, predicate: CaseListActionsComponent, descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-interactive-table\n *ngIf=\"widgetConfiguration$ | async as widgetConfiguration\"\n [widgetData]=\"widgetData$ | async\"\n [widgetConfiguration]=\"widgetConfiguration\"\n (actionEvent)=\"onActionEvent($event)\"\n (paginationEvent)=\"onPaginationEvent($event)\"\n (rowClickEvent)=\"onRowClickEvent($event, widgetConfiguration)\"\n (caseStartEvent)=\"onCaseStartEvent($event)\"\n>\n</valtimo-widget-interactive-table>\n\n<valtimo-case-list-actions [navigateAfterSubmit]=\"false\"></valtimo-case-list-actions>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "ngmodule", type: PaginationModule }, { kind: "ngmodule", type: TilesModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: WidgetInteractiveTableComponent, selector: "valtimo-widget-interactive-table", inputs: ["widgetConfiguration", "widgetData"], outputs: ["paginationEvent", "rowClickEvent", "actionEvent", "caseStartEvent"] }, { kind: "component", type: CaseListActionsComponent, selector: "valtimo-case-list-actions", inputs: ["loading", "navigateAfterSubmit"], outputs: ["formFlowComplete", "startButtonDisableEvent"] }, { kind: "ngmodule", type: ModalModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
820
|
+
}
|
|
821
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetInteractiveTableComponent, decorators: [{
|
|
822
|
+
type: Component,
|
|
823
|
+
args: [{ selector: 'valtimo-iko-widget-interactive-table', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
|
824
|
+
CommonModule,
|
|
825
|
+
CarbonListModule,
|
|
826
|
+
PaginationModule,
|
|
827
|
+
TilesModule,
|
|
828
|
+
TranslateModule,
|
|
829
|
+
ButtonModule,
|
|
830
|
+
WidgetInteractiveTableComponent,
|
|
831
|
+
CaseListActionsComponent,
|
|
832
|
+
ModalModule,
|
|
833
|
+
], providers: [CaseListService], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-interactive-table\n *ngIf=\"widgetConfiguration$ | async as widgetConfiguration\"\n [widgetData]=\"widgetData$ | async\"\n [widgetConfiguration]=\"widgetConfiguration\"\n (actionEvent)=\"onActionEvent($event)\"\n (paginationEvent)=\"onPaginationEvent($event)\"\n (rowClickEvent)=\"onRowClickEvent($event, widgetConfiguration)\"\n (caseStartEvent)=\"onCaseStartEvent($event)\"\n>\n</valtimo-widget-interactive-table>\n\n<valtimo-case-list-actions [navigateAfterSubmit]=\"false\"></valtimo-case-list-actions>\n" }]
|
|
834
|
+
}], ctorParameters: () => [{ type: IkoApiService }, { type: i2$1.WidgetLayoutService }, { type: i3.CaseListService }], propDecorators: { listActionsComponent: [{
|
|
835
|
+
type: ViewChild,
|
|
836
|
+
args: [CaseListActionsComponent]
|
|
837
|
+
}], widgetConfiguration: [{
|
|
838
|
+
type: Input,
|
|
839
|
+
args: [{ required: true }]
|
|
840
|
+
}], widgetUuid: [{
|
|
841
|
+
type: Input
|
|
842
|
+
}], widgetParams: [{
|
|
843
|
+
type: Input
|
|
844
|
+
}] } });
|
|
845
|
+
|
|
846
|
+
/*
|
|
847
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
848
|
+
*
|
|
849
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
850
|
+
* you may not use this file except in compliance with the License.
|
|
851
|
+
* You may obtain a copy of the License at
|
|
852
|
+
*
|
|
853
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
854
|
+
*
|
|
855
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
856
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
857
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
858
|
+
* See the License for the specific language governing permissions and
|
|
859
|
+
* limitations under the License.
|
|
860
|
+
*/
|
|
861
|
+
|
|
862
|
+
/*
|
|
863
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
864
|
+
*
|
|
865
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
866
|
+
* you may not use this file except in compliance with the License.
|
|
867
|
+
* You may obtain a copy of the License at
|
|
868
|
+
*
|
|
869
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
870
|
+
*
|
|
871
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
872
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
873
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
874
|
+
* See the License for the specific language governing permissions and
|
|
875
|
+
* limitations under the License.
|
|
876
|
+
*/
|
|
877
|
+
class IkoWidgetTableComponent {
|
|
878
|
+
set widgetConfiguration(value) {
|
|
879
|
+
this._widgetConfiguration = value;
|
|
880
|
+
this.widgetConfiguration$.next(value);
|
|
881
|
+
}
|
|
882
|
+
get widgetConfiguration() {
|
|
883
|
+
return this._widgetConfiguration;
|
|
884
|
+
}
|
|
885
|
+
set widgetParams(value) {
|
|
886
|
+
this._widgetParams$.next(value);
|
|
887
|
+
}
|
|
888
|
+
constructor(ikoApiService, widgetLayoutService) {
|
|
889
|
+
this.ikoApiService = ikoApiService;
|
|
890
|
+
this.widgetLayoutService = widgetLayoutService;
|
|
891
|
+
this.widgetConfiguration$ = new BehaviorSubject(null);
|
|
892
|
+
this._widgetParams$ = new BehaviorSubject(null);
|
|
893
|
+
this._queryParams$ = new BehaviorSubject(null);
|
|
894
|
+
this.widgetData$ = combineLatest([
|
|
895
|
+
this.widgetConfiguration$,
|
|
896
|
+
this._widgetParams$,
|
|
897
|
+
]).pipe(switchMap(([widgetConfiguration, widgetParams]) => !widgetParams || !widgetConfiguration
|
|
898
|
+
? of(null)
|
|
899
|
+
: this.ikoApiService.getIkoWidgetData(widgetParams.dataAggregateKey, widgetParams.tabKey, widgetConfiguration.key, widgetParams.entryId)), tap(() => this.widgetLayoutService.setWidgetDataLoaded(this.widgetUuid)));
|
|
900
|
+
}
|
|
901
|
+
onPaginationEvent(event) {
|
|
902
|
+
this._queryParams$.next(`page=${event.currentPage - 1}&size=${event.pageLength}`);
|
|
903
|
+
}
|
|
904
|
+
getPageSizeParam(widgetConfiguration) {
|
|
905
|
+
return `size=${widgetConfiguration.properties.defaultPageSize}`;
|
|
906
|
+
}
|
|
907
|
+
onWidgetActionClick(action) {
|
|
908
|
+
this.ikoApiService.handleAction(action);
|
|
909
|
+
}
|
|
910
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetTableComponent, deps: [{ token: IkoApiService }, { token: i2$1.WidgetLayoutService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
911
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: IkoWidgetTableComponent, isStandalone: true, selector: "valtimo-iko-widget-table", inputs: { widgetConfiguration: "widgetConfiguration", widgetUuid: "widgetUuid", widgetParams: "widgetParams" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-table\n [widgetData]=\"widgetData$ | async\"\n [widgetConfiguration]=\"widgetConfiguration\"\n (paginationEvent)=\"onPaginationEvent($event)\"\n>\n @if (widgetConfiguration?.actions?.length >= 1) {\n <button cdsButton=\"ghost\" (click)=\"onWidgetActionClick(widgetConfiguration?.actions[0])\">\n {{ widgetConfiguration?.actions[0].name }}\n </button>\n }\n</valtimo-widget-table>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "ngmodule", type: PaginationModule }, { kind: "ngmodule", type: TilesModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: WidgetTableComponent, selector: "valtimo-widget-table", inputs: ["widgetConfiguration", "widgetData"], outputs: ["paginationEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
912
|
+
}
|
|
913
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetTableComponent, decorators: [{
|
|
914
|
+
type: Component,
|
|
915
|
+
args: [{ selector: 'valtimo-iko-widget-table', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
|
916
|
+
CommonModule,
|
|
917
|
+
CarbonListModule,
|
|
918
|
+
PaginationModule,
|
|
919
|
+
TilesModule,
|
|
920
|
+
TranslateModule,
|
|
921
|
+
ButtonModule,
|
|
922
|
+
WidgetTableComponent,
|
|
923
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-table\n [widgetData]=\"widgetData$ | async\"\n [widgetConfiguration]=\"widgetConfiguration\"\n (paginationEvent)=\"onPaginationEvent($event)\"\n>\n @if (widgetConfiguration?.actions?.length >= 1) {\n <button cdsButton=\"ghost\" (click)=\"onWidgetActionClick(widgetConfiguration?.actions[0])\">\n {{ widgetConfiguration?.actions[0].name }}\n </button>\n }\n</valtimo-widget-table>\n" }]
|
|
924
|
+
}], ctorParameters: () => [{ type: IkoApiService }, { type: i2$1.WidgetLayoutService }], propDecorators: { widgetConfiguration: [{
|
|
925
|
+
type: Input,
|
|
926
|
+
args: [{ required: true }]
|
|
927
|
+
}], widgetUuid: [{
|
|
928
|
+
type: Input
|
|
929
|
+
}], widgetParams: [{
|
|
930
|
+
type: Input
|
|
931
|
+
}] } });
|
|
932
|
+
|
|
933
|
+
/*
|
|
934
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
935
|
+
*
|
|
936
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
937
|
+
* you may not use this file except in compliance with the License.
|
|
938
|
+
* You may obtain a copy of the License at
|
|
939
|
+
*
|
|
940
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
941
|
+
*
|
|
942
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
943
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
944
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
945
|
+
* See the License for the specific language governing permissions and
|
|
946
|
+
* limitations under the License.
|
|
947
|
+
*/
|
|
948
|
+
|
|
949
|
+
/*
|
|
950
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
951
|
+
*
|
|
952
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
953
|
+
* you may not use this file except in compliance with the License.
|
|
954
|
+
* You may obtain a copy of the License at
|
|
955
|
+
*
|
|
956
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
957
|
+
*
|
|
958
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
959
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
960
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
961
|
+
* See the License for the specific language governing permissions and
|
|
962
|
+
* limitations under the License.
|
|
963
|
+
*/
|
|
964
|
+
class IkoWidgetComponent {
|
|
965
|
+
set key(value) {
|
|
966
|
+
this._key$.next(value);
|
|
967
|
+
}
|
|
968
|
+
get key$() {
|
|
969
|
+
return this._key$.pipe(filter((key) => !!key));
|
|
970
|
+
}
|
|
971
|
+
constructor(ikoTabService, ikoApiService, logger) {
|
|
972
|
+
this.ikoTabService = ikoTabService;
|
|
973
|
+
this.ikoApiService = ikoApiService;
|
|
974
|
+
this.logger = logger;
|
|
975
|
+
this.dataAggregateKey$ = this.ikoTabService.dataAggregateKey$;
|
|
976
|
+
this.entryId$ = this.ikoTabService.entryId$;
|
|
977
|
+
this._key$ = new BehaviorSubject('');
|
|
978
|
+
this.loading$ = new BehaviorSubject(true);
|
|
979
|
+
this.widgets$ = combineLatest([this.dataAggregateKey$, this.key$]).pipe(switchMap(([dataAggregateKey, key]) => this.ikoApiService.getIkoWidget(dataAggregateKey, key)));
|
|
980
|
+
this.widgetParams$ = combineLatest([
|
|
981
|
+
this.dataAggregateKey$,
|
|
982
|
+
this.key$,
|
|
983
|
+
this.entryId$,
|
|
984
|
+
]).pipe(map$1(([dataAggregateKey, tabKey, entryId]) => ({
|
|
985
|
+
dataAggregateKey,
|
|
986
|
+
entryId,
|
|
987
|
+
tabKey,
|
|
988
|
+
})), tap(widgets => {
|
|
989
|
+
this.logger.debug(`IKO widgets retrieved ${JSON.stringify(widgets)}`);
|
|
990
|
+
this.loading$.next(false);
|
|
991
|
+
}));
|
|
992
|
+
this.widgetComponentMap = {
|
|
993
|
+
[WidgetType.FIELDS]: IkoWidgetFieldComponent,
|
|
994
|
+
[WidgetType.CUSTOM]: IkoWidgetCustomComponent,
|
|
995
|
+
[WidgetType.FORMIO]: IkoWidgetFormioComponent,
|
|
996
|
+
[WidgetType.TABLE]: IkoWidgetTableComponent,
|
|
997
|
+
[WidgetType.INTERACTIVE_TABLE]: IkoWidgetInteractiveTableComponent,
|
|
998
|
+
[WidgetType.COLLECTION]: IkoWidgetCollectionComponent,
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetComponent, deps: [{ token: IkoTabService }, { token: IkoApiService }, { token: i1$1.NGXLogger }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1002
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoWidgetComponent, isStandalone: true, selector: "ng-component", inputs: { key: "key" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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<valtimo-widget-container\n [widgets]=\"widgets$ | async\"\n [widgetComponentMap]=\"widgetComponentMap\"\n [widgetParams]=\"widgetParams$ | async\"\n>\n</valtimo-widget-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "component", type: WidgetContainerComponent, selector: "valtimo-widget-container", inputs: ["widgets", "widgetComponentMap", "widgetParams"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1003
|
+
}
|
|
1004
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoWidgetComponent, decorators: [{
|
|
1005
|
+
type: Component,
|
|
1006
|
+
args: [{ standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, WidgetContainerComponent], template: "<!--\n ~ Copyright 2015-2025 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<valtimo-widget-container\n [widgets]=\"widgets$ | async\"\n [widgetComponentMap]=\"widgetComponentMap\"\n [widgetParams]=\"widgetParams$ | async\"\n>\n</valtimo-widget-container>\n" }]
|
|
1007
|
+
}], ctorParameters: () => [{ type: IkoTabService }, { type: IkoApiService }, { type: i1$1.NGXLogger }], propDecorators: { key: [{
|
|
1008
|
+
type: Input
|
|
1009
|
+
}] } });
|
|
1010
|
+
|
|
1011
|
+
/*
|
|
1012
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1013
|
+
*
|
|
1014
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1015
|
+
* you may not use this file except in compliance with the License.
|
|
1016
|
+
* You may obtain a copy of the License at
|
|
1017
|
+
*
|
|
1018
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1019
|
+
*
|
|
1020
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1021
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1022
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1023
|
+
* See the License for the specific language governing permissions and
|
|
1024
|
+
* limitations under the License.
|
|
1025
|
+
*/
|
|
1026
|
+
const IkoTabComponents = [IkoWidgetComponent];
|
|
1027
|
+
const TabComponentTypes = {
|
|
1028
|
+
widgets: IkoWidgetComponent,
|
|
1029
|
+
};
|
|
1030
|
+
|
|
1031
|
+
/*
|
|
1032
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1033
|
+
*
|
|
1034
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1035
|
+
* you may not use this file except in compliance with the License.
|
|
1036
|
+
* You may obtain a copy of the License at
|
|
1037
|
+
*
|
|
1038
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1039
|
+
*
|
|
1040
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1041
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1042
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1043
|
+
* See the License for the specific language governing permissions and
|
|
1044
|
+
* limitations under the License.
|
|
1045
|
+
*/
|
|
1046
|
+
class IkoDetailsComponent {
|
|
1047
|
+
constructor(breadcrumbService, ikoApiService, ikoTabService, pageTitleService, route, translateService) {
|
|
1048
|
+
this.breadcrumbService = breadcrumbService;
|
|
1049
|
+
this.ikoApiService = ikoApiService;
|
|
1050
|
+
this.ikoTabService = ikoTabService;
|
|
1051
|
+
this.pageTitleService = pageTitleService;
|
|
1052
|
+
this.route = route;
|
|
1053
|
+
this.translateService = translateService;
|
|
1054
|
+
this.activeTabKey$ = this.ikoTabService.activeTabKey$;
|
|
1055
|
+
this.tabs$ = combineLatest([
|
|
1056
|
+
this.route.params,
|
|
1057
|
+
this.route.queryParams,
|
|
1058
|
+
this.translateService.stream('interface.results'),
|
|
1059
|
+
this.ikoApiService.cachedMenuItems$,
|
|
1060
|
+
]).pipe(tap(([params, queryParams, breadcrumbTitle, menuItems]) => {
|
|
1061
|
+
const currentMenuItem = menuItems.find(item => item.key === params.key);
|
|
1062
|
+
if (currentMenuItem && currentMenuItem?.title)
|
|
1063
|
+
this.pageTitleService.setCustomPageTitle(currentMenuItem.title, true);
|
|
1064
|
+
this.breadcrumbService.setSecondBreadcrumb({
|
|
1065
|
+
route: [`/iko/${params.key}`],
|
|
1066
|
+
content: currentMenuItem?.title ?? '',
|
|
1067
|
+
href: `/iko/${params.key}`,
|
|
1068
|
+
});
|
|
1069
|
+
this.breadcrumbService.setThirdBreadcrumb({
|
|
1070
|
+
content: breadcrumbTitle,
|
|
1071
|
+
route: [`/iko/${params.key}/${params.searchKey}`],
|
|
1072
|
+
href: `/iko/${params.key}/${params.searchKey}`,
|
|
1073
|
+
routeExtras: { queryParams },
|
|
1074
|
+
});
|
|
1075
|
+
this.ikoTabService.setDataAggregateKey(params.key);
|
|
1076
|
+
this.ikoTabService.setEntryId(params.id);
|
|
1077
|
+
}), switchMap(([params]) => this.ikoApiService.getIkoDetailTabs(params.key)), tap((tabs) => this.ikoTabService.setActiveTab(tabs[0])));
|
|
1078
|
+
}
|
|
1079
|
+
ngOnDestroy() {
|
|
1080
|
+
this.breadcrumbService.clearSecondBreadcrumb();
|
|
1081
|
+
this.breadcrumbService.clearThirdBreadcrumb();
|
|
1082
|
+
this.pageTitleService.enableReset();
|
|
1083
|
+
}
|
|
1084
|
+
onTabSelected(tab) {
|
|
1085
|
+
this.ikoTabService.setActiveTab(tab);
|
|
1086
|
+
this._container.clear();
|
|
1087
|
+
const componentRef = this._container.createComponent(TabComponentTypes[tab.type]);
|
|
1088
|
+
componentRef.instance.key = tab.key;
|
|
1089
|
+
}
|
|
1090
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoDetailsComponent, deps: [{ token: i1$2.BreadcrumbService }, { token: IkoApiService }, { token: IkoTabService }, { token: i1$2.PageTitleService }, { token: i1$3.ActivatedRoute }, { token: i4$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1091
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: IkoDetailsComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "_container", first: true, predicate: ["content"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{tabs: tabs$ | async, activeTabKey: activeTabKey$ | async} as obs\"\n renderInPageHeader\n>\n <ng-template>\n <cds-tabs class=\"valtimo-iko-details\">\n @for (tab of obs.tabs; track tab.key) {\n <cds-tab\n [active]=\"obs.activeTabKey === tab.key\"\n [heading]=\"tab.title\"\n (selected)=\"onTabSelected(tab)\"\n >\n </cds-tab>\n }\n </cds-tabs>\n </ng-template>\n</ng-container>\n\n<ng-container #content></ng-container>\n", styles: ["::ng-deep .page-actions{margin-left:unset!important}.valtimo-iko-details ::ng-deep .cds--tab-content{display:none}\n/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i6.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i6.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive", "tabContent", "templateContext"], outputs: ["selected"] }, { kind: "directive", type: RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1092
|
+
}
|
|
1093
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoDetailsComponent, decorators: [{
|
|
1094
|
+
type: Component,
|
|
1095
|
+
args: [{ standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, TabsModule, RenderInPageHeaderDirective, ...[IkoTabComponents]], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{tabs: tabs$ | async, activeTabKey: activeTabKey$ | async} as obs\"\n renderInPageHeader\n>\n <ng-template>\n <cds-tabs class=\"valtimo-iko-details\">\n @for (tab of obs.tabs; track tab.key) {\n <cds-tab\n [active]=\"obs.activeTabKey === tab.key\"\n [heading]=\"tab.title\"\n (selected)=\"onTabSelected(tab)\"\n >\n </cds-tab>\n }\n </cds-tabs>\n </ng-template>\n</ng-container>\n\n<ng-container #content></ng-container>\n", styles: ["::ng-deep .page-actions{margin-left:unset!important}.valtimo-iko-details ::ng-deep .cds--tab-content{display:none}\n/*!\n * Copyright 2015-2025 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"] }]
|
|
1096
|
+
}], ctorParameters: () => [{ type: i1$2.BreadcrumbService }, { type: IkoApiService }, { type: IkoTabService }, { type: i1$2.PageTitleService }, { type: i1$3.ActivatedRoute }, { type: i4$1.TranslateService }], propDecorators: { _container: [{
|
|
1097
|
+
type: ViewChild,
|
|
1098
|
+
args: ['content', { read: ViewContainerRef, static: true }]
|
|
1099
|
+
}] } });
|
|
1100
|
+
|
|
1101
|
+
/*
|
|
1102
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1103
|
+
*
|
|
1104
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1105
|
+
* you may not use this file except in compliance with the License.
|
|
1106
|
+
* You may obtain a copy of the License at
|
|
1107
|
+
*
|
|
1108
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1109
|
+
*
|
|
1110
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1111
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1112
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1113
|
+
* See the License for the specific language governing permissions and
|
|
1114
|
+
* limitations under the License.
|
|
1115
|
+
*/
|
|
1116
|
+
class IkoListComponent {
|
|
1117
|
+
constructor(breadcrumbService, ikoApiService, route, router) {
|
|
1118
|
+
this.breadcrumbService = breadcrumbService;
|
|
1119
|
+
this.ikoApiService = ikoApiService;
|
|
1120
|
+
this.route = route;
|
|
1121
|
+
this.router = router;
|
|
1122
|
+
this.loading$ = new BehaviorSubject(true);
|
|
1123
|
+
this.listConfig$ = combineLatest([
|
|
1124
|
+
this.route.params,
|
|
1125
|
+
this.route.queryParams,
|
|
1126
|
+
this.ikoApiService.cachedMenuItems$,
|
|
1127
|
+
]).pipe(tap(() => this.loading$.next(true)), switchMap(([params, queryParams, menuItems]) => {
|
|
1128
|
+
const currentMenuItem = menuItems.find(item => item.key === params.key);
|
|
1129
|
+
this.breadcrumbService.setSecondBreadcrumb({
|
|
1130
|
+
route: [`/iko/${params.key}`],
|
|
1131
|
+
content: currentMenuItem?.title ?? '',
|
|
1132
|
+
href: `/iko/${params.key}`,
|
|
1133
|
+
});
|
|
1134
|
+
return this.ikoApiService.searchIkoDataRequest(params.key, params.searchKey, {
|
|
1135
|
+
filters: queryParams,
|
|
1136
|
+
});
|
|
1137
|
+
}), map$1(res => ({
|
|
1138
|
+
fields: res.headers.reduce((acc, curr) => [
|
|
1139
|
+
...acc,
|
|
1140
|
+
...(curr.displayType.type === 'hidden'
|
|
1141
|
+
? []
|
|
1142
|
+
: [
|
|
1143
|
+
{
|
|
1144
|
+
key: curr.key,
|
|
1145
|
+
label: curr.title,
|
|
1146
|
+
viewType: curr.displayType.type,
|
|
1147
|
+
sortable: curr.sortable,
|
|
1148
|
+
...(!!curr.defaultSort && { default: curr.defaultSort }),
|
|
1149
|
+
...curr.displayType.displayTypeParameters,
|
|
1150
|
+
},
|
|
1151
|
+
]),
|
|
1152
|
+
], []),
|
|
1153
|
+
items: res.rows.content.map(stuff => stuff.items.reduce((acc, curr) => ({ ...acc, [curr.key]: curr.value }), {})),
|
|
1154
|
+
})), tap(() => this.loading$.next(false)));
|
|
1155
|
+
}
|
|
1156
|
+
ngOnDestroy() {
|
|
1157
|
+
this.breadcrumbService.clearSecondBreadcrumb();
|
|
1158
|
+
}
|
|
1159
|
+
onRowClicked(item) {
|
|
1160
|
+
this.router.navigate([`details/${item.id}`], {
|
|
1161
|
+
relativeTo: this.route,
|
|
1162
|
+
queryParamsHandling: 'preserve',
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoListComponent, deps: [{ token: i1$2.BreadcrumbService }, { token: IkoApiService }, { token: i1$3.ActivatedRoute }, { token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1166
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoListComponent, isStandalone: true, selector: "valtimo-iko-list", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n *ngIf=\"{\n listConfig: listConfig$ | async,\n loading: loading$ | async,\n } as obs\"\n [fields]=\"obs.listConfig?.fields\"\n [items]=\"obs.listConfig?.items\"\n [loading]=\"obs.loading\"\n [hideToolbar]=\"true\"\n (rowClicked)=\"onRowClicked($event)\"\n>\n <valtimo-no-results\n title=\"{{ 'ikoManagement.search.noResultsTitle' | translate }}\"\n illustration=\"valtimo-layout/img/emptystate-no-result.svg\"\n description=\"{{ 'ikoManagement.search.noResultsDescription' | translate }}\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1$2.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i1$2.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
1167
|
+
}
|
|
1168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoListComponent, decorators: [{
|
|
1169
|
+
type: Component,
|
|
1170
|
+
args: [{ selector: 'valtimo-iko-list', standalone: true, imports: [CommonModule, CarbonListModule, TranslatePipe], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n *ngIf=\"{\n listConfig: listConfig$ | async,\n loading: loading$ | async,\n } as obs\"\n [fields]=\"obs.listConfig?.fields\"\n [items]=\"obs.listConfig?.items\"\n [loading]=\"obs.loading\"\n [hideToolbar]=\"true\"\n (rowClicked)=\"onRowClicked($event)\"\n>\n <valtimo-no-results\n title=\"{{ 'ikoManagement.search.noResultsTitle' | translate }}\"\n illustration=\"valtimo-layout/img/emptystate-no-result.svg\"\n description=\"{{ 'ikoManagement.search.noResultsDescription' | translate }}\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n" }]
|
|
1171
|
+
}], ctorParameters: () => [{ type: i1$2.BreadcrumbService }, { type: IkoApiService }, { type: i1$3.ActivatedRoute }, { type: i1$3.Router }] });
|
|
1172
|
+
|
|
1173
|
+
/*
|
|
1174
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1175
|
+
*
|
|
1176
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1177
|
+
* you may not use this file except in compliance with the License.
|
|
1178
|
+
* You may obtain a copy of the License at
|
|
1179
|
+
*
|
|
1180
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1181
|
+
*
|
|
1182
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1183
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1184
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1185
|
+
* See the License for the specific language governing permissions and
|
|
1186
|
+
* limitations under the License.
|
|
1187
|
+
*/
|
|
1188
|
+
class PropertiesFormComponent {
|
|
1189
|
+
set fields(fields) {
|
|
1190
|
+
if (fields) {
|
|
1191
|
+
this.applyPropertyControls(this.fb, this.propertiesFormGroup, fields);
|
|
1192
|
+
this.$fields.set(fields);
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
set prefillData(value) {
|
|
1196
|
+
this.$prefillData.set(value ?? {});
|
|
1197
|
+
}
|
|
1198
|
+
constructor(fb, iconService) {
|
|
1199
|
+
this.fb = fb;
|
|
1200
|
+
this.iconService = iconService;
|
|
1201
|
+
this.$fields = signal([]);
|
|
1202
|
+
this.$prefillData = signal({});
|
|
1203
|
+
this.$selectItems = computed(() => this.$fields()
|
|
1204
|
+
.filter(field => field?.dropdownList)
|
|
1205
|
+
.reduce((acc, field) => {
|
|
1206
|
+
acc[field.key] = field.dropdownList.map(item => ({
|
|
1207
|
+
id: item.first,
|
|
1208
|
+
text: item.second,
|
|
1209
|
+
}));
|
|
1210
|
+
return acc;
|
|
1211
|
+
}, {}));
|
|
1212
|
+
this.combined = computed(() => ({
|
|
1213
|
+
prefill: this.$prefillData(),
|
|
1214
|
+
fields: this.$fields(),
|
|
1215
|
+
}));
|
|
1216
|
+
this._effect = effect(() => {
|
|
1217
|
+
const { prefill, fields } = this.combined();
|
|
1218
|
+
this.mapPrefillDataToForm(prefill, fields);
|
|
1219
|
+
});
|
|
1220
|
+
this.iconService.registerAll([Information16]);
|
|
1221
|
+
}
|
|
1222
|
+
getFa(key) {
|
|
1223
|
+
return this.propertiesFormGroup.get(key);
|
|
1224
|
+
}
|
|
1225
|
+
onAddKeyValue(key, required) {
|
|
1226
|
+
this.addKeyValue(this.getFa(key), this.fb, required);
|
|
1227
|
+
}
|
|
1228
|
+
onDeleteRowClick(key, index) {
|
|
1229
|
+
this.getFa(key).removeAt(index);
|
|
1230
|
+
}
|
|
1231
|
+
applyPropertyControls(fb, propertiesGroup, fields) {
|
|
1232
|
+
fields.forEach(field => {
|
|
1233
|
+
if (propertiesGroup.contains(field.key))
|
|
1234
|
+
return;
|
|
1235
|
+
switch (field.type) {
|
|
1236
|
+
case 'text':
|
|
1237
|
+
case 'url':
|
|
1238
|
+
case 'integer':
|
|
1239
|
+
case 'dropdown':
|
|
1240
|
+
propertiesGroup.addControl(field.key, fb.control('', field.required ? [Validators.required] : []));
|
|
1241
|
+
break;
|
|
1242
|
+
case 'keyValueList':
|
|
1243
|
+
propertiesGroup.addControl(field.key, fb.array([
|
|
1244
|
+
fb.group({
|
|
1245
|
+
key: fb.control('', Validators.required),
|
|
1246
|
+
value: fb.control('', Validators.required),
|
|
1247
|
+
}),
|
|
1248
|
+
]));
|
|
1249
|
+
break;
|
|
1250
|
+
}
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1253
|
+
getControlInvalid(controlKey) {
|
|
1254
|
+
const control = this.propertiesFormGroup.get(controlKey);
|
|
1255
|
+
if (!control) {
|
|
1256
|
+
return true;
|
|
1257
|
+
}
|
|
1258
|
+
return !control.valid && !control.pristine;
|
|
1259
|
+
}
|
|
1260
|
+
mapPrefillDataToForm(prefillData, propertyFields) {
|
|
1261
|
+
if (!prefillData || !this.propertiesFormGroup)
|
|
1262
|
+
return;
|
|
1263
|
+
propertyFields.forEach((field) => {
|
|
1264
|
+
if (field.type === 'keyValueList') {
|
|
1265
|
+
const keyValueList = !prefillData[field.key]
|
|
1266
|
+
? [{ key: '', value: '' }]
|
|
1267
|
+
: Array.isArray(prefillData[field.key])
|
|
1268
|
+
? prefillData[field.key]
|
|
1269
|
+
: Object.entries(prefillData[field.key]).map(([key, value]) => ({
|
|
1270
|
+
key,
|
|
1271
|
+
value,
|
|
1272
|
+
}));
|
|
1273
|
+
this.getFa(field.key).clear();
|
|
1274
|
+
keyValueList.forEach(item => this.onAddKeyValue(field.key, field.required));
|
|
1275
|
+
prefillData[field.key] = keyValueList;
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1278
|
+
this.propertiesFormGroup.patchValue(prefillData);
|
|
1279
|
+
}
|
|
1280
|
+
addKeyValue(arr, fb, required) {
|
|
1281
|
+
arr.push(fb.group({
|
|
1282
|
+
key: fb.control('', required ? Validators.required : []),
|
|
1283
|
+
value: fb.control('', required ? Validators.required : []),
|
|
1284
|
+
}));
|
|
1285
|
+
}
|
|
1286
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: PropertiesFormComponent, deps: [{ token: i1$4.FormBuilder }, { token: i6.IconService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1287
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: PropertiesFormComponent, isStandalone: true, selector: "valtimo-iko-management-properties", inputs: { propertiesFormGroup: "propertiesFormGroup", fields: "fields", prefillData: "prefillData" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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<form [formGroup]=\"propertiesFormGroup\">\n @for (propertyField of $fields(); track propertyField.key) {\n @switch (true) {\n @case (\n propertyField.type === 'text' ||\n propertyField.type === 'url' ||\n propertyField.type === 'integer'\n ) {\n <cds-label>\n {{ propertyField.title }}\n @if (propertyField.tooltip) {\n <cds-tooltip [caret]=\"true\" [description]=\"propertyField.tooltip\">\n <svg class=\"tooltip-trigger\" cdsIcon=\"information\" size=\"16\"></svg>\n </cds-tooltip>\n }\n <input\n [formControlName]=\"propertyField.key\"\n cdsText\n cdsLayer\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n }\n @case (propertyField.type === 'dropdown') {\n @if (propertyField?.dropdownList) {\n <v-select\n [invalid]=\"getControlInvalid(propertyField.key)\"\n [formControlName]=\"propertyField.key\"\n [items]=\"$selectItems()[propertyField.key]\"\n [title]=\"propertyField.title\"\n [tooltip]=\"propertyField.tooltip\"\n [appendInline]=\"false\"\n [dropUp]=\"false\"\n ></v-select>\n }\n }\n @case (propertyField.type === 'keyValueList') {\n <div [formArrayName]=\"propertyField.key\">\n @for (keyValueControl of getFa(propertyField.key)?.controls; track keyValueControl) {\n <cds-text-label>\n {{ propertyField.title }}\n @if (propertyField.tooltip) {\n <cds-tooltip [caret]=\"true\" [description]=\"propertyField.tooltip\">\n <svg class=\"tooltip-trigger\" cdsIcon=\"information\" size=\"16\"></svg>\n </cds-tooltip>\n }\n\n <fieldset [formGroupName]=\"$index\">\n <input\n formControlName=\"key\"\n cdsText\n cdsLayer\n [placeholder]=\"'interface.key' | translate\"\n [attr.modal-primary-focus]=\"true\"\n />\n <input\n formControlName=\"value\"\n cdsText\n cdsLayer\n [placeholder]=\"'interface.value' | translate\"\n [attr.modal-primary-focus]=\"true\"\n />\n <button\n cdsButton=\"danger--ghost\"\n [disabled]=\"$count === 1\"\n [iconOnly]=\"true\"\n (click)=\"onDeleteRowClick(propertyField.key, $index)\"\n >\n <svg cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </fieldset>\n </cds-text-label>\n }\n\n <button\n cdsButton=\"primary\"\n (click)=\"onAddKeyValue(propertyField.key, propertyField.required)\"\n >\n Add Key Value\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </div>\n }\n }\n }\n</form>\n", styles: ["form{display:flex;flex-direction:column;gap:16px}::ng-deep fieldset{margin-top:8px;display:flex;gap:16px}::ng-deep label{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.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: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$4.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$4.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i6.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "component", type: i6.TextInputLabelComponent, selector: "cds-text-label, ibm-text-label", inputs: ["labelInputID", "disabled", "skeleton", "labelTemplate", "textInputTemplate", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel", "fluid"] }, { kind: "directive", type: i6.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i6.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i6.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i1$2.SelectComponent, selector: "v-select", inputs: ["items", "defaultSelection", "defaultSelectionId", "defaultSelectionIds", "disabled", "dropUp", "invalid", "multiple", "margin", "widthInPx", "notFoundText", "clearAllText", "clearText", "clearable", "name", "title", "titleTranslationKey", "clearSelectionSubject$", "tooltip", "required", "loading", "loadingText", "placeholder", "smallMargin", "carbonTheme", "appendInline", "dataTestId"], outputs: ["selectedChange"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "component", type: i6.Tooltip, selector: "cds-tooltip, ibm-tooltip", inputs: ["id", "enterDelayMs", "leaveDelayMs", "disabled", "description", "templateContext"] }] }); }
|
|
1288
|
+
}
|
|
1289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: PropertiesFormComponent, decorators: [{
|
|
1290
|
+
type: Component,
|
|
1291
|
+
args: [{ selector: 'valtimo-iko-management-properties', standalone: true, imports: [
|
|
1292
|
+
CommonModule,
|
|
1293
|
+
ReactiveFormsModule,
|
|
1294
|
+
TranslatePipe,
|
|
1295
|
+
ButtonModule,
|
|
1296
|
+
InputModule,
|
|
1297
|
+
IconModule,
|
|
1298
|
+
LayerModule,
|
|
1299
|
+
SelectModule,
|
|
1300
|
+
TooltipModule,
|
|
1301
|
+
], template: "<!--\n ~ Copyright 2015-2025 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<form [formGroup]=\"propertiesFormGroup\">\n @for (propertyField of $fields(); track propertyField.key) {\n @switch (true) {\n @case (\n propertyField.type === 'text' ||\n propertyField.type === 'url' ||\n propertyField.type === 'integer'\n ) {\n <cds-label>\n {{ propertyField.title }}\n @if (propertyField.tooltip) {\n <cds-tooltip [caret]=\"true\" [description]=\"propertyField.tooltip\">\n <svg class=\"tooltip-trigger\" cdsIcon=\"information\" size=\"16\"></svg>\n </cds-tooltip>\n }\n <input\n [formControlName]=\"propertyField.key\"\n cdsText\n cdsLayer\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n }\n @case (propertyField.type === 'dropdown') {\n @if (propertyField?.dropdownList) {\n <v-select\n [invalid]=\"getControlInvalid(propertyField.key)\"\n [formControlName]=\"propertyField.key\"\n [items]=\"$selectItems()[propertyField.key]\"\n [title]=\"propertyField.title\"\n [tooltip]=\"propertyField.tooltip\"\n [appendInline]=\"false\"\n [dropUp]=\"false\"\n ></v-select>\n }\n }\n @case (propertyField.type === 'keyValueList') {\n <div [formArrayName]=\"propertyField.key\">\n @for (keyValueControl of getFa(propertyField.key)?.controls; track keyValueControl) {\n <cds-text-label>\n {{ propertyField.title }}\n @if (propertyField.tooltip) {\n <cds-tooltip [caret]=\"true\" [description]=\"propertyField.tooltip\">\n <svg class=\"tooltip-trigger\" cdsIcon=\"information\" size=\"16\"></svg>\n </cds-tooltip>\n }\n\n <fieldset [formGroupName]=\"$index\">\n <input\n formControlName=\"key\"\n cdsText\n cdsLayer\n [placeholder]=\"'interface.key' | translate\"\n [attr.modal-primary-focus]=\"true\"\n />\n <input\n formControlName=\"value\"\n cdsText\n cdsLayer\n [placeholder]=\"'interface.value' | translate\"\n [attr.modal-primary-focus]=\"true\"\n />\n <button\n cdsButton=\"danger--ghost\"\n [disabled]=\"$count === 1\"\n [iconOnly]=\"true\"\n (click)=\"onDeleteRowClick(propertyField.key, $index)\"\n >\n <svg cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </fieldset>\n </cds-text-label>\n }\n\n <button\n cdsButton=\"primary\"\n (click)=\"onAddKeyValue(propertyField.key, propertyField.required)\"\n >\n Add Key Value\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </div>\n }\n }\n }\n</form>\n", styles: ["form{display:flex;flex-direction:column;gap:16px}::ng-deep fieldset{margin-top:8px;display:flex;gap:16px}::ng-deep label{width:100%}\n"] }]
|
|
1302
|
+
}], ctorParameters: () => [{ type: i1$4.FormBuilder }, { type: i6.IconService }], propDecorators: { propertiesFormGroup: [{
|
|
1303
|
+
type: Input,
|
|
1304
|
+
args: [{ required: true }]
|
|
1305
|
+
}], fields: [{
|
|
1306
|
+
type: Input
|
|
1307
|
+
}], prefillData: [{
|
|
1308
|
+
type: Input
|
|
1309
|
+
}] } });
|
|
1310
|
+
|
|
1311
|
+
class IkoManagementRepositoryModalComponent {
|
|
1312
|
+
set open(value) {
|
|
1313
|
+
this._open$.next(value);
|
|
1314
|
+
value ? (this.showAutoKey = true) : this.resetForm();
|
|
1315
|
+
}
|
|
1316
|
+
get open$() {
|
|
1317
|
+
return this._open$.asObservable();
|
|
1318
|
+
}
|
|
1319
|
+
set prefillData(value) {
|
|
1320
|
+
this.$prefillData.set(value);
|
|
1321
|
+
if (!value)
|
|
1322
|
+
return;
|
|
1323
|
+
this.modalMode = 'edit';
|
|
1324
|
+
this.formGroup.patchValue(value);
|
|
1325
|
+
this.formGroup.get('key')?.disable();
|
|
1326
|
+
}
|
|
1327
|
+
get title() {
|
|
1328
|
+
return this.formGroup.get('title');
|
|
1329
|
+
}
|
|
1330
|
+
constructor(fb, ikoManagementApiService, configService) {
|
|
1331
|
+
this.fb = fb;
|
|
1332
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
1333
|
+
this.configService = configService;
|
|
1334
|
+
this._open$ = new BehaviorSubject(false);
|
|
1335
|
+
this.modalMode = 'add';
|
|
1336
|
+
this.$selectedKey = signal('');
|
|
1337
|
+
this.$prefillData = signal(null);
|
|
1338
|
+
this.modalClose = new EventEmitter();
|
|
1339
|
+
this.showAutoKey = true;
|
|
1340
|
+
this.enableIkoType = false;
|
|
1341
|
+
this.disabled$ = new BehaviorSubject(true);
|
|
1342
|
+
this._ikoRepositoryTypes$ = this.ikoManagementApiService.getIkoRepositoryTypes();
|
|
1343
|
+
this.usedKeys$ = this.ikoManagementApiService
|
|
1344
|
+
.getIkoRepositoryConfigs()
|
|
1345
|
+
.pipe(map$1(response => response.content.map(c => c.key)));
|
|
1346
|
+
this.ikoRepositoryTypeSelectItems$ = this._ikoRepositoryTypes$.pipe(map$1(types => Object.keys(types).map(typeKey => ({ id: typeKey, text: types[typeKey] }))), tap(() => {
|
|
1347
|
+
this.disabled$.next(false);
|
|
1348
|
+
}));
|
|
1349
|
+
this.formGroup = this.fb.group({
|
|
1350
|
+
title: this.fb.control('', Validators.required),
|
|
1351
|
+
key: this.fb.control('', Validators.required),
|
|
1352
|
+
type: this.fb.control('', Validators.required),
|
|
1353
|
+
properties: this.fb.group({}, Validators.required),
|
|
1354
|
+
});
|
|
1355
|
+
this.propertyFields$ = this.formGroup
|
|
1356
|
+
.get('type')
|
|
1357
|
+
.valueChanges.pipe(startWith(this.formGroup.get('type').value), tap(_ => this.formGroup.patchValue({ properties: {} })), filter(type => !!type && !Array.isArray(type)), switchMap(type => this.ikoManagementApiService.getIkoRepositoryPropertyFields(type)));
|
|
1358
|
+
this.enableIkoType = this.configService.getFeatureToggle('enableIkoType');
|
|
1359
|
+
}
|
|
1360
|
+
get properties() {
|
|
1361
|
+
const properties = this.formGroup.get('properties');
|
|
1362
|
+
return !properties ? null : properties;
|
|
1363
|
+
}
|
|
1364
|
+
onCancel() {
|
|
1365
|
+
this.modalClose.emit(null);
|
|
1366
|
+
runAfterCarbonModalClosed(() => {
|
|
1367
|
+
this.showAutoKey = false;
|
|
1368
|
+
this.modalMode = 'add';
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
onSave() {
|
|
1372
|
+
this.modalClose.emit(this.formGroup.getRawValue());
|
|
1373
|
+
runAfterCarbonModalClosed(() => {
|
|
1374
|
+
this.showAutoKey = false;
|
|
1375
|
+
});
|
|
1376
|
+
}
|
|
1377
|
+
getControlInvalid(controlKey) {
|
|
1378
|
+
if (controlKey === 'type' && !this.enableIkoType) {
|
|
1379
|
+
return false;
|
|
1380
|
+
}
|
|
1381
|
+
const control = this.formGroup.get(controlKey);
|
|
1382
|
+
if (!control) {
|
|
1383
|
+
return true;
|
|
1384
|
+
}
|
|
1385
|
+
return !control.valid && !control.pristine;
|
|
1386
|
+
}
|
|
1387
|
+
resetForm() {
|
|
1388
|
+
setTimeout(() => {
|
|
1389
|
+
this.formGroup.reset({
|
|
1390
|
+
title: '',
|
|
1391
|
+
key: '',
|
|
1392
|
+
type: 'iko',
|
|
1393
|
+
properties: {},
|
|
1394
|
+
});
|
|
1395
|
+
this.formGroup.get('key')?.enable();
|
|
1396
|
+
}, CARBON_CONSTANTS.modalAnimationMs);
|
|
1397
|
+
}
|
|
1398
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementRepositoryModalComponent, deps: [{ token: i1$4.FormBuilder }, { token: IkoManagementApiService }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1399
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: IkoManagementRepositoryModalComponent, isStandalone: true, selector: "valtimo-iko-management-repository-modal", inputs: { open: "open", prefillData: "prefillData" }, outputs: { modalClose: "modalClose" }, ngImport: i0, template: "<cds-modal valtimoCdsModal [open]=\"open$ | async\" size=\"sm\" showFooter=\"true\" (close)=\"onCancel()\">\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCancel()\">\n <h3 cdsModalHeaderHeading>{{ 'ikoManagement.configureIkoServer' | translate }}</h3>\n </cds-modal-header>\n\n <form cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"formGroup\" class=\"iko-api-form\">\n <cds-label [invalid]=\"getControlInvalid('title')\">\n {{ 'ikoManagement.titleTitle' | translate }}\n\n <input\n [invalid]=\"getControlInvalid('title')\"\n formControlName=\"title\"\n cdsText\n placeholder=\"{{ 'ikoManagement.titlePlaceholder' | translate }}\"\n />\n </cds-label>\n\n <valtimo-auto-key-input\n *ngIf=\"showAutoKey\"\n formControlName=\"key\"\n placeholderTranslationKey=\"ikoManagement.keyPlaceholder\"\n [sourceText]=\"modalMode === 'edit' ? $selectedKey() : title.value\"\n [mode]=\"modalMode\"\n [usedKeys]=\"usedKeys$ | async\"\n >\n </valtimo-auto-key-input>\n\n @if (enableIkoType) {\n <v-select\n [invalid]=\"getControlInvalid('type')\"\n formControlName=\"type\"\n [disabled]=\"!enableIkoType\"\n [items]=\"ikoRepositoryTypeSelectItems$ | async\"\n [title]=\"'ikoManagement.typeTitle' | translate\"\n [appendInline]=\"false\"\n [dropUp]=\"false\"\n ></v-select>\n }\n\n <valtimo-iko-management-properties\n [propertiesFormGroup]=\"properties\"\n [fields]=\"propertyFields$ | async\"\n [prefillData]=\"$prefillData()?.properties\"\n />\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"onCancel()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button [disabled]=\"formGroup.invalid\" cdsButton=\"primary\" (click)=\"onSave()\">\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["form{display:flex;flex-direction:column;gap:16px}fieldset{display:flex;gap:16px}::ng-deep label{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i6.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i6.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i6.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i6.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i6.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i6.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i6.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.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: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "component", type: PropertiesFormComponent, selector: "valtimo-iko-management-properties", inputs: ["propertiesFormGroup", "fields", "prefillData"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i1$2.SelectComponent, selector: "v-select", inputs: ["items", "defaultSelection", "defaultSelectionId", "defaultSelectionIds", "disabled", "dropUp", "invalid", "multiple", "margin", "widthInPx", "notFoundText", "clearAllText", "clearText", "clearable", "name", "title", "titleTranslationKey", "clearSelectionSubject$", "tooltip", "required", "loading", "loadingText", "placeholder", "smallMargin", "carbonTheme", "appendInline", "dataTestId"], outputs: ["selectedChange"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i6.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "component", type: AutoKeyInputComponent, selector: "valtimo-auto-key-input", inputs: ["labelTranslationKey", "placeholderTranslationKey", "mode", "usedKeys", "sourceText"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1400
|
+
}
|
|
1401
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementRepositoryModalComponent, decorators: [{
|
|
1402
|
+
type: Component,
|
|
1403
|
+
args: [{ selector: 'valtimo-iko-management-repository-modal', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
1404
|
+
CommonModule,
|
|
1405
|
+
TranslateModule,
|
|
1406
|
+
ModalModule,
|
|
1407
|
+
ValtimoCdsModalDirective,
|
|
1408
|
+
InputModule,
|
|
1409
|
+
ReactiveFormsModule,
|
|
1410
|
+
ButtonModule,
|
|
1411
|
+
IconModule,
|
|
1412
|
+
PropertiesFormComponent,
|
|
1413
|
+
SelectModule,
|
|
1414
|
+
LayerModule,
|
|
1415
|
+
AutoKeyInputComponent,
|
|
1416
|
+
], template: "<cds-modal valtimoCdsModal [open]=\"open$ | async\" size=\"sm\" showFooter=\"true\" (close)=\"onCancel()\">\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCancel()\">\n <h3 cdsModalHeaderHeading>{{ 'ikoManagement.configureIkoServer' | translate }}</h3>\n </cds-modal-header>\n\n <form cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"formGroup\" class=\"iko-api-form\">\n <cds-label [invalid]=\"getControlInvalid('title')\">\n {{ 'ikoManagement.titleTitle' | translate }}\n\n <input\n [invalid]=\"getControlInvalid('title')\"\n formControlName=\"title\"\n cdsText\n placeholder=\"{{ 'ikoManagement.titlePlaceholder' | translate }}\"\n />\n </cds-label>\n\n <valtimo-auto-key-input\n *ngIf=\"showAutoKey\"\n formControlName=\"key\"\n placeholderTranslationKey=\"ikoManagement.keyPlaceholder\"\n [sourceText]=\"modalMode === 'edit' ? $selectedKey() : title.value\"\n [mode]=\"modalMode\"\n [usedKeys]=\"usedKeys$ | async\"\n >\n </valtimo-auto-key-input>\n\n @if (enableIkoType) {\n <v-select\n [invalid]=\"getControlInvalid('type')\"\n formControlName=\"type\"\n [disabled]=\"!enableIkoType\"\n [items]=\"ikoRepositoryTypeSelectItems$ | async\"\n [title]=\"'ikoManagement.typeTitle' | translate\"\n [appendInline]=\"false\"\n [dropUp]=\"false\"\n ></v-select>\n }\n\n <valtimo-iko-management-properties\n [propertiesFormGroup]=\"properties\"\n [fields]=\"propertyFields$ | async\"\n [prefillData]=\"$prefillData()?.properties\"\n />\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"onCancel()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button [disabled]=\"formGroup.invalid\" cdsButton=\"primary\" (click)=\"onSave()\">\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["form{display:flex;flex-direction:column;gap:16px}fieldset{display:flex;gap:16px}::ng-deep label{width:100%}\n"] }]
|
|
1417
|
+
}], ctorParameters: () => [{ type: i1$4.FormBuilder }, { type: IkoManagementApiService }, { type: i2.ConfigService }], propDecorators: { open: [{
|
|
1418
|
+
type: Input
|
|
1419
|
+
}], prefillData: [{
|
|
1420
|
+
type: Input
|
|
1421
|
+
}], modalClose: [{
|
|
1422
|
+
type: Output
|
|
1423
|
+
}] } });
|
|
1424
|
+
|
|
1425
|
+
/*
|
|
1426
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1427
|
+
*
|
|
1428
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1429
|
+
* you may not use this file except in compliance with the License.
|
|
1430
|
+
* You may obtain a copy of the License at
|
|
1431
|
+
*
|
|
1432
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1433
|
+
*
|
|
1434
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1435
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1436
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1437
|
+
* See the License for the specific language governing permissions and
|
|
1438
|
+
* limitations under the License.
|
|
1439
|
+
*/
|
|
1440
|
+
class IkoManagementApiComponent {
|
|
1441
|
+
constructor(ikoManagementApiService, pageTitleService, router) {
|
|
1442
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
1443
|
+
this.pageTitleService = pageTitleService;
|
|
1444
|
+
this.router = router;
|
|
1445
|
+
this.$modalOpen = signal(false);
|
|
1446
|
+
this.$prefillData = signal(null);
|
|
1447
|
+
this.$keyToDelete = signal(null);
|
|
1448
|
+
this.showDeleteModal$ = new BehaviorSubject(false);
|
|
1449
|
+
this.disabled$ = new BehaviorSubject(true);
|
|
1450
|
+
this.loading$ = new BehaviorSubject(true);
|
|
1451
|
+
this._reload$ = new BehaviorSubject(null);
|
|
1452
|
+
this.apiConfigs$ = this._reload$.pipe(switchMap(() => this.ikoManagementApiService.getIkoRepositoryConfigs()), map(res => res.content), tap(() => this.loading$.next(false)));
|
|
1453
|
+
this.FIELDS = [
|
|
1454
|
+
{
|
|
1455
|
+
key: 'title',
|
|
1456
|
+
label: 'ikoManagement.ikoServer',
|
|
1457
|
+
},
|
|
1458
|
+
];
|
|
1459
|
+
this.ACTION_ITEMS = [
|
|
1460
|
+
{
|
|
1461
|
+
label: 'interface.edit',
|
|
1462
|
+
callback: this.onEditClick.bind(this),
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
label: 'interface.delete',
|
|
1466
|
+
callback: this.onDeleteClick.bind(this),
|
|
1467
|
+
type: 'danger',
|
|
1468
|
+
},
|
|
1469
|
+
];
|
|
1470
|
+
this._ikoRepositoryTypes$ = this.ikoManagementApiService.getIkoRepositoryTypes();
|
|
1471
|
+
this.ikoRepositoryTypeSelectItems$ = this._ikoRepositoryTypes$.pipe(map(types => Object.keys(types).map(typeKey => ({ id: typeKey, text: types[typeKey] }))), tap(() => {
|
|
1472
|
+
this.disabled$.next(false);
|
|
1473
|
+
}));
|
|
1474
|
+
}
|
|
1475
|
+
ngOnInit() {
|
|
1476
|
+
this.pageTitleService.disableReset();
|
|
1477
|
+
}
|
|
1478
|
+
ngOnDestroy() {
|
|
1479
|
+
this.pageTitleService.enableReset();
|
|
1480
|
+
}
|
|
1481
|
+
onRowClicked(event) {
|
|
1482
|
+
this.router.navigate(['iko-management', event.key]);
|
|
1483
|
+
}
|
|
1484
|
+
openModal() {
|
|
1485
|
+
this.$modalOpen.set(true);
|
|
1486
|
+
}
|
|
1487
|
+
closeModal(item) {
|
|
1488
|
+
this.$modalOpen.set(false);
|
|
1489
|
+
this.disable();
|
|
1490
|
+
const prefillData = this.$prefillData();
|
|
1491
|
+
this.$prefillData.set(null);
|
|
1492
|
+
if (!item)
|
|
1493
|
+
return;
|
|
1494
|
+
let saveObservable;
|
|
1495
|
+
if (prefillData !== null) {
|
|
1496
|
+
saveObservable = this.ikoManagementApiService.updateIkoRepositoryConfig(item.key, item);
|
|
1497
|
+
}
|
|
1498
|
+
else {
|
|
1499
|
+
saveObservable = this.ikoManagementApiService.createIkoRepositoryConfig(item.key, item);
|
|
1500
|
+
}
|
|
1501
|
+
saveObservable.pipe(take(1)).subscribe({
|
|
1502
|
+
next: () => {
|
|
1503
|
+
this.enable();
|
|
1504
|
+
this.reload();
|
|
1505
|
+
},
|
|
1506
|
+
error: () => this.enable(),
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1509
|
+
onEditClick(item) {
|
|
1510
|
+
this.$prefillData.set(item);
|
|
1511
|
+
this.$modalOpen.set(true);
|
|
1512
|
+
}
|
|
1513
|
+
onDeleteClick(item) {
|
|
1514
|
+
this.$keyToDelete.set(item.key);
|
|
1515
|
+
this.showDeleteModal$.next(true);
|
|
1516
|
+
}
|
|
1517
|
+
onDeleteConfirm(key) {
|
|
1518
|
+
this.ikoManagementApiService
|
|
1519
|
+
.deleteIkoRepositoryConfig(key)
|
|
1520
|
+
.subscribe(() => this._reload$.next(null));
|
|
1521
|
+
}
|
|
1522
|
+
disable() {
|
|
1523
|
+
this.disabled$.next(true);
|
|
1524
|
+
}
|
|
1525
|
+
enable() {
|
|
1526
|
+
this.disabled$.next(false);
|
|
1527
|
+
}
|
|
1528
|
+
reload() {
|
|
1529
|
+
this.loading$.next(true);
|
|
1530
|
+
this._reload$.next(null);
|
|
1531
|
+
}
|
|
1532
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementApiComponent, deps: [{ token: IkoManagementApiService }, { token: i1$2.PageTitleService }, { token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1533
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoManagementApiComponent, isStandalone: true, selector: "valtimo-iko-management-api", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n [actionItems]=\"ACTION_ITEMS\"\n [fields]=\"FIELDS\"\n [items]=\"apiConfigs$ | async\"\n [loading]=\"loading$ | async\"\n (rowClicked)=\"onRowClicked($event)\"\n>\n <ng-container carbonToolbarContent [ngTemplateOutlet]=\"addViewButton\"></ng-container>\n\n <valtimo-no-results\n [action]=\"addViewButton\"\n [description]=\"'ikoManagement.views.noResultsDescription' | translate\"\n [title]=\"'ikoManagement.views.noResultsTitle' | translate\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<ng-template #addViewButton>\n <button cdsButton=\"primary\" (click)=\"openModal()\">\n {{ 'ikoManagement.addApiConfig' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n\n<valtimo-iko-management-repository-modal\n [open]=\"$modalOpen()\"\n [prefillData]=\"$prefillData()\"\n (modalClose)=\"closeModal($event)\"\n></valtimo-iko-management-repository-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"ikoManagement.views.deleteContent\"\n [outputOnConfirm]=\"$keyToDelete()\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteConfirm($event)\"\n></valtimo-confirmation-modal>\n", styles: [".iko-api-form{display:flex;flex-direction:column;gap:16px;width:100%}\n/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1$2.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i1$2.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: TabsModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ModalModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i6.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: InputModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: LayerModule }, { kind: "ngmodule", type: SelectModule }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i1$2.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }, { kind: "component", type: IkoManagementRepositoryModalComponent, selector: "valtimo-iko-management-repository-modal", inputs: ["open", "prefillData"], outputs: ["modalClose"] }] }); }
|
|
1534
|
+
}
|
|
1535
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementApiComponent, decorators: [{
|
|
1536
|
+
type: Component,
|
|
1537
|
+
args: [{ selector: 'valtimo-iko-management-api', standalone: true, imports: [
|
|
1538
|
+
CommonModule,
|
|
1539
|
+
CarbonListModule,
|
|
1540
|
+
TabsModule,
|
|
1541
|
+
TranslateModule,
|
|
1542
|
+
ModalModule,
|
|
1543
|
+
ButtonModule,
|
|
1544
|
+
IconModule,
|
|
1545
|
+
FormsModule,
|
|
1546
|
+
InputModule,
|
|
1547
|
+
ReactiveFormsModule,
|
|
1548
|
+
ValtimoCdsModalDirective,
|
|
1549
|
+
LayerModule,
|
|
1550
|
+
SelectModule,
|
|
1551
|
+
ConfirmationModalModule,
|
|
1552
|
+
IkoManagementRepositoryModalComponent,
|
|
1553
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n [actionItems]=\"ACTION_ITEMS\"\n [fields]=\"FIELDS\"\n [items]=\"apiConfigs$ | async\"\n [loading]=\"loading$ | async\"\n (rowClicked)=\"onRowClicked($event)\"\n>\n <ng-container carbonToolbarContent [ngTemplateOutlet]=\"addViewButton\"></ng-container>\n\n <valtimo-no-results\n [action]=\"addViewButton\"\n [description]=\"'ikoManagement.views.noResultsDescription' | translate\"\n [title]=\"'ikoManagement.views.noResultsTitle' | translate\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<ng-template #addViewButton>\n <button cdsButton=\"primary\" (click)=\"openModal()\">\n {{ 'ikoManagement.addApiConfig' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n\n<valtimo-iko-management-repository-modal\n [open]=\"$modalOpen()\"\n [prefillData]=\"$prefillData()\"\n (modalClose)=\"closeModal($event)\"\n></valtimo-iko-management-repository-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"ikoManagement.views.deleteContent\"\n [outputOnConfirm]=\"$keyToDelete()\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteConfirm($event)\"\n></valtimo-confirmation-modal>\n", styles: [".iko-api-form{display:flex;flex-direction:column;gap:16px;width:100%}\n/*!\n * Copyright 2015-2025 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"] }]
|
|
1554
|
+
}], ctorParameters: () => [{ type: IkoManagementApiService }, { type: i1$2.PageTitleService }, { type: i1$3.Router }] });
|
|
1555
|
+
|
|
1556
|
+
/*
|
|
1557
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1558
|
+
*
|
|
1559
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1560
|
+
* you may not use this file except in compliance with the License.
|
|
1561
|
+
* You may obtain a copy of the License at
|
|
1562
|
+
*
|
|
1563
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1564
|
+
*
|
|
1565
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1566
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1567
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1568
|
+
* See the License for the specific language governing permissions and
|
|
1569
|
+
* limitations under the License.
|
|
1570
|
+
*/
|
|
1571
|
+
|
|
1572
|
+
/*
|
|
1573
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1574
|
+
*
|
|
1575
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1576
|
+
* you may not use this file except in compliance with the License.
|
|
1577
|
+
* You may obtain a copy of the License at
|
|
1578
|
+
*
|
|
1579
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1580
|
+
*
|
|
1581
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1582
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1583
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1584
|
+
* See the License for the specific language governing permissions and
|
|
1585
|
+
* limitations under the License.
|
|
1586
|
+
*/
|
|
1587
|
+
|
|
1588
|
+
/*
|
|
1589
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1590
|
+
*
|
|
1591
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1592
|
+
* you may not use this file except in compliance with the License.
|
|
1593
|
+
* You may obtain a copy of the License at
|
|
1594
|
+
*
|
|
1595
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1596
|
+
*
|
|
1597
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1598
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1599
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1600
|
+
* See the License for the specific language governing permissions and
|
|
1601
|
+
* limitations under the License.
|
|
1602
|
+
*/
|
|
1603
|
+
|
|
1604
|
+
/*
|
|
1605
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1606
|
+
*
|
|
1607
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1608
|
+
* you may not use this file except in compliance with the License.
|
|
1609
|
+
* You may obtain a copy of the License at
|
|
1610
|
+
*
|
|
1611
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1612
|
+
*
|
|
1613
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1614
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1615
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1616
|
+
* See the License for the specific language governing permissions and
|
|
1617
|
+
* limitations under the License.
|
|
1618
|
+
*/
|
|
1619
|
+
var IkoManagementTabType;
|
|
1620
|
+
(function (IkoManagementTabType) {
|
|
1621
|
+
IkoManagementTabType["LIST"] = "list";
|
|
1622
|
+
IkoManagementTabType["SEARCH_FIELDS"] = "search";
|
|
1623
|
+
IkoManagementTabType["WIDGETS"] = "widgets";
|
|
1624
|
+
IkoManagementTabType["TABS"] = "tabs";
|
|
1625
|
+
})(IkoManagementTabType || (IkoManagementTabType = {}));
|
|
1626
|
+
var IkoTabType;
|
|
1627
|
+
(function (IkoTabType) {
|
|
1628
|
+
IkoTabType["WIDGETS"] = "widgets";
|
|
1629
|
+
})(IkoTabType || (IkoTabType = {}));
|
|
1630
|
+
|
|
1631
|
+
/*
|
|
1632
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1633
|
+
*
|
|
1634
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1635
|
+
* you may not use this file except in compliance with the License.
|
|
1636
|
+
* You may obtain a copy of the License at
|
|
1637
|
+
*
|
|
1638
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1639
|
+
*
|
|
1640
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1641
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1642
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1643
|
+
* See the License for the specific language governing permissions and
|
|
1644
|
+
* limitations under the License.
|
|
1645
|
+
*/
|
|
1646
|
+
|
|
1647
|
+
/*
|
|
1648
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1649
|
+
*
|
|
1650
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1651
|
+
* you may not use this file except in compliance with the License.
|
|
1652
|
+
* You may obtain a copy of the License at
|
|
1653
|
+
*
|
|
1654
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1655
|
+
*
|
|
1656
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1657
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1658
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1659
|
+
* See the License for the specific language governing permissions and
|
|
1660
|
+
* limitations under the License.
|
|
1661
|
+
*/
|
|
1662
|
+
var SearchFieldDataType;
|
|
1663
|
+
(function (SearchFieldDataType) {
|
|
1664
|
+
SearchFieldDataType["TEXT"] = "text";
|
|
1665
|
+
SearchFieldDataType["NUMBER"] = "number";
|
|
1666
|
+
SearchFieldDataType["DATE"] = "date";
|
|
1667
|
+
SearchFieldDataType["DATETIME"] = "datetime";
|
|
1668
|
+
SearchFieldDataType["TIME"] = "time";
|
|
1669
|
+
SearchFieldDataType["BOOLEAN"] = "boolean";
|
|
1670
|
+
})(SearchFieldDataType || (SearchFieldDataType = {}));
|
|
1671
|
+
var SearchFieldFieldType;
|
|
1672
|
+
(function (SearchFieldFieldType) {
|
|
1673
|
+
SearchFieldFieldType["SINGLE"] = "single";
|
|
1674
|
+
SearchFieldFieldType["RANGE"] = "range";
|
|
1675
|
+
SearchFieldFieldType["SINGLE_SELECT_DROPDOWN"] = "single_select_dropdown";
|
|
1676
|
+
SearchFieldFieldType["MULTI_SELECT_DROPDOWN"] = "multi_select_dropdown";
|
|
1677
|
+
})(SearchFieldFieldType || (SearchFieldFieldType = {}));
|
|
1678
|
+
var SearchFieldMatchType;
|
|
1679
|
+
(function (SearchFieldMatchType) {
|
|
1680
|
+
SearchFieldMatchType["LIKE"] = "like";
|
|
1681
|
+
SearchFieldMatchType["EXACT"] = "exact";
|
|
1682
|
+
})(SearchFieldMatchType || (SearchFieldMatchType = {}));
|
|
1683
|
+
var SearchDropdownDataProvider;
|
|
1684
|
+
(function (SearchDropdownDataProvider) {
|
|
1685
|
+
SearchDropdownDataProvider["DATABASE"] = "dropdownDatabaseDataProvider";
|
|
1686
|
+
SearchDropdownDataProvider["JSON"] = "dropdownJsonFileDataProvider";
|
|
1687
|
+
})(SearchDropdownDataProvider || (SearchDropdownDataProvider = {}));
|
|
1688
|
+
|
|
1689
|
+
/*
|
|
1690
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1691
|
+
*
|
|
1692
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1693
|
+
* you may not use this file except in compliance with the License.
|
|
1694
|
+
* You may obtain a copy of the License at
|
|
1695
|
+
*
|
|
1696
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1697
|
+
*
|
|
1698
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1699
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1700
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1701
|
+
* See the License for the specific language governing permissions and
|
|
1702
|
+
* limitations under the License.
|
|
1703
|
+
*/
|
|
1704
|
+
|
|
1705
|
+
/*
|
|
1706
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1707
|
+
*
|
|
1708
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1709
|
+
* you may not use this file except in compliance with the License.
|
|
1710
|
+
* You may obtain a copy of the License at
|
|
1711
|
+
*
|
|
1712
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1713
|
+
*
|
|
1714
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1715
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1716
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1717
|
+
* See the License for the specific language governing permissions and
|
|
1718
|
+
* limitations under the License.
|
|
1719
|
+
*/
|
|
1720
|
+
class IkoManagementSearchFieldModalComponent {
|
|
1721
|
+
set prefillData(value) {
|
|
1722
|
+
this._prefillData = value;
|
|
1723
|
+
this.setPrefilledForm(value);
|
|
1724
|
+
}
|
|
1725
|
+
get prefillData() {
|
|
1726
|
+
return this._prefillData;
|
|
1727
|
+
}
|
|
1728
|
+
get dataType() {
|
|
1729
|
+
return this.formGroup.get('dataType');
|
|
1730
|
+
}
|
|
1731
|
+
get dataTypeValue$() {
|
|
1732
|
+
return this.dataType?.valueChanges.pipe(startWith(this.dataType.value)) ?? of(null);
|
|
1733
|
+
}
|
|
1734
|
+
get matchType() {
|
|
1735
|
+
return this.formGroup.get('matchType');
|
|
1736
|
+
}
|
|
1737
|
+
get matchTypeValue$() {
|
|
1738
|
+
return this.matchType?.valueChanges.pipe(startWith(this.matchType.value)) ?? of(null);
|
|
1739
|
+
}
|
|
1740
|
+
get dropdownDataProvider() {
|
|
1741
|
+
return this.formGroup.get('dropdownDataProvider');
|
|
1742
|
+
}
|
|
1743
|
+
get dropdownDataProviderValue$() {
|
|
1744
|
+
return (this.dropdownDataProvider?.valueChanges.pipe(startWith(this.dropdownDataProvider.value)) ??
|
|
1745
|
+
of(null));
|
|
1746
|
+
}
|
|
1747
|
+
get fieldType() {
|
|
1748
|
+
return this.formGroup.get('fieldType');
|
|
1749
|
+
}
|
|
1750
|
+
get fieldTypeValue$() {
|
|
1751
|
+
return this.fieldType?.valueChanges.pipe(startWith(this.fieldType.value)) ?? of(null);
|
|
1752
|
+
}
|
|
1753
|
+
get keyValue() {
|
|
1754
|
+
const controlValue = this.formGroup.get('key')?.value;
|
|
1755
|
+
return !controlValue ? null : controlValue;
|
|
1756
|
+
}
|
|
1757
|
+
get dataTypeValue() {
|
|
1758
|
+
const controlValue = this.formGroup.get('dataType')?.value;
|
|
1759
|
+
this._dataTypeValue$.next(controlValue?.id);
|
|
1760
|
+
return !controlValue ? null : controlValue.id;
|
|
1761
|
+
}
|
|
1762
|
+
get fieldTypeValue() {
|
|
1763
|
+
const controlValue = this.formGroup.get('fieldType')?.value;
|
|
1764
|
+
return !controlValue ? null : controlValue.id;
|
|
1765
|
+
}
|
|
1766
|
+
get dropdownDataProviderValue() {
|
|
1767
|
+
const controlValue = this.formGroup.get('dropdownDataProvider')?.value;
|
|
1768
|
+
this._dropdownProviderValue$.next(controlValue?.id);
|
|
1769
|
+
return !controlValue ? null : controlValue.id;
|
|
1770
|
+
}
|
|
1771
|
+
get dropdownValuesArray() {
|
|
1772
|
+
const formArray = this.formGroup.get('dropdownValues');
|
|
1773
|
+
return !formArray ? null : formArray;
|
|
1774
|
+
}
|
|
1775
|
+
constructor(iconService, fb, translateService) {
|
|
1776
|
+
this.iconService = iconService;
|
|
1777
|
+
this.fb = fb;
|
|
1778
|
+
this.translateService = translateService;
|
|
1779
|
+
this.closeEvent = new EventEmitter();
|
|
1780
|
+
this.formGroup = this.fb.group({
|
|
1781
|
+
key: this.fb.control('', Validators.required),
|
|
1782
|
+
title: this.fb.control('', Validators.required),
|
|
1783
|
+
path: this.fb.control('', Validators.required),
|
|
1784
|
+
dataType: this.fb.control(null, Validators.required),
|
|
1785
|
+
matchType: this.fb.control(null, this.matchTypeValidator),
|
|
1786
|
+
fieldType: this.fb.control(null, Validators.required),
|
|
1787
|
+
dropdownDataProvider: this.fb.control(null),
|
|
1788
|
+
dropdownValues: this.fb.array([]),
|
|
1789
|
+
});
|
|
1790
|
+
this.SearchFieldDataType = SearchFieldDataType;
|
|
1791
|
+
this.SearchFieldFieldType = SearchFieldFieldType;
|
|
1792
|
+
this.SearchDropdownDataProvider = SearchDropdownDataProvider;
|
|
1793
|
+
this.DROPDOWN_FIELDS = [
|
|
1794
|
+
{
|
|
1795
|
+
key: 'key',
|
|
1796
|
+
label: 'searchFieldsOverview.key',
|
|
1797
|
+
viewType: ViewType.TEXT,
|
|
1798
|
+
},
|
|
1799
|
+
{
|
|
1800
|
+
key: 'value',
|
|
1801
|
+
label: 'searchFieldsOverview.text',
|
|
1802
|
+
viewType: ViewType.TEXT,
|
|
1803
|
+
},
|
|
1804
|
+
];
|
|
1805
|
+
this._dataTypeValue$ = new BehaviorSubject(null);
|
|
1806
|
+
this._dropdownProviderValue$ = new BehaviorSubject(null);
|
|
1807
|
+
this.dataTypeItems$ = combineLatest([
|
|
1808
|
+
this.dataTypeValue$,
|
|
1809
|
+
this.translateService.stream('key'),
|
|
1810
|
+
]).pipe(map$1(([dataTypeValue]) => [
|
|
1811
|
+
{
|
|
1812
|
+
content: this.translateService.instant('searchFields.text'),
|
|
1813
|
+
id: SearchFieldDataType.TEXT,
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
content: this.translateService.instant('searchFields.boolean'),
|
|
1817
|
+
id: SearchFieldDataType.BOOLEAN,
|
|
1818
|
+
},
|
|
1819
|
+
{
|
|
1820
|
+
content: this.translateService.instant('searchFields.date'),
|
|
1821
|
+
id: SearchFieldDataType.DATE,
|
|
1822
|
+
},
|
|
1823
|
+
{
|
|
1824
|
+
content: this.translateService.instant('searchFields.datetime'),
|
|
1825
|
+
id: SearchFieldDataType.DATETIME,
|
|
1826
|
+
},
|
|
1827
|
+
{
|
|
1828
|
+
content: this.translateService.instant('searchFields.number'),
|
|
1829
|
+
id: SearchFieldDataType.NUMBER,
|
|
1830
|
+
},
|
|
1831
|
+
{
|
|
1832
|
+
content: this.translateService.instant('searchFields.time'),
|
|
1833
|
+
id: SearchFieldDataType.TIME,
|
|
1834
|
+
},
|
|
1835
|
+
].map(item => ({ ...item, selected: item.id === dataTypeValue?.id }))));
|
|
1836
|
+
this.fieldTypeItems$ = combineLatest([
|
|
1837
|
+
this._dataTypeValue$.pipe(distinctUntilChanged()),
|
|
1838
|
+
this.fieldTypeValue$,
|
|
1839
|
+
this.translateService.stream('key'),
|
|
1840
|
+
]).pipe(map$1(([dataTypeValue, fieldTypeValue]) => [
|
|
1841
|
+
{
|
|
1842
|
+
content: this.translateService.instant('searchFieldsOverview.single'),
|
|
1843
|
+
id: SearchFieldFieldType.SINGLE,
|
|
1844
|
+
},
|
|
1845
|
+
{
|
|
1846
|
+
content: this.translateService.instant('searchFieldsOverview.range'),
|
|
1847
|
+
id: SearchFieldFieldType.RANGE,
|
|
1848
|
+
},
|
|
1849
|
+
...(dataTypeValue === SearchFieldDataType.TEXT
|
|
1850
|
+
? [
|
|
1851
|
+
{
|
|
1852
|
+
content: this.translateService.instant('searchFieldsOverview.single-select-dropdown'),
|
|
1853
|
+
id: SearchFieldFieldType.SINGLE_SELECT_DROPDOWN,
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
content: this.translateService.instant('searchFieldsOverview.multi-select-dropdown'),
|
|
1857
|
+
id: SearchFieldFieldType.MULTI_SELECT_DROPDOWN,
|
|
1858
|
+
},
|
|
1859
|
+
]
|
|
1860
|
+
: []),
|
|
1861
|
+
].map(item => ({ ...item, selected: item.id === fieldTypeValue?.id }))));
|
|
1862
|
+
this.dataProviderItems$ = this.translateService
|
|
1863
|
+
.stream('key')
|
|
1864
|
+
.pipe(switchMap(() => this.dropdownDataProviderValue$), map$1(dataProviderValue => [
|
|
1865
|
+
{
|
|
1866
|
+
content: this.translateService.instant('searchFieldsOverview.dropdownDatabaseDataProvider'),
|
|
1867
|
+
id: SearchDropdownDataProvider.DATABASE,
|
|
1868
|
+
},
|
|
1869
|
+
{
|
|
1870
|
+
content: this.translateService.instant('searchFieldsOverview.dropdownJsonFileDataProvider'),
|
|
1871
|
+
id: SearchDropdownDataProvider.JSON,
|
|
1872
|
+
},
|
|
1873
|
+
].map(item => ({ ...item, selected: item.id === dataProviderValue?.id }))));
|
|
1874
|
+
this.matchTypeItems$ = this.translateService
|
|
1875
|
+
.stream('key')
|
|
1876
|
+
.pipe(switchMap(() => this.matchTypeValue$), map$1(matchTypeValue => [
|
|
1877
|
+
{
|
|
1878
|
+
content: this.translateService.instant('searchFieldsOverview.like'),
|
|
1879
|
+
id: SearchFieldMatchType.LIKE,
|
|
1880
|
+
},
|
|
1881
|
+
{
|
|
1882
|
+
content: this.translateService.instant('searchFieldsOverview.exact'),
|
|
1883
|
+
id: SearchFieldMatchType.EXACT,
|
|
1884
|
+
},
|
|
1885
|
+
].map(item => ({ ...item, selected: item.id === matchTypeValue?.id }))));
|
|
1886
|
+
this.ValuePathSelectorPrefix = ValuePathSelectorPrefix;
|
|
1887
|
+
this.iconService.registerAll([TrashCan16, InformationFilled16]);
|
|
1888
|
+
}
|
|
1889
|
+
ngOnInit() {
|
|
1890
|
+
this.formGroup.setValidators([
|
|
1891
|
+
this.dropdownDataProviderValidator,
|
|
1892
|
+
this.dropdownValuesValidator,
|
|
1893
|
+
]);
|
|
1894
|
+
}
|
|
1895
|
+
addDropdownValue(prefillValue) {
|
|
1896
|
+
if (!this.dropdownValuesArray)
|
|
1897
|
+
return;
|
|
1898
|
+
this.dropdownValuesArray.push(this.fb.group({
|
|
1899
|
+
key: this.fb.control(prefillValue?.key ?? '', Validators.required),
|
|
1900
|
+
value: this.fb.control(prefillValue?.value ?? '', Validators.required),
|
|
1901
|
+
}));
|
|
1902
|
+
}
|
|
1903
|
+
removeDropdownValue(index) {
|
|
1904
|
+
if (!this.dropdownValuesArray)
|
|
1905
|
+
return;
|
|
1906
|
+
this.dropdownValuesArray.removeAt(index);
|
|
1907
|
+
}
|
|
1908
|
+
onCancel() {
|
|
1909
|
+
this.closeEvent.emit(null);
|
|
1910
|
+
this.resetForm();
|
|
1911
|
+
}
|
|
1912
|
+
onSave() {
|
|
1913
|
+
const groupValue = this.formGroup.getRawValue();
|
|
1914
|
+
this.closeEvent.emit({
|
|
1915
|
+
...(groupValue.title && { title: groupValue.title }),
|
|
1916
|
+
...(groupValue.key && { key: groupValue.key }),
|
|
1917
|
+
...(groupValue.path && { path: groupValue.path }),
|
|
1918
|
+
...(groupValue.dataType?.content && { dataType: groupValue.dataType.id }),
|
|
1919
|
+
...(groupValue.matchType?.content && { matchType: groupValue.matchType.id }),
|
|
1920
|
+
...(groupValue.fieldType?.content && { fieldType: groupValue.fieldType.id }),
|
|
1921
|
+
...(groupValue.dropdownDataProvider?.content && {
|
|
1922
|
+
dropdownDataProvider: groupValue.dropdownDataProvider.id,
|
|
1923
|
+
}),
|
|
1924
|
+
...(groupValue.dropdownValues && {
|
|
1925
|
+
dropdownValues: groupValue.dropdownValues.reduce((acc, curr) => ({ ...acc, ...(!!curr?.key && { [curr.key]: curr.value }) }), {}),
|
|
1926
|
+
}),
|
|
1927
|
+
});
|
|
1928
|
+
this.resetForm();
|
|
1929
|
+
}
|
|
1930
|
+
setPrefilledForm(prefillData) {
|
|
1931
|
+
if (!prefillData)
|
|
1932
|
+
return;
|
|
1933
|
+
this.formGroup.patchValue({
|
|
1934
|
+
...prefillData,
|
|
1935
|
+
dataType: !prefillData.dataType
|
|
1936
|
+
? null
|
|
1937
|
+
: {
|
|
1938
|
+
content: prefillData.dataType,
|
|
1939
|
+
id: prefillData.dataType,
|
|
1940
|
+
selected: true,
|
|
1941
|
+
},
|
|
1942
|
+
matchType: !prefillData.matchType
|
|
1943
|
+
? null
|
|
1944
|
+
: {
|
|
1945
|
+
content: prefillData.matchType,
|
|
1946
|
+
id: prefillData.matchType,
|
|
1947
|
+
selected: true,
|
|
1948
|
+
},
|
|
1949
|
+
fieldType: !prefillData.fieldType
|
|
1950
|
+
? null
|
|
1951
|
+
: {
|
|
1952
|
+
content: prefillData.fieldType,
|
|
1953
|
+
id: prefillData.fieldType,
|
|
1954
|
+
selected: true,
|
|
1955
|
+
},
|
|
1956
|
+
dropdownDataProvider: !prefillData.dropdownDataProvider
|
|
1957
|
+
? null
|
|
1958
|
+
: {
|
|
1959
|
+
content: prefillData.dropdownDataProvider,
|
|
1960
|
+
id: prefillData.dropdownDataProvider,
|
|
1961
|
+
selected: true,
|
|
1962
|
+
},
|
|
1963
|
+
dropdownValues: [],
|
|
1964
|
+
});
|
|
1965
|
+
if (prefillData.dropdownDataProvider && prefillData.dropdownValues)
|
|
1966
|
+
this.setPrefilledDropdownValues(prefillData.dropdownValues);
|
|
1967
|
+
this.formGroup.get('key')?.disable();
|
|
1968
|
+
}
|
|
1969
|
+
setPrefilledDropdownValues(dropdownValue) {
|
|
1970
|
+
if (!this.dropdownValuesArray || !this.dropdownDataProviderValue)
|
|
1971
|
+
return;
|
|
1972
|
+
Object.entries(dropdownValue).forEach(([key, value]) => {
|
|
1973
|
+
this.addDropdownValue({ key, value });
|
|
1974
|
+
});
|
|
1975
|
+
}
|
|
1976
|
+
matchTypeValidator(control) {
|
|
1977
|
+
const controlValue = control.value;
|
|
1978
|
+
const dataTypeControlValue = control.parent?.get('dataType')?.value;
|
|
1979
|
+
if (dataTypeControlValue?.id === SearchFieldDataType.TEXT &&
|
|
1980
|
+
(!controlValue || !controlValue.selected))
|
|
1981
|
+
return { error: 'Match type not selected' };
|
|
1982
|
+
return null;
|
|
1983
|
+
}
|
|
1984
|
+
dropdownDataProviderValidator(group) {
|
|
1985
|
+
const controlValue = group.get('dropdownDataProvider')?.value;
|
|
1986
|
+
const fieldTypeControlValue = group.get('fieldType')?.value;
|
|
1987
|
+
if ([
|
|
1988
|
+
SearchFieldFieldType.SINGLE_SELECT_DROPDOWN,
|
|
1989
|
+
SearchFieldFieldType.MULTI_SELECT_DROPDOWN,
|
|
1990
|
+
].includes(fieldTypeControlValue?.id) &&
|
|
1991
|
+
!controlValue)
|
|
1992
|
+
return { error: 'Dropdown source provider is not specified' };
|
|
1993
|
+
return null;
|
|
1994
|
+
}
|
|
1995
|
+
dropdownValuesValidator(group) {
|
|
1996
|
+
const controlValue = group.get('dropdownValues')?.value;
|
|
1997
|
+
const fieldTypeControlValue = group.get('fieldType')?.value?.id;
|
|
1998
|
+
const dropdownProviderValue = group.get('dropdownDataProvider')?.value?.id;
|
|
1999
|
+
if ([
|
|
2000
|
+
SearchFieldFieldType.SINGLE_SELECT_DROPDOWN,
|
|
2001
|
+
SearchFieldFieldType.MULTI_SELECT_DROPDOWN,
|
|
2002
|
+
].includes(fieldTypeControlValue) &&
|
|
2003
|
+
(!controlValue || controlValue?.length === 0) &&
|
|
2004
|
+
dropdownProviderValue === SearchDropdownDataProvider.DATABASE)
|
|
2005
|
+
return { error: 'Dropdown source provider is not specified or is empty' };
|
|
2006
|
+
return null;
|
|
2007
|
+
}
|
|
2008
|
+
resetForm() {
|
|
2009
|
+
setTimeout(() => {
|
|
2010
|
+
while (!!this.dropdownValuesArray?.length) {
|
|
2011
|
+
this.dropdownValuesArray.removeAt(0);
|
|
2012
|
+
}
|
|
2013
|
+
this.formGroup.reset();
|
|
2014
|
+
this.formGroup.enable();
|
|
2015
|
+
}, CARBON_CONSTANTS.modalAnimationMs);
|
|
2016
|
+
}
|
|
2017
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementSearchFieldModalComponent, deps: [{ token: i6.IconService }, { token: i1$4.FormBuilder }, { token: i4$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2018
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: IkoManagementSearchFieldModalComponent, isStandalone: true, selector: "valtimo-iko-management-search-field-modal", inputs: { open: "open", prefillData: "prefillData" }, outputs: { closeEvent: "closeEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal [open]=\"open\" showFooter=\"true\" (close)=\"onCancel()\">\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCancel()\">\n <h3 cdsModalHeaderHeading>\n {{ (!prefillData ? 'searchFieldsOverview.add' : 'searchFieldsOverview.edit') | translate }}\n </h3>\n </cds-modal-header>\n\n <form cdsModalContent [formGroup]=\"formGroup\" class=\"valtimo-search-fields-modal__content\">\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.title' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.title' | translate\"\n >\n </v-input-label>\n\n <input data-testid=\"-search-title\" cdsText type=\"text\" formControlName=\"title\" cdsLayer />\n </div>\n\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.key' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.key' | translate\"\n >\n </v-input-label>\n\n <input cdsLayer data-testid=\"iko-search-key\" cdsText type=\"text\" formControlName=\"key\" />\n </div>\n\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.path' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.path' | translate\"\n >\n </v-input-label>\n\n <input cdsLayer data-testid=\"iko-search-key\" cdsText type=\"text\" formControlName=\"path\" />\n\n <!-- TODO: When BE value resolver is in place -->\n <!-- <valtimo-value-path-selector\n formControlName=\"path\"\n [caseDefinitionKey]=\"caseDefinitionKey$ | async\"\n [prefixes]=\"[ValuePathSelectorPrefix.DOC, ValuePathSelectorPrefix.CASE]\"\n ></valtimo-value-path-selector> -->\n </div>\n\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.dataType' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.dataType' | translate\"\n >\n </v-input-label>\n\n <cds-dropdown cdsLayer data-testid=\"-search-dataType\" formControlName=\"dataType\">\n <cds-dropdown-list [items]=\"dataTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </div>\n\n @if (dataTypeValue === SearchFieldDataType.TEXT) {\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.matchType' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.matchType' | translate\"\n >\n </v-input-label>\n\n <cds-dropdown cdsLayer data-testid=\"-search-matchType\" formControlName=\"matchType\">\n <cds-dropdown-list [items]=\"matchTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </div>\n }\n\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.fieldType' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.fieldType' | translate\"\n >\n </v-input-label>\n\n <cds-dropdown cdsLayer data-testid=\"-search-fieldType\" formControlName=\"fieldType\">\n <cds-dropdown-list [items]=\"fieldTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </div>\n\n @if (\n dataTypeValue === SearchFieldDataType.TEXT &&\n (fieldTypeValue === SearchFieldFieldType.SINGLE_SELECT_DROPDOWN ||\n fieldTypeValue === SearchFieldFieldType.MULTI_SELECT_DROPDOWN)\n ) {\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.dropdownDataProvider' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.dropdownDataProvider' | translate\"\n >\n </v-input-label>\n\n <cds-dropdown\n data-testid=\"-search-dropdownDataProvider\"\n formControlName=\"dropdownDataProvider\"\n cdsLayer\n >\n <cds-dropdown-list [items]=\"dataProviderItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </div>\n\n @if (dropdownDataProviderValue === SearchDropdownDataProvider.DATABASE) {\n <div class=\"valtimo-search-fields-modal__list\" formArrayName=\"dropdownValues\">\n <v-input-label\n [title]=\"'searchFieldsOverview.dropdownListValues' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.dropdownListValues' | translate\"\n [noMargin]=\"true\"\n >\n </v-input-label>\n\n @for (dropdownValue of dropdownValuesArray?.controls; track $index) {\n <form [formGroup]=\"dropdownValue\" class=\"valtimo-search-fields-modal__dropdown-values\">\n <cds-text-label>\n {{ 'interface.value' | translate }}\n\n <input\n data-testid=\"iko-search-dropdownKey\"\n cdsText\n type=\"text\"\n formControlName=\"key\"\n cdsLayer\n />\n </cds-text-label>\n\n <cds-text-label>\n {{ 'interface.display' | translate }}\n\n <input\n data-testid=\"-search-dropdownValue\"\n cdsText\n type=\"text\"\n formControlName=\"value\"\n cdsLayer\n />\n </cds-text-label>\n\n <button\n cdsButton=\"danger\"\n data-testid=\"iko-search-deleteEnum\"\n [disabled]=\"$count === 1\"\n [iconOnly]=\"true\"\n (click)=\"removeDropdownValue($index)\"\n >\n <svg cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </form>\n }\n\n <button\n data-testid=\"-search-addDropdownValue\"\n cdsButton=\"primary\"\n (click)=\"addDropdownValue()\"\n >\n {{ 'interface.addRow' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n }\n }\n </form>\n\n <cds-modal-footer>\n <button data-testid=\"-search-cancel\" cdsButton=\"ghost\" (click)=\"onCancel()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n data-testid=\"-search-save\"\n cdsButton=\"primary\"\n [disabled]=\"formGroup.invalid\"\n (click)=\"onSave()\"\n >\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-search-fields-modal__content,.valtimo-search-fields-modal__dropdown-values{display:flex;gap:16px}.valtimo-search-fields-modal__content{flex-direction:column}.valtimo-search-fields-modal__dropdown-values{align-items:flex-end;gap:16px}.valtimo-search-fields-modal__label{display:flex;gap:4px}.valtimo-search-fields-modal__list{display:flex;flex-direction:column;gap:16px}\n/*!\n * Copyright 2015-2025 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: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i6.Dropdown, selector: "cds-dropdown, ibm-dropdown", inputs: ["id", "label", "hideLabel", "helperText", "placeholder", "displayValue", "clearText", "size", "type", "theme", "disabled", "readonly", "skeleton", "inline", "disableArrowKeys", "invalid", "invalidText", "warn", "warnText", "appendInline", "scrollableContainer", "itemValueKey", "selectionFeedback", "menuButtonLabel", "selectedLabel", "dropUp", "fluid"], outputs: ["selected", "onClose", "close"] }, { kind: "component", type: i6.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "ngmodule", type: InputLabelModule }, { kind: "component", type: i1$2.InputLabelComponent, selector: "v-input-label", inputs: ["name", "tooltip", "tooltipTranslationKey", "largeMargin", "small", "noMargin", "title", "titleTranslationKey", "required", "disabled", "carbonTheme"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i6.TextInputLabelComponent, selector: "cds-text-label, ibm-text-label", inputs: ["labelInputID", "disabled", "skeleton", "labelTemplate", "textInputTemplate", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel", "fluid"] }, { kind: "directive", type: i6.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i6.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i6.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i6.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i6.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i6.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i6.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.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: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$4.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2019
|
+
}
|
|
2020
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementSearchFieldModalComponent, decorators: [{
|
|
2021
|
+
type: Component,
|
|
2022
|
+
args: [{ selector: 'valtimo-iko-management-search-field-modal', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
2023
|
+
ButtonModule,
|
|
2024
|
+
CommonModule,
|
|
2025
|
+
DropdownModule,
|
|
2026
|
+
InputLabelModule,
|
|
2027
|
+
InputModule,
|
|
2028
|
+
LayerModule,
|
|
2029
|
+
ModalModule,
|
|
2030
|
+
ReactiveFormsModule,
|
|
2031
|
+
TranslateModule,
|
|
2032
|
+
ValtimoCdsModalDirective,
|
|
2033
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal [open]=\"open\" showFooter=\"true\" (close)=\"onCancel()\">\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCancel()\">\n <h3 cdsModalHeaderHeading>\n {{ (!prefillData ? 'searchFieldsOverview.add' : 'searchFieldsOverview.edit') | translate }}\n </h3>\n </cds-modal-header>\n\n <form cdsModalContent [formGroup]=\"formGroup\" class=\"valtimo-search-fields-modal__content\">\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.title' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.title' | translate\"\n >\n </v-input-label>\n\n <input data-testid=\"-search-title\" cdsText type=\"text\" formControlName=\"title\" cdsLayer />\n </div>\n\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.key' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.key' | translate\"\n >\n </v-input-label>\n\n <input cdsLayer data-testid=\"iko-search-key\" cdsText type=\"text\" formControlName=\"key\" />\n </div>\n\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.path' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.path' | translate\"\n >\n </v-input-label>\n\n <input cdsLayer data-testid=\"iko-search-key\" cdsText type=\"text\" formControlName=\"path\" />\n\n <!-- TODO: When BE value resolver is in place -->\n <!-- <valtimo-value-path-selector\n formControlName=\"path\"\n [caseDefinitionKey]=\"caseDefinitionKey$ | async\"\n [prefixes]=\"[ValuePathSelectorPrefix.DOC, ValuePathSelectorPrefix.CASE]\"\n ></valtimo-value-path-selector> -->\n </div>\n\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.dataType' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.dataType' | translate\"\n >\n </v-input-label>\n\n <cds-dropdown cdsLayer data-testid=\"-search-dataType\" formControlName=\"dataType\">\n <cds-dropdown-list [items]=\"dataTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </div>\n\n @if (dataTypeValue === SearchFieldDataType.TEXT) {\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.matchType' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.matchType' | translate\"\n >\n </v-input-label>\n\n <cds-dropdown cdsLayer data-testid=\"-search-matchType\" formControlName=\"matchType\">\n <cds-dropdown-list [items]=\"matchTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </div>\n }\n\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.fieldType' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.fieldType' | translate\"\n >\n </v-input-label>\n\n <cds-dropdown cdsLayer data-testid=\"-search-fieldType\" formControlName=\"fieldType\">\n <cds-dropdown-list [items]=\"fieldTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </div>\n\n @if (\n dataTypeValue === SearchFieldDataType.TEXT &&\n (fieldTypeValue === SearchFieldFieldType.SINGLE_SELECT_DROPDOWN ||\n fieldTypeValue === SearchFieldFieldType.MULTI_SELECT_DROPDOWN)\n ) {\n <div class=\"valtimo-search-fields-modal__input\">\n <v-input-label\n [title]=\"'searchFieldsOverview.dropdownDataProvider' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.dropdownDataProvider' | translate\"\n >\n </v-input-label>\n\n <cds-dropdown\n data-testid=\"-search-dropdownDataProvider\"\n formControlName=\"dropdownDataProvider\"\n cdsLayer\n >\n <cds-dropdown-list [items]=\"dataProviderItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </div>\n\n @if (dropdownDataProviderValue === SearchDropdownDataProvider.DATABASE) {\n <div class=\"valtimo-search-fields-modal__list\" formArrayName=\"dropdownValues\">\n <v-input-label\n [title]=\"'searchFieldsOverview.dropdownListValues' | translate\"\n [tooltip]=\"'searchFieldsOverviewTooltips.dropdownListValues' | translate\"\n [noMargin]=\"true\"\n >\n </v-input-label>\n\n @for (dropdownValue of dropdownValuesArray?.controls; track $index) {\n <form [formGroup]=\"dropdownValue\" class=\"valtimo-search-fields-modal__dropdown-values\">\n <cds-text-label>\n {{ 'interface.value' | translate }}\n\n <input\n data-testid=\"iko-search-dropdownKey\"\n cdsText\n type=\"text\"\n formControlName=\"key\"\n cdsLayer\n />\n </cds-text-label>\n\n <cds-text-label>\n {{ 'interface.display' | translate }}\n\n <input\n data-testid=\"-search-dropdownValue\"\n cdsText\n type=\"text\"\n formControlName=\"value\"\n cdsLayer\n />\n </cds-text-label>\n\n <button\n cdsButton=\"danger\"\n data-testid=\"iko-search-deleteEnum\"\n [disabled]=\"$count === 1\"\n [iconOnly]=\"true\"\n (click)=\"removeDropdownValue($index)\"\n >\n <svg cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </form>\n }\n\n <button\n data-testid=\"-search-addDropdownValue\"\n cdsButton=\"primary\"\n (click)=\"addDropdownValue()\"\n >\n {{ 'interface.addRow' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n }\n }\n </form>\n\n <cds-modal-footer>\n <button data-testid=\"-search-cancel\" cdsButton=\"ghost\" (click)=\"onCancel()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n data-testid=\"-search-save\"\n cdsButton=\"primary\"\n [disabled]=\"formGroup.invalid\"\n (click)=\"onSave()\"\n >\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-search-fields-modal__content,.valtimo-search-fields-modal__dropdown-values{display:flex;gap:16px}.valtimo-search-fields-modal__content{flex-direction:column}.valtimo-search-fields-modal__dropdown-values{align-items:flex-end;gap:16px}.valtimo-search-fields-modal__label{display:flex;gap:4px}.valtimo-search-fields-modal__list{display:flex;flex-direction:column;gap:16px}\n/*!\n * Copyright 2015-2025 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"] }]
|
|
2034
|
+
}], ctorParameters: () => [{ type: i6.IconService }, { type: i1$4.FormBuilder }, { type: i4$1.TranslateService }], propDecorators: { open: [{
|
|
2035
|
+
type: Input,
|
|
2036
|
+
args: [{ required: true }]
|
|
2037
|
+
}], prefillData: [{
|
|
2038
|
+
type: Input
|
|
2039
|
+
}], closeEvent: [{
|
|
2040
|
+
type: Output
|
|
2041
|
+
}] } });
|
|
2042
|
+
|
|
2043
|
+
/*
|
|
2044
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2045
|
+
*
|
|
2046
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2047
|
+
* you may not use this file except in compliance with the License.
|
|
2048
|
+
* You may obtain a copy of the License at
|
|
2049
|
+
*
|
|
2050
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2051
|
+
*
|
|
2052
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2053
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2054
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2055
|
+
* See the License for the specific language governing permissions and
|
|
2056
|
+
* limitations under the License.
|
|
2057
|
+
*/
|
|
2058
|
+
class IkoManagementSearchFieldsComponent {
|
|
2059
|
+
constructor(breadcrumbService, ikoManagementApiService, pageTitleService, route, translateService) {
|
|
2060
|
+
this.breadcrumbService = breadcrumbService;
|
|
2061
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
2062
|
+
this.pageTitleService = pageTitleService;
|
|
2063
|
+
this.route = route;
|
|
2064
|
+
this.translateService = translateService;
|
|
2065
|
+
this._refresh$ = new BehaviorSubject(null);
|
|
2066
|
+
this.params$ = this.route.params.pipe(map$1((params) => ({
|
|
2067
|
+
apiKey: params.apiKey,
|
|
2068
|
+
aggregateKey: params.key,
|
|
2069
|
+
actionKey: params.actionKey,
|
|
2070
|
+
tabKey: params.tabKey,
|
|
2071
|
+
})));
|
|
2072
|
+
this.loading$ = new BehaviorSubject(true);
|
|
2073
|
+
this.searchFields$ = combineLatest([
|
|
2074
|
+
this.params$,
|
|
2075
|
+
this.translateService.stream('key'),
|
|
2076
|
+
this._refresh$,
|
|
2077
|
+
]).pipe(switchMap(([params]) => this.ikoManagementApiService.getIkoSearchFields(params.aggregateKey, params.actionKey)), map$1((searchFields) => searchFields.map((field) => ({
|
|
2078
|
+
...field,
|
|
2079
|
+
dataTypeText: this.translateService.instant(`searchFields.${field.dataType}`),
|
|
2080
|
+
fieldTypeText: this.translateService.instant(`searchFieldsOverview.${field.fieldType}`),
|
|
2081
|
+
}))), tap(() => this.loading$.next(false)));
|
|
2082
|
+
this.deleteModalOpen$ = new BehaviorSubject(false);
|
|
2083
|
+
this.deleteFieldKey$ = new BehaviorSubject(null);
|
|
2084
|
+
this.fieldModalOpen$ = new BehaviorSubject(false);
|
|
2085
|
+
this.prefillData$ = new BehaviorSubject(null);
|
|
2086
|
+
this._searchAction$ = this.params$.pipe(switchMap((params) => this.ikoManagementApiService.getIkoDataRequest(params.aggregateKey, params.actionKey)));
|
|
2087
|
+
this._ikoRepositoryConfig$ = this.params$.pipe(switchMap((params) => this.ikoManagementApiService.getIkoRepositoryConfig(params.apiKey)));
|
|
2088
|
+
this.FIELDS = [
|
|
2089
|
+
{
|
|
2090
|
+
key: 'key',
|
|
2091
|
+
label: 'interface.key',
|
|
2092
|
+
viewType: ViewType.TEXT,
|
|
2093
|
+
},
|
|
2094
|
+
{
|
|
2095
|
+
key: 'title',
|
|
2096
|
+
label: 'interface.title',
|
|
2097
|
+
viewType: ViewType.TEXT,
|
|
2098
|
+
},
|
|
2099
|
+
{
|
|
2100
|
+
key: 'path',
|
|
2101
|
+
label: 'searchFieldsOverview.path',
|
|
2102
|
+
viewType: ViewType.TEXT,
|
|
2103
|
+
},
|
|
2104
|
+
{
|
|
2105
|
+
key: 'dataTypeText',
|
|
2106
|
+
label: 'searchFieldsOverview.dataType',
|
|
2107
|
+
viewType: ViewType.TEXT,
|
|
2108
|
+
},
|
|
2109
|
+
{
|
|
2110
|
+
key: 'fieldTypeText',
|
|
2111
|
+
label: 'searchFieldsOverview.fieldType',
|
|
2112
|
+
viewType: ViewType.TEXT,
|
|
2113
|
+
},
|
|
2114
|
+
];
|
|
2115
|
+
this.ACTION_ITEMS = [
|
|
2116
|
+
{
|
|
2117
|
+
label: 'interface.edit',
|
|
2118
|
+
callback: this.editSearchField.bind(this),
|
|
2119
|
+
},
|
|
2120
|
+
{
|
|
2121
|
+
label: 'interface.delete',
|
|
2122
|
+
callback: this.deleteSearchField.bind(this),
|
|
2123
|
+
type: 'danger',
|
|
2124
|
+
},
|
|
2125
|
+
];
|
|
2126
|
+
this._subscriptions = new Subscription();
|
|
2127
|
+
}
|
|
2128
|
+
ngOnInit() {
|
|
2129
|
+
this.setBreadcrumbs();
|
|
2130
|
+
this._subscriptions.add(combineLatest([this._searchAction$, this.translateService.stream('key')]).subscribe(([searchAction]) => {
|
|
2131
|
+
this.pageTitleService.setCustomPageTitle(this.translateService.instant('ikoManagement.searchFields.pageTitle', {
|
|
2132
|
+
searchActionTitle: searchAction.title,
|
|
2133
|
+
}), true);
|
|
2134
|
+
}));
|
|
2135
|
+
}
|
|
2136
|
+
ngOnDestroy() {
|
|
2137
|
+
this._subscriptions.unsubscribe();
|
|
2138
|
+
this.pageTitleService.enableReset();
|
|
2139
|
+
this.breadcrumbService.clearThirdBreadcrumb();
|
|
2140
|
+
this.breadcrumbService.clearFourthBreadcrumb();
|
|
2141
|
+
}
|
|
2142
|
+
onItemsReordered(searchFields, params) {
|
|
2143
|
+
this.ikoManagementApiService
|
|
2144
|
+
.updateIkoSearchFields(params.aggregateKey, params.actionKey, searchFields)
|
|
2145
|
+
.pipe(take(1))
|
|
2146
|
+
.subscribe();
|
|
2147
|
+
}
|
|
2148
|
+
openAddModal() {
|
|
2149
|
+
this.fieldModalOpen$.next(true);
|
|
2150
|
+
}
|
|
2151
|
+
deleteSearchField(field) {
|
|
2152
|
+
this.deleteFieldKey$.next(field.key);
|
|
2153
|
+
this.deleteModalOpen$.next(true);
|
|
2154
|
+
}
|
|
2155
|
+
editSearchField(field) {
|
|
2156
|
+
this.prefillData$.next(field);
|
|
2157
|
+
this.fieldModalOpen$.next(true);
|
|
2158
|
+
}
|
|
2159
|
+
onDeleteSearchField(key) {
|
|
2160
|
+
this.params$
|
|
2161
|
+
.pipe(switchMap((params) => this.ikoManagementApiService.deleteIkoSearchField(params.aggregateKey, params.actionKey, key)))
|
|
2162
|
+
.subscribe(() => this._refresh$.next(null));
|
|
2163
|
+
}
|
|
2164
|
+
onModalClose(field) {
|
|
2165
|
+
this.fieldModalOpen$.next(false);
|
|
2166
|
+
if (!field)
|
|
2167
|
+
return;
|
|
2168
|
+
this.params$
|
|
2169
|
+
.pipe(switchMap((params) => this.prefillData$.getValue() === null
|
|
2170
|
+
? this.ikoManagementApiService.createIkoSearchField(params.aggregateKey, params.actionKey, field.key, field)
|
|
2171
|
+
: this.ikoManagementApiService.updateIkoSearchField(params.aggregateKey, params.actionKey, field.key, field)))
|
|
2172
|
+
.subscribe(() => this._refresh$.next(null));
|
|
2173
|
+
}
|
|
2174
|
+
setBreadcrumbs() {
|
|
2175
|
+
combineLatest([
|
|
2176
|
+
this._ikoRepositoryConfig$,
|
|
2177
|
+
this.params$,
|
|
2178
|
+
this.translateService.stream('key'),
|
|
2179
|
+
]).subscribe(([repositoryConfig, params]) => {
|
|
2180
|
+
this.breadcrumbService.setThirdBreadcrumb({
|
|
2181
|
+
route: [`/iko-management/${repositoryConfig.key}`],
|
|
2182
|
+
content: repositoryConfig.title,
|
|
2183
|
+
href: `/iko-management/${repositoryConfig.key}`,
|
|
2184
|
+
});
|
|
2185
|
+
this.breadcrumbService.setFourthBreadcrumb({
|
|
2186
|
+
route: [`/iko-management/${repositoryConfig.key}/${params.aggregateKey}/${params.tabKey}`],
|
|
2187
|
+
content: this.translateService.instant('ikoManagement.searchActions.title'),
|
|
2188
|
+
href: `/iko-management/${repositoryConfig.key}/${params.aggregateKey}/${params.tabKey}`,
|
|
2189
|
+
});
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2192
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementSearchFieldsComponent, deps: [{ token: i1$2.BreadcrumbService }, { token: IkoManagementApiService }, { token: i1$2.PageTitleService }, { token: i1$3.ActivatedRoute }, { token: i4$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2193
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: IkoManagementSearchFieldsComponent, isStandalone: true, selector: "valtimo-iko-management-search-fields", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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@if (params$ | async; as params) {\n <valtimo-carbon-list\n [actionItems]=\"ACTION_ITEMS\"\n [dragAndDrop]=\"true\"\n [fields]=\"FIELDS\"\n [items]=\"searchFields$ | async\"\n [loading]=\"loading$ | async\"\n (itemsReordered)=\"onItemsReordered($event, params)\"\n (rowClicked)=\"editSearchField($event)\"\n >\n <div carbonToolbarContent>\n <ng-container [ngTemplateOutlet]=\"addFieldButton\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"addFieldButton\"\n [description]=\"'ikoManagement.searchFields.noResultsDescription' | translate\"\n [title]=\"'ikoManagement.searchFields.noResultsTitle' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n}\n\n<valtimo-iko-management-search-field-modal\n [open]=\"fieldModalOpen$ | async\"\n [prefillData]=\"prefillData$ | async\"\n (closeEvent)=\"onModalClose($event)\"\n></valtimo-iko-management-search-field-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"ikoManagement.searchFields.deleteModalText\"\n [outputOnConfirm]=\"deleteFieldKey$ | async\"\n [showModalSubject$]=\"deleteModalOpen$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteSearchField($event)\"\n></valtimo-confirmation-modal>\n\n<ng-template #addFieldButton>\n <button cdsButton=\"primary\" (click)=\"openAddModal()\">\n {{ 'searchFieldsOverview.add' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1$2.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i1$2.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i1$2.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i6.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "component", type: IkoManagementSearchFieldModalComponent, selector: "valtimo-iko-management-search-field-modal", inputs: ["open", "prefillData"], outputs: ["closeEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2194
|
+
}
|
|
2195
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementSearchFieldsComponent, decorators: [{
|
|
2196
|
+
type: Component,
|
|
2197
|
+
args: [{ selector: 'valtimo-iko-management-search-fields', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
2198
|
+
ButtonModule,
|
|
2199
|
+
CarbonListModule,
|
|
2200
|
+
CommonModule,
|
|
2201
|
+
ConfirmationModalModule,
|
|
2202
|
+
IconModule,
|
|
2203
|
+
TranslateModule,
|
|
2204
|
+
IkoManagementSearchFieldModalComponent,
|
|
2205
|
+
], template: "<!--\n ~ Copyright 2015-2025 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@if (params$ | async; as params) {\n <valtimo-carbon-list\n [actionItems]=\"ACTION_ITEMS\"\n [dragAndDrop]=\"true\"\n [fields]=\"FIELDS\"\n [items]=\"searchFields$ | async\"\n [loading]=\"loading$ | async\"\n (itemsReordered)=\"onItemsReordered($event, params)\"\n (rowClicked)=\"editSearchField($event)\"\n >\n <div carbonToolbarContent>\n <ng-container [ngTemplateOutlet]=\"addFieldButton\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"addFieldButton\"\n [description]=\"'ikoManagement.searchFields.noResultsDescription' | translate\"\n [title]=\"'ikoManagement.searchFields.noResultsTitle' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n}\n\n<valtimo-iko-management-search-field-modal\n [open]=\"fieldModalOpen$ | async\"\n [prefillData]=\"prefillData$ | async\"\n (closeEvent)=\"onModalClose($event)\"\n></valtimo-iko-management-search-field-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"ikoManagement.searchFields.deleteModalText\"\n [outputOnConfirm]=\"deleteFieldKey$ | async\"\n [showModalSubject$]=\"deleteModalOpen$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteSearchField($event)\"\n></valtimo-confirmation-modal>\n\n<ng-template #addFieldButton>\n <button cdsButton=\"primary\" (click)=\"openAddModal()\">\n {{ 'searchFieldsOverview.add' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n" }]
|
|
2206
|
+
}], ctorParameters: () => [{ type: i1$2.BreadcrumbService }, { type: IkoManagementApiService }, { type: i1$2.PageTitleService }, { type: i1$3.ActivatedRoute }, { type: i4$1.TranslateService }] });
|
|
2207
|
+
|
|
2208
|
+
/*
|
|
2209
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2210
|
+
*
|
|
2211
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2212
|
+
* you may not use this file except in compliance with the License.
|
|
2213
|
+
* You may obtain a copy of the License at
|
|
2214
|
+
*
|
|
2215
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2216
|
+
*
|
|
2217
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2218
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2219
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2220
|
+
* See the License for the specific language governing permissions and
|
|
2221
|
+
* limitations under the License.
|
|
2222
|
+
*/
|
|
2223
|
+
class IkoManagementWidgetsComponent extends ManagementWidgetDetailsComponent {
|
|
2224
|
+
constructor(widgetWizardService, breadcrumbService, ikoManagementApiService, route, translateService, ikoWidgetManagementApiService) {
|
|
2225
|
+
super(widgetWizardService);
|
|
2226
|
+
this.widgetWizardService = widgetWizardService;
|
|
2227
|
+
this.breadcrumbService = breadcrumbService;
|
|
2228
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
2229
|
+
this.route = route;
|
|
2230
|
+
this.translateService = translateService;
|
|
2231
|
+
this.ikoWidgetManagementApiService = ikoWidgetManagementApiService;
|
|
2232
|
+
this.params$ = this.route.params.pipe(map$1((params) => ({
|
|
2233
|
+
apiKey: params.apiKey,
|
|
2234
|
+
aggregateKey: params.key,
|
|
2235
|
+
actionKey: params.actionKey,
|
|
2236
|
+
tabKey: params.tabKey,
|
|
2237
|
+
widgetTabKey: params.widgetTabKey,
|
|
2238
|
+
})), tap((params) => this.ikoWidgetManagementApiService.initParams(params)));
|
|
2239
|
+
this.widgets$ = this.ikoWidgetManagementApiService.getWidgetConfiguration();
|
|
2240
|
+
this.AVAILABLE_WIDGET_TYPES = [
|
|
2241
|
+
WidgetType.FIELDS,
|
|
2242
|
+
WidgetType.COLLECTION,
|
|
2243
|
+
WidgetType.TABLE,
|
|
2244
|
+
WidgetType.INTERACTIVE_TABLE,
|
|
2245
|
+
];
|
|
2246
|
+
this._ikoRepositoryConfig$ = this.params$.pipe(switchMap((params) => this.ikoManagementApiService.getIkoRepositoryConfig(params.apiKey)));
|
|
2247
|
+
this._ikoTabConfig$ = this.params$.pipe(switchMap((params) => this.ikoManagementApiService.getIkoTab(params.aggregateKey, params.widgetTabKey)));
|
|
2248
|
+
this._subscriptions = new Subscription();
|
|
2249
|
+
}
|
|
2250
|
+
ngOnInit() {
|
|
2251
|
+
this.setContext('iko');
|
|
2252
|
+
this.setBreadcrumbs();
|
|
2253
|
+
}
|
|
2254
|
+
ngOnDestroy() {
|
|
2255
|
+
this.breadcrumbService.clearThirdBreadcrumb();
|
|
2256
|
+
this.breadcrumbService.clearFourthBreadcrumb();
|
|
2257
|
+
this._subscriptions.unsubscribe();
|
|
2258
|
+
}
|
|
2259
|
+
setBreadcrumbs() {
|
|
2260
|
+
this._subscriptions.add(combineLatest([
|
|
2261
|
+
this._ikoTabConfig$,
|
|
2262
|
+
this._ikoRepositoryConfig$,
|
|
2263
|
+
this.ikoWidgetManagementApiService.params$,
|
|
2264
|
+
this.translateService.stream('key'),
|
|
2265
|
+
])
|
|
2266
|
+
.pipe(tap(([tabConfig, repositoryConfig, params]) => {
|
|
2267
|
+
if (!params)
|
|
2268
|
+
return;
|
|
2269
|
+
this.breadcrumbService.setThirdBreadcrumb({
|
|
2270
|
+
route: [`/iko-management/${repositoryConfig.key}`],
|
|
2271
|
+
content: repositoryConfig.title,
|
|
2272
|
+
href: `/iko-management/${repositoryConfig.key}`,
|
|
2273
|
+
});
|
|
2274
|
+
this.breadcrumbService.setFourthBreadcrumb({
|
|
2275
|
+
route: [
|
|
2276
|
+
`/iko-management/${repositoryConfig.key}/${params.aggregateKey}/${params.tabKey}`,
|
|
2277
|
+
],
|
|
2278
|
+
content: tabConfig.title || params.widgetTabKey || '',
|
|
2279
|
+
href: `/iko-management/${repositoryConfig.key}/${params.aggregateKey}/${params.tabKey}`,
|
|
2280
|
+
});
|
|
2281
|
+
}))
|
|
2282
|
+
.subscribe());
|
|
2283
|
+
}
|
|
2284
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementWidgetsComponent, deps: [{ token: i2$1.WidgetWizardService }, { token: i1$2.BreadcrumbService }, { token: IkoManagementApiService }, { token: i1$3.ActivatedRoute }, { token: i4$1.TranslateService }, { token: WIDGET_MANAGEMENT_SERVICE }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2285
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoManagementWidgetsComponent, isStandalone: true, selector: "ng-component", providers: [
|
|
2286
|
+
{
|
|
2287
|
+
provide: WIDGET_MANAGEMENT_SERVICE,
|
|
2288
|
+
useClass: IkoWidgetManagementApiService,
|
|
2289
|
+
},
|
|
2290
|
+
], usesInheritance: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-management\n [params]=\"params$ | async\"\n [availableWidgetTypes]=\"AVAILABLE_WIDGET_TYPES\"\n></valtimo-widget-management>\n", styles: ["/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "component", type: WidgetManagementComponent, selector: "valtimo-widget-management", inputs: ["params", "availableWidgetTypes", "disableDuplicate", "enableWidgetDivider", "singleWidget", "disableJsonEditor", "defaultWidth", "widgetWizardSteps"] }, { kind: "ngmodule", type: TranslateModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2291
|
+
}
|
|
2292
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementWidgetsComponent, decorators: [{
|
|
2293
|
+
type: Component,
|
|
2294
|
+
args: [{ standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, WidgetManagementComponent, TranslateModule], providers: [
|
|
2295
|
+
{
|
|
2296
|
+
provide: WIDGET_MANAGEMENT_SERVICE,
|
|
2297
|
+
useClass: IkoWidgetManagementApiService,
|
|
2298
|
+
},
|
|
2299
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-widget-management\n [params]=\"params$ | async\"\n [availableWidgetTypes]=\"AVAILABLE_WIDGET_TYPES\"\n></valtimo-widget-management>\n", styles: ["/*!\n * Copyright 2015-2025 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"] }]
|
|
2300
|
+
}], ctorParameters: () => [{ type: i2$1.WidgetWizardService }, { type: i1$2.BreadcrumbService }, { type: IkoManagementApiService }, { type: i1$3.ActivatedRoute }, { type: i4$1.TranslateService }, { type: undefined, decorators: [{
|
|
2301
|
+
type: Inject,
|
|
2302
|
+
args: [WIDGET_MANAGEMENT_SERVICE]
|
|
2303
|
+
}] }] });
|
|
2304
|
+
|
|
2305
|
+
/*
|
|
2306
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2307
|
+
*
|
|
2308
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2309
|
+
* you may not use this file except in compliance with the License.
|
|
2310
|
+
* You may obtain a copy of the License at
|
|
2311
|
+
*
|
|
2312
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2313
|
+
*
|
|
2314
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2315
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2316
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2317
|
+
* See the License for the specific language governing permissions and
|
|
2318
|
+
* limitations under the License.
|
|
2319
|
+
*/
|
|
2320
|
+
class IkoManagementSearchActionModalComponent {
|
|
2321
|
+
set open(value) {
|
|
2322
|
+
this.$isOpen.set(value);
|
|
2323
|
+
if (value)
|
|
2324
|
+
return;
|
|
2325
|
+
setTimeout(() => {
|
|
2326
|
+
this.$modalType.set('add');
|
|
2327
|
+
this.formGroup.reset();
|
|
2328
|
+
this.formGroup.get('key')?.enable();
|
|
2329
|
+
}, CARBON_CONSTANTS.modalAnimationMs);
|
|
2330
|
+
}
|
|
2331
|
+
set prefillData(value) {
|
|
2332
|
+
this.$prefillData.set(value);
|
|
2333
|
+
if (!value)
|
|
2334
|
+
return;
|
|
2335
|
+
this.$modalType.set('edit');
|
|
2336
|
+
this.formGroup.patchValue(value);
|
|
2337
|
+
this.formGroup.get('key')?.disable();
|
|
2338
|
+
}
|
|
2339
|
+
constructor(fb, ikoManagementApiService) {
|
|
2340
|
+
this.fb = fb;
|
|
2341
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
2342
|
+
this.$modalType = signal('add');
|
|
2343
|
+
this.$isOpen = signal(false);
|
|
2344
|
+
this.$prefillData = signal(null);
|
|
2345
|
+
this.modalClose = new EventEmitter();
|
|
2346
|
+
this.propertyFields$ = toObservable(this.$isOpen).pipe(filter((open) => !!open), map$1(() => this.repositoryKey), switchMap((repositoryKey) => this.ikoManagementApiService.getIkoRepositoryConfig(repositoryKey ?? '')), switchMap((repository) => this.ikoManagementApiService.getIkoDataRequestPropertyFields(repository.type)));
|
|
2347
|
+
this.formGroup = this.fb.group({
|
|
2348
|
+
key: this.fb.control('', Validators.required),
|
|
2349
|
+
title: this.fb.control('', Validators.required),
|
|
2350
|
+
ikoDataAggregateKey: this.fb.control(''),
|
|
2351
|
+
properties: this.fb.group({}),
|
|
2352
|
+
});
|
|
2353
|
+
}
|
|
2354
|
+
get properties() {
|
|
2355
|
+
const properties = this.formGroup.get('properties');
|
|
2356
|
+
return !properties ? null : properties;
|
|
2357
|
+
}
|
|
2358
|
+
onCancel() {
|
|
2359
|
+
this.modalClose.emit(null);
|
|
2360
|
+
}
|
|
2361
|
+
onSave() {
|
|
2362
|
+
this.propertyFields$.pipe(take(1)).subscribe(fields => {
|
|
2363
|
+
const formData = this.formGroup.getRawValue();
|
|
2364
|
+
fields.forEach(field => {
|
|
2365
|
+
if (formData.properties[field.key] && field.type === 'keyValueList') {
|
|
2366
|
+
formData.properties[field.key] = Array.isArray(formData.properties[field.key])
|
|
2367
|
+
? formData.properties[field.key].reduce((acc, cur) => {
|
|
2368
|
+
if (cur.key) {
|
|
2369
|
+
acc[cur.key] = cur.value;
|
|
2370
|
+
}
|
|
2371
|
+
return acc;
|
|
2372
|
+
}, {})
|
|
2373
|
+
: {};
|
|
2374
|
+
}
|
|
2375
|
+
});
|
|
2376
|
+
this.modalClose.emit(formData);
|
|
2377
|
+
});
|
|
2378
|
+
}
|
|
2379
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementSearchActionModalComponent, deps: [{ token: i1$4.FormBuilder }, { token: IkoManagementApiService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2380
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoManagementSearchActionModalComponent, isStandalone: true, selector: "valtimo-iko-management-search-action-modal", inputs: { open: "open", prefillData: "prefillData", repositoryKey: "repositoryKey", aggregateKey: "aggregateKey" }, outputs: { modalClose: "modalClose" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n valtimoCdsModal\n [open]=\"$isOpen()\"\n size=\"sm\"\n showFooter=\"true\"\n [title]=\"'ikoManagement.searchActions.' + $modalType() + 'ActionTitle' | translate\"\n (close)=\"onCancel()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCancel()\">\n <h3 cdsModalHeaderHeading>\n {{ 'ikoManagement.searchActions.' + $modalType() + 'ActionTitle' | translate }}\n </h3>\n </cds-modal-header>\n\n <form cdsModalContent [formGroup]=\"formGroup\">\n <cds-label>\n {{ 'interface.title' | translate }}\n\n <input\n formControlName=\"title\"\n cdsText\n cdsLayer\n placeholder=\"{{ 'interface.title' | translate }}\"\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n\n <cds-label>\n {{ 'interface.key' | translate }}\n\n <input\n formControlName=\"key\"\n cdsText\n cdsLayer\n placeholder=\"{{ 'interface.key' | translate }}\"\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n\n <valtimo-iko-management-properties\n [propertiesFormGroup]=\"properties\"\n [fields]=\"propertyFields$ | async\"\n [prefillData]=\"$prefillData()?.properties\"\n />\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"onCancel()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button cdsButton=\"primary\" [disabled]=\"formGroup.invalid\" (click)=\"onSave()\">\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["form{display:flex;flex-direction:column;gap:16px}\n/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.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: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i6.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i6.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i6.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i6.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i6.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i6.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i6.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i6.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "component", type: PropertiesFormComponent, selector: "valtimo-iko-management-properties", inputs: ["propertiesFormGroup", "fields", "prefillData"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2381
|
+
}
|
|
2382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementSearchActionModalComponent, decorators: [{
|
|
2383
|
+
type: Component,
|
|
2384
|
+
args: [{ selector: 'valtimo-iko-management-search-action-modal', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
2385
|
+
CommonModule,
|
|
2386
|
+
ReactiveFormsModule,
|
|
2387
|
+
InputModule,
|
|
2388
|
+
TranslateModule,
|
|
2389
|
+
ModalModule,
|
|
2390
|
+
ValtimoCdsModalDirective,
|
|
2391
|
+
ButtonModule,
|
|
2392
|
+
LayerModule,
|
|
2393
|
+
PropertiesFormComponent,
|
|
2394
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n valtimoCdsModal\n [open]=\"$isOpen()\"\n size=\"sm\"\n showFooter=\"true\"\n [title]=\"'ikoManagement.searchActions.' + $modalType() + 'ActionTitle' | translate\"\n (close)=\"onCancel()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCancel()\">\n <h3 cdsModalHeaderHeading>\n {{ 'ikoManagement.searchActions.' + $modalType() + 'ActionTitle' | translate }}\n </h3>\n </cds-modal-header>\n\n <form cdsModalContent [formGroup]=\"formGroup\">\n <cds-label>\n {{ 'interface.title' | translate }}\n\n <input\n formControlName=\"title\"\n cdsText\n cdsLayer\n placeholder=\"{{ 'interface.title' | translate }}\"\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n\n <cds-label>\n {{ 'interface.key' | translate }}\n\n <input\n formControlName=\"key\"\n cdsText\n cdsLayer\n placeholder=\"{{ 'interface.key' | translate }}\"\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n\n <valtimo-iko-management-properties\n [propertiesFormGroup]=\"properties\"\n [fields]=\"propertyFields$ | async\"\n [prefillData]=\"$prefillData()?.properties\"\n />\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"onCancel()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button cdsButton=\"primary\" [disabled]=\"formGroup.invalid\" (click)=\"onSave()\">\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["form{display:flex;flex-direction:column;gap:16px}\n/*!\n * Copyright 2015-2025 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"] }]
|
|
2395
|
+
}], ctorParameters: () => [{ type: i1$4.FormBuilder }, { type: IkoManagementApiService }], propDecorators: { open: [{
|
|
2396
|
+
type: Input
|
|
2397
|
+
}], prefillData: [{
|
|
2398
|
+
type: Input
|
|
2399
|
+
}], repositoryKey: [{
|
|
2400
|
+
type: Input
|
|
2401
|
+
}], aggregateKey: [{
|
|
2402
|
+
type: Input
|
|
2403
|
+
}], modalClose: [{
|
|
2404
|
+
type: Output
|
|
2405
|
+
}] } });
|
|
2406
|
+
|
|
2407
|
+
/*
|
|
2408
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2409
|
+
*
|
|
2410
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2411
|
+
* you may not use this file except in compliance with the License.
|
|
2412
|
+
* You may obtain a copy of the License at
|
|
2413
|
+
*
|
|
2414
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2415
|
+
*
|
|
2416
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2417
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2418
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2419
|
+
* See the License for the specific language governing permissions and
|
|
2420
|
+
* limitations under the License.
|
|
2421
|
+
*/
|
|
2422
|
+
class IkoManagementSearchActionsComponent {
|
|
2423
|
+
constructor(document, route, router, ikoManagementApiService, notificationService, translateService) {
|
|
2424
|
+
this.document = document;
|
|
2425
|
+
this.route = route;
|
|
2426
|
+
this.router = router;
|
|
2427
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
2428
|
+
this.notificationService = notificationService;
|
|
2429
|
+
this.translateService = translateService;
|
|
2430
|
+
this.loading$ = new BehaviorSubject(true);
|
|
2431
|
+
this.FIELDS = [
|
|
2432
|
+
{
|
|
2433
|
+
key: 'title',
|
|
2434
|
+
label: 'interface.title',
|
|
2435
|
+
viewType: ViewType.TEXT,
|
|
2436
|
+
},
|
|
2437
|
+
{
|
|
2438
|
+
key: 'key',
|
|
2439
|
+
label: 'interface.key',
|
|
2440
|
+
viewType: ViewType.TEXT,
|
|
2441
|
+
},
|
|
2442
|
+
];
|
|
2443
|
+
this.ACTION_ITEMS = [
|
|
2444
|
+
{
|
|
2445
|
+
label: 'interface.edit',
|
|
2446
|
+
callback: this.editSearchAction.bind(this),
|
|
2447
|
+
},
|
|
2448
|
+
{
|
|
2449
|
+
label: 'interface.delete',
|
|
2450
|
+
callback: this.deleteSearchAction.bind(this),
|
|
2451
|
+
type: 'danger',
|
|
2452
|
+
},
|
|
2453
|
+
];
|
|
2454
|
+
this.deleteSearchActionKey$ = new BehaviorSubject(null);
|
|
2455
|
+
this.prefillData$ = new BehaviorSubject(null);
|
|
2456
|
+
this.actionModalOpen$ = new BehaviorSubject(false);
|
|
2457
|
+
this.deleteModalOpen$ = new BehaviorSubject(false);
|
|
2458
|
+
this.exporting$ = new BehaviorSubject(false);
|
|
2459
|
+
this.repositoryKey$ = this.route.params.pipe(map((params) => params.apiKey), filter(repositoryKey => !!repositoryKey));
|
|
2460
|
+
this.aggregateKey$ = this.route.params.pipe(map((params) => params.key), filter(key => !!key));
|
|
2461
|
+
this._refresh$ = new BehaviorSubject(null);
|
|
2462
|
+
this.searchActions$ = combineLatest([
|
|
2463
|
+
this.aggregateKey$,
|
|
2464
|
+
this._refresh$,
|
|
2465
|
+
]).pipe(switchMap(([key]) => this.ikoManagementApiService.getManagementIkoDataRequests(key)), tap(() => this.loading$.next(false)));
|
|
2466
|
+
}
|
|
2467
|
+
onSearchActionClick(action) {
|
|
2468
|
+
this.router.navigate([`search-action/${action.key}`], { relativeTo: this.route });
|
|
2469
|
+
}
|
|
2470
|
+
deleteSearchAction(action) {
|
|
2471
|
+
this.deleteSearchActionKey$.next(action.key);
|
|
2472
|
+
this.deleteModalOpen$.next(true);
|
|
2473
|
+
}
|
|
2474
|
+
onDeleteSearchAction(key) {
|
|
2475
|
+
this.aggregateKey$
|
|
2476
|
+
.pipe(switchMap((aggregateKey) => this.ikoManagementApiService.deleteIkoDataRequest(aggregateKey, key)))
|
|
2477
|
+
.subscribe(() => this._refresh$.next(null));
|
|
2478
|
+
}
|
|
2479
|
+
editSearchAction(action) {
|
|
2480
|
+
this.prefillData$.next(action);
|
|
2481
|
+
this.actionModalOpen$.next(true);
|
|
2482
|
+
}
|
|
2483
|
+
onItemsReordered(searchActions, aggregateKey) {
|
|
2484
|
+
this.ikoManagementApiService
|
|
2485
|
+
.updateIkoDataRequests(aggregateKey, searchActions)
|
|
2486
|
+
.pipe(take$1(1))
|
|
2487
|
+
.subscribe();
|
|
2488
|
+
}
|
|
2489
|
+
onModalClose(action) {
|
|
2490
|
+
this.actionModalOpen$.next(false);
|
|
2491
|
+
const prefillData = this.prefillData$.getValue();
|
|
2492
|
+
this.prefillData$.next(null);
|
|
2493
|
+
if (!action)
|
|
2494
|
+
return;
|
|
2495
|
+
this.aggregateKey$
|
|
2496
|
+
.pipe(switchMap((aggregateKey) => prefillData === null
|
|
2497
|
+
? this.ikoManagementApiService.createIkoDataRequest(aggregateKey, action.key, action)
|
|
2498
|
+
: this.ikoManagementApiService.updateIkoDataRequest(aggregateKey, action.key, action)))
|
|
2499
|
+
.subscribe(() => {
|
|
2500
|
+
this._refresh$.next(null);
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
exportConfiguration() {
|
|
2504
|
+
this.closeCurrentNotification();
|
|
2505
|
+
this._currentNotification = this.notificationService.showNotification({
|
|
2506
|
+
type: 'info',
|
|
2507
|
+
title: '',
|
|
2508
|
+
showClose: false,
|
|
2509
|
+
template: this._exportMessageTemplateRef,
|
|
2510
|
+
});
|
|
2511
|
+
this.startExporting();
|
|
2512
|
+
combineLatest([this.aggregateKey$])
|
|
2513
|
+
.pipe(take$1(1), switchMap(([aggregateKey]) => this.ikoManagementApiService.exportIKOConfiguration(aggregateKey)))
|
|
2514
|
+
.subscribe({
|
|
2515
|
+
next: response => {
|
|
2516
|
+
this.closeCurrentNotification();
|
|
2517
|
+
this._currentNotification = this.notificationService.showNotification({
|
|
2518
|
+
type: 'success',
|
|
2519
|
+
title: this.translateService.instant('caseManagement.exportSuccessTitle'),
|
|
2520
|
+
duration: 5000,
|
|
2521
|
+
});
|
|
2522
|
+
this.downloadZip(response);
|
|
2523
|
+
this.stopExporting();
|
|
2524
|
+
},
|
|
2525
|
+
error: () => {
|
|
2526
|
+
this.closeCurrentNotification();
|
|
2527
|
+
this._currentNotification = this.notificationService.showNotification({
|
|
2528
|
+
type: 'error',
|
|
2529
|
+
title: this.translateService.instant('caseManagement.exportErrorTitle'),
|
|
2530
|
+
message: this.translateService.instant('caseManagement.exportErrorMessage'),
|
|
2531
|
+
duration: 5000,
|
|
2532
|
+
});
|
|
2533
|
+
this.stopExporting();
|
|
2534
|
+
},
|
|
2535
|
+
});
|
|
2536
|
+
}
|
|
2537
|
+
openAddModal() {
|
|
2538
|
+
this.actionModalOpen$.next(true);
|
|
2539
|
+
}
|
|
2540
|
+
startExporting() {
|
|
2541
|
+
this.exporting$.next(true);
|
|
2542
|
+
}
|
|
2543
|
+
downloadZip(response) {
|
|
2544
|
+
this.aggregateKey$.pipe(take$1(1)).subscribe(key => {
|
|
2545
|
+
const link = document.createElement('a');
|
|
2546
|
+
const contentDisposition = response.headers.get('content-disposition');
|
|
2547
|
+
const splitContentDisposition = contentDisposition?.split('filename=') ?? [];
|
|
2548
|
+
const fileName = splitContentDisposition.length > 1 && splitContentDisposition[1];
|
|
2549
|
+
link.href = this.document.defaultView?.URL.createObjectURL(response.body) ?? '';
|
|
2550
|
+
link.download = fileName || `${key}.valtimo.zip`;
|
|
2551
|
+
link.target = '_blank';
|
|
2552
|
+
link.click();
|
|
2553
|
+
link.remove();
|
|
2554
|
+
});
|
|
2555
|
+
}
|
|
2556
|
+
closeCurrentNotification() {
|
|
2557
|
+
if (this._currentNotification) {
|
|
2558
|
+
this.notificationService.close(this._currentNotification);
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
stopExporting() {
|
|
2562
|
+
this.exporting$.next(false);
|
|
2563
|
+
}
|
|
2564
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementSearchActionsComponent, deps: [{ token: DOCUMENT }, { token: i1$3.ActivatedRoute }, { token: i1$3.Router }, { token: IkoManagementApiService }, { token: i2.GlobalNotificationService }, { token: i4$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2565
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: IkoManagementSearchActionsComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "_exportMessageTemplateRef", first: true, predicate: ["exportingMessage"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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@if (aggregateKey$ | async; as aggregateKey) {\n <valtimo-carbon-list\n [actionItems]=\"ACTION_ITEMS\"\n [dragAndDrop]=\"true\"\n [fields]=\"FIELDS\"\n [items]=\"searchActions$ | async\"\n [loading]=\"loading$ | async\"\n (itemsReordered)=\"onItemsReordered($event, aggregateKey)\"\n (rowClicked)=\"onSearchActionClick($event)\"\n >\n <div carbonToolbarContent>\n <ng-container [ngTemplateOutlet]=\"exportButton\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"addActionButton\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"addActionButton\"\n [description]=\"'ikoManagement.searchActions.noResultsDescription' | translate\"\n [title]=\"'ikoManagement.searchActions.noResultsTitle' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n\n <valtimo-iko-management-search-action-modal\n [repositoryKey]=\"repositoryKey$ | async\"\n [aggregateKey]=\"aggregateKey\"\n [open]=\"actionModalOpen$ | async\"\n [prefillData]=\"prefillData$ | async\"\n (modalClose)=\"onModalClose($event)\"\n ></valtimo-iko-management-search-action-modal>\n\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"ikoManagement.searchActions.deleteModalText\"\n [outputOnConfirm]=\"deleteSearchActionKey$ | async\"\n [showModalSubject$]=\"deleteModalOpen$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteSearchAction($event)\"\n ></valtimo-confirmation-modal>\n\n <ng-template #exportButton>\n <button [iconOnly]=\"true\" cdsButton=\"ghost\" (click)=\"exportConfiguration()\">\n <svg cdsIcon=\"download\" size=\"16\"></svg>\n </button>\n </ng-template>\n\n <ng-template #addActionButton>\n <button cdsButton=\"primary\" (click)=\"openAddModal()\">\n {{ 'ikoManagement.searchActions.addActionTitle' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </ng-template>\n\n <ng-template #exportingMessage>\n <div class=\"exporting-message\">\n <span class=\"cds--inline-notification__title\">{{\n 'ikoManagement.preparingDownload' | translate\n }}</span>\n\n <cds-loading size=\"sm\"></cds-loading>\n </div>\n </ng-template>\n}\n", dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1$2.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i1$2.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i1$2.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i6.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: IkoManagementSearchActionModalComponent, selector: "valtimo-iko-management-search-action-modal", inputs: ["open", "prefillData", "repositoryKey", "aggregateKey"], outputs: ["modalClose"] }, { kind: "ngmodule", type: TabsModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: LoadingModule }, { kind: "component", type: i6.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }] }); }
|
|
2566
|
+
}
|
|
2567
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementSearchActionsComponent, decorators: [{
|
|
2568
|
+
type: Component,
|
|
2569
|
+
args: [{ standalone: true, imports: [
|
|
2570
|
+
ButtonModule,
|
|
2571
|
+
CarbonListModule,
|
|
2572
|
+
CommonModule,
|
|
2573
|
+
ConfirmationModalModule,
|
|
2574
|
+
IconModule,
|
|
2575
|
+
IkoManagementSearchActionModalComponent,
|
|
2576
|
+
TabsModule,
|
|
2577
|
+
TranslateModule,
|
|
2578
|
+
LoadingModule,
|
|
2579
|
+
], template: "<!--\n ~ Copyright 2015-2025 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@if (aggregateKey$ | async; as aggregateKey) {\n <valtimo-carbon-list\n [actionItems]=\"ACTION_ITEMS\"\n [dragAndDrop]=\"true\"\n [fields]=\"FIELDS\"\n [items]=\"searchActions$ | async\"\n [loading]=\"loading$ | async\"\n (itemsReordered)=\"onItemsReordered($event, aggregateKey)\"\n (rowClicked)=\"onSearchActionClick($event)\"\n >\n <div carbonToolbarContent>\n <ng-container [ngTemplateOutlet]=\"exportButton\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"addActionButton\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"addActionButton\"\n [description]=\"'ikoManagement.searchActions.noResultsDescription' | translate\"\n [title]=\"'ikoManagement.searchActions.noResultsTitle' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n\n <valtimo-iko-management-search-action-modal\n [repositoryKey]=\"repositoryKey$ | async\"\n [aggregateKey]=\"aggregateKey\"\n [open]=\"actionModalOpen$ | async\"\n [prefillData]=\"prefillData$ | async\"\n (modalClose)=\"onModalClose($event)\"\n ></valtimo-iko-management-search-action-modal>\n\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"ikoManagement.searchActions.deleteModalText\"\n [outputOnConfirm]=\"deleteSearchActionKey$ | async\"\n [showModalSubject$]=\"deleteModalOpen$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteSearchAction($event)\"\n ></valtimo-confirmation-modal>\n\n <ng-template #exportButton>\n <button [iconOnly]=\"true\" cdsButton=\"ghost\" (click)=\"exportConfiguration()\">\n <svg cdsIcon=\"download\" size=\"16\"></svg>\n </button>\n </ng-template>\n\n <ng-template #addActionButton>\n <button cdsButton=\"primary\" (click)=\"openAddModal()\">\n {{ 'ikoManagement.searchActions.addActionTitle' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </ng-template>\n\n <ng-template #exportingMessage>\n <div class=\"exporting-message\">\n <span class=\"cds--inline-notification__title\">{{\n 'ikoManagement.preparingDownload' | translate\n }}</span>\n\n <cds-loading size=\"sm\"></cds-loading>\n </div>\n </ng-template>\n}\n" }]
|
|
2580
|
+
}], ctorParameters: () => [{ type: Document, decorators: [{
|
|
2581
|
+
type: Inject,
|
|
2582
|
+
args: [DOCUMENT]
|
|
2583
|
+
}] }, { type: i1$3.ActivatedRoute }, { type: i1$3.Router }, { type: IkoManagementApiService }, { type: i2.GlobalNotificationService }, { type: i4$1.TranslateService }], propDecorators: { _exportMessageTemplateRef: [{
|
|
2584
|
+
type: ViewChild,
|
|
2585
|
+
args: ['exportingMessage']
|
|
2586
|
+
}] } });
|
|
2587
|
+
|
|
2588
|
+
/*
|
|
2589
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2590
|
+
*
|
|
2591
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2592
|
+
* you may not use this file except in compliance with the License.
|
|
2593
|
+
* You may obtain a copy of the License at
|
|
2594
|
+
*
|
|
2595
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2596
|
+
*
|
|
2597
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2598
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2599
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2600
|
+
* See the License for the specific language governing permissions and
|
|
2601
|
+
* limitations under the License.
|
|
2602
|
+
*/
|
|
2603
|
+
class IkoManagementListModalComponent {
|
|
2604
|
+
set openModal(value) {
|
|
2605
|
+
this.$openModal.set(value);
|
|
2606
|
+
}
|
|
2607
|
+
set selectedListColumn(value) {
|
|
2608
|
+
if (!value)
|
|
2609
|
+
return;
|
|
2610
|
+
this._selectedListColumn = value;
|
|
2611
|
+
this.form.setValue(this.mapListColumnDtoToFormValue(value));
|
|
2612
|
+
this.form.markAsPristine();
|
|
2613
|
+
}
|
|
2614
|
+
set modalMode(value) {
|
|
2615
|
+
this._modalMode = value;
|
|
2616
|
+
if (value === 'add') {
|
|
2617
|
+
this.key.setAsyncValidators(this.keyNotUsedValidator());
|
|
2618
|
+
this.key.enable();
|
|
2619
|
+
}
|
|
2620
|
+
else {
|
|
2621
|
+
this.key.clearAsyncValidators();
|
|
2622
|
+
this.key.disable();
|
|
2623
|
+
}
|
|
2624
|
+
this.key.updateValueAndValidity();
|
|
2625
|
+
}
|
|
2626
|
+
get modalMode() {
|
|
2627
|
+
return this._modalMode;
|
|
2628
|
+
}
|
|
2629
|
+
get title() {
|
|
2630
|
+
return this.form.get('title');
|
|
2631
|
+
}
|
|
2632
|
+
get key() {
|
|
2633
|
+
return this.form.get('key');
|
|
2634
|
+
}
|
|
2635
|
+
get path() {
|
|
2636
|
+
return this.form.get('path');
|
|
2637
|
+
}
|
|
2638
|
+
get displayType() {
|
|
2639
|
+
return this.form.get('displayType');
|
|
2640
|
+
}
|
|
2641
|
+
get sortable() {
|
|
2642
|
+
return this.form.get('sortable');
|
|
2643
|
+
}
|
|
2644
|
+
get defaultSort() {
|
|
2645
|
+
return this.form.get('defaultSort');
|
|
2646
|
+
}
|
|
2647
|
+
get dateFormat() {
|
|
2648
|
+
return this.form.get('dateFormat');
|
|
2649
|
+
}
|
|
2650
|
+
constructor(ikoManagementApiService, formBuilder, route) {
|
|
2651
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
2652
|
+
this.formBuilder = formBuilder;
|
|
2653
|
+
this.route = route;
|
|
2654
|
+
this.$openModal = signal(false);
|
|
2655
|
+
this.listColumns = [];
|
|
2656
|
+
this._modalMode = 'add';
|
|
2657
|
+
this.closeModalEvent = new EventEmitter();
|
|
2658
|
+
this.form = this.formBuilder.group({
|
|
2659
|
+
title: this.formBuilder.control('', [Validators.required]),
|
|
2660
|
+
key: this.formBuilder.control('', [Validators.required], [this.keyNotUsedValidator()]),
|
|
2661
|
+
path: this.formBuilder.control('', [Validators.required]),
|
|
2662
|
+
displayType: this.formBuilder.control('', [Validators.required]),
|
|
2663
|
+
sortable: this.formBuilder.control(false, [Validators.required]),
|
|
2664
|
+
defaultSort: this.formBuilder.control(''),
|
|
2665
|
+
dateFormat: this.formBuilder.control(''),
|
|
2666
|
+
tagAmount: this.formBuilder.control(1),
|
|
2667
|
+
booleanDisplayTypeParameters: this.formBuilder.control([
|
|
2668
|
+
{ key: '', value: '' },
|
|
2669
|
+
]),
|
|
2670
|
+
enumDisplayTypeParameters: this.formBuilder.control([
|
|
2671
|
+
{ key: '', value: '' },
|
|
2672
|
+
]),
|
|
2673
|
+
});
|
|
2674
|
+
this.isDateDisplayType$ = this.displayType.valueChanges.pipe(map(type => type === ViewType.DATE));
|
|
2675
|
+
this.isBooleanDisplayType$ = this.displayType.valueChanges.pipe(map(type => type === ViewType.BOOLEAN));
|
|
2676
|
+
this.isEnumDisplayType$ = this.displayType.valueChanges.pipe(map(type => type === ViewType.ENUM));
|
|
2677
|
+
this.isTagsDisplayType$ = this.displayType.valueChanges.pipe(map(type => type === ViewType.TAGS));
|
|
2678
|
+
this._DISPLAY_TYPES = [
|
|
2679
|
+
ViewType.TEXT,
|
|
2680
|
+
ViewType.DATE,
|
|
2681
|
+
ViewType.BOOLEAN,
|
|
2682
|
+
ViewType.ENUM,
|
|
2683
|
+
ViewType.ARRAY_COUNT,
|
|
2684
|
+
ViewType.UNDERSCORES_TO_SPACES,
|
|
2685
|
+
ViewType.TAGS,
|
|
2686
|
+
ViewType.HIDDEN,
|
|
2687
|
+
];
|
|
2688
|
+
this._dataAggregateKey$ = this.route.params.pipe(map(params => params?.key), filter(key => !!key));
|
|
2689
|
+
this.displayTypeSelectItems = this._DISPLAY_TYPES.map(displayType => ({
|
|
2690
|
+
id: displayType,
|
|
2691
|
+
translationKey: `listColumnDisplayType.${displayType}`,
|
|
2692
|
+
}));
|
|
2693
|
+
this.sortSelectItems = [
|
|
2694
|
+
{
|
|
2695
|
+
translationKey: 'listColumn.sortableAsc',
|
|
2696
|
+
id: 'ASC',
|
|
2697
|
+
},
|
|
2698
|
+
{
|
|
2699
|
+
translationKey: 'listColumn.sortableDesc',
|
|
2700
|
+
id: 'DESC',
|
|
2701
|
+
},
|
|
2702
|
+
];
|
|
2703
|
+
this._subscriptions = new Subscription();
|
|
2704
|
+
this.resetForm = () => {
|
|
2705
|
+
this.form.reset();
|
|
2706
|
+
this.form.markAsPristine();
|
|
2707
|
+
this.form.markAsUntouched();
|
|
2708
|
+
this.form.updateValueAndValidity();
|
|
2709
|
+
};
|
|
2710
|
+
}
|
|
2711
|
+
ngOnInit() {
|
|
2712
|
+
this._subscriptions.add(this.defaultSort.valueChanges.subscribe(defaultSortValue => {
|
|
2713
|
+
if (defaultSortValue) {
|
|
2714
|
+
this.sortable.setValue(true);
|
|
2715
|
+
this.sortable.disable();
|
|
2716
|
+
}
|
|
2717
|
+
else {
|
|
2718
|
+
this.sortable.enable();
|
|
2719
|
+
}
|
|
2720
|
+
}));
|
|
2721
|
+
}
|
|
2722
|
+
ngOnDestroy() {
|
|
2723
|
+
this._subscriptions.unsubscribe();
|
|
2724
|
+
}
|
|
2725
|
+
closeModal() {
|
|
2726
|
+
this.closeModalEvent.emit('close');
|
|
2727
|
+
runAfterCarbonModalClosed(this.resetForm);
|
|
2728
|
+
}
|
|
2729
|
+
addColumn() {
|
|
2730
|
+
const formValue = this.form.getRawValue();
|
|
2731
|
+
const requestBody = this.getCreateRequestBodyFromFormValue();
|
|
2732
|
+
this.disableForm();
|
|
2733
|
+
this._dataAggregateKey$
|
|
2734
|
+
.pipe(switchMap(dataAggregateKey => this.modalMode === 'add'
|
|
2735
|
+
? this.ikoManagementApiService.createIkoListColumn(dataAggregateKey, formValue.key, requestBody)
|
|
2736
|
+
: this.ikoManagementApiService.updateListColumn(dataAggregateKey, formValue.key, requestBody)))
|
|
2737
|
+
.subscribe({
|
|
2738
|
+
next: () => {
|
|
2739
|
+
this.enableForm();
|
|
2740
|
+
this.closeModalEvent.emit('closeAndRefresh');
|
|
2741
|
+
runAfterCarbonModalClosed(this.resetForm);
|
|
2742
|
+
},
|
|
2743
|
+
error: () => {
|
|
2744
|
+
this.enableForm();
|
|
2745
|
+
},
|
|
2746
|
+
});
|
|
2747
|
+
}
|
|
2748
|
+
disableForm() {
|
|
2749
|
+
this.form.disable();
|
|
2750
|
+
}
|
|
2751
|
+
enableForm() {
|
|
2752
|
+
this.form.enable();
|
|
2753
|
+
}
|
|
2754
|
+
mapMultiInputValueToEnum(multiInputValues) {
|
|
2755
|
+
return multiInputValues.reduce((acc, curr) => {
|
|
2756
|
+
return { ...acc, [curr.key]: curr.value };
|
|
2757
|
+
}, {});
|
|
2758
|
+
}
|
|
2759
|
+
getCreateRequestBodyFromFormValue() {
|
|
2760
|
+
const { key, path, sortable, displayType, dateFormat, enumDisplayTypeParameters, booleanDisplayTypeParameters, defaultSort, ...rest } = this.form.getRawValue();
|
|
2761
|
+
const displayTypeParameters = (() => {
|
|
2762
|
+
switch (displayType) {
|
|
2763
|
+
case ViewType.DATE:
|
|
2764
|
+
return { dateFormat };
|
|
2765
|
+
case ViewType.ENUM:
|
|
2766
|
+
return {
|
|
2767
|
+
enum: this.mapMultiInputValueToEnum(enumDisplayTypeParameters),
|
|
2768
|
+
};
|
|
2769
|
+
case ViewType.BOOLEAN:
|
|
2770
|
+
return {
|
|
2771
|
+
enum: this.mapMultiInputValueToEnum(booleanDisplayTypeParameters),
|
|
2772
|
+
};
|
|
2773
|
+
default:
|
|
2774
|
+
return {};
|
|
2775
|
+
}
|
|
2776
|
+
})();
|
|
2777
|
+
return {
|
|
2778
|
+
key,
|
|
2779
|
+
path,
|
|
2780
|
+
sortable: Boolean(sortable),
|
|
2781
|
+
...(defaultSort ? { defaultSort: defaultSort } : {}),
|
|
2782
|
+
...rest,
|
|
2783
|
+
...(this.modalMode === 'edit' && {
|
|
2784
|
+
order: this._selectedListColumn.order,
|
|
2785
|
+
}),
|
|
2786
|
+
displayType: {
|
|
2787
|
+
type: displayType,
|
|
2788
|
+
displayTypeParameters,
|
|
2789
|
+
},
|
|
2790
|
+
};
|
|
2791
|
+
}
|
|
2792
|
+
mapEnumToMultiInputValues(enumObj) {
|
|
2793
|
+
if (!enumObj) {
|
|
2794
|
+
return [{ key: '', value: '' }];
|
|
2795
|
+
}
|
|
2796
|
+
return Object.entries(enumObj).map(([key, value]) => ({ key, value }));
|
|
2797
|
+
}
|
|
2798
|
+
mapListColumnDtoToFormValue(dto) {
|
|
2799
|
+
const { key, title, path, sortable, defaultSort, displayType } = dto;
|
|
2800
|
+
const baseFormValue = {
|
|
2801
|
+
key,
|
|
2802
|
+
title: title || '',
|
|
2803
|
+
path,
|
|
2804
|
+
sortable,
|
|
2805
|
+
defaultSort: defaultSort || '',
|
|
2806
|
+
displayType: displayType.type,
|
|
2807
|
+
dateFormat: '',
|
|
2808
|
+
booleanDisplayTypeParameters: [{ key: '', value: '' }],
|
|
2809
|
+
enumDisplayTypeParameters: [{ key: '', value: '' }],
|
|
2810
|
+
tagAmount: 1,
|
|
2811
|
+
};
|
|
2812
|
+
if (displayType.type === ViewType.DATE) {
|
|
2813
|
+
baseFormValue.dateFormat = displayType.displayTypeParameters?.dateFormat || '';
|
|
2814
|
+
}
|
|
2815
|
+
if (displayType.type === ViewType.ENUM) {
|
|
2816
|
+
baseFormValue.enumDisplayTypeParameters = this.mapEnumToMultiInputValues(displayType.displayTypeParameters?.enum);
|
|
2817
|
+
}
|
|
2818
|
+
if (displayType.type === ViewType.BOOLEAN) {
|
|
2819
|
+
baseFormValue.booleanDisplayTypeParameters = this.mapEnumToMultiInputValues(displayType.displayTypeParameters?.enum);
|
|
2820
|
+
}
|
|
2821
|
+
return baseFormValue;
|
|
2822
|
+
}
|
|
2823
|
+
keyNotUsedValidator() {
|
|
2824
|
+
return (control) => {
|
|
2825
|
+
const value = control.value?.trim();
|
|
2826
|
+
if (!value)
|
|
2827
|
+
return of(null);
|
|
2828
|
+
const exists = this.listColumns.some(column => column.key.trim().toLowerCase() === value.toLowerCase());
|
|
2829
|
+
return of(exists ? { keyTaken: true } : null).pipe(delay(200));
|
|
2830
|
+
};
|
|
2831
|
+
}
|
|
2832
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementListModalComponent, deps: [{ token: IkoManagementApiService }, { token: i1$4.FormBuilder }, { token: i1$3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2833
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoManagementListModalComponent, isStandalone: true, selector: "valtimo-iko-management-list-modal", inputs: { openModal: "openModal", listColumns: "listColumns", selectedListColumn: "selectedListColumn", modalMode: "modalMode" }, outputs: { closeModalEvent: "closeModalEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n valtimoCdsModal\n *ngIf=\"{\n title:\n (modalMode === 'add' ? 'ikoManagement.addColumn' : 'ikoManagement.editColumn') | translate,\n } as state\"\n [open]=\"$openModal()\"\n [title]=\"state.title\"\n (close)=\"closeModal()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{ state.title }}\n </h3>\n </cds-modal-header>\n\n <form cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\" class=\"iko-column-form\">\n <cds-label>\n {{ 'ikoManagement.titleTitle' | translate }}\n\n <input\n [invalid]=\"title.dirty && title.invalid\"\n formControlName=\"title\"\n cdsText\n placeholder=\"{{ 'ikoManagement.columnTitlePlaceholder' | translate }}\"\n />\n </cds-label>\n\n <cds-label>\n {{ 'ikoManagement.keyTitle' | translate }}\n\n <input\n [invalid]=\"key.dirty && key.invalid\"\n formControlName=\"key\"\n cdsText\n placeholder=\"{{ 'ikoManagement.columnKeyPlaceholder' | translate }}\"\n />\n </cds-label>\n\n <cds-label>\n {{ 'ikoManagement.pathTitle' | translate }}\n\n <input\n [invalid]=\"path.dirty && path.invalid\"\n formControlName=\"path\"\n cdsText\n placeholder=\"{{ 'ikoManagement.columnPathPlaceholder' | translate }}\"\n />\n </cds-label>\n\n <cds-toggle\n formControlName=\"sortable\"\n [label]=\"'ikoManagement.sortableTitle' | translate\"\n [onText]=\"'ikoManagement.sortingEnabled' | translate\"\n [offText]=\"'ikoManagement.sortingDisabled' | translate\"\n ></cds-toggle>\n\n <v-select\n [invalid]=\"defaultSort.dirty && defaultSort.invalid\"\n formControlName=\"defaultSort\"\n [items]=\"sortSelectItems\"\n titleTranslationKey=\"ikoManagement.defaultSortTitle\"\n [appendInline]=\"false\"\n ></v-select>\n\n <v-select\n [invalid]=\"displayType.dirty && displayType.invalid\"\n formControlName=\"displayType\"\n [items]=\"displayTypeSelectItems\"\n titleTranslationKey=\"ikoManagement.displayType\"\n [appendInline]=\"false\"\n ></v-select>\n\n <v-input-label\n *ngIf=\"isDateDisplayType$ | async\"\n titleTranslationKey=\"listColumn.dateFormat\"\n tooltipTranslationKey=\"listColumn.dateFormatTooltip\"\n >\n <input cdsText formControlName=\"dateFormat\" />\n </v-input-label>\n\n <v-input-label\n *ngIf=\"isBooleanDisplayType$ | async\"\n titleTranslationKey=\"listColumn.enumTitleOptional\"\n tooltipTranslationKey=\"listColumn.enumTooltipOptional\"\n >\n <valtimo-carbon-multi-input\n type=\"keyValue\"\n formControlName=\"booleanDisplayTypeParameters\"\n [hideAddButton]=\"true\"\n [hideDeleteButton]=\"true\"\n [maxRows]=\"1\"\n [keyColumnTitle]=\"'viewTypeConverter.Yes' | translate\"\n [valueColumnTitle]=\"'viewTypeConverter.No' | translate\"\n ></valtimo-carbon-multi-input>\n </v-input-label>\n\n <v-input-label\n *ngIf=\"isEnumDisplayType$ | async\"\n titleTranslationKey=\"listColumn.enumTitle\"\n tooltipTranslationKey=\"listColumn.enumTooltip\"\n >\n <valtimo-carbon-multi-input\n type=\"keyValue\"\n formControlName=\"enumDisplayTypeParameters\"\n ></valtimo-carbon-multi-input>\n </v-input-label>\n\n <v-input-label\n *ngIf=\"isTagsDisplayType$ | async\"\n titleTranslationKey=\"listColumn.tagAmount\"\n tooltipTranslationKey=\"listColumn.tagAmountTooltip\"\n >\n <cds-number formControlName=\"tagAmount\" [min]=\"1\" [step]=\"1\"></cds-number>\n </v-input-label>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n [disabled]=\"form.invalid || form.disabled || !form.dirty\"\n cdsButton=\"primary\"\n (click)=\"addColumn()\"\n >\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".iko-column-form{display:flex;flex-direction:column;gap:16px;width:100%}\n/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i6.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i6.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i6.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i6.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i6.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i6.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i6.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.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: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i6.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i1$2.SelectComponent, selector: "v-select", inputs: ["items", "defaultSelection", "defaultSelectionId", "defaultSelectionIds", "disabled", "dropUp", "invalid", "multiple", "margin", "widthInPx", "notFoundText", "clearAllText", "clearText", "clearable", "name", "title", "titleTranslationKey", "clearSelectionSubject$", "tooltip", "required", "loading", "loadingText", "placeholder", "smallMargin", "carbonTheme", "appendInline", "dataTestId"], outputs: ["selectedChange"] }, { kind: "ngmodule", type: ToggleModule }, { kind: "component", type: i6.Toggle, selector: "cds-toggle, ibm-toggle", inputs: ["offText", "onText", "label", "size", "hideLabel", "ariaLabel", "skeleton"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: CarbonMultiInputModule }, { kind: "component", type: i1$2.CarbonMultiInputComponent, selector: "valtimo-carbon-multi-input", inputs: ["addRowText", "addButtonType", "addRowTranslationKey", "arbitraryAmountTitles", "arbitraryValueAmount", "defaultValues", "deleteRowText", "deleteRowTranslationKey", "disabled", "dropdownColumnTitle", "dropdownItems", "dropdownWidth", "fullWidth", "hideAddButton", "hideDeleteButton", "initialAmountOfRows", "keyColumnTitle", "margin", "maxRows", "minimumAmountOfRows", "name", "required", "title", "titleTranslationKey", "tooltip", "type", "valueColumnTitle", "valuePathSelectorCaseDefinitionKey", "valuePathSelectorPrefixes", "valuePathSelectorShowCaseDefinitionSelector", "valuePathSelectorNotation", "keyColumnFlex", "dropdownColumnFlex", "valueColumnFlex"], outputs: ["valueChange", "allValuesValidEvent"] }, { kind: "ngmodule", type: InputLabelModule }, { kind: "component", type: i1$2.InputLabelComponent, selector: "v-input-label", inputs: ["name", "tooltip", "tooltipTranslationKey", "largeMargin", "small", "noMargin", "title", "titleTranslationKey", "required", "disabled", "carbonTheme"] }, { kind: "ngmodule", type: NumberModule }, { kind: "component", type: i6.NumberComponent, selector: "cds-number, ibm-number", inputs: ["readonly", "theme", "disabled", "skeleton", "invalid", "id", "placeholder", "size", "required", "value", "min", "max", "label", "helperText", "invalidText", "step", "precision", "warn", "warnText", "ariaLabel", "decrementLabel", "incrementLabel", "fluid"], outputs: ["change"] }] }); }
|
|
2834
|
+
}
|
|
2835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementListModalComponent, decorators: [{
|
|
2836
|
+
type: Component,
|
|
2837
|
+
args: [{ standalone: true, selector: 'valtimo-iko-management-list-modal', imports: [
|
|
2838
|
+
CommonModule,
|
|
2839
|
+
TranslateModule,
|
|
2840
|
+
ModalModule,
|
|
2841
|
+
ValtimoCdsModalDirective,
|
|
2842
|
+
ButtonModule,
|
|
2843
|
+
InputModule,
|
|
2844
|
+
ReactiveFormsModule,
|
|
2845
|
+
LayerModule,
|
|
2846
|
+
SelectModule,
|
|
2847
|
+
ToggleModule,
|
|
2848
|
+
TooltipModule,
|
|
2849
|
+
CarbonMultiInputModule,
|
|
2850
|
+
InputLabelModule,
|
|
2851
|
+
NumberModule,
|
|
2852
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n valtimoCdsModal\n *ngIf=\"{\n title:\n (modalMode === 'add' ? 'ikoManagement.addColumn' : 'ikoManagement.editColumn') | translate,\n } as state\"\n [open]=\"$openModal()\"\n [title]=\"state.title\"\n (close)=\"closeModal()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{ state.title }}\n </h3>\n </cds-modal-header>\n\n <form cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\" class=\"iko-column-form\">\n <cds-label>\n {{ 'ikoManagement.titleTitle' | translate }}\n\n <input\n [invalid]=\"title.dirty && title.invalid\"\n formControlName=\"title\"\n cdsText\n placeholder=\"{{ 'ikoManagement.columnTitlePlaceholder' | translate }}\"\n />\n </cds-label>\n\n <cds-label>\n {{ 'ikoManagement.keyTitle' | translate }}\n\n <input\n [invalid]=\"key.dirty && key.invalid\"\n formControlName=\"key\"\n cdsText\n placeholder=\"{{ 'ikoManagement.columnKeyPlaceholder' | translate }}\"\n />\n </cds-label>\n\n <cds-label>\n {{ 'ikoManagement.pathTitle' | translate }}\n\n <input\n [invalid]=\"path.dirty && path.invalid\"\n formControlName=\"path\"\n cdsText\n placeholder=\"{{ 'ikoManagement.columnPathPlaceholder' | translate }}\"\n />\n </cds-label>\n\n <cds-toggle\n formControlName=\"sortable\"\n [label]=\"'ikoManagement.sortableTitle' | translate\"\n [onText]=\"'ikoManagement.sortingEnabled' | translate\"\n [offText]=\"'ikoManagement.sortingDisabled' | translate\"\n ></cds-toggle>\n\n <v-select\n [invalid]=\"defaultSort.dirty && defaultSort.invalid\"\n formControlName=\"defaultSort\"\n [items]=\"sortSelectItems\"\n titleTranslationKey=\"ikoManagement.defaultSortTitle\"\n [appendInline]=\"false\"\n ></v-select>\n\n <v-select\n [invalid]=\"displayType.dirty && displayType.invalid\"\n formControlName=\"displayType\"\n [items]=\"displayTypeSelectItems\"\n titleTranslationKey=\"ikoManagement.displayType\"\n [appendInline]=\"false\"\n ></v-select>\n\n <v-input-label\n *ngIf=\"isDateDisplayType$ | async\"\n titleTranslationKey=\"listColumn.dateFormat\"\n tooltipTranslationKey=\"listColumn.dateFormatTooltip\"\n >\n <input cdsText formControlName=\"dateFormat\" />\n </v-input-label>\n\n <v-input-label\n *ngIf=\"isBooleanDisplayType$ | async\"\n titleTranslationKey=\"listColumn.enumTitleOptional\"\n tooltipTranslationKey=\"listColumn.enumTooltipOptional\"\n >\n <valtimo-carbon-multi-input\n type=\"keyValue\"\n formControlName=\"booleanDisplayTypeParameters\"\n [hideAddButton]=\"true\"\n [hideDeleteButton]=\"true\"\n [maxRows]=\"1\"\n [keyColumnTitle]=\"'viewTypeConverter.Yes' | translate\"\n [valueColumnTitle]=\"'viewTypeConverter.No' | translate\"\n ></valtimo-carbon-multi-input>\n </v-input-label>\n\n <v-input-label\n *ngIf=\"isEnumDisplayType$ | async\"\n titleTranslationKey=\"listColumn.enumTitle\"\n tooltipTranslationKey=\"listColumn.enumTooltip\"\n >\n <valtimo-carbon-multi-input\n type=\"keyValue\"\n formControlName=\"enumDisplayTypeParameters\"\n ></valtimo-carbon-multi-input>\n </v-input-label>\n\n <v-input-label\n *ngIf=\"isTagsDisplayType$ | async\"\n titleTranslationKey=\"listColumn.tagAmount\"\n tooltipTranslationKey=\"listColumn.tagAmountTooltip\"\n >\n <cds-number formControlName=\"tagAmount\" [min]=\"1\" [step]=\"1\"></cds-number>\n </v-input-label>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n [disabled]=\"form.invalid || form.disabled || !form.dirty\"\n cdsButton=\"primary\"\n (click)=\"addColumn()\"\n >\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".iko-column-form{display:flex;flex-direction:column;gap:16px;width:100%}\n/*!\n * Copyright 2015-2025 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"] }]
|
|
2853
|
+
}], ctorParameters: () => [{ type: IkoManagementApiService }, { type: i1$4.FormBuilder }, { type: i1$3.ActivatedRoute }], propDecorators: { openModal: [{
|
|
2854
|
+
type: Input
|
|
2855
|
+
}], listColumns: [{
|
|
2856
|
+
type: Input
|
|
2857
|
+
}], selectedListColumn: [{
|
|
2858
|
+
type: Input
|
|
2859
|
+
}], modalMode: [{
|
|
2860
|
+
type: Input
|
|
2861
|
+
}], closeModalEvent: [{
|
|
2862
|
+
type: Output
|
|
2863
|
+
}] } });
|
|
2864
|
+
|
|
2865
|
+
/*
|
|
2866
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2867
|
+
*
|
|
2868
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2869
|
+
* you may not use this file except in compliance with the License.
|
|
2870
|
+
* You may obtain a copy of the License at
|
|
2871
|
+
*
|
|
2872
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2873
|
+
*
|
|
2874
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2875
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2876
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2877
|
+
* See the License for the specific language governing permissions and
|
|
2878
|
+
* limitations under the License.
|
|
2879
|
+
*/
|
|
2880
|
+
class IkoManagementListComponent {
|
|
2881
|
+
constructor(route, ikoManagementApiService, translateService) {
|
|
2882
|
+
this.route = route;
|
|
2883
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
2884
|
+
this.translateService = translateService;
|
|
2885
|
+
this.$openModal = signal(false);
|
|
2886
|
+
this.openConfirmationModal$ = new BehaviorSubject(false);
|
|
2887
|
+
this.$loading = signal(true);
|
|
2888
|
+
this.$disableInput = signal(true);
|
|
2889
|
+
this.$modalMode = signal('add');
|
|
2890
|
+
this._dataAggregateKey$ = this.route.params.pipe(map(params => params?.key), filter(key => !!key));
|
|
2891
|
+
this.$ikoListColumnDtos = signal([]);
|
|
2892
|
+
this.$selectedListColumn = signal(null);
|
|
2893
|
+
this._reloadColumns$ = new BehaviorSubject(null);
|
|
2894
|
+
this.ikoListColumns$ = combineLatest([
|
|
2895
|
+
toObservable(this.$ikoListColumnDtos),
|
|
2896
|
+
this.translateService.stream('key'),
|
|
2897
|
+
]).pipe(map(([columns]) => columns.map(column => ({
|
|
2898
|
+
...column,
|
|
2899
|
+
title: column.title || '-',
|
|
2900
|
+
sortable: column.sortable
|
|
2901
|
+
? this.translateService.instant('listColumn.sortableYes')
|
|
2902
|
+
: this.translateService.instant('listColumn.sortableNo'),
|
|
2903
|
+
defaultSort: (column.defaultSort === 'ASC' &&
|
|
2904
|
+
this.translateService.instant('listColumn.sortableAsc')) ||
|
|
2905
|
+
(column.defaultSort === 'DESC' &&
|
|
2906
|
+
this.translateService.instant('listColumn.sortableDesc')) ||
|
|
2907
|
+
'-',
|
|
2908
|
+
displayType: this.translateService.instant(`listColumnDisplayType.${column?.displayType?.type}`),
|
|
2909
|
+
displayTypeParameters: getDisplayTypeParametersView(column.displayType.displayTypeParameters),
|
|
2910
|
+
}))), tap(() => this.$disableInput.set(false)));
|
|
2911
|
+
this.FIELDS = [
|
|
2912
|
+
{
|
|
2913
|
+
key: 'title',
|
|
2914
|
+
label: 'listColumn.title',
|
|
2915
|
+
viewType: 'string',
|
|
2916
|
+
sortable: false,
|
|
2917
|
+
},
|
|
2918
|
+
{
|
|
2919
|
+
key: 'key',
|
|
2920
|
+
label: 'listColumn.key',
|
|
2921
|
+
viewType: 'string',
|
|
2922
|
+
sortable: false,
|
|
2923
|
+
},
|
|
2924
|
+
{
|
|
2925
|
+
key: 'path',
|
|
2926
|
+
label: 'listColumn.path',
|
|
2927
|
+
viewType: 'string',
|
|
2928
|
+
sortable: false,
|
|
2929
|
+
},
|
|
2930
|
+
{
|
|
2931
|
+
key: 'displayType',
|
|
2932
|
+
label: 'listColumn.displayType',
|
|
2933
|
+
viewType: 'string',
|
|
2934
|
+
sortable: false,
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
key: 'displayTypeParameters',
|
|
2938
|
+
label: 'listColumn.displayTypeParameters',
|
|
2939
|
+
viewType: 'string',
|
|
2940
|
+
sortable: false,
|
|
2941
|
+
},
|
|
2942
|
+
{
|
|
2943
|
+
key: 'sortable',
|
|
2944
|
+
label: 'listColumn.sortable',
|
|
2945
|
+
viewType: 'string',
|
|
2946
|
+
sortable: false,
|
|
2947
|
+
},
|
|
2948
|
+
{
|
|
2949
|
+
key: 'defaultSort',
|
|
2950
|
+
label: 'listColumn.defaultSort',
|
|
2951
|
+
viewType: 'string',
|
|
2952
|
+
sortable: false,
|
|
2953
|
+
},
|
|
2954
|
+
];
|
|
2955
|
+
this.ACTION_ITEMS = [
|
|
2956
|
+
{
|
|
2957
|
+
label: 'interface.edit',
|
|
2958
|
+
callback: this.onRowClicked.bind(this),
|
|
2959
|
+
},
|
|
2960
|
+
{
|
|
2961
|
+
label: 'interface.delete',
|
|
2962
|
+
callback: this.onDeleteClicked.bind(this),
|
|
2963
|
+
type: 'danger',
|
|
2964
|
+
},
|
|
2965
|
+
];
|
|
2966
|
+
this._subscriptions = new Subscription();
|
|
2967
|
+
}
|
|
2968
|
+
ngOnInit() {
|
|
2969
|
+
this._subscriptions.add(combineLatest([this._dataAggregateKey$, this._reloadColumns$])
|
|
2970
|
+
.pipe(tap(() => this.$disableInput.set(true)), switchMap(([key]) => this.ikoManagementApiService.getIkoListColumns(key)), tap(res => {
|
|
2971
|
+
this.$ikoListColumnDtos.set(res);
|
|
2972
|
+
this.$loading.set(false);
|
|
2973
|
+
}))
|
|
2974
|
+
.subscribe());
|
|
2975
|
+
}
|
|
2976
|
+
ngOnDestroy() {
|
|
2977
|
+
this._subscriptions.unsubscribe();
|
|
2978
|
+
}
|
|
2979
|
+
onItemsReordered(items) {
|
|
2980
|
+
const listColumns = this.$ikoListColumnDtos();
|
|
2981
|
+
const mappedItems = items
|
|
2982
|
+
.map(item => listColumns.find(column => column.id === item.id))
|
|
2983
|
+
.map((item, index) => ({ ...item, order: index }));
|
|
2984
|
+
this.disableInput();
|
|
2985
|
+
this._dataAggregateKey$
|
|
2986
|
+
.pipe(switchMap(key => this.ikoManagementApiService.updateIkoListColumnOrder(key, mappedItems)))
|
|
2987
|
+
.subscribe({
|
|
2988
|
+
next: () => {
|
|
2989
|
+
this.enableInput();
|
|
2990
|
+
this.reloadColumns();
|
|
2991
|
+
},
|
|
2992
|
+
error: () => {
|
|
2993
|
+
this.enableInput();
|
|
2994
|
+
},
|
|
2995
|
+
});
|
|
2996
|
+
}
|
|
2997
|
+
onRowClicked(event) {
|
|
2998
|
+
const listColumnDto = this.$ikoListColumnDtos().find(column => column.key === event.key);
|
|
2999
|
+
if (!listColumnDto)
|
|
3000
|
+
return;
|
|
3001
|
+
this.$selectedListColumn.set({ ...listColumnDto });
|
|
3002
|
+
this.$openModal.set(true);
|
|
3003
|
+
this.$modalMode.set('edit');
|
|
3004
|
+
}
|
|
3005
|
+
onDeleteClicked(event) {
|
|
3006
|
+
const listColumnDto = this.$ikoListColumnDtos().find(column => column.key === event.key);
|
|
3007
|
+
if (!listColumnDto)
|
|
3008
|
+
return;
|
|
3009
|
+
this.$selectedListColumn.set({ ...listColumnDto });
|
|
3010
|
+
this.openConfirmationModal$.next(true);
|
|
3011
|
+
}
|
|
3012
|
+
onDeleteListColumn(event) {
|
|
3013
|
+
this.disableInput();
|
|
3014
|
+
this._dataAggregateKey$
|
|
3015
|
+
.pipe(switchMap(key => this.ikoManagementApiService.deleteIkoListColumn(key, event.key)))
|
|
3016
|
+
.subscribe({
|
|
3017
|
+
next: () => {
|
|
3018
|
+
this.reloadColumns();
|
|
3019
|
+
this.enableInput();
|
|
3020
|
+
},
|
|
3021
|
+
error: () => {
|
|
3022
|
+
this.enableInput();
|
|
3023
|
+
},
|
|
3024
|
+
});
|
|
3025
|
+
}
|
|
3026
|
+
openModal() {
|
|
3027
|
+
this.$openModal.set(true);
|
|
3028
|
+
}
|
|
3029
|
+
onCreateButtonClicked() {
|
|
3030
|
+
this.$modalMode.set('add');
|
|
3031
|
+
this.openModal();
|
|
3032
|
+
}
|
|
3033
|
+
closeModal() {
|
|
3034
|
+
this.$openModal.set(false);
|
|
3035
|
+
}
|
|
3036
|
+
onCloseModalEvent(event) {
|
|
3037
|
+
this.closeModal();
|
|
3038
|
+
if (event === 'closeAndRefresh')
|
|
3039
|
+
this.reloadColumns();
|
|
3040
|
+
}
|
|
3041
|
+
disableInput() {
|
|
3042
|
+
this.$disableInput.set(true);
|
|
3043
|
+
}
|
|
3044
|
+
enableInput() {
|
|
3045
|
+
this.$disableInput.set(false);
|
|
3046
|
+
}
|
|
3047
|
+
reloadColumns() {
|
|
3048
|
+
this._reloadColumns$.next(null);
|
|
3049
|
+
}
|
|
3050
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementListComponent, deps: [{ token: i1$3.ActivatedRoute }, { token: IkoManagementApiService }, { token: i4$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3051
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoManagementListComponent, isStandalone: true, selector: "valtimo-iko-management-list-columns", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n columns: (ikoListColumns$ | async) || [],\n ikoListColumnDtos: $ikoListColumnDtos(),\n selectedListColumn: $selectedListColumn(),\n loading: $loading(),\n openModal: $openModal(),\n disableInput: $disableInput(),\n modalMode: $modalMode(),\n } as state\"\n>\n <valtimo-carbon-list\n [items]=\"state.columns\"\n [loading]=\"state.loading\"\n [fields]=\"FIELDS\"\n [header]=\"false\"\n [dragAndDrop]=\"true\"\n [dragAndDropDisabled]=\"state.disableInput\"\n [actionItems]=\"ACTION_ITEMS\"\n (itemsReordered)=\"onItemsReordered($event)\"\n (rowClicked)=\"onRowClicked($event)\"\n >\n <div carbonToolbarContent>\n <button cdsButton=\"primary\" (click)=\"onCreateButtonClicked()\">\n {{ 'ikoManagement.addColumn' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n\n <valtimo-no-results\n [title]=\"'listColumn.noConfigWarningTitle' | translate\"\n [description]=\"'listColumn.noConfigWarning' | translate\"\n illustration=\"valtimo-layout/img/emptystate-empty.svg\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n\n <valtimo-iko-management-list-modal\n [openModal]=\"state.openModal\"\n [listColumns]=\"state.ikoListColumnDtos\"\n [selectedListColumn]=\"state.selectedListColumn\"\n [modalMode]=\"state.modalMode\"\n (closeModalEvent)=\"onCloseModalEvent($event)\"\n ></valtimo-iko-management-list-modal>\n\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"ikoManagement.searchActions.deleteModalText\"\n [showModalSubject$]=\"openConfirmationModal$\"\n [outputOnConfirm]=\"state.selectedListColumn\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteListColumn($event)\"\n ></valtimo-confirmation-modal>\n</ng-container>\n", styles: ["::ng-deep .tab-container{min-height:unset!important}::ng-deep .cds--inline-notification{max-width:100%}::ng-deep .cds--label{width:100%}.center-link{display:flex;align-items:center}.iko-list-columns__actions{display:flex;gap:8px}.list-columns__buttons{display:flex;gap:16px;flex-direction:row;justify-content:flex-end}\n/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1$2.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i1$2.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: TabsModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "component", type: IkoManagementListModalComponent, selector: "valtimo-iko-management-list-modal", inputs: ["openModal", "listColumns", "selectedListColumn", "modalMode"], outputs: ["closeModalEvent"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i6.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i1$2.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }] }); }
|
|
3052
|
+
}
|
|
3053
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementListComponent, decorators: [{
|
|
3054
|
+
type: Component,
|
|
3055
|
+
args: [{ standalone: true, selector: 'valtimo-iko-management-list-columns', imports: [
|
|
3056
|
+
CommonModule,
|
|
3057
|
+
CarbonListModule,
|
|
3058
|
+
TabsModule,
|
|
3059
|
+
TranslateModule,
|
|
3060
|
+
IkoManagementListModalComponent,
|
|
3061
|
+
ButtonModule,
|
|
3062
|
+
IconModule,
|
|
3063
|
+
ConfirmationModalModule,
|
|
3064
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n columns: (ikoListColumns$ | async) || [],\n ikoListColumnDtos: $ikoListColumnDtos(),\n selectedListColumn: $selectedListColumn(),\n loading: $loading(),\n openModal: $openModal(),\n disableInput: $disableInput(),\n modalMode: $modalMode(),\n } as state\"\n>\n <valtimo-carbon-list\n [items]=\"state.columns\"\n [loading]=\"state.loading\"\n [fields]=\"FIELDS\"\n [header]=\"false\"\n [dragAndDrop]=\"true\"\n [dragAndDropDisabled]=\"state.disableInput\"\n [actionItems]=\"ACTION_ITEMS\"\n (itemsReordered)=\"onItemsReordered($event)\"\n (rowClicked)=\"onRowClicked($event)\"\n >\n <div carbonToolbarContent>\n <button cdsButton=\"primary\" (click)=\"onCreateButtonClicked()\">\n {{ 'ikoManagement.addColumn' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n\n <valtimo-no-results\n [title]=\"'listColumn.noConfigWarningTitle' | translate\"\n [description]=\"'listColumn.noConfigWarning' | translate\"\n illustration=\"valtimo-layout/img/emptystate-empty.svg\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n\n <valtimo-iko-management-list-modal\n [openModal]=\"state.openModal\"\n [listColumns]=\"state.ikoListColumnDtos\"\n [selectedListColumn]=\"state.selectedListColumn\"\n [modalMode]=\"state.modalMode\"\n (closeModalEvent)=\"onCloseModalEvent($event)\"\n ></valtimo-iko-management-list-modal>\n\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"ikoManagement.searchActions.deleteModalText\"\n [showModalSubject$]=\"openConfirmationModal$\"\n [outputOnConfirm]=\"state.selectedListColumn\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteListColumn($event)\"\n ></valtimo-confirmation-modal>\n</ng-container>\n", styles: ["::ng-deep .tab-container{min-height:unset!important}::ng-deep .cds--inline-notification{max-width:100%}::ng-deep .cds--label{width:100%}.center-link{display:flex;align-items:center}.iko-list-columns__actions{display:flex;gap:8px}.list-columns__buttons{display:flex;gap:16px;flex-direction:row;justify-content:flex-end}\n/*!\n * Copyright 2015-2025 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"] }]
|
|
3065
|
+
}], ctorParameters: () => [{ type: i1$3.ActivatedRoute }, { type: IkoManagementApiService }, { type: i4$1.TranslateService }] });
|
|
3066
|
+
|
|
3067
|
+
/*
|
|
3068
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3069
|
+
*
|
|
3070
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3071
|
+
* you may not use this file except in compliance with the License.
|
|
3072
|
+
* You may obtain a copy of the License at
|
|
3073
|
+
*
|
|
3074
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3075
|
+
*
|
|
3076
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3077
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3078
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3079
|
+
* See the License for the specific language governing permissions and
|
|
3080
|
+
* limitations under the License.
|
|
3081
|
+
*/
|
|
3082
|
+
class IkoManagementTabDetailsModalComponent {
|
|
3083
|
+
set openModal(value) {
|
|
3084
|
+
this.$openModal.set(value);
|
|
3085
|
+
}
|
|
3086
|
+
set selectedTab(value) {
|
|
3087
|
+
if (!value)
|
|
3088
|
+
return;
|
|
3089
|
+
this.$selectedKey.set(value.key);
|
|
3090
|
+
this.form.setValue({ ...value, title: value.title || '' });
|
|
3091
|
+
this.form.markAsPristine();
|
|
3092
|
+
}
|
|
3093
|
+
set modalMode(value) {
|
|
3094
|
+
this._modalMode = value;
|
|
3095
|
+
}
|
|
3096
|
+
get modalMode() {
|
|
3097
|
+
return this._modalMode;
|
|
3098
|
+
}
|
|
3099
|
+
get title() {
|
|
3100
|
+
return this.form.get('title');
|
|
3101
|
+
}
|
|
3102
|
+
get key() {
|
|
3103
|
+
return this.form.get('key');
|
|
3104
|
+
}
|
|
3105
|
+
get type() {
|
|
3106
|
+
return this.form.get('type');
|
|
3107
|
+
}
|
|
3108
|
+
constructor(ikoManagementApiService, formBuilder, route) {
|
|
3109
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
3110
|
+
this.formBuilder = formBuilder;
|
|
3111
|
+
this.route = route;
|
|
3112
|
+
this.$openModal = signal(false);
|
|
3113
|
+
this.usedKeys = [];
|
|
3114
|
+
this.$selectedKey = signal('');
|
|
3115
|
+
this._modalMode = 'add';
|
|
3116
|
+
this.closeModalEvent = new EventEmitter();
|
|
3117
|
+
this.form = this.formBuilder.group({
|
|
3118
|
+
title: this.formBuilder.control('', Validators.required),
|
|
3119
|
+
key: this.formBuilder.control('', [Validators.required]),
|
|
3120
|
+
type: this.formBuilder.control('', [Validators.required]),
|
|
3121
|
+
});
|
|
3122
|
+
this._dataAggregateKey$ = this.route.params.pipe(map$1(params => params?.key), filter(key => !!key));
|
|
3123
|
+
this._TAB_TYPES = [IkoTabType.WIDGETS];
|
|
3124
|
+
this.tabTypeSelectItems = this._TAB_TYPES.map(tabType => ({
|
|
3125
|
+
id: tabType,
|
|
3126
|
+
translationKey: `ikoManagement.tabTypes.${tabType}`,
|
|
3127
|
+
}));
|
|
3128
|
+
this.resetForm = () => {
|
|
3129
|
+
this.form.reset();
|
|
3130
|
+
this.form.markAsPristine();
|
|
3131
|
+
this.form.markAsUntouched();
|
|
3132
|
+
this.form.updateValueAndValidity();
|
|
3133
|
+
};
|
|
3134
|
+
}
|
|
3135
|
+
closeModal() {
|
|
3136
|
+
this.closeModalEvent.emit('close');
|
|
3137
|
+
runAfterCarbonModalClosed(this.resetForm);
|
|
3138
|
+
}
|
|
3139
|
+
addTab() {
|
|
3140
|
+
const formValue = this.form.getRawValue();
|
|
3141
|
+
this.disableForm();
|
|
3142
|
+
this._dataAggregateKey$
|
|
3143
|
+
.pipe(switchMap(dataAggregateKey => this.modalMode === 'add'
|
|
3144
|
+
? this.ikoManagementApiService.createIkoTab(dataAggregateKey, formValue.key, formValue)
|
|
3145
|
+
: this.ikoManagementApiService.updateIkoTab(dataAggregateKey, formValue.key, formValue)))
|
|
3146
|
+
.subscribe({
|
|
3147
|
+
next: () => {
|
|
3148
|
+
this.enableForm();
|
|
3149
|
+
this.closeModalEvent.emit('closeAndRefresh');
|
|
3150
|
+
runAfterCarbonModalClosed(this.resetForm);
|
|
3151
|
+
},
|
|
3152
|
+
error: () => {
|
|
3153
|
+
this.enableForm();
|
|
3154
|
+
},
|
|
3155
|
+
});
|
|
3156
|
+
}
|
|
3157
|
+
disableForm() {
|
|
3158
|
+
this.form.disable();
|
|
3159
|
+
}
|
|
3160
|
+
enableForm() {
|
|
3161
|
+
this.form.enable();
|
|
3162
|
+
}
|
|
3163
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementTabDetailsModalComponent, deps: [{ token: IkoManagementApiService }, { token: i1$4.FormBuilder }, { token: i1$3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3164
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoManagementTabDetailsModalComponent, isStandalone: true, selector: "valtimo-iko-management-tab-details-modal", inputs: { openModal: "openModal", usedKeys: "usedKeys", selectedTab: "selectedTab", modalMode: "modalMode" }, outputs: { closeModalEvent: "closeModalEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n (close)=\"closeModal()\"\n *ngIf=\"{\n title: (modalMode === 'add' ? 'ikoManagement.addTab' : 'ikoManagement.editTab') | translate,\n } as state\"\n [open]=\"$openModal()\"\n [title]=\"state.title\"\n valtimoCdsModal\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{ state.title }}\n </h3>\n </cds-modal-header>\n\n <form cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\" class=\"iko-tab-form\">\n <cds-label>\n {{ 'ikoManagement.tabTitle' | translate }}\n\n <input\n [invalid]=\"title.dirty && title.invalid\"\n formControlName=\"title\"\n cdsText\n placeholder=\"{{ 'ikoManagement.tabTitlePlaceholder' | translate }}\"\n />\n </cds-label>\n\n <valtimo-auto-key-input\n formControlName=\"key\"\n labelTranslationKey=\"ikoManagement.keyTitle\"\n placeholderTranslationKey=\"ikoManagement.tabKeyPlaceholder\"\n [usedKeys]=\"usedKeys\"\n [sourceText]=\"modalMode === 'edit' ? $selectedKey() : title.value\"\n [mode]=\"modalMode\"\n >\n </valtimo-auto-key-input>\n\n <v-select\n [invalid]=\"type.dirty && type.invalid\"\n [dropUp]=\"false\"\n formControlName=\"type\"\n [items]=\"tabTypeSelectItems\"\n titleTranslationKey=\"ikoManagement.tabTypeTitle\"\n [appendInline]=\"false\"\n ></v-select>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n [disabled]=\"form.invalid || form.disabled || !form.dirty\"\n cdsButton=\"primary\"\n (click)=\"addTab()\"\n >\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".iko-tab-form{display:flex;flex-direction:column;gap:16px;width:100%}\n/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i6.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i6.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i6.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i6.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i6.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i6.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i6.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.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: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i6.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i1$2.SelectComponent, selector: "v-select", inputs: ["items", "defaultSelection", "defaultSelectionId", "defaultSelectionIds", "disabled", "dropUp", "invalid", "multiple", "margin", "widthInPx", "notFoundText", "clearAllText", "clearText", "clearable", "name", "title", "titleTranslationKey", "clearSelectionSubject$", "tooltip", "required", "loading", "loadingText", "placeholder", "smallMargin", "carbonTheme", "appendInline", "dataTestId"], outputs: ["selectedChange"] }, { kind: "ngmodule", type: ToggleModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: CarbonMultiInputModule }, { kind: "ngmodule", type: InputLabelModule }, { kind: "ngmodule", type: NumberModule }, { kind: "component", type: AutoKeyInputComponent, selector: "valtimo-auto-key-input", inputs: ["labelTranslationKey", "placeholderTranslationKey", "mode", "usedKeys", "sourceText"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3165
|
+
}
|
|
3166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementTabDetailsModalComponent, decorators: [{
|
|
3167
|
+
type: Component,
|
|
3168
|
+
args: [{ selector: 'valtimo-iko-management-tab-details-modal', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
3169
|
+
CommonModule,
|
|
3170
|
+
TranslateModule,
|
|
3171
|
+
ModalModule,
|
|
3172
|
+
ValtimoCdsModalDirective,
|
|
3173
|
+
ButtonModule,
|
|
3174
|
+
InputModule,
|
|
3175
|
+
ReactiveFormsModule,
|
|
3176
|
+
LayerModule,
|
|
3177
|
+
SelectModule,
|
|
3178
|
+
ToggleModule,
|
|
3179
|
+
TooltipModule,
|
|
3180
|
+
CarbonMultiInputModule,
|
|
3181
|
+
InputLabelModule,
|
|
3182
|
+
NumberModule,
|
|
3183
|
+
AutoKeyInputComponent,
|
|
3184
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n (close)=\"closeModal()\"\n *ngIf=\"{\n title: (modalMode === 'add' ? 'ikoManagement.addTab' : 'ikoManagement.editTab') | translate,\n } as state\"\n [open]=\"$openModal()\"\n [title]=\"state.title\"\n valtimoCdsModal\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{ state.title }}\n </h3>\n </cds-modal-header>\n\n <form cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\" class=\"iko-tab-form\">\n <cds-label>\n {{ 'ikoManagement.tabTitle' | translate }}\n\n <input\n [invalid]=\"title.dirty && title.invalid\"\n formControlName=\"title\"\n cdsText\n placeholder=\"{{ 'ikoManagement.tabTitlePlaceholder' | translate }}\"\n />\n </cds-label>\n\n <valtimo-auto-key-input\n formControlName=\"key\"\n labelTranslationKey=\"ikoManagement.keyTitle\"\n placeholderTranslationKey=\"ikoManagement.tabKeyPlaceholder\"\n [usedKeys]=\"usedKeys\"\n [sourceText]=\"modalMode === 'edit' ? $selectedKey() : title.value\"\n [mode]=\"modalMode\"\n >\n </valtimo-auto-key-input>\n\n <v-select\n [invalid]=\"type.dirty && type.invalid\"\n [dropUp]=\"false\"\n formControlName=\"type\"\n [items]=\"tabTypeSelectItems\"\n titleTranslationKey=\"ikoManagement.tabTypeTitle\"\n [appendInline]=\"false\"\n ></v-select>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n [disabled]=\"form.invalid || form.disabled || !form.dirty\"\n cdsButton=\"primary\"\n (click)=\"addTab()\"\n >\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".iko-tab-form{display:flex;flex-direction:column;gap:16px;width:100%}\n/*!\n * Copyright 2015-2025 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"] }]
|
|
3185
|
+
}], ctorParameters: () => [{ type: IkoManagementApiService }, { type: i1$4.FormBuilder }, { type: i1$3.ActivatedRoute }], propDecorators: { openModal: [{
|
|
3186
|
+
type: Input
|
|
3187
|
+
}], usedKeys: [{
|
|
3188
|
+
type: Input
|
|
3189
|
+
}], selectedTab: [{
|
|
3190
|
+
type: Input
|
|
3191
|
+
}], modalMode: [{
|
|
3192
|
+
type: Input
|
|
3193
|
+
}], closeModalEvent: [{
|
|
3194
|
+
type: Output
|
|
3195
|
+
}] } });
|
|
3196
|
+
|
|
3197
|
+
/*
|
|
3198
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3199
|
+
*
|
|
3200
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3201
|
+
* you may not use this file except in compliance with the License.
|
|
3202
|
+
* You may obtain a copy of the License at
|
|
3203
|
+
*
|
|
3204
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3205
|
+
*
|
|
3206
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3207
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3208
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3209
|
+
* See the License for the specific language governing permissions and
|
|
3210
|
+
* limitations under the License.
|
|
3211
|
+
*/
|
|
3212
|
+
class IkoManagementTabsComponent {
|
|
3213
|
+
constructor(route, ikoManagementApiService, translateService, router) {
|
|
3214
|
+
this.route = route;
|
|
3215
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
3216
|
+
this.translateService = translateService;
|
|
3217
|
+
this.router = router;
|
|
3218
|
+
this.$disableInput = signal(true);
|
|
3219
|
+
this.$ikoTabDtos = signal([]);
|
|
3220
|
+
this.$usedKeys = computed(() => this.$ikoTabDtos().reduce((acc, curr) => [...acc, ...(curr.key === this.$selectedTab()?.key ? [] : [curr.key])], []));
|
|
3221
|
+
this.$loading = signal(true);
|
|
3222
|
+
this.$selectedTab = signal(null);
|
|
3223
|
+
this.$openModal = signal(false);
|
|
3224
|
+
this.$modalMode = signal('add');
|
|
3225
|
+
this.openConfirmationModal$ = new BehaviorSubject(false);
|
|
3226
|
+
this._dataAggregateKey$ = this.route.params.pipe(map(params => params?.key), filter(key => !!key));
|
|
3227
|
+
this._reloadTabs$ = new BehaviorSubject(null);
|
|
3228
|
+
this.ikoTabs$ = combineLatest([
|
|
3229
|
+
toObservable(this.$ikoTabDtos),
|
|
3230
|
+
this.translateService.stream('key'),
|
|
3231
|
+
]).pipe(map(([tabs]) => tabs.map(tab => ({
|
|
3232
|
+
...tab,
|
|
3233
|
+
type: this.translateService.instant(`ikoManagement.tabTypes.${tab.type}`),
|
|
3234
|
+
}))), tap(() => this.$disableInput.set(false)));
|
|
3235
|
+
this.FIELDS = [
|
|
3236
|
+
{
|
|
3237
|
+
key: 'key',
|
|
3238
|
+
label: 'ikoManagement.tabKey',
|
|
3239
|
+
viewType: 'string',
|
|
3240
|
+
sortable: false,
|
|
3241
|
+
},
|
|
3242
|
+
{
|
|
3243
|
+
key: 'title',
|
|
3244
|
+
label: 'ikoManagement.tabTitle',
|
|
3245
|
+
viewType: 'string',
|
|
3246
|
+
sortable: false,
|
|
3247
|
+
},
|
|
3248
|
+
{
|
|
3249
|
+
key: 'type',
|
|
3250
|
+
label: 'ikoManagement.tabType',
|
|
3251
|
+
viewType: 'string',
|
|
3252
|
+
sortable: false,
|
|
3253
|
+
},
|
|
3254
|
+
];
|
|
3255
|
+
this.ACTION_ITEMS = [
|
|
3256
|
+
{
|
|
3257
|
+
label: 'interface.edit',
|
|
3258
|
+
callback: this.editTab.bind(this),
|
|
3259
|
+
},
|
|
3260
|
+
{
|
|
3261
|
+
label: 'interface.delete',
|
|
3262
|
+
callback: this.onDeleteClicked.bind(this),
|
|
3263
|
+
type: 'danger',
|
|
3264
|
+
},
|
|
3265
|
+
];
|
|
3266
|
+
this._subscriptions = new Subscription();
|
|
3267
|
+
}
|
|
3268
|
+
ngOnInit() {
|
|
3269
|
+
this._subscriptions.add(combineLatest([this._dataAggregateKey$, this._reloadTabs$])
|
|
3270
|
+
.pipe(tap(() => this.$disableInput.set(true)), switchMap(([key]) => this.ikoManagementApiService.getIkoTabs(key)), tap(res => {
|
|
3271
|
+
this.$ikoTabDtos.set(res);
|
|
3272
|
+
this.$loading.set(false);
|
|
3273
|
+
}))
|
|
3274
|
+
.subscribe());
|
|
3275
|
+
}
|
|
3276
|
+
ngOnDestroy() {
|
|
3277
|
+
this._subscriptions.unsubscribe();
|
|
3278
|
+
}
|
|
3279
|
+
onRowClicked(event) {
|
|
3280
|
+
const tabDto = this.$ikoTabDtos().find(column => column.key === event.key);
|
|
3281
|
+
if (!tabDto)
|
|
3282
|
+
return;
|
|
3283
|
+
if (tabDto.type === 'widgets') {
|
|
3284
|
+
this.router.navigate(['widget-details', tabDto.key], { relativeTo: this.route });
|
|
3285
|
+
return;
|
|
3286
|
+
}
|
|
3287
|
+
this.editTab(event);
|
|
3288
|
+
}
|
|
3289
|
+
editTab(event) {
|
|
3290
|
+
const tabDto = this.$ikoTabDtos().find(column => column.key === event.key);
|
|
3291
|
+
if (!tabDto)
|
|
3292
|
+
return;
|
|
3293
|
+
this.$selectedTab.set({ ...tabDto });
|
|
3294
|
+
this.$openModal.set(true);
|
|
3295
|
+
this.$modalMode.set('edit');
|
|
3296
|
+
}
|
|
3297
|
+
onDeleteClicked(event) {
|
|
3298
|
+
const tabDto = this.$ikoTabDtos().find(tab => tab.key === event.key);
|
|
3299
|
+
if (!tabDto)
|
|
3300
|
+
return;
|
|
3301
|
+
this.$selectedTab.set({ ...tabDto });
|
|
3302
|
+
this.openConfirmationModal$.next(true);
|
|
3303
|
+
}
|
|
3304
|
+
onItemsReordered(items) {
|
|
3305
|
+
const tabs = this.$ikoTabDtos();
|
|
3306
|
+
const mappedItems = items
|
|
3307
|
+
.map(item => tabs.find(column => column.key === item.key))
|
|
3308
|
+
.map((item, index) => ({ ...item, order: index, title: item.title || null }));
|
|
3309
|
+
this.disableInput();
|
|
3310
|
+
this._dataAggregateKey$
|
|
3311
|
+
.pipe(switchMap(key => this.ikoManagementApiService.updateIkoTabs(key, mappedItems)))
|
|
3312
|
+
.subscribe({
|
|
3313
|
+
next: () => {
|
|
3314
|
+
this.enableInput();
|
|
3315
|
+
this.reloadTabs();
|
|
3316
|
+
},
|
|
3317
|
+
error: () => {
|
|
3318
|
+
this.enableInput();
|
|
3319
|
+
},
|
|
3320
|
+
});
|
|
3321
|
+
}
|
|
3322
|
+
onCreateButtonClicked() {
|
|
3323
|
+
this.$modalMode.set('add');
|
|
3324
|
+
this.$selectedTab.set({ title: '', key: '', type: '' });
|
|
3325
|
+
this.openModal();
|
|
3326
|
+
}
|
|
3327
|
+
closeModal() {
|
|
3328
|
+
this.$openModal.set(false);
|
|
3329
|
+
}
|
|
3330
|
+
onCloseModalEvent(event) {
|
|
3331
|
+
this.closeModal();
|
|
3332
|
+
if (event === 'closeAndRefresh')
|
|
3333
|
+
this.reloadTabs();
|
|
3334
|
+
}
|
|
3335
|
+
openModal() {
|
|
3336
|
+
this.$openModal.set(true);
|
|
3337
|
+
}
|
|
3338
|
+
onDeleteTab(event) {
|
|
3339
|
+
this.disableInput();
|
|
3340
|
+
this._dataAggregateKey$
|
|
3341
|
+
.pipe(switchMap(key => this.ikoManagementApiService.deleteIkoTab(key, event.key)))
|
|
3342
|
+
.subscribe({
|
|
3343
|
+
next: () => {
|
|
3344
|
+
this.reloadTabs();
|
|
3345
|
+
this.enableInput();
|
|
3346
|
+
},
|
|
3347
|
+
error: () => {
|
|
3348
|
+
this.enableInput();
|
|
3349
|
+
},
|
|
3350
|
+
});
|
|
3351
|
+
}
|
|
3352
|
+
disableInput() {
|
|
3353
|
+
this.$disableInput.set(true);
|
|
3354
|
+
}
|
|
3355
|
+
enableInput() {
|
|
3356
|
+
this.$disableInput.set(false);
|
|
3357
|
+
}
|
|
3358
|
+
reloadTabs() {
|
|
3359
|
+
this._reloadTabs$.next(null);
|
|
3360
|
+
}
|
|
3361
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementTabsComponent, deps: [{ token: i1$3.ActivatedRoute }, { token: IkoManagementApiService }, { token: i4$1.TranslateService }, { token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3362
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoManagementTabsComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n tabs: (ikoTabs$ | async) || [],\n ikoTabColumnDtos: $ikoTabDtos(),\n selectedTab: $selectedTab(),\n loading: $loading(),\n openModal: $openModal(),\n disableInput: $disableInput(),\n modalMode: $modalMode(),\n usedKeys: $usedKeys(),\n } as state\"\n>\n <valtimo-carbon-list\n [items]=\"state.tabs\"\n [loading]=\"state.loading\"\n [fields]=\"FIELDS\"\n [header]=\"false\"\n [dragAndDrop]=\"true\"\n [dragAndDropDisabled]=\"state.disableInput\"\n [actionItems]=\"ACTION_ITEMS\"\n (itemsReordered)=\"onItemsReordered($event)\"\n (rowClicked)=\"onRowClicked($event)\"\n >\n <div carbonToolbarContent>\n <button cdsButton=\"primary\" (click)=\"onCreateButtonClicked()\">\n {{ 'ikoManagement.addTab' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n\n <valtimo-no-results\n [title]=\"'ikoManagement.noTabConfigWarningTitle' | translate\"\n [description]=\"'ikoManagement.noTabConfigWarning' | translate\"\n illustration=\"valtimo-layout/img/emptystate-empty.svg\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"ikoManagement.deleteTabModalText\"\n [showModalSubject$]=\"openConfirmationModal$\"\n [outputOnConfirm]=\"state.selectedTab\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteTab($event)\"\n ></valtimo-confirmation-modal>\n\n <valtimo-iko-management-tab-details-modal\n [openModal]=\"state.openModal\"\n [selectedTab]=\"state.selectedTab\"\n [modalMode]=\"state.modalMode\"\n [usedKeys]=\"state.usedKeys\"\n (closeModalEvent)=\"onCloseModalEvent($event)\"\n ></valtimo-iko-management-tab-details-modal>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1$2.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i1$2.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: TabsModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i6.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: IkoManagementTabDetailsModalComponent, selector: "valtimo-iko-management-tab-details-modal", inputs: ["openModal", "usedKeys", "selectedTab", "modalMode"], outputs: ["closeModalEvent"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i1$2.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }] }); }
|
|
3363
|
+
}
|
|
3364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementTabsComponent, decorators: [{
|
|
3365
|
+
type: Component,
|
|
3366
|
+
args: [{ standalone: true, imports: [
|
|
3367
|
+
CommonModule,
|
|
3368
|
+
CarbonListModule,
|
|
3369
|
+
TabsModule,
|
|
3370
|
+
CarbonListModule,
|
|
3371
|
+
ButtonModule,
|
|
3372
|
+
IconModule,
|
|
3373
|
+
IkoManagementTabDetailsModalComponent,
|
|
3374
|
+
TranslatePipe,
|
|
3375
|
+
ConfirmationModalModule,
|
|
3376
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n tabs: (ikoTabs$ | async) || [],\n ikoTabColumnDtos: $ikoTabDtos(),\n selectedTab: $selectedTab(),\n loading: $loading(),\n openModal: $openModal(),\n disableInput: $disableInput(),\n modalMode: $modalMode(),\n usedKeys: $usedKeys(),\n } as state\"\n>\n <valtimo-carbon-list\n [items]=\"state.tabs\"\n [loading]=\"state.loading\"\n [fields]=\"FIELDS\"\n [header]=\"false\"\n [dragAndDrop]=\"true\"\n [dragAndDropDisabled]=\"state.disableInput\"\n [actionItems]=\"ACTION_ITEMS\"\n (itemsReordered)=\"onItemsReordered($event)\"\n (rowClicked)=\"onRowClicked($event)\"\n >\n <div carbonToolbarContent>\n <button cdsButton=\"primary\" (click)=\"onCreateButtonClicked()\">\n {{ 'ikoManagement.addTab' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n\n <valtimo-no-results\n [title]=\"'ikoManagement.noTabConfigWarningTitle' | translate\"\n [description]=\"'ikoManagement.noTabConfigWarning' | translate\"\n illustration=\"valtimo-layout/img/emptystate-empty.svg\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"ikoManagement.deleteTabModalText\"\n [showModalSubject$]=\"openConfirmationModal$\"\n [outputOnConfirm]=\"state.selectedTab\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteTab($event)\"\n ></valtimo-confirmation-modal>\n\n <valtimo-iko-management-tab-details-modal\n [openModal]=\"state.openModal\"\n [selectedTab]=\"state.selectedTab\"\n [modalMode]=\"state.modalMode\"\n [usedKeys]=\"state.usedKeys\"\n (closeModalEvent)=\"onCloseModalEvent($event)\"\n ></valtimo-iko-management-tab-details-modal>\n</ng-container>\n" }]
|
|
3377
|
+
}], ctorParameters: () => [{ type: i1$3.ActivatedRoute }, { type: IkoManagementApiService }, { type: i4$1.TranslateService }, { type: i1$3.Router }] });
|
|
3378
|
+
|
|
3379
|
+
/*
|
|
3380
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3381
|
+
*
|
|
3382
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3383
|
+
* you may not use this file except in compliance with the License.
|
|
3384
|
+
* You may obtain a copy of the License at
|
|
3385
|
+
*
|
|
3386
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3387
|
+
*
|
|
3388
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3389
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3390
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3391
|
+
* See the License for the specific language governing permissions and
|
|
3392
|
+
* limitations under the License.
|
|
3393
|
+
*/
|
|
3394
|
+
const IKO_MANAGEMENT_TABS = [
|
|
3395
|
+
{
|
|
3396
|
+
key: IkoManagementTabType.SEARCH_FIELDS,
|
|
3397
|
+
title: 'ikoManagement.searchActions.title',
|
|
3398
|
+
component: IkoManagementSearchActionsComponent,
|
|
3399
|
+
},
|
|
3400
|
+
{
|
|
3401
|
+
key: IkoManagementTabType.LIST,
|
|
3402
|
+
title: 'ikoManagement.list',
|
|
3403
|
+
component: IkoManagementListComponent,
|
|
3404
|
+
},
|
|
3405
|
+
{
|
|
3406
|
+
key: IkoManagementTabType.TABS,
|
|
3407
|
+
title: 'ikoManagement.tabs.title',
|
|
3408
|
+
component: IkoManagementTabsComponent,
|
|
3409
|
+
},
|
|
3410
|
+
];
|
|
3411
|
+
|
|
3412
|
+
/*
|
|
3413
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3414
|
+
*
|
|
3415
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3416
|
+
* you may not use this file except in compliance with the License.
|
|
3417
|
+
* You may obtain a copy of the License at
|
|
3418
|
+
*
|
|
3419
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3420
|
+
*
|
|
3421
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3422
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3423
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3424
|
+
* See the License for the specific language governing permissions and
|
|
3425
|
+
* limitations under the License.
|
|
3426
|
+
*/
|
|
3427
|
+
|
|
3428
|
+
/*
|
|
3429
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3430
|
+
*
|
|
3431
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3432
|
+
* you may not use this file except in compliance with the License.
|
|
3433
|
+
* You may obtain a copy of the License at
|
|
3434
|
+
*
|
|
3435
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3436
|
+
*
|
|
3437
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3438
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3439
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3440
|
+
* See the License for the specific language governing permissions and
|
|
3441
|
+
* limitations under the License.
|
|
3442
|
+
*/
|
|
3443
|
+
class IkoManagementDetailsComponent {
|
|
3444
|
+
set dynamicContainer(view) {
|
|
3445
|
+
if (view)
|
|
3446
|
+
this._dynamicContainerSubject$.next(view);
|
|
3447
|
+
}
|
|
3448
|
+
get _dynamicContainer$() {
|
|
3449
|
+
return this._dynamicContainerSubject$.pipe(filter(container => !!container));
|
|
3450
|
+
}
|
|
3451
|
+
constructor(ikoApiService, route, pageTitleService, router, breadcrumbService, ikoManagementApiService) {
|
|
3452
|
+
this.ikoApiService = ikoApiService;
|
|
3453
|
+
this.route = route;
|
|
3454
|
+
this.pageTitleService = pageTitleService;
|
|
3455
|
+
this.router = router;
|
|
3456
|
+
this.breadcrumbService = breadcrumbService;
|
|
3457
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
3458
|
+
this._dynamicContainerSubject$ = new BehaviorSubject(null);
|
|
3459
|
+
this.loading$ = new BehaviorSubject(true);
|
|
3460
|
+
this.tabKey$ = this.route.params.pipe(map(params => params?.tabKey), filter(key => !!key));
|
|
3461
|
+
this._key$ = this.route.params.pipe(map(params => params?.key), filter(key => !!key));
|
|
3462
|
+
this._apiKey$ = this.route.params.pipe(map(params => params?.apiKey), filter(key => !!key));
|
|
3463
|
+
this.currentMenuItem$ = combineLatest([
|
|
3464
|
+
this._key$,
|
|
3465
|
+
this.ikoApiService.cachedMenuItems$,
|
|
3466
|
+
]).pipe(map(([key, items]) => {
|
|
3467
|
+
const currentItem = items.find(item => item.key === key);
|
|
3468
|
+
if (!currentItem)
|
|
3469
|
+
return;
|
|
3470
|
+
this.pageTitleService.setCustomPageTitle(currentItem.title || '-');
|
|
3471
|
+
}));
|
|
3472
|
+
this.FIELDS = [
|
|
3473
|
+
{
|
|
3474
|
+
key: 'title',
|
|
3475
|
+
label: 'ikoManagement.title',
|
|
3476
|
+
},
|
|
3477
|
+
];
|
|
3478
|
+
this.TABS = IKO_MANAGEMENT_TABS;
|
|
3479
|
+
this._subscriptions = new Subscription();
|
|
3480
|
+
}
|
|
3481
|
+
ngOnInit() {
|
|
3482
|
+
this.openActivateTabSubscription();
|
|
3483
|
+
this.setThirdBreadcrumb();
|
|
3484
|
+
this.pageTitleService.disableReset();
|
|
3485
|
+
}
|
|
3486
|
+
ngOnDestroy() {
|
|
3487
|
+
this._subscriptions.unsubscribe();
|
|
3488
|
+
this.pageTitleService.enableReset();
|
|
3489
|
+
this.breadcrumbService.clearThirdBreadcrumb();
|
|
3490
|
+
}
|
|
3491
|
+
onTabSelected(tab) {
|
|
3492
|
+
this.router.navigate([`../${tab.key}`], { relativeTo: this.route });
|
|
3493
|
+
}
|
|
3494
|
+
openActivateTabSubscription() {
|
|
3495
|
+
this._subscriptions.add(combineLatest([this.tabKey$, this._dynamicContainer$]).subscribe(([tabKey, container]) => {
|
|
3496
|
+
const tab = this.TABS.find(tab => tab.key === tabKey);
|
|
3497
|
+
container.clear();
|
|
3498
|
+
container.createComponent(tab.component);
|
|
3499
|
+
}));
|
|
3500
|
+
}
|
|
3501
|
+
setThirdBreadcrumb() {
|
|
3502
|
+
this._apiKey$
|
|
3503
|
+
.pipe(take(1), switchMap(apiKey => this.ikoManagementApiService.getIkoRepositoryConfig(apiKey)))
|
|
3504
|
+
.subscribe(repositoryConfig => {
|
|
3505
|
+
this.breadcrumbService.setThirdBreadcrumb({
|
|
3506
|
+
route: [`/iko-management/${repositoryConfig.key}`],
|
|
3507
|
+
content: repositoryConfig?.title ?? '',
|
|
3508
|
+
href: `/iko-management/${repositoryConfig.key}`,
|
|
3509
|
+
});
|
|
3510
|
+
});
|
|
3511
|
+
}
|
|
3512
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementDetailsComponent, deps: [{ token: IkoApiService }, { token: i1$3.ActivatedRoute }, { token: i1$2.PageTitleService }, { token: i1$3.Router }, { token: i1$2.BreadcrumbService }, { token: IkoManagementApiService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3513
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoManagementDetailsComponent, isStandalone: true, selector: "valtimo-iko-management-details", viewQueries: [{ propertyName: "dynamicContainer", first: true, predicate: ["tabComponent"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n currentMenuItem: currentMenuItem$ | async,\n tabKey: tabKey$ | async,\n } as obs\"\n>\n <cds-tabs type=\"contained\">\n <cds-tab\n *ngFor=\"let tab of TABS\"\n [active]=\"obs.tabKey === tab.key\"\n [heading]=\"tab.title | translate\"\n (selected)=\"onTabSelected(tab)\"\n >\n </cds-tab>\n </cds-tabs>\n\n <ng-template #tabComponent></ng-template>\n</ng-container>\n", styles: [":host ::ng-deep .cds--tab-content{display:none}\n/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i6.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i6.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive", "tabContent", "templateContext"], outputs: ["selected"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] }); }
|
|
3514
|
+
}
|
|
3515
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementDetailsComponent, decorators: [{
|
|
3516
|
+
type: Component,
|
|
3517
|
+
args: [{ selector: 'valtimo-iko-management-details', standalone: true, imports: [CommonModule, CarbonListModule, TabsModule, TranslateModule], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n currentMenuItem: currentMenuItem$ | async,\n tabKey: tabKey$ | async,\n } as obs\"\n>\n <cds-tabs type=\"contained\">\n <cds-tab\n *ngFor=\"let tab of TABS\"\n [active]=\"obs.tabKey === tab.key\"\n [heading]=\"tab.title | translate\"\n (selected)=\"onTabSelected(tab)\"\n >\n </cds-tab>\n </cds-tabs>\n\n <ng-template #tabComponent></ng-template>\n</ng-container>\n", styles: [":host ::ng-deep .cds--tab-content{display:none}\n/*!\n * Copyright 2015-2025 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"] }]
|
|
3518
|
+
}], ctorParameters: () => [{ type: IkoApiService }, { type: i1$3.ActivatedRoute }, { type: i1$2.PageTitleService }, { type: i1$3.Router }, { type: i1$2.BreadcrumbService }, { type: IkoManagementApiService }], propDecorators: { dynamicContainer: [{
|
|
3519
|
+
type: ViewChild,
|
|
3520
|
+
args: ['tabComponent', { static: false, read: ViewContainerRef }]
|
|
3521
|
+
}] } });
|
|
3522
|
+
|
|
3523
|
+
class IkoManagementViewModalComponent {
|
|
3524
|
+
set open(value) {
|
|
3525
|
+
this._open$.next(value);
|
|
3526
|
+
if (!value)
|
|
3527
|
+
this.resetForm();
|
|
3528
|
+
}
|
|
3529
|
+
get open$() {
|
|
3530
|
+
return this._open$.asObservable();
|
|
3531
|
+
}
|
|
3532
|
+
set apiKey(value) {
|
|
3533
|
+
if (!value)
|
|
3534
|
+
return;
|
|
3535
|
+
this._apiKey$.next(value);
|
|
3536
|
+
}
|
|
3537
|
+
set prefillData(value) {
|
|
3538
|
+
this.$prefillData.set(value);
|
|
3539
|
+
if (!value)
|
|
3540
|
+
return;
|
|
3541
|
+
this.formGroup.patchValue(value);
|
|
3542
|
+
this.formGroup.get('key')?.disable();
|
|
3543
|
+
}
|
|
3544
|
+
constructor(fb, ikoManagementApiService) {
|
|
3545
|
+
this.fb = fb;
|
|
3546
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
3547
|
+
this._open$ = new BehaviorSubject(false);
|
|
3548
|
+
this._apiKey$ = new BehaviorSubject(null);
|
|
3549
|
+
this.$prefillData = signal(null);
|
|
3550
|
+
this.modalClose = new EventEmitter();
|
|
3551
|
+
this.propertyFields$ = this.open$.pipe(filter((open) => !!open), switchMap(() => this._apiKey$), switchMap((repositoryKey) => this.ikoManagementApiService.getIkoDataAggregateType(repositoryKey ?? '')), switchMap((repository) => this.ikoManagementApiService.getIkoDataAggregatePropertyFields(repository.type)));
|
|
3552
|
+
this.formGroup = this.fb.group({
|
|
3553
|
+
title: this.fb.control('', Validators.required),
|
|
3554
|
+
key: this.fb.control('', Validators.required),
|
|
3555
|
+
properties: this.fb.group({}, Validators.required),
|
|
3556
|
+
});
|
|
3557
|
+
}
|
|
3558
|
+
get properties() {
|
|
3559
|
+
const properties = this.formGroup.get('properties');
|
|
3560
|
+
return !properties ? null : properties;
|
|
3561
|
+
}
|
|
3562
|
+
onCancel() {
|
|
3563
|
+
this.modalClose.emit(null);
|
|
3564
|
+
}
|
|
3565
|
+
onSave() {
|
|
3566
|
+
this.propertyFields$.pipe(take(1)).subscribe(fields => {
|
|
3567
|
+
const formData = this.formGroup.getRawValue();
|
|
3568
|
+
fields.forEach(field => {
|
|
3569
|
+
if (formData.properties[field.key] && field.type === 'keyValueList') {
|
|
3570
|
+
formData.properties[field.key] = Array.isArray(formData.properties[field.key])
|
|
3571
|
+
? formData.properties[field.key].reduce((acc, cur) => {
|
|
3572
|
+
if (cur.key) {
|
|
3573
|
+
acc[cur.key] = cur.value;
|
|
3574
|
+
}
|
|
3575
|
+
return acc;
|
|
3576
|
+
}, {})
|
|
3577
|
+
: {};
|
|
3578
|
+
}
|
|
3579
|
+
});
|
|
3580
|
+
this.modalClose.emit(formData);
|
|
3581
|
+
});
|
|
3582
|
+
}
|
|
3583
|
+
resetForm() {
|
|
3584
|
+
setTimeout(() => {
|
|
3585
|
+
this.formGroup.reset({
|
|
3586
|
+
title: '',
|
|
3587
|
+
key: '',
|
|
3588
|
+
properties: {},
|
|
3589
|
+
});
|
|
3590
|
+
this.formGroup.get('key')?.enable();
|
|
3591
|
+
}, CARBON_CONSTANTS.modalAnimationMs);
|
|
3592
|
+
}
|
|
3593
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementViewModalComponent, deps: [{ token: i1$4.FormBuilder }, { token: IkoManagementApiService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3594
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoManagementViewModalComponent, isStandalone: true, selector: "valtimo-iko-management-view-modal", inputs: { open: "open", apiKey: "apiKey", prefillData: "prefillData" }, outputs: { modalClose: "modalClose" }, ngImport: i0, template: "<cds-modal valtimoCdsModal [open]=\"open$ | async\" size=\"sm\" showFooter=\"true\" (close)=\"onCancel()\">\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCancel()\">\n <h3 cdsModalHeaderHeading>{{ 'ikoManagement.views.add' | translate }}</h3>\n </cds-modal-header>\n\n <form [formGroup]=\"formGroup\" cdsModalContent>\n <cds-label>\n {{ 'interface.title' | translate }}\n\n <input\n formControlName=\"title\"\n cdsText\n cdsLayer\n placeholder=\"{{ 'interface.title' | translate }}\"\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n\n <cds-label>\n {{ 'interface.key' | translate }}\n\n <input\n formControlName=\"key\"\n cdsText\n cdsLayer\n placeholder=\"{{ 'interface.key' | translate }}\"\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n\n <valtimo-iko-management-properties\n [propertiesFormGroup]=\"properties\"\n [fields]=\"propertyFields$ | async\"\n [prefillData]=\"$prefillData()?.properties\"\n />\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"onCancel()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button [disabled]=\"formGroup.invalid\" cdsButton=\"primary\" (click)=\"onSave()\">\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["form{display:flex;flex-direction:column;gap:16px}fieldset{display:flex;gap:16px}::ng-deep label{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i6.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i6.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i6.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i6.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i6.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i6.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i6.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.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: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "component", type: PropertiesFormComponent, selector: "valtimo-iko-management-properties", inputs: ["propertiesFormGroup", "fields", "prefillData"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i6.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3595
|
+
}
|
|
3596
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementViewModalComponent, decorators: [{
|
|
3597
|
+
type: Component,
|
|
3598
|
+
args: [{ selector: 'valtimo-iko-management-view-modal', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
3599
|
+
CommonModule,
|
|
3600
|
+
TranslateModule,
|
|
3601
|
+
ModalModule,
|
|
3602
|
+
ValtimoCdsModalDirective,
|
|
3603
|
+
InputModule,
|
|
3604
|
+
ReactiveFormsModule,
|
|
3605
|
+
ButtonModule,
|
|
3606
|
+
IconModule,
|
|
3607
|
+
PropertiesFormComponent,
|
|
3608
|
+
LayerModule,
|
|
3609
|
+
], template: "<cds-modal valtimoCdsModal [open]=\"open$ | async\" size=\"sm\" showFooter=\"true\" (close)=\"onCancel()\">\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCancel()\">\n <h3 cdsModalHeaderHeading>{{ 'ikoManagement.views.add' | translate }}</h3>\n </cds-modal-header>\n\n <form [formGroup]=\"formGroup\" cdsModalContent>\n <cds-label>\n {{ 'interface.title' | translate }}\n\n <input\n formControlName=\"title\"\n cdsText\n cdsLayer\n placeholder=\"{{ 'interface.title' | translate }}\"\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n\n <cds-label>\n {{ 'interface.key' | translate }}\n\n <input\n formControlName=\"key\"\n cdsText\n cdsLayer\n placeholder=\"{{ 'interface.key' | translate }}\"\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n\n <valtimo-iko-management-properties\n [propertiesFormGroup]=\"properties\"\n [fields]=\"propertyFields$ | async\"\n [prefillData]=\"$prefillData()?.properties\"\n />\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"onCancel()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button [disabled]=\"formGroup.invalid\" cdsButton=\"primary\" (click)=\"onSave()\">\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["form{display:flex;flex-direction:column;gap:16px}fieldset{display:flex;gap:16px}::ng-deep label{width:100%}\n"] }]
|
|
3610
|
+
}], ctorParameters: () => [{ type: i1$4.FormBuilder }, { type: IkoManagementApiService }], propDecorators: { open: [{
|
|
3611
|
+
type: Input
|
|
3612
|
+
}], apiKey: [{
|
|
3613
|
+
type: Input
|
|
3614
|
+
}], prefillData: [{
|
|
3615
|
+
type: Input
|
|
3616
|
+
}], modalClose: [{
|
|
3617
|
+
type: Output
|
|
3618
|
+
}] } });
|
|
3619
|
+
|
|
3620
|
+
/*
|
|
3621
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3622
|
+
*
|
|
3623
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3624
|
+
* you may not use this file except in compliance with the License.
|
|
3625
|
+
* You may obtain a copy of the License at
|
|
3626
|
+
*
|
|
3627
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3628
|
+
*
|
|
3629
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3630
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3631
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3632
|
+
* See the License for the specific language governing permissions and
|
|
3633
|
+
* limitations under the License.
|
|
3634
|
+
*/
|
|
3635
|
+
var UPLOAD_STATUS;
|
|
3636
|
+
(function (UPLOAD_STATUS) {
|
|
3637
|
+
UPLOAD_STATUS["ACTIVE"] = "active";
|
|
3638
|
+
UPLOAD_STATUS["ERROR"] = "error";
|
|
3639
|
+
UPLOAD_STATUS["FINISHED"] = "finished";
|
|
3640
|
+
})(UPLOAD_STATUS || (UPLOAD_STATUS = {}));
|
|
3641
|
+
var UPLOAD_STEP;
|
|
3642
|
+
(function (UPLOAD_STEP) {
|
|
3643
|
+
UPLOAD_STEP["FILE_SELECT"] = "fileSelect";
|
|
3644
|
+
UPLOAD_STEP["FILE_UPLOAD"] = "fileUpload";
|
|
3645
|
+
UPLOAD_STEP["ACCESS_CONTROL"] = "accessControl";
|
|
3646
|
+
})(UPLOAD_STEP || (UPLOAD_STEP = {}));
|
|
3647
|
+
const STEPS = [UPLOAD_STEP.FILE_SELECT, UPLOAD_STEP.FILE_UPLOAD, UPLOAD_STEP.ACCESS_CONTROL];
|
|
3648
|
+
|
|
3649
|
+
/*
|
|
3650
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3651
|
+
*
|
|
3652
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3653
|
+
* you may not use this file except in compliance with the License.
|
|
3654
|
+
* You may obtain a copy of the License at
|
|
3655
|
+
*
|
|
3656
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3657
|
+
*
|
|
3658
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3659
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3660
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3661
|
+
* See the License for the specific language governing permissions and
|
|
3662
|
+
* limitations under the License.
|
|
3663
|
+
*/
|
|
3664
|
+
class IkoManagementUploadStepComponent {
|
|
3665
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementUploadStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3666
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoManagementUploadStepComponent, isStandalone: true, selector: "valtimo-case-management-upload-step", inputs: { illustration: "illustration", message: "message", title: "title" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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=\"valtimo-upload-step__content\">\n <div class=\"valtimo-upload-step__title\">{{ title }}</div>\n\n <div class=\"valtimo-upload-step__message\">{{ message }}</div>\n</div>\n\n<img [src]=\"illustration\" alt=\"{{ illustration }}\" class=\"valtimo-upload-step__illustration\" />\n", styles: [":host{display:flex;justify-content:space-around;align-items:center;gap:32px;height:100%}:host label{color:unset}.valtimo-upload-step__content{display:flex;flex-direction:column;gap:16px}.valtimo-upload-step__title{font-weight:600;font-size:16px}.valtimo-upload-step__message{font-size:16px;line-height:28px}.valtimo-upload-step__illustration{max-width:200px}\n/*!\n * Copyright 2015-2025 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"] }); }
|
|
3667
|
+
}
|
|
3668
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementUploadStepComponent, decorators: [{
|
|
3669
|
+
type: Component,
|
|
3670
|
+
args: [{ standalone: true, selector: 'valtimo-case-management-upload-step', template: "<!--\n ~ Copyright 2015-2025 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=\"valtimo-upload-step__content\">\n <div class=\"valtimo-upload-step__title\">{{ title }}</div>\n\n <div class=\"valtimo-upload-step__message\">{{ message }}</div>\n</div>\n\n<img [src]=\"illustration\" alt=\"{{ illustration }}\" class=\"valtimo-upload-step__illustration\" />\n", styles: [":host{display:flex;justify-content:space-around;align-items:center;gap:32px;height:100%}:host label{color:unset}.valtimo-upload-step__content{display:flex;flex-direction:column;gap:16px}.valtimo-upload-step__title{font-weight:600;font-size:16px}.valtimo-upload-step__message{font-size:16px;line-height:28px}.valtimo-upload-step__illustration{max-width:200px}\n/*!\n * Copyright 2015-2025 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"] }]
|
|
3671
|
+
}], propDecorators: { illustration: [{
|
|
3672
|
+
type: Input
|
|
3673
|
+
}], message: [{
|
|
3674
|
+
type: Input
|
|
3675
|
+
}], title: [{
|
|
3676
|
+
type: Input
|
|
3677
|
+
}] } });
|
|
3678
|
+
|
|
3679
|
+
/*
|
|
3680
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3681
|
+
*
|
|
3682
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3683
|
+
* you may not use this file except in compliance with the License.
|
|
3684
|
+
* You may obtain a copy of the License at
|
|
3685
|
+
*
|
|
3686
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3687
|
+
*
|
|
3688
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3689
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3690
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3691
|
+
* See the License for the specific language governing permissions and
|
|
3692
|
+
* limitations under the License.
|
|
3693
|
+
*/
|
|
3694
|
+
class IkoManagementUploadModalComponent {
|
|
3695
|
+
set open(value) {
|
|
3696
|
+
this._open$.next(value);
|
|
3697
|
+
if (!value)
|
|
3698
|
+
this.resetForm();
|
|
3699
|
+
}
|
|
3700
|
+
get open$() {
|
|
3701
|
+
return this._open$.asObservable();
|
|
3702
|
+
}
|
|
3703
|
+
constructor(fb, translateService, ikoManagementApiService) {
|
|
3704
|
+
this.fb = fb;
|
|
3705
|
+
this.translateService = translateService;
|
|
3706
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
3707
|
+
this._open$ = new BehaviorSubject(false);
|
|
3708
|
+
this.modalClose = new EventEmitter();
|
|
3709
|
+
this.showCheckboxError$ = new BehaviorSubject(false);
|
|
3710
|
+
this.activeStep$ = new BehaviorSubject(UPLOAD_STEP.FILE_SELECT);
|
|
3711
|
+
this.backButtonEnabled$ = this.activeStep$.pipe(map$1((activeStep) => [UPLOAD_STEP.ACCESS_CONTROL].includes(activeStep)));
|
|
3712
|
+
this._disabled$ = new BehaviorSubject(true);
|
|
3713
|
+
this.uploadStatus$ = new BehaviorSubject(UPLOAD_STATUS.ACTIVE);
|
|
3714
|
+
this.nextButtonDisabled$ = combineLatest([
|
|
3715
|
+
this.activeStep$,
|
|
3716
|
+
this._disabled$,
|
|
3717
|
+
this.uploadStatus$,
|
|
3718
|
+
]).pipe(map$1(([activeStep, disabled, status]) => activeStep === UPLOAD_STEP.FILE_UPLOAD ? status !== UPLOAD_STATUS.FINISHED : disabled));
|
|
3719
|
+
this.isStepAfterUpload$ = this.activeStep$.pipe(map$1((activeStep) => ![UPLOAD_STEP.FILE_SELECT].includes(activeStep)));
|
|
3720
|
+
this.notificationObj$ = combineLatest([
|
|
3721
|
+
this.translateService.stream('interface.warning'),
|
|
3722
|
+
this.translateService.stream('ikoManagement.importDefinition.overwriteWarning'),
|
|
3723
|
+
]).pipe(map$1(([title, message]) => ({
|
|
3724
|
+
type: 'warning',
|
|
3725
|
+
title,
|
|
3726
|
+
message,
|
|
3727
|
+
showClose: false,
|
|
3728
|
+
lowContrast: true,
|
|
3729
|
+
})));
|
|
3730
|
+
this.showCloseButton$ = this.activeStep$.pipe(map$1((activeStep) => [UPLOAD_STEP.FILE_SELECT, UPLOAD_STEP.FILE_UPLOAD].includes(activeStep)));
|
|
3731
|
+
this.acceptedFiles = ['.zip'];
|
|
3732
|
+
this.UPLOAD_STATUS = UPLOAD_STATUS;
|
|
3733
|
+
this.UPLOAD_STEP = UPLOAD_STEP;
|
|
3734
|
+
this._subscriptions = new Subscription();
|
|
3735
|
+
this._importFile$ = new BehaviorSubject('');
|
|
3736
|
+
this.form = this.fb.group({
|
|
3737
|
+
file: this.fb.control(new Set(), [Validators.required]),
|
|
3738
|
+
});
|
|
3739
|
+
this._checked = false;
|
|
3740
|
+
}
|
|
3741
|
+
ngOnInit() {
|
|
3742
|
+
const control = this.form.get('file');
|
|
3743
|
+
if (!control)
|
|
3744
|
+
return;
|
|
3745
|
+
this._subscriptions.add(this.form.get('file').valueChanges.subscribe((fileSet) => {
|
|
3746
|
+
const [fileItem] = fileSet;
|
|
3747
|
+
if (!fileItem) {
|
|
3748
|
+
this._disabled$.next(true);
|
|
3749
|
+
this.showCheckboxError$.next(false);
|
|
3750
|
+
this._checked = false;
|
|
3751
|
+
return;
|
|
3752
|
+
}
|
|
3753
|
+
this.setZipFile(fileItem);
|
|
3754
|
+
}));
|
|
3755
|
+
}
|
|
3756
|
+
ngOnDestroy() {
|
|
3757
|
+
this._subscriptions.unsubscribe();
|
|
3758
|
+
this.resetModal();
|
|
3759
|
+
}
|
|
3760
|
+
onCloseModal(definitionUploaded) {
|
|
3761
|
+
this.modalClose.emit(definitionUploaded ?? false);
|
|
3762
|
+
this.resetModal();
|
|
3763
|
+
}
|
|
3764
|
+
onNextClick(activeStep) {
|
|
3765
|
+
const nextIndex = STEPS.findIndex((step) => step === activeStep) + 1;
|
|
3766
|
+
if (nextIndex === STEPS.length) {
|
|
3767
|
+
return;
|
|
3768
|
+
}
|
|
3769
|
+
if (activeStep === UPLOAD_STEP.FILE_SELECT && !this._checked) {
|
|
3770
|
+
this.showCheckboxError$.next(true);
|
|
3771
|
+
return;
|
|
3772
|
+
}
|
|
3773
|
+
this.showCheckboxError$.next(false);
|
|
3774
|
+
this.activeStep$.next(STEPS[nextIndex]);
|
|
3775
|
+
if (STEPS[nextIndex] === UPLOAD_STEP.FILE_UPLOAD) {
|
|
3776
|
+
this.uploadDefinition();
|
|
3777
|
+
}
|
|
3778
|
+
}
|
|
3779
|
+
onBackClick(activeStep) {
|
|
3780
|
+
const prevIndex = STEPS.findIndex((step) => step === activeStep) - 1;
|
|
3781
|
+
if (prevIndex === -1) {
|
|
3782
|
+
return;
|
|
3783
|
+
}
|
|
3784
|
+
this.activeStep$.next(STEPS[prevIndex]);
|
|
3785
|
+
}
|
|
3786
|
+
onCheckedChange(checked) {
|
|
3787
|
+
this._checked = checked;
|
|
3788
|
+
if (!checked) {
|
|
3789
|
+
return;
|
|
3790
|
+
}
|
|
3791
|
+
this.showCheckboxError$.next(false);
|
|
3792
|
+
}
|
|
3793
|
+
onCancel() {
|
|
3794
|
+
this.modalClose.emit(false);
|
|
3795
|
+
}
|
|
3796
|
+
uploadDefinition() {
|
|
3797
|
+
this._disabled$.next(true);
|
|
3798
|
+
this._importFile$
|
|
3799
|
+
.pipe(switchMap((file) => this.ikoManagementApiService.importConfigurationZip(file)), take(1))
|
|
3800
|
+
.subscribe({
|
|
3801
|
+
next: () => {
|
|
3802
|
+
this._disabled$.next(false);
|
|
3803
|
+
this.uploadStatus$.next(UPLOAD_STATUS.FINISHED);
|
|
3804
|
+
},
|
|
3805
|
+
error: () => {
|
|
3806
|
+
this.uploadStatus$.next(UPLOAD_STATUS.ERROR);
|
|
3807
|
+
this._disabled$.next(false);
|
|
3808
|
+
},
|
|
3809
|
+
});
|
|
3810
|
+
}
|
|
3811
|
+
setZipFile(fileItem) {
|
|
3812
|
+
const file = fileItem?.file;
|
|
3813
|
+
if (!file) {
|
|
3814
|
+
this._importFile$.next('');
|
|
3815
|
+
return;
|
|
3816
|
+
}
|
|
3817
|
+
const blob = new Blob([fileItem.file], { type: fileItem.file.type });
|
|
3818
|
+
const fd = new FormData();
|
|
3819
|
+
fd.append('file', blob, fileItem.file.name);
|
|
3820
|
+
this._importFile$.next(fd);
|
|
3821
|
+
this._disabled$.next(false);
|
|
3822
|
+
}
|
|
3823
|
+
resetForm() {
|
|
3824
|
+
this.form.get('file')?.setValue(new Set());
|
|
3825
|
+
}
|
|
3826
|
+
resetModal() {
|
|
3827
|
+
setTimeout(() => {
|
|
3828
|
+
this.resetForm();
|
|
3829
|
+
this.activeStep$.next(UPLOAD_STEP.FILE_SELECT);
|
|
3830
|
+
this.uploadStatus$.next(UPLOAD_STATUS.ACTIVE);
|
|
3831
|
+
this.showCheckboxError$.next(false);
|
|
3832
|
+
this._disabled$.next(true);
|
|
3833
|
+
}, CARBON_CONSTANTS.modalAnimationMs);
|
|
3834
|
+
}
|
|
3835
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementUploadModalComponent, deps: [{ token: i1$4.FormBuilder }, { token: i4$1.TranslateService }, { token: IkoManagementApiService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3836
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: IkoManagementUploadModalComponent, isStandalone: true, selector: "valtimo-iko-management-upload-modal", inputs: { open: "open" }, outputs: { modalClose: "modalClose" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{\n activeStep: activeStep$ | async,\n uploadStatus: uploadStatus$ | async,\n backButtonEnabled: backButtonEnabled$ | async,\n nextButtonDisabled: nextButtonDisabled$ | async,\n notificationObj: notificationObj$ | async,\n showCheckboxError: showCheckboxError$ | async,\n isStepAfterUpload: isStepAfterUpload$ | async,\n showCloseButton: showCloseButton$ | async,\n } as obs\"\n valtimoCdsModal\n [open]=\"open$ | async\"\n showFooter=\"true\"\n class=\"valtimo-definition-uploader\"\n (close)=\"onCancel()\"\n>\n <cds-modal-header\n [showCloseButton]=\"obs.showCloseButton\"\n (closeSelect)=\"onCloseModal(obs.isStepAfterUpload && obs.uploadStatus !== UPLOAD_STATUS.ERROR)\"\n >\n <h3 cdsModalHeaderHeading>\n {{ 'ikoManagement.importDefinition.title' | translate }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent class=\"valtimo-definition-uploader__content\">\n @switch (obs.activeStep) {\n @case (UPLOAD_STEP.FILE_SELECT) {\n <form [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"acceptedFiles\"\n [buttonText]=\"'ikoManagement.importDefinition.upload.buttonText' | translate\"\n [description]=\"'ikoManagement.importDefinition.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'ikoManagement.importDefinition.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n class=\"valtimo-definition-uploader__file-uploader\"\n >\n </cds-file-uploader>\n\n @if (!obs.nextButtonDisabled) {\n <cds-inline-notification\n [notificationObj]=\"obs.notificationObj\"\n ></cds-inline-notification>\n\n <div class=\"valtimo-definition-uploader__checkbox\">\n <cds-checkbox\n [class.valtimo-definition-uploader__checkbox--invalid]=\"obs.showCheckboxError\"\n (checkedChange)=\"onCheckedChange($event)\"\n >\n {{ 'ikoManagement.importDefinition.checkbox.message' | translate }}\n </cds-checkbox>\n\n @if (obs.showCheckboxError) {\n <div class=\"valtimo-definition-uploader__error\">\n <svg cdsIcon=\"warning--filled\" size=\"16\"></svg>\n {{ 'ikoManagement.importDefinition.checkbox.error' | translate }}\n </div>\n }\n </div>\n }\n </form>\n }\n\n @case (UPLOAD_STEP.FILE_UPLOAD) {\n <cds-progress-bar\n class=\"valtimo-definition-uploader__progress-bar\"\n [label]=\"'ikoManagement.importDefinition.progressBar.label' | translate\"\n [status]=\"obs.uploadStatus\"\n [helperText]=\"\n 'ikoManagement.importDefinition.progressBar.' + obs.uploadStatus | translate\n \"\n ></cds-progress-bar>\n }\n\n @default {\n <valtimo-case-management-upload-step\n [message]=\"\n 'ikoManagement.importDefinition.steps.' + obs.activeStep + '.message' | translate\n \"\n [title]=\"'ikoManagement.importDefinition.steps.' + obs.activeStep + '.title' | translate\"\n [illustration]=\"'valtimo-layout/img/' + obs.activeStep + '.svg'\"\n >\n </valtimo-case-management-upload-step>\n }\n }\n </section>\n\n <cds-modal-footer class=\"valtimo-definition-uploader__footer\">\n <button\n *ngIf=\"obs.uploadStatus !== UPLOAD_STATUS.ERROR\"\n class=\"valtimo-definition-uploader__cancel\"\n cdsButton=\"ghost\"\n (click)=\"onCloseModal(obs.isStepAfterUpload)\"\n >\n {{ (obs.isStepAfterUpload ? 'interface.skip' : 'interface.cancel') | translate }}\n </button>\n\n <div class=\"valtimo-definition-uploader__actions\">\n <button\n *ngIf=\"obs.backButtonEnabled\"\n cdsButton=\"secondary\"\n (click)=\"onBackClick(obs.activeStep)\"\n >\n {{ 'interface.back' | translate }}\n </button>\n\n <button\n *ngIf=\"\n obs.uploadStatus !== UPLOAD_STATUS.ERROR && obs.activeStep !== UPLOAD_STEP.ACCESS_CONTROL\n \"\n cdsButton=\"primary\"\n [disabled]=\"\n obs.nextButtonDisabled || (obs.activeStep === UPLOAD_STEP.FILE_SELECT && !_checked)\n \"\n (click)=\"onNextClick(obs.activeStep)\"\n >\n {{\n (obs.activeStep === UPLOAD_STEP.FILE_SELECT\n ? 'ikoManagement.importDefinition.startUpload'\n : 'interface.next'\n ) | translate\n }}\n </button>\n\n <button\n *ngIf=\"\n obs.uploadStatus === UPLOAD_STATUS.ERROR || obs.activeStep === UPLOAD_STEP.ACCESS_CONTROL\n \"\n class=\"valtimo-definition-uploader__cancel\"\n cdsButton=\"primary\"\n (click)=\"onCloseModal(true)\"\n >\n {{ 'interface.finish' | translate }}\n </button>\n </div>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-definition-uploader__content form{width:100%}.valtimo-definition-uploader__content,.valtimo-definition-uploader__content form{display:flex;flex-direction:column;gap:16px}.valtimo-definition-uploader__footer ::ng-deep .cds--modal-footer{justify-content:unset!important;display:grid!important;grid-template-columns:1fr 1fr 2fr!important;grid-template-areas:\"cancel . actions\"!important}.valtimo-definition-uploader__progress-bar{height:100%;display:flex;flex-direction:column;justify-content:center}.valtimo-definition-uploader__error{display:flex;align-items:center;gap:10px;color:#da1e28;fill:#da1e28;font-size:12px}.valtimo-definition-uploader__cancel{grid-area:cancel;width:100%}.valtimo-definition-uploader__actions{grid-area:actions;display:flex}.valtimo-definition-uploader__actions button{flex:unset;width:100%}.valtimo-definition-uploader__file-uploader ::ng-deep cds-file{max-width:unset}.valtimo-definition-uploader__checkbox{display:flex;flex-direction:column;gap:8px}.valtimo-definition-uploader__checkbox--invalid ::ng-deep label:before{border-color:#da1e28;margin-inline:0}.valtimo-definition-uploader ::ng-deep .cds--modal-container{height:550px}.valtimo-definition-uploader ::ng-deep .cds--checkbox-label-text{color:#000}.valtimo-definition-uploader ::ng-deep cds-inline-notification,.valtimo-definition-uploader ::ng-deep .cds--inline-notification{width:100%!important;max-width:none!important}\n/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i6.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i6.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i6.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i6.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i6.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "ngmodule", type: InputModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i6.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i6.ProgressBar, selector: "cds-progress-bar, ibm-progress-bar", inputs: ["value", "id", "label", "helperText", "max", "type", "status", "size"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i6.Checkbox, selector: "cds-checkbox, ibm-checkbox", inputs: ["disabled", "skeleton", "hideLabel", "name", "id", "required", "value", "ariaLabel", "ariaLabelledby", "indeterminate", "checked"], outputs: ["click", "checkedChange", "indeterminateChange"] }, { kind: "ngmodule", type: FileUploaderModule }, { kind: "component", type: i6.FileUploader, selector: "cds-file-uploader, ibm-file-uploader", inputs: ["buttonText", "buttonType", "title", "description", "accept", "multiple", "skeleton", "size", "fileItemSize", "drop", "dropText", "fileUploaderId", "files", "disabled"], outputs: ["filesChange"] }, { kind: "component", type: IkoManagementUploadStepComponent, selector: "valtimo-case-management-upload-step", inputs: ["illustration", "message", "title"] }, { kind: "ngmodule", type: NotificationModule }, { kind: "component", type: i6.Notification, selector: "cds-notification, cds-inline-notification, ibm-notification, ibm-inline-notification", inputs: ["notificationObj"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3837
|
+
}
|
|
3838
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementUploadModalComponent, decorators: [{
|
|
3839
|
+
type: Component,
|
|
3840
|
+
args: [{ standalone: true, selector: 'valtimo-iko-management-upload-modal', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
3841
|
+
CommonModule,
|
|
3842
|
+
TranslateModule,
|
|
3843
|
+
ModalModule,
|
|
3844
|
+
ValtimoCdsModalDirective,
|
|
3845
|
+
InputModule,
|
|
3846
|
+
ReactiveFormsModule,
|
|
3847
|
+
ButtonModule,
|
|
3848
|
+
IconModule,
|
|
3849
|
+
ProgressBarModule,
|
|
3850
|
+
CheckboxModule,
|
|
3851
|
+
FileUploaderModule,
|
|
3852
|
+
IkoManagementUploadStepComponent,
|
|
3853
|
+
NotificationModule,
|
|
3854
|
+
TranslateModule,
|
|
3855
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{\n activeStep: activeStep$ | async,\n uploadStatus: uploadStatus$ | async,\n backButtonEnabled: backButtonEnabled$ | async,\n nextButtonDisabled: nextButtonDisabled$ | async,\n notificationObj: notificationObj$ | async,\n showCheckboxError: showCheckboxError$ | async,\n isStepAfterUpload: isStepAfterUpload$ | async,\n showCloseButton: showCloseButton$ | async,\n } as obs\"\n valtimoCdsModal\n [open]=\"open$ | async\"\n showFooter=\"true\"\n class=\"valtimo-definition-uploader\"\n (close)=\"onCancel()\"\n>\n <cds-modal-header\n [showCloseButton]=\"obs.showCloseButton\"\n (closeSelect)=\"onCloseModal(obs.isStepAfterUpload && obs.uploadStatus !== UPLOAD_STATUS.ERROR)\"\n >\n <h3 cdsModalHeaderHeading>\n {{ 'ikoManagement.importDefinition.title' | translate }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent class=\"valtimo-definition-uploader__content\">\n @switch (obs.activeStep) {\n @case (UPLOAD_STEP.FILE_SELECT) {\n <form [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"acceptedFiles\"\n [buttonText]=\"'ikoManagement.importDefinition.upload.buttonText' | translate\"\n [description]=\"'ikoManagement.importDefinition.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'ikoManagement.importDefinition.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n class=\"valtimo-definition-uploader__file-uploader\"\n >\n </cds-file-uploader>\n\n @if (!obs.nextButtonDisabled) {\n <cds-inline-notification\n [notificationObj]=\"obs.notificationObj\"\n ></cds-inline-notification>\n\n <div class=\"valtimo-definition-uploader__checkbox\">\n <cds-checkbox\n [class.valtimo-definition-uploader__checkbox--invalid]=\"obs.showCheckboxError\"\n (checkedChange)=\"onCheckedChange($event)\"\n >\n {{ 'ikoManagement.importDefinition.checkbox.message' | translate }}\n </cds-checkbox>\n\n @if (obs.showCheckboxError) {\n <div class=\"valtimo-definition-uploader__error\">\n <svg cdsIcon=\"warning--filled\" size=\"16\"></svg>\n {{ 'ikoManagement.importDefinition.checkbox.error' | translate }}\n </div>\n }\n </div>\n }\n </form>\n }\n\n @case (UPLOAD_STEP.FILE_UPLOAD) {\n <cds-progress-bar\n class=\"valtimo-definition-uploader__progress-bar\"\n [label]=\"'ikoManagement.importDefinition.progressBar.label' | translate\"\n [status]=\"obs.uploadStatus\"\n [helperText]=\"\n 'ikoManagement.importDefinition.progressBar.' + obs.uploadStatus | translate\n \"\n ></cds-progress-bar>\n }\n\n @default {\n <valtimo-case-management-upload-step\n [message]=\"\n 'ikoManagement.importDefinition.steps.' + obs.activeStep + '.message' | translate\n \"\n [title]=\"'ikoManagement.importDefinition.steps.' + obs.activeStep + '.title' | translate\"\n [illustration]=\"'valtimo-layout/img/' + obs.activeStep + '.svg'\"\n >\n </valtimo-case-management-upload-step>\n }\n }\n </section>\n\n <cds-modal-footer class=\"valtimo-definition-uploader__footer\">\n <button\n *ngIf=\"obs.uploadStatus !== UPLOAD_STATUS.ERROR\"\n class=\"valtimo-definition-uploader__cancel\"\n cdsButton=\"ghost\"\n (click)=\"onCloseModal(obs.isStepAfterUpload)\"\n >\n {{ (obs.isStepAfterUpload ? 'interface.skip' : 'interface.cancel') | translate }}\n </button>\n\n <div class=\"valtimo-definition-uploader__actions\">\n <button\n *ngIf=\"obs.backButtonEnabled\"\n cdsButton=\"secondary\"\n (click)=\"onBackClick(obs.activeStep)\"\n >\n {{ 'interface.back' | translate }}\n </button>\n\n <button\n *ngIf=\"\n obs.uploadStatus !== UPLOAD_STATUS.ERROR && obs.activeStep !== UPLOAD_STEP.ACCESS_CONTROL\n \"\n cdsButton=\"primary\"\n [disabled]=\"\n obs.nextButtonDisabled || (obs.activeStep === UPLOAD_STEP.FILE_SELECT && !_checked)\n \"\n (click)=\"onNextClick(obs.activeStep)\"\n >\n {{\n (obs.activeStep === UPLOAD_STEP.FILE_SELECT\n ? 'ikoManagement.importDefinition.startUpload'\n : 'interface.next'\n ) | translate\n }}\n </button>\n\n <button\n *ngIf=\"\n obs.uploadStatus === UPLOAD_STATUS.ERROR || obs.activeStep === UPLOAD_STEP.ACCESS_CONTROL\n \"\n class=\"valtimo-definition-uploader__cancel\"\n cdsButton=\"primary\"\n (click)=\"onCloseModal(true)\"\n >\n {{ 'interface.finish' | translate }}\n </button>\n </div>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-definition-uploader__content form{width:100%}.valtimo-definition-uploader__content,.valtimo-definition-uploader__content form{display:flex;flex-direction:column;gap:16px}.valtimo-definition-uploader__footer ::ng-deep .cds--modal-footer{justify-content:unset!important;display:grid!important;grid-template-columns:1fr 1fr 2fr!important;grid-template-areas:\"cancel . actions\"!important}.valtimo-definition-uploader__progress-bar{height:100%;display:flex;flex-direction:column;justify-content:center}.valtimo-definition-uploader__error{display:flex;align-items:center;gap:10px;color:#da1e28;fill:#da1e28;font-size:12px}.valtimo-definition-uploader__cancel{grid-area:cancel;width:100%}.valtimo-definition-uploader__actions{grid-area:actions;display:flex}.valtimo-definition-uploader__actions button{flex:unset;width:100%}.valtimo-definition-uploader__file-uploader ::ng-deep cds-file{max-width:unset}.valtimo-definition-uploader__checkbox{display:flex;flex-direction:column;gap:8px}.valtimo-definition-uploader__checkbox--invalid ::ng-deep label:before{border-color:#da1e28;margin-inline:0}.valtimo-definition-uploader ::ng-deep .cds--modal-container{height:550px}.valtimo-definition-uploader ::ng-deep .cds--checkbox-label-text{color:#000}.valtimo-definition-uploader ::ng-deep cds-inline-notification,.valtimo-definition-uploader ::ng-deep .cds--inline-notification{width:100%!important;max-width:none!important}\n/*!\n * Copyright 2015-2025 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"] }]
|
|
3856
|
+
}], ctorParameters: () => [{ type: i1$4.FormBuilder }, { type: i4$1.TranslateService }, { type: IkoManagementApiService }], propDecorators: { open: [{
|
|
3857
|
+
type: Input
|
|
3858
|
+
}], modalClose: [{
|
|
3859
|
+
type: Output
|
|
3860
|
+
}] } });
|
|
3861
|
+
|
|
3862
|
+
/*
|
|
3863
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3864
|
+
*
|
|
3865
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3866
|
+
* you may not use this file except in compliance with the License.
|
|
3867
|
+
* You may obtain a copy of the License at
|
|
3868
|
+
*
|
|
3869
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3870
|
+
*
|
|
3871
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3872
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3873
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3874
|
+
* See the License for the specific language governing permissions and
|
|
3875
|
+
* limitations under the License.
|
|
3876
|
+
*/
|
|
3877
|
+
class IkoManagementComponent {
|
|
3878
|
+
constructor(ikoManagementApiService, router, route, pageTitleService, menuService, iconService) {
|
|
3879
|
+
this.ikoManagementApiService = ikoManagementApiService;
|
|
3880
|
+
this.router = router;
|
|
3881
|
+
this.route = route;
|
|
3882
|
+
this.pageTitleService = pageTitleService;
|
|
3883
|
+
this.menuService = menuService;
|
|
3884
|
+
this.iconService = iconService;
|
|
3885
|
+
this.$loading = signal(true);
|
|
3886
|
+
this.apiKey$ = this.route.params.pipe(map(params => params?.apiKey), filter(key => !!key));
|
|
3887
|
+
this._refresh$ = new BehaviorSubject(null);
|
|
3888
|
+
this.ikoDataAggregates$ = combineLatest([this.apiKey$, this._refresh$]).pipe(tap(() => this.$loading.set(true)), switchMap(([apiKey]) => this.ikoManagementApiService
|
|
3889
|
+
.getManagementIkoDataAggregates(undefined, undefined, apiKey)
|
|
3890
|
+
.pipe(map(dataAggregatePage => dataAggregatePage.content), tap(() => this.$loading.set(false)))));
|
|
3891
|
+
this.$viewModalOpen = signal(false);
|
|
3892
|
+
this.$uploadModalOpen = signal(false);
|
|
3893
|
+
this.$prefillData = signal(null);
|
|
3894
|
+
this.$keyToDelete = signal(null);
|
|
3895
|
+
this.showDeleteModal$ = new BehaviorSubject(false);
|
|
3896
|
+
this.FIELDS = [
|
|
3897
|
+
{
|
|
3898
|
+
key: 'title',
|
|
3899
|
+
label: 'ikoManagement.views.title',
|
|
3900
|
+
},
|
|
3901
|
+
];
|
|
3902
|
+
this.ACTION_ITEMS = [
|
|
3903
|
+
{
|
|
3904
|
+
label: 'interface.edit',
|
|
3905
|
+
callback: this.onEditClick.bind(this),
|
|
3906
|
+
},
|
|
3907
|
+
{
|
|
3908
|
+
label: 'interface.delete',
|
|
3909
|
+
callback: this.onDeleteClick.bind(this),
|
|
3910
|
+
type: 'danger',
|
|
3911
|
+
},
|
|
3912
|
+
];
|
|
3913
|
+
this.iconService.registerAll([Upload16]);
|
|
3914
|
+
}
|
|
3915
|
+
ngOnInit() {
|
|
3916
|
+
this.pageTitleService.disableReset();
|
|
3917
|
+
this.setPageTitle();
|
|
3918
|
+
}
|
|
3919
|
+
ngOnDestroy() {
|
|
3920
|
+
this.pageTitleService.enableReset();
|
|
3921
|
+
}
|
|
3922
|
+
onRowClicked(event) {
|
|
3923
|
+
this.apiKey$.pipe(take(1)).subscribe(apiKey => {
|
|
3924
|
+
this.router.navigate(['iko-management', apiKey, event.key, IKO_MANAGEMENT_TABS[0].key]);
|
|
3925
|
+
});
|
|
3926
|
+
}
|
|
3927
|
+
openAddModal() {
|
|
3928
|
+
this.$viewModalOpen.set(true);
|
|
3929
|
+
}
|
|
3930
|
+
openUploadModal() {
|
|
3931
|
+
this.$uploadModalOpen.set(true);
|
|
3932
|
+
}
|
|
3933
|
+
onEditClick(item) {
|
|
3934
|
+
this.$prefillData.set(item);
|
|
3935
|
+
this.$viewModalOpen.set(true);
|
|
3936
|
+
}
|
|
3937
|
+
onDeleteClick(item) {
|
|
3938
|
+
this.$keyToDelete.set(item.key);
|
|
3939
|
+
this.showDeleteModal$.next(true);
|
|
3940
|
+
}
|
|
3941
|
+
onDeleteConfirm(key) {
|
|
3942
|
+
this.ikoManagementApiService.deleteIkoDataAggregate(key).subscribe(() => {
|
|
3943
|
+
this.menuService.reload();
|
|
3944
|
+
this._refresh$.next(null);
|
|
3945
|
+
});
|
|
3946
|
+
}
|
|
3947
|
+
onViewModalClose(item, ikoRepositoryConfigKey) {
|
|
3948
|
+
this.$viewModalOpen.set(false);
|
|
3949
|
+
const prefillData = this.$prefillData();
|
|
3950
|
+
this.$prefillData.set(null);
|
|
3951
|
+
if (!item)
|
|
3952
|
+
return;
|
|
3953
|
+
if (prefillData !== null) {
|
|
3954
|
+
this.ikoManagementApiService
|
|
3955
|
+
.updateIkoDataAggregate(item.key, {
|
|
3956
|
+
...item,
|
|
3957
|
+
ikoRepositoryConfigKey,
|
|
3958
|
+
})
|
|
3959
|
+
.pipe(take(1))
|
|
3960
|
+
.subscribe(() => {
|
|
3961
|
+
this.menuService.reload();
|
|
3962
|
+
this._refresh$.next(null);
|
|
3963
|
+
});
|
|
3964
|
+
return;
|
|
3965
|
+
}
|
|
3966
|
+
this.ikoManagementApiService
|
|
3967
|
+
.createIkoDataAggregate(item.key, { ...item, ikoRepositoryConfigKey })
|
|
3968
|
+
.pipe(take(1))
|
|
3969
|
+
.subscribe(() => {
|
|
3970
|
+
this.menuService.reload();
|
|
3971
|
+
this._refresh$.next(null);
|
|
3972
|
+
});
|
|
3973
|
+
}
|
|
3974
|
+
onUploadModalClose(item) {
|
|
3975
|
+
this.$uploadModalOpen.set(false);
|
|
3976
|
+
if (!item)
|
|
3977
|
+
return;
|
|
3978
|
+
this._refresh$.next(null);
|
|
3979
|
+
this.menuService.reload();
|
|
3980
|
+
}
|
|
3981
|
+
setPageTitle() {
|
|
3982
|
+
this.apiKey$
|
|
3983
|
+
.pipe(take(1), switchMap(apiKey => this.ikoManagementApiService.getIkoRepositoryConfig(apiKey)))
|
|
3984
|
+
.subscribe(repositoryConfig => {
|
|
3985
|
+
this.pageTitleService.setCustomPageTitle(repositoryConfig.title);
|
|
3986
|
+
});
|
|
3987
|
+
}
|
|
3988
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementComponent, deps: [{ token: IkoManagementApiService }, { token: i1$3.Router }, { token: i1$3.ActivatedRoute }, { token: i1$2.PageTitleService }, { token: i1$2.MenuService }, { token: i6.IconService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3989
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: IkoManagementComponent, isStandalone: true, selector: "valtimo-iko-management", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n [actionItems]=\"ACTION_ITEMS\"\n [fields]=\"FIELDS\"\n [items]=\"ikoDataAggregates$ | async\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClicked($event)\"\n>\n <ng-container carbonToolbarContent [ngTemplateOutlet]=\"uploadButton\"></ng-container>\n\n <ng-container carbonToolbarContent [ngTemplateOutlet]=\"addViewButton\"></ng-container>\n\n <valtimo-no-results\n [action]=\"addViewButton\"\n [description]=\"'ikoManagement.views.noResultsDescription' | translate\"\n [title]=\"'ikoManagement.views.noResultsTitle' | translate\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<ng-template #uploadButton>\n <button [iconOnly]=\"true\" cdsButton=\"ghost\" (click)=\"openUploadModal()\">\n <svg cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #addViewButton>\n <button cdsButton=\"primary\" (click)=\"openAddModal()\">\n {{ 'ikoManagement.views.add' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<valtimo-iko-management-view-modal\n *ngIf=\"apiKey$ | async as apiKey\"\n [apiKey]=\"apiKey\"\n [open]=\"$viewModalOpen()\"\n [prefillData]=\"$prefillData()\"\n (modalClose)=\"onViewModalClose($event, apiKey)\"\n></valtimo-iko-management-view-modal>\n\n<valtimo-iko-management-upload-modal\n [open]=\"$uploadModalOpen()\"\n (modalClose)=\"onUploadModalClose($event)\"\n></valtimo-iko-management-upload-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"ikoManagement.views.deleteContent\"\n [outputOnConfirm]=\"$keyToDelete()\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteConfirm($event)\"\n></valtimo-confirmation-modal>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1$2.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i1$2.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i6.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: IkoManagementViewModalComponent, selector: "valtimo-iko-management-view-modal", inputs: ["open", "apiKey", "prefillData"], outputs: ["modalClose"] }, { kind: "component", type: IkoManagementUploadModalComponent, selector: "valtimo-iko-management-upload-modal", inputs: ["open"], outputs: ["modalClose"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i1$2.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }] }); }
|
|
3990
|
+
}
|
|
3991
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoManagementComponent, decorators: [{
|
|
3992
|
+
type: Component,
|
|
3993
|
+
args: [{ selector: 'valtimo-iko-management', standalone: true, imports: [
|
|
3994
|
+
CommonModule,
|
|
3995
|
+
CarbonListModule,
|
|
3996
|
+
ButtonModule,
|
|
3997
|
+
IconModule,
|
|
3998
|
+
IkoManagementViewModalComponent,
|
|
3999
|
+
IkoManagementUploadModalComponent,
|
|
4000
|
+
TranslateModule,
|
|
4001
|
+
ConfirmationModalModule,
|
|
4002
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n [actionItems]=\"ACTION_ITEMS\"\n [fields]=\"FIELDS\"\n [items]=\"ikoDataAggregates$ | async\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClicked($event)\"\n>\n <ng-container carbonToolbarContent [ngTemplateOutlet]=\"uploadButton\"></ng-container>\n\n <ng-container carbonToolbarContent [ngTemplateOutlet]=\"addViewButton\"></ng-container>\n\n <valtimo-no-results\n [action]=\"addViewButton\"\n [description]=\"'ikoManagement.views.noResultsDescription' | translate\"\n [title]=\"'ikoManagement.views.noResultsTitle' | translate\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<ng-template #uploadButton>\n <button [iconOnly]=\"true\" cdsButton=\"ghost\" (click)=\"openUploadModal()\">\n <svg cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #addViewButton>\n <button cdsButton=\"primary\" (click)=\"openAddModal()\">\n {{ 'ikoManagement.views.add' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<valtimo-iko-management-view-modal\n *ngIf=\"apiKey$ | async as apiKey\"\n [apiKey]=\"apiKey\"\n [open]=\"$viewModalOpen()\"\n [prefillData]=\"$prefillData()\"\n (modalClose)=\"onViewModalClose($event, apiKey)\"\n></valtimo-iko-management-view-modal>\n\n<valtimo-iko-management-upload-modal\n [open]=\"$uploadModalOpen()\"\n (modalClose)=\"onUploadModalClose($event)\"\n></valtimo-iko-management-upload-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"ikoManagement.views.deleteContent\"\n [outputOnConfirm]=\"$keyToDelete()\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteConfirm($event)\"\n></valtimo-confirmation-modal>\n" }]
|
|
4003
|
+
}], ctorParameters: () => [{ type: IkoManagementApiService }, { type: i1$3.Router }, { type: i1$3.ActivatedRoute }, { type: i1$2.PageTitleService }, { type: i1$2.MenuService }, { type: i6.IconService }] });
|
|
4004
|
+
|
|
4005
|
+
/*
|
|
4006
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
4007
|
+
*
|
|
4008
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4009
|
+
* you may not use this file except in compliance with the License.
|
|
4010
|
+
* You may obtain a copy of the License at
|
|
4011
|
+
*
|
|
4012
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4013
|
+
*
|
|
4014
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4015
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
4016
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4017
|
+
* See the License for the specific language governing permissions and
|
|
4018
|
+
* limitations under the License.
|
|
4019
|
+
*/
|
|
4020
|
+
class IkoSearchComponent {
|
|
4021
|
+
constructor(route, router, pageTitleService, iconService, ikoApiService) {
|
|
4022
|
+
this.route = route;
|
|
4023
|
+
this.router = router;
|
|
4024
|
+
this.pageTitleService = pageTitleService;
|
|
4025
|
+
this.iconService = iconService;
|
|
4026
|
+
this.ikoApiService = ikoApiService;
|
|
4027
|
+
this.formValues = {};
|
|
4028
|
+
this._key$ = this.route.params.pipe(map$1(params => params?.key), filter(key => !!key));
|
|
4029
|
+
this.dataRequests$ = this._key$.pipe(switchMap(key => combineLatest([
|
|
4030
|
+
of(key),
|
|
4031
|
+
this.ikoApiService.cachedMenuItems$,
|
|
4032
|
+
this.ikoApiService.getIkoDataRequests(key),
|
|
4033
|
+
])), map$1(([key, menuItems, dataRequests]) => {
|
|
4034
|
+
const currentMenuItem = menuItems.find(item => item.key === key);
|
|
4035
|
+
if (currentMenuItem && currentMenuItem?.title)
|
|
4036
|
+
this.pageTitleService.setCustomPageTitle(currentMenuItem.title, true);
|
|
4037
|
+
return dataRequests;
|
|
4038
|
+
}));
|
|
4039
|
+
this.iconService.register(Search16);
|
|
4040
|
+
}
|
|
4041
|
+
ngOnDestroy() {
|
|
4042
|
+
this.pageTitleService.enableReset();
|
|
4043
|
+
}
|
|
4044
|
+
searchDisabled(params) {
|
|
4045
|
+
return params.some(param => !this.formValues[param.key] && param.required);
|
|
4046
|
+
}
|
|
4047
|
+
isQueryGroup(param) {
|
|
4048
|
+
return param && param.group === true && Array.isArray(param.fields);
|
|
4049
|
+
}
|
|
4050
|
+
searchGroup(paramKey, params) {
|
|
4051
|
+
const queryParams = {};
|
|
4052
|
+
for (const param of params) {
|
|
4053
|
+
const value = this.formValues[param.key];
|
|
4054
|
+
if (value) {
|
|
4055
|
+
queryParams[param.key] = value;
|
|
4056
|
+
}
|
|
4057
|
+
}
|
|
4058
|
+
this.router.navigate([`${paramKey}`], { relativeTo: this.route, queryParams });
|
|
4059
|
+
}
|
|
4060
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoSearchComponent, deps: [{ token: i1$3.ActivatedRoute }, { token: i1$3.Router }, { token: i1$2.PageTitleService }, { token: i6.IconService }, { token: IkoApiService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4061
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: IkoSearchComponent, isStandalone: true, selector: "valtimo-iko-search", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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@if (dataRequests$ | async; as dataRequests) {\n @if (dataRequests.length === 0) {\n <valtimo-no-results [title]=\"'iko.searchFieldsNoResults' | translate\"></valtimo-no-results>\n } @else {\n @for (param of dataRequests; track param.key ?? param.fields?.[0]?.key) {\n <div class=\"query-group\">\n <span class=\"query-group__label\">{{ param.title }}</span>\n\n <div class=\"query-group__row\">\n @for (field of param.searchFields; track field.key) {\n <div class=\"query-group__field\">\n <input\n cdsText\n [id]=\"field.key\"\n [placeholder]=\"field.title\"\n [(ngModel)]=\"formValues[field.key]\"\n />\n </div>\n }\n <button\n cdsButton=\"primary\"\n class=\"query-group__search-button\"\n [disabled]=\"searchDisabled(param.searchFields)\"\n (click)=\"searchGroup(param.key, param.searchFields)\"\n >\n {{ 'searchFields.searchButtonText' | translate }}\n <svg cdsIcon=\"search\" size=\"16\"></svg>\n </button>\n </div>\n </div>\n }\n }\n}\n", styles: [":host{display:flex;flex-direction:column;gap:32px}.query-group{display:flex;flex-direction:column;gap:8px}.query-group__row{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-end}.query-group__field{flex:1 1 200px;display:flex;flex-direction:column;min-width:180px}.query-group__field input{width:100%}.query-group__label{font-size:14px;font-weight:600;color:var(--cds-text-primary)}.query-group__search-button{box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;height:40px;max-height:40px;min-height:40px;padding:8px 16px;min-width:120px;white-space:nowrap;overflow:hidden}\n/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: InputModule }, { kind: "directive", type: i6.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i6.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.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: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1$2.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }] }); }
|
|
4062
|
+
}
|
|
4063
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoSearchComponent, decorators: [{
|
|
4064
|
+
type: Component,
|
|
4065
|
+
args: [{ selector: 'valtimo-iko-search', standalone: true, imports: [
|
|
4066
|
+
CommonModule,
|
|
4067
|
+
InputModule,
|
|
4068
|
+
ButtonModule,
|
|
4069
|
+
IconModule,
|
|
4070
|
+
FormsModule,
|
|
4071
|
+
ReactiveFormsModule,
|
|
4072
|
+
TranslateModule,
|
|
4073
|
+
IkoListComponent,
|
|
4074
|
+
CarbonListModule,
|
|
4075
|
+
], template: "<!--\n ~ Copyright 2015-2025 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@if (dataRequests$ | async; as dataRequests) {\n @if (dataRequests.length === 0) {\n <valtimo-no-results [title]=\"'iko.searchFieldsNoResults' | translate\"></valtimo-no-results>\n } @else {\n @for (param of dataRequests; track param.key ?? param.fields?.[0]?.key) {\n <div class=\"query-group\">\n <span class=\"query-group__label\">{{ param.title }}</span>\n\n <div class=\"query-group__row\">\n @for (field of param.searchFields; track field.key) {\n <div class=\"query-group__field\">\n <input\n cdsText\n [id]=\"field.key\"\n [placeholder]=\"field.title\"\n [(ngModel)]=\"formValues[field.key]\"\n />\n </div>\n }\n <button\n cdsButton=\"primary\"\n class=\"query-group__search-button\"\n [disabled]=\"searchDisabled(param.searchFields)\"\n (click)=\"searchGroup(param.key, param.searchFields)\"\n >\n {{ 'searchFields.searchButtonText' | translate }}\n <svg cdsIcon=\"search\" size=\"16\"></svg>\n </button>\n </div>\n </div>\n }\n }\n}\n", styles: [":host{display:flex;flex-direction:column;gap:32px}.query-group{display:flex;flex-direction:column;gap:8px}.query-group__row{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-end}.query-group__field{flex:1 1 200px;display:flex;flex-direction:column;min-width:180px}.query-group__field input{width:100%}.query-group__label{font-size:14px;font-weight:600;color:var(--cds-text-primary)}.query-group__search-button{box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;height:40px;max-height:40px;min-height:40px;padding:8px 16px;min-width:120px;white-space:nowrap;overflow:hidden}\n/*!\n * Copyright 2015-2025 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"] }]
|
|
4076
|
+
}], ctorParameters: () => [{ type: i1$3.ActivatedRoute }, { type: i1$3.Router }, { type: i1$2.PageTitleService }, { type: i6.IconService }, { type: IkoApiService }] });
|
|
4077
|
+
|
|
4078
|
+
/*
|
|
4079
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
4080
|
+
*
|
|
4081
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4082
|
+
* you may not use this file except in compliance with the License.
|
|
4083
|
+
* You may obtain a copy of the License at
|
|
4084
|
+
*
|
|
4085
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4086
|
+
*
|
|
4087
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4088
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
4089
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4090
|
+
* See the License for the specific language governing permissions and
|
|
4091
|
+
* limitations under the License.
|
|
4092
|
+
*/
|
|
4093
|
+
const routes = [
|
|
4094
|
+
{
|
|
4095
|
+
path: 'iko/:key',
|
|
4096
|
+
component: IkoSearchComponent,
|
|
4097
|
+
canActivate: [AuthGuardService],
|
|
4098
|
+
data: {
|
|
4099
|
+
title: 'Iko',
|
|
4100
|
+
customPageTitle: true,
|
|
4101
|
+
},
|
|
4102
|
+
},
|
|
4103
|
+
{
|
|
4104
|
+
path: 'iko/:key/:searchKey',
|
|
4105
|
+
component: IkoListComponent,
|
|
4106
|
+
canActivate: [AuthGuardService],
|
|
4107
|
+
data: {
|
|
4108
|
+
title: 'interface.results',
|
|
4109
|
+
},
|
|
4110
|
+
},
|
|
4111
|
+
{
|
|
4112
|
+
path: 'iko/:key/:searchKey/details/:id',
|
|
4113
|
+
component: IkoDetailsComponent,
|
|
4114
|
+
canActivate: [AuthGuardService],
|
|
4115
|
+
data: {
|
|
4116
|
+
title: 'interface.details',
|
|
4117
|
+
customPageTitle: true,
|
|
4118
|
+
},
|
|
4119
|
+
},
|
|
4120
|
+
{
|
|
4121
|
+
path: 'iko-management',
|
|
4122
|
+
component: IkoManagementApiComponent,
|
|
4123
|
+
canActivate: [AuthGuardService],
|
|
4124
|
+
data: {
|
|
4125
|
+
title: 'Iko',
|
|
4126
|
+
roles: [ROLE_ADMIN],
|
|
4127
|
+
},
|
|
4128
|
+
},
|
|
4129
|
+
{
|
|
4130
|
+
path: 'iko-management/:apiKey',
|
|
4131
|
+
component: IkoManagementComponent,
|
|
4132
|
+
canActivate: [AuthGuardService],
|
|
4133
|
+
data: {
|
|
4134
|
+
title: 'Iko',
|
|
4135
|
+
roles: [ROLE_ADMIN],
|
|
4136
|
+
customPageTitle: true,
|
|
4137
|
+
},
|
|
4138
|
+
},
|
|
4139
|
+
{
|
|
4140
|
+
path: 'iko-management/:apiKey/:key/:tabKey',
|
|
4141
|
+
component: IkoManagementDetailsComponent,
|
|
4142
|
+
canActivate: [AuthGuardService],
|
|
4143
|
+
data: {
|
|
4144
|
+
customPageTitle: true,
|
|
4145
|
+
title: 'IKO Details',
|
|
4146
|
+
roles: [ROLE_ADMIN],
|
|
4147
|
+
},
|
|
4148
|
+
},
|
|
4149
|
+
{
|
|
4150
|
+
path: 'iko-management/:apiKey/:key/:tabKey/search-action/:actionKey',
|
|
4151
|
+
component: IkoManagementSearchFieldsComponent,
|
|
4152
|
+
canActivate: [AuthGuardService],
|
|
4153
|
+
data: {
|
|
4154
|
+
customPageTitle: true,
|
|
4155
|
+
title: 'IKO Search action details',
|
|
4156
|
+
roles: [ROLE_ADMIN],
|
|
4157
|
+
},
|
|
4158
|
+
},
|
|
4159
|
+
{
|
|
4160
|
+
path: 'iko-management/:apiKey/:key/:tabKey/widget-details/:widgetTabKey',
|
|
4161
|
+
component: IkoManagementWidgetsComponent,
|
|
4162
|
+
canActivate: [AuthGuardService],
|
|
4163
|
+
data: {
|
|
4164
|
+
title: 'IKO Widget details',
|
|
4165
|
+
roles: [ROLE_ADMIN],
|
|
4166
|
+
},
|
|
4167
|
+
},
|
|
4168
|
+
{
|
|
4169
|
+
path: 'iko-management/:apiKey',
|
|
4170
|
+
component: IkoManagementComponent,
|
|
4171
|
+
canActivate: [AuthGuardService],
|
|
4172
|
+
data: {
|
|
4173
|
+
title: 'Iko',
|
|
4174
|
+
roles: [ROLE_ADMIN],
|
|
4175
|
+
customPageTitle: true,
|
|
4176
|
+
},
|
|
4177
|
+
},
|
|
4178
|
+
{
|
|
4179
|
+
path: 'iko-management/:apiKey/:key/:tabKey',
|
|
4180
|
+
component: IkoManagementDetailsComponent,
|
|
4181
|
+
canActivate: [AuthGuardService],
|
|
4182
|
+
data: {
|
|
4183
|
+
customPageTitle: true,
|
|
4184
|
+
title: 'IKO Details',
|
|
4185
|
+
roles: [ROLE_ADMIN],
|
|
4186
|
+
},
|
|
4187
|
+
},
|
|
4188
|
+
];
|
|
4189
|
+
class IkoRoutingModule {
|
|
4190
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
4191
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: IkoRoutingModule, imports: [CommonModule, i1$3.RouterModule], exports: [RouterModule] }); }
|
|
4192
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
|
|
4193
|
+
}
|
|
4194
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoRoutingModule, decorators: [{
|
|
4195
|
+
type: NgModule,
|
|
4196
|
+
args: [{
|
|
4197
|
+
declarations: [],
|
|
4198
|
+
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
4199
|
+
exports: [RouterModule],
|
|
4200
|
+
}]
|
|
4201
|
+
}] });
|
|
4202
|
+
|
|
4203
|
+
/*
|
|
4204
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
4205
|
+
*
|
|
4206
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4207
|
+
* you may not use this file except in compliance with the License.
|
|
4208
|
+
* You may obtain a copy of the License at
|
|
4209
|
+
*
|
|
4210
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4211
|
+
*
|
|
4212
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4213
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
4214
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4215
|
+
* See the License for the specific language governing permissions and
|
|
4216
|
+
* limitations under the License.
|
|
4217
|
+
*/
|
|
4218
|
+
class IkoModule {
|
|
4219
|
+
constructor(ikoMenuService, menuService) {
|
|
4220
|
+
this.ikoMenuService = ikoMenuService;
|
|
4221
|
+
this.menuService = menuService;
|
|
4222
|
+
this.menuService.registerAppendMenuItemsFunction(this.ikoMenuService.appendIkoMenuItems);
|
|
4223
|
+
}
|
|
4224
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoModule, deps: [{ token: IkoMenuService }, { token: i1$2.MenuService }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
4225
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: IkoModule, imports: [CommonModule, IkoRoutingModule, IkoSearchComponent] }); }
|
|
4226
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoModule, providers: [
|
|
4227
|
+
IkoMenuService,
|
|
4228
|
+
{
|
|
4229
|
+
provide: IKO_TOKEN,
|
|
4230
|
+
useValue: true,
|
|
4231
|
+
},
|
|
4232
|
+
], imports: [CommonModule, IkoRoutingModule, IkoSearchComponent] }); }
|
|
4233
|
+
}
|
|
4234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IkoModule, decorators: [{
|
|
4235
|
+
type: NgModule,
|
|
4236
|
+
args: [{
|
|
4237
|
+
imports: [CommonModule, IkoRoutingModule, IkoSearchComponent],
|
|
4238
|
+
providers: [
|
|
4239
|
+
IkoMenuService,
|
|
4240
|
+
{
|
|
4241
|
+
provide: IKO_TOKEN,
|
|
4242
|
+
useValue: true,
|
|
4243
|
+
},
|
|
4244
|
+
],
|
|
4245
|
+
}]
|
|
4246
|
+
}], ctorParameters: () => [{ type: IkoMenuService }, { type: i1$2.MenuService }] });
|
|
4247
|
+
|
|
4248
|
+
/*
|
|
4249
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
4250
|
+
*
|
|
4251
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
4252
|
+
* you may not use this file except in compliance with the License.
|
|
4253
|
+
* You may obtain a copy of the License at
|
|
4254
|
+
*
|
|
4255
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
4256
|
+
*
|
|
4257
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4258
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
4259
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4260
|
+
* See the License for the specific language governing permissions and
|
|
4261
|
+
* limitations under the License.
|
|
4262
|
+
*/
|
|
4263
|
+
/*
|
|
4264
|
+
* Public API Surface of iko
|
|
4265
|
+
*/
|
|
4266
|
+
|
|
4267
|
+
/**
|
|
4268
|
+
* Generated bundle index. Do not edit.
|
|
4269
|
+
*/
|
|
4270
|
+
|
|
4271
|
+
export { IkoModule };
|
|
4272
|
+
//# sourceMappingURL=valtimo-iko.mjs.map
|