@valtimo/dashboard-management 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,976 @@
1
+ import * as i2$1 from '@angular/common';
2
+ import { DOCUMENT, CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Injectable, EventEmitter, ViewContainerRef, Output, Input, ViewChild, Component, Inject, ViewEncapsulation, ChangeDetectionStrategy, signal, computed, NgModule } from '@angular/core';
5
+ import * as i1$1 from '@angular/forms';
6
+ import { Validators, ReactiveFormsModule } from '@angular/forms';
7
+ import * as i6 from '@ngx-translate/core';
8
+ import { TranslateModule } from '@ngx-translate/core';
9
+ import * as i4 from '@valtimo/components';
10
+ import { CARBON_CONSTANTS, ViewType, SpinnerModule, RenderInPageHeaderDirective, ConfirmationModalModule, CarbonListModule, ValtimoCdsModalDirective, JsonEditorComponent } from '@valtimo/components';
11
+ import * as i3 from 'carbon-components-angular';
12
+ import { ButtonModule, DropdownModule, InputModule, ModalModule, NotificationModule, IconModule, LayerModule } from 'carbon-components-angular';
13
+ import { Code16, Edit16 } from '@carbon/icons';
14
+ import { take, tap, BehaviorSubject, switchMap, catchError, of, Subscription, combineLatest, filter, map, finalize } from 'rxjs';
15
+ import * as i1 from '@angular/common/http';
16
+ import * as i2 from '@valtimo/shared';
17
+ import { ROLE_ADMIN } from '@valtimo/shared';
18
+ import * as i5$1 from '@angular/router';
19
+ import { RouterModule } from '@angular/router';
20
+ import * as i5 from '@valtimo/dashboard';
21
+ import { WidgetTranslatePipeModule } from '@valtimo/dashboard';
22
+ import { tap as tap$1 } from 'rxjs/operators';
23
+ import { AuthGuardService } from '@valtimo/security';
24
+
25
+ class DashboardManagementService {
26
+ loadData() {
27
+ this.http
28
+ .get(this.valtimoEndpointUri)
29
+ .pipe(take(1), tap(() => {
30
+ this.dashboards$.next({ items: null, loading: true });
31
+ }))
32
+ .subscribe({
33
+ next: (items) => {
34
+ this.dashboards$.next({ items, loading: false });
35
+ },
36
+ error: error => {
37
+ console.error(error);
38
+ },
39
+ });
40
+ }
41
+ constructor(http, configService) {
42
+ this.http = http;
43
+ this.configService = configService;
44
+ this.dashboards$ = new BehaviorSubject({
45
+ items: null,
46
+ loading: true,
47
+ });
48
+ this.valtimoEndpointUri = `${this.configService.config.valtimoApi.endpointUri}management/v1/dashboard`;
49
+ }
50
+ createDashboard(dashboard) {
51
+ return this.http.post(this.valtimoEndpointUri, dashboard);
52
+ }
53
+ updateDashboards(dashboards) {
54
+ return this.http.put(this.valtimoEndpointUri, dashboards);
55
+ }
56
+ updateDashboard(dashboard) {
57
+ return this.http.put(`${this.valtimoEndpointUri}/${dashboard.key}`, dashboard);
58
+ }
59
+ deleteDashboard(dashboardKey) {
60
+ return this.http.delete(`${this.valtimoEndpointUri}/${dashboardKey}`);
61
+ }
62
+ dispatchAction(actionResult) {
63
+ actionResult
64
+ .pipe(switchMap(() => this.getDashboards()), tap(() => {
65
+ this.dashboards$.next({ items: null, loading: true });
66
+ }), take(1), catchError(error => of(error)))
67
+ .subscribe({
68
+ next: (items) => this.dashboards$.next({ items, loading: false }),
69
+ error: error => {
70
+ console.error(error);
71
+ },
72
+ });
73
+ }
74
+ getDashboard(dashboardKey) {
75
+ return this.http.get(`${this.valtimoEndpointUri}/${dashboardKey}`);
76
+ }
77
+ getDashboardWidgetConfiguration(dashboardKey) {
78
+ return this.http.get(`${this.valtimoEndpointUri}/${dashboardKey}/widget-configuration`);
79
+ }
80
+ createDashboardWidgetConfiguration(dashboardKey, widgetConfiguration) {
81
+ return this.http.post(`${this.valtimoEndpointUri}/${dashboardKey}/widget-configuration`, widgetConfiguration);
82
+ }
83
+ updateDashboardWidgetConfigurations(dashboardKey, widgetConfigurations) {
84
+ return this.http.put(`${this.valtimoEndpointUri}/${dashboardKey}/widget-configuration`, widgetConfigurations);
85
+ }
86
+ updateDashboardWidgetConfiguration(dashboardKey, widgetConfiguration) {
87
+ return this.http.put(`${this.valtimoEndpointUri}/${dashboardKey}/widget-configuration/${widgetConfiguration.key}`, widgetConfiguration);
88
+ }
89
+ deleteDashboardWidgetConfiguration(dashboardKey, widgetKey) {
90
+ return this.http.delete(`${this.valtimoEndpointUri}/${dashboardKey}/widget-configuration/${widgetKey}`);
91
+ }
92
+ getDataSources() {
93
+ return this.http.get(`${this.valtimoEndpointUri}/widget-data-sources`);
94
+ }
95
+ getDashboards() {
96
+ return this.http.get(this.valtimoEndpointUri);
97
+ }
98
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
99
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementService, providedIn: 'root' }); }
100
+ }
101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementService, decorators: [{
102
+ type: Injectable,
103
+ args: [{
104
+ providedIn: 'root',
105
+ }]
106
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ConfigService }] });
107
+
108
+ /*
109
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
110
+ *
111
+ * Licensed under EUPL, Version 1.2 (the "License");
112
+ * you may not use this file except in compliance with the License.
113
+ * You may obtain a copy of the License at
114
+ *
115
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
116
+ *
117
+ * Unless required by applicable law or agreed to in writing, software
118
+ * distributed under the License is distributed on an "AS IS" basis,
119
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
120
+ * See the License for the specific language governing permissions and
121
+ * limitations under the License.
122
+ */
123
+ class WidgetConfigurationContainerComponent {
124
+ set dataSourceKey(value) {
125
+ this._dataSourceKey$.next(value);
126
+ }
127
+ set displayTypeKey(value) {
128
+ this._displayTypeKey$.next(value);
129
+ }
130
+ set disabled(disabledValue) {
131
+ this._disabled$.next(disabledValue);
132
+ }
133
+ set prefillConfiguration(prefillConfigurationValue) {
134
+ this._prefillConfiguration$.next(prefillConfigurationValue);
135
+ }
136
+ constructor(widgetService) {
137
+ this.widgetService = widgetService;
138
+ this.configurationEvent = new EventEmitter();
139
+ this._subscriptions = new Subscription();
140
+ this._componentRef$ = new BehaviorSubject(undefined);
141
+ this._dataSourceKey$ = new BehaviorSubject('');
142
+ this._displayTypeKey$ = new BehaviorSubject('');
143
+ this._disabled$ = new BehaviorSubject(false);
144
+ this._prefillConfiguration$ = new BehaviorSubject(null);
145
+ }
146
+ ngOnInit() {
147
+ this.openConfigurationComponentSubscription();
148
+ this.openComponentInstanceSubscription();
149
+ this.openDisabledSubscription();
150
+ this.openPrefillConfigurationSubscription();
151
+ }
152
+ ngOnDestroy() {
153
+ this._subscriptions.unsubscribe();
154
+ }
155
+ openConfigurationComponentSubscription() {
156
+ this._subscriptions.add(combineLatest([
157
+ this._displayTypeKey$,
158
+ this._dataSourceKey$,
159
+ this.widgetService.supportedDisplayTypes$,
160
+ this.widgetService.supportedDataSources$,
161
+ ])
162
+ .pipe(tap$1(([displayTypeKey, dataSourceKey, supportedDisplayTypes, supportedDataSources]) => {
163
+ let configurationComponent;
164
+ this._dynamicContainer.clear();
165
+ const displayTypeSpecification = displayTypeKey &&
166
+ supportedDisplayTypes.find(type => type.displayTypeKey === displayTypeKey);
167
+ const dataSourceSpecification = dataSourceKey &&
168
+ supportedDataSources.find(source => source.dataSourceKey === dataSourceKey);
169
+ if (displayTypeSpecification && displayTypeSpecification.configurationComponent) {
170
+ configurationComponent = displayTypeSpecification.configurationComponent;
171
+ }
172
+ else if (dataSourceSpecification && dataSourceSpecification.configurationComponent) {
173
+ configurationComponent = dataSourceSpecification.configurationComponent;
174
+ }
175
+ if (configurationComponent) {
176
+ const componentRef = this._dynamicContainer.createComponent(configurationComponent);
177
+ this.configurationEvent.emit({ valid: false, data: {} });
178
+ this._componentRef$.next(componentRef);
179
+ }
180
+ else {
181
+ this.configurationEvent.emit({ valid: true, data: {} });
182
+ }
183
+ }))
184
+ .subscribe());
185
+ }
186
+ openComponentInstanceSubscription() {
187
+ this._subscriptions.add(combineLatest([this._componentRef$, this._dataSourceKey$, this._displayTypeKey$]).subscribe(([ref, dataSourceKey, displayTypeKey]) => {
188
+ const instance = ref?.instance;
189
+ this._configurationSubscription?.unsubscribe();
190
+ if (instance) {
191
+ if (displayTypeKey) {
192
+ instance.displayTypeKey = displayTypeKey;
193
+ }
194
+ else if (dataSourceKey) {
195
+ instance.dataSourceKey = dataSourceKey;
196
+ }
197
+ this._configurationSubscription = instance.configurationEvent.subscribe(configuration => {
198
+ this.configurationEvent.emit(configuration);
199
+ });
200
+ }
201
+ }));
202
+ }
203
+ openDisabledSubscription() {
204
+ this._subscriptions.add(combineLatest([this._componentRef$, this._disabled$]).subscribe(([ref, disabled]) => {
205
+ const instance = ref?.instance;
206
+ if (instance) {
207
+ instance.disabled = disabled;
208
+ }
209
+ }));
210
+ }
211
+ openPrefillConfigurationSubscription() {
212
+ this._subscriptions.add(combineLatest([this._componentRef$, this._prefillConfiguration$]).subscribe(([ref, prefillConfiguration]) => {
213
+ const instance = ref?.instance;
214
+ if (instance && prefillConfiguration) {
215
+ instance.prefillConfiguration = prefillConfiguration;
216
+ }
217
+ }));
218
+ }
219
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: WidgetConfigurationContainerComponent, deps: [{ token: i5.WidgetService }], target: i0.ɵɵFactoryTarget.Component }); }
220
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: WidgetConfigurationContainerComponent, isStandalone: false, selector: "valtimo-widget-configuration-container", inputs: { dataSourceKey: "dataSourceKey", displayTypeKey: "displayTypeKey", disabled: "disabled", prefillConfiguration: "prefillConfiguration" }, outputs: { configurationEvent: "configurationEvent" }, viewQueries: [{ propertyName: "_dynamicContainer", first: true, predicate: ["widgetConfigurationComponent"], 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-template #widgetConfigurationComponent></ng-template>\n" }); }
221
+ }
222
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: WidgetConfigurationContainerComponent, decorators: [{
223
+ type: Component,
224
+ args: [{ standalone: false, selector: 'valtimo-widget-configuration-container', 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-template #widgetConfigurationComponent></ng-template>\n" }]
225
+ }], ctorParameters: () => [{ type: i5.WidgetService }], propDecorators: { _dynamicContainer: [{
226
+ type: ViewChild,
227
+ args: ['widgetConfigurationComponent', { static: true, read: ViewContainerRef }]
228
+ }], dataSourceKey: [{
229
+ type: Input
230
+ }], displayTypeKey: [{
231
+ type: Input
232
+ }], disabled: [{
233
+ type: Input
234
+ }], prefillConfiguration: [{
235
+ type: Input
236
+ }], configurationEvent: [{
237
+ type: Output
238
+ }] } });
239
+
240
+ /*
241
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
242
+ *
243
+ * Licensed under EUPL, Version 1.2 (the "License");
244
+ * you may not use this file except in compliance with the License.
245
+ * You may obtain a copy of the License at
246
+ *
247
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
248
+ *
249
+ * Unless required by applicable law or agreed to in writing, software
250
+ * distributed under the License is distributed on an "AS IS" basis,
251
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
252
+ * See the License for the specific language governing permissions and
253
+ * limitations under the License.
254
+ */
255
+ class WidgetModalComponent {
256
+ set editWidgetConfiguration(configuration) {
257
+ if (configuration) {
258
+ this.title.setValue(configuration.title);
259
+ this.url.setValue(configuration.url);
260
+ this.dataSourceSelected({ item: { key: configuration.dataSourceKey } });
261
+ this.displayTypeSelected({ item: { key: configuration.displayType } });
262
+ this.dataSourcePrefillConfig$.next(configuration.dataSourceProperties);
263
+ this.displayTypePrefillConfig$.next(configuration.displayTypeProperties);
264
+ }
265
+ else {
266
+ this.dataSourcePrefillConfig$.next(null);
267
+ this.displayTypePrefillConfig$.next(null);
268
+ }
269
+ }
270
+ get title() {
271
+ return this.form.get('title');
272
+ }
273
+ get key() {
274
+ return this.form.get('key');
275
+ }
276
+ get dataSource() {
277
+ return this.form.get('dataSource');
278
+ }
279
+ get displayType() {
280
+ return this.form.get('displayType');
281
+ }
282
+ get url() {
283
+ return this.form.get('url');
284
+ }
285
+ constructor(document, fb, translateService, notificationService, dashboardManagementService, widgetService, widgetTranslationService) {
286
+ this.document = document;
287
+ this.fb = fb;
288
+ this.translateService = translateService;
289
+ this.notificationService = notificationService;
290
+ this.dashboardManagementService = dashboardManagementService;
291
+ this.widgetService = widgetService;
292
+ this.widgetTranslationService = widgetTranslationService;
293
+ this.saveEvent = new EventEmitter();
294
+ this.form = this.fb.group({
295
+ title: this.fb.control('', [Validators.required]),
296
+ dataSource: this.fb.control(null, [Validators.required]),
297
+ displayType: this.fb.control(null, [Validators.required]),
298
+ url: this.fb.control(''),
299
+ });
300
+ this.open$ = new BehaviorSubject(false);
301
+ this.selectedDataSourceKey$ = new BehaviorSubject('');
302
+ this.selectedDisplayTypeKey$ = new BehaviorSubject('');
303
+ this.dataSourceItems$ = combineLatest([
304
+ this.dashboardManagementService.getDataSources(),
305
+ this.selectedDataSourceKey$,
306
+ this.widgetService.supportedDataSources$,
307
+ this.translateService.stream('key'),
308
+ ]).pipe(filter(([dataSources]) => !!dataSources), tap(([dataSources, selectedDataSourceKey]) => {
309
+ if (selectedDataSourceKey) {
310
+ this.setCompatibleDisplayTypes(dataSources, selectedDataSourceKey);
311
+ }
312
+ else {
313
+ this.resetCompatibleDisplayTypes();
314
+ }
315
+ }), map(([dataSources, selectedDataSourceKey, supportedDataSources]) => dataSources
316
+ .filter(dataSource => supportedDataSources.find(supportedDataSource => supportedDataSource.dataSourceKey === dataSource.key))
317
+ .map(dataSource => ({
318
+ content: this.widgetTranslationService.instant('title', dataSource.key),
319
+ selected: selectedDataSourceKey === dataSource.key,
320
+ key: dataSource.key,
321
+ }))));
322
+ this.dataSourcePrefillConfig$ = new BehaviorSubject(null);
323
+ this.displayTypePrefillConfig$ = new BehaviorSubject(null);
324
+ this._compatibleDisplayTypes$ = new BehaviorSubject([]);
325
+ this.displayTypeItems$ = combineLatest([
326
+ this._compatibleDisplayTypes$,
327
+ this.selectedDisplayTypeKey$,
328
+ this.translateService.stream('key'),
329
+ ]).pipe(map(([compatibleDisplayTypes, selectedDisplayTypeKey]) => compatibleDisplayTypes.map(displayType => ({
330
+ content: this.widgetTranslationService.instant('title', displayType.displayTypeKey),
331
+ selected: displayType.displayTypeKey === selectedDisplayTypeKey,
332
+ key: displayType.displayTypeKey,
333
+ }))));
334
+ this.displayTypeDropdownDisabled$ = combineLatest([
335
+ this._compatibleDisplayTypes$,
336
+ this.selectedDataSourceKey$,
337
+ ]).pipe(map(([compatibleDisplayTypes, selectedDataSourceKey]) => compatibleDisplayTypes?.length === 0 || !selectedDataSourceKey), tap(displayTypeDropdownDisabled => {
338
+ if (displayTypeDropdownDisabled) {
339
+ this.displayType?.disable();
340
+ }
341
+ else {
342
+ this.displayType?.enable();
343
+ }
344
+ }));
345
+ this.dataSourceConfiguration$ = new BehaviorSubject({
346
+ valid: false,
347
+ data: {},
348
+ });
349
+ this.displayTypeConfiguration$ = new BehaviorSubject({
350
+ valid: false,
351
+ data: {},
352
+ });
353
+ this.disabled$ = new BehaviorSubject(false);
354
+ }
355
+ ngOnInit() {
356
+ this.openOpenSubscription();
357
+ }
358
+ ngOnDestroy() {
359
+ this._openSubscription?.unsubscribe();
360
+ }
361
+ closeModal() {
362
+ this.open$.next(false);
363
+ setTimeout(() => {
364
+ this.enable();
365
+ this.form.reset();
366
+ this.selectedDataSourceKey$.next('');
367
+ this.selectedDisplayTypeKey$.next('');
368
+ }, CARBON_CONSTANTS.modalAnimationMs);
369
+ }
370
+ save() {
371
+ this.disable();
372
+ combineLatest([
373
+ this.selectedDataSourceKey$,
374
+ this.selectedDisplayTypeKey$,
375
+ this.displayTypeConfiguration$,
376
+ this.dataSourceConfiguration$,
377
+ ])
378
+ .pipe(take(1), map(([selectedDataSourceKey, selectedDisplayTypeKey, displayTypeConfiguration, dataSourceConfiguration,]) => ({
379
+ title: this.title.value,
380
+ displayType: selectedDisplayTypeKey,
381
+ dataSourceKey: selectedDataSourceKey,
382
+ dataSourceProperties: { ...dataSourceConfiguration.data },
383
+ displayTypeProperties: { ...displayTypeConfiguration.data },
384
+ url: this.url.value,
385
+ })), switchMap(widgetUpdateObject => this.type === 'create'
386
+ ? this.dashboardManagementService.createDashboardWidgetConfiguration(this.dashboard.key, widgetUpdateObject)
387
+ : this.dashboardManagementService.updateDashboardWidgetConfiguration(this.dashboard.key, { ...widgetUpdateObject, key: this.widgetKey })))
388
+ .subscribe({
389
+ complete: () => {
390
+ this.saveEvent.emit();
391
+ this.closeModal();
392
+ },
393
+ error: () => {
394
+ this.enable();
395
+ },
396
+ });
397
+ }
398
+ delete() {
399
+ this.disable();
400
+ this.dashboardManagementService
401
+ .deleteDashboardWidgetConfiguration(this.dashboard.key, this.widgetKey)
402
+ .subscribe({
403
+ complete: () => {
404
+ this.saveEvent.emit();
405
+ this.closeModal();
406
+ },
407
+ error: () => {
408
+ this.enable();
409
+ },
410
+ });
411
+ }
412
+ dataSourceSelected(dataSource) {
413
+ if (!dataSource) {
414
+ return;
415
+ }
416
+ this.selectedDataSourceKey$.next(dataSource?.item?.key);
417
+ this.dataSource.setValue(dataSource?.item?.key);
418
+ }
419
+ displayTypeSelected(displayType) {
420
+ if (!displayType) {
421
+ return;
422
+ }
423
+ this.selectedDisplayTypeKey$.next(displayType?.item?.key);
424
+ this.displayType.setValue(displayType?.item?.key);
425
+ }
426
+ dataSourceConfiguration(configuration) {
427
+ this.dataSourceConfiguration$.next(configuration);
428
+ }
429
+ displayTypeConfiguration(configuration) {
430
+ this.displayTypeConfiguration$.next(configuration);
431
+ }
432
+ openOpenSubscription() {
433
+ this._openSubscription = this.showModal$.subscribe(show => {
434
+ this.open$.next(show);
435
+ });
436
+ }
437
+ resetCompatibleDisplayTypes() {
438
+ this._compatibleDisplayTypes$.next([]);
439
+ }
440
+ setCompatibleDisplayTypes(dataSources, selectedDataSourceKey) {
441
+ this.widgetService.supportedDisplayTypes$.pipe(take(1)).subscribe(supportedDisplayTypes => {
442
+ const selectedDataSource = dataSources.find(source => source.key === selectedDataSourceKey);
443
+ const availableDataFeatures = selectedDataSource?.dataFeatures;
444
+ const compatibleDisplayTypes = supportedDisplayTypes.filter(displayType => {
445
+ const supportedDataFeatures = displayType.requiredDataFeatures.filter(requiredDataFeature => !!availableDataFeatures?.some(availableDataFeature => this.trimAndToUpperCase(availableDataFeature) ===
446
+ this.trimAndToUpperCase(requiredDataFeature)));
447
+ return supportedDataFeatures.length === displayType.requiredDataFeatures.length;
448
+ });
449
+ this._compatibleDisplayTypes$.next(compatibleDisplayTypes);
450
+ });
451
+ }
452
+ disable() {
453
+ this.disabled$.next(true);
454
+ this.form.disable();
455
+ }
456
+ enable() {
457
+ this.disabled$.next(false);
458
+ this.form.enable();
459
+ }
460
+ trimAndToUpperCase(text) {
461
+ return `${text}`.trim().toUpperCase();
462
+ }
463
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: WidgetModalComponent, deps: [{ token: DOCUMENT }, { token: i1$1.FormBuilder }, { token: i6.TranslateService }, { token: i2.GlobalNotificationService }, { token: DashboardManagementService }, { token: i5.WidgetService }, { token: i5.WidgetTranslationService }], target: i0.ɵɵFactoryTarget.Component }); }
464
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: WidgetModalComponent, isStandalone: false, selector: "valtimo-widget-modal", inputs: { showModal$: "showModal$", type: "type", dashboard: "dashboard", widgetKey: "widgetKey", editWidgetConfiguration: "editWidgetConfiguration" }, outputs: { saveEvent: "saveEvent" }, 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 disabled: disabled$ | async,\n isCreate: type === 'create',\n isDelete: type === 'delete',\n isEdit: type === 'edit',\n open: open$ | async,\n } as vars\"\n>\n <ng-container\n *ngIf=\"{\n create: vars.isCreate && ('dashboardManagement.widgets.add' | translate),\n delete: vars.isDelete && ('dashboardManagement.widgets.delete' | translate),\n edit: vars.isEdit && ('dashboardManagement.widgets.edit' | translate),\n } as titles\"\n >\n <cds-modal\n *ngIf=\"{\n title: titles.edit || titles.create || titles.delete,\n } as translations\"\n valtimoCdsModal\n [open]=\"vars.open\"\n showFooter=\"true\"\n size=\"md\"\n title=\"{{ translations.title }}\"\n class=\"widget-modal\"\n (close)=\"closeModal()\"\n >\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{ translations.title }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent [cdsLayer]=\"1\">\n <ng-container *ngIf=\"vars.isDelete\">\n {{ 'dashboardManagement.widgets.deleteDescription' | translate }}</ng-container\n >\n\n <ng-container *ngIf=\"vars.isEdit || vars.isCreate\">\n <ng-container *ngTemplateOutlet=\"widgetForm; context: {vars: vars}\"></ng-container>\n </ng-container>\n </section>\n\n <cds-modal-footer>\n <ng-container *ngIf=\"vars.isEdit || vars.isCreate\">\n <ng-container *ngTemplateOutlet=\"editButtons; context: {vars: vars}\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"vars.isDelete\">\n <ng-container *ngTemplateOutlet=\"deleteButtons; context: {vars: vars}\"></ng-container>\n </ng-container>\n </cds-modal-footer>\n </cds-modal>\n </ng-container>\n</ng-container>\n\n<ng-template #widgetForm let-vars=\"vars\">\n <form\n *ngIf=\"\n form && {\n dataSourceItems: dataSourceItems$ | async,\n displayTypeDropdownDisabled: displayTypeDropdownDisabled$ | async,\n displayTypeItems: displayTypeItems$ | async,\n selectedDataSourceKey: selectedDataSourceKey$ | async,\n selectedDisplayTypeKey: selectedDisplayTypeKey$ | async,\n } as obs\n \"\n [formGroup]=\"form\"\n class=\"dashboard-modal__form\"\n >\n <div class=\"form__element\">\n <cds-label\n [helperText]=\"'dashboardManagement.widgets.form.titleHelperText' | translate\"\n [invalidText]=\"'dashboardManagement.widgets.form.titleHelperText' | translate\"\n [invalid]=\"title.dirty && title.invalid\"\n >\n {{ 'dashboardManagement.widgets.form.title' | translate }}\n\n <input\n cdsText\n formControlName=\"title\"\n [invalid]=\"title.dirty && title.invalid\"\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n </div>\n\n <div class=\"form__element\" *ngIf=\"obs.dataSourceItems\">\n <cds-dropdown\n [appendInline]=\"true\"\n formControlName=\"dataSource\"\n [helperText]=\"'dashboardManagement.widgets.form.dataSourceHelperText' | translate\"\n [invalidText]=\"'dashboardManagement.widgets.form.dateSourceHelperText' | translate\"\n [invalid]=\"dataSource.dirty && dataSource.invalid\"\n [label]=\"'dashboardManagement.widgets.form.dataSource' | translate\"\n (selected)=\"dataSourceSelected($event)\"\n >\n <cds-dropdown-list [items]=\"obs.dataSourceItems\" type=\"multi\"></cds-dropdown-list>\n </cds-dropdown>\n </div>\n\n <valtimo-widget-configuration-container\n *ngIf=\"obs.selectedDataSourceKey\"\n [dataSourceKey]=\"obs.selectedDataSourceKey\"\n [disabled]=\"vars.disabled\"\n [prefillConfiguration]=\"dataSourcePrefillConfig$ | async\"\n (configurationEvent)=\"dataSourceConfiguration($event)\"\n ></valtimo-widget-configuration-container>\n\n <div class=\"form__element\" *ngIf=\"obs.displayTypeItems\">\n <cds-dropdown\n [appendInline]=\"true\"\n formControlName=\"displayType\"\n [helperText]=\"'dashboardManagement.widgets.form.displayTypeHelperText' | translate\"\n [invalid]=\"displayType.dirty && displayType.invalid\"\n [invalidText]=\"'dashboardManagement.widgets.form.displayTypeHelperText' | translate\"\n [label]=\"'dashboardManagement.widgets.form.displayType' | translate\"\n (selected)=\"displayTypeSelected($event)\"\n >\n <cds-dropdown-list [items]=\"obs.displayTypeItems\" type=\"multi\"></cds-dropdown-list>\n </cds-dropdown>\n </div>\n\n <valtimo-widget-configuration-container\n *ngIf=\"obs.selectedDisplayTypeKey\"\n [disabled]=\"vars.disabled\"\n [displayTypeKey]=\"obs.selectedDisplayTypeKey\"\n [prefillConfiguration]=\"displayTypePrefillConfig$ | async\"\n (configurationEvent)=\"displayTypeConfiguration($event)\"\n ></valtimo-widget-configuration-container>\n\n <div class=\"form__element\">\n <cds-label\n [helperText]=\"'dashboardManagement.widgets.form.urlHelperText' | translate\"\n [invalidText]=\"'dashboardManagement.widgets.form.urlHelperText' | translate\"\n [invalid]=\"url.dirty && url.invalid\"\n >\n {{ 'dashboardManagement.widgets.form.url' | translate }}\n\n <input cdsText formControlName=\"url\" [invalid]=\"url.dirty && url.invalid\" />\n </cds-label>\n </div>\n </form>\n</ng-template>\n\n<ng-template #editButtons let-vars=\"vars\">\n <ng-container\n *ngIf=\"{\n dataSourceConfiguration: dataSourceConfiguration$ | async,\n displayTypeConfiguration: displayTypeConfiguration$ | async,\n } as obs\"\n >\n <button cdsButton=\"ghost\" [disabled]=\"vars.disabled\" (click)=\"closeModal()\">\n {{ 'dashboardManagement.widgets.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"\n form.invalid ||\n !obs.dataSourceConfiguration.valid ||\n !obs.displayTypeConfiguration.valid ||\n vars.disabled\n \"\n (click)=\"save()\"\n >\n {{ 'dashboardManagement.widgets.save' | translate }}\n </button>\n </ng-container>\n</ng-template>\n\n<ng-template #deleteButtons let-vars=\"vars\">\n <button cdsButton=\"secondary\" [disabled]=\"vars.disabled\" (click)=\"closeModal()\">\n {{ 'dashboardManagement.widgets.cancel' | translate }}\n </button>\n\n <button cdsButton=\"danger\" [disabled]=\"vars.disabled\" (click)=\"delete()\">\n {{ 'dashboardManagement.widgets.delete' | translate }}\n </button>\n</ng-template>\n", styles: [".widget-modal .cds--modal-container{inline-size:75%!important;max-width:1200px!important}.widget-modal .form__row{display:flex;flex-direction:row;justify-content:space-between;align-items:flex-start}.widget-modal .form__spacer{width:32px}.widget-modal .form__element{width:100%;margin-bottom:32px}.widget-modal .form__element.--with-button{display:flex;align-items:flex-end;flex-direction:row}.widget-modal .form__element.--with-button button{margin-left:16px}.widget-modal .form__element.--readonly input{background-color:transparent}\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: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.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: i3.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "component", type: i3.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "component", type: i3.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "directive", type: i4.ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "component", type: WidgetConfigurationContainerComponent, selector: "valtimo-widget-configuration-container", inputs: ["dataSourceKey", "displayTypeKey", "disabled", "prefillConfiguration"], outputs: ["configurationEvent"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
465
+ }
466
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: WidgetModalComponent, decorators: [{
467
+ type: Component,
468
+ args: [{ standalone: false, selector: 'valtimo-widget-modal', encapsulation: ViewEncapsulation.None, 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 disabled: disabled$ | async,\n isCreate: type === 'create',\n isDelete: type === 'delete',\n isEdit: type === 'edit',\n open: open$ | async,\n } as vars\"\n>\n <ng-container\n *ngIf=\"{\n create: vars.isCreate && ('dashboardManagement.widgets.add' | translate),\n delete: vars.isDelete && ('dashboardManagement.widgets.delete' | translate),\n edit: vars.isEdit && ('dashboardManagement.widgets.edit' | translate),\n } as titles\"\n >\n <cds-modal\n *ngIf=\"{\n title: titles.edit || titles.create || titles.delete,\n } as translations\"\n valtimoCdsModal\n [open]=\"vars.open\"\n showFooter=\"true\"\n size=\"md\"\n title=\"{{ translations.title }}\"\n class=\"widget-modal\"\n (close)=\"closeModal()\"\n >\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{ translations.title }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent [cdsLayer]=\"1\">\n <ng-container *ngIf=\"vars.isDelete\">\n {{ 'dashboardManagement.widgets.deleteDescription' | translate }}</ng-container\n >\n\n <ng-container *ngIf=\"vars.isEdit || vars.isCreate\">\n <ng-container *ngTemplateOutlet=\"widgetForm; context: {vars: vars}\"></ng-container>\n </ng-container>\n </section>\n\n <cds-modal-footer>\n <ng-container *ngIf=\"vars.isEdit || vars.isCreate\">\n <ng-container *ngTemplateOutlet=\"editButtons; context: {vars: vars}\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"vars.isDelete\">\n <ng-container *ngTemplateOutlet=\"deleteButtons; context: {vars: vars}\"></ng-container>\n </ng-container>\n </cds-modal-footer>\n </cds-modal>\n </ng-container>\n</ng-container>\n\n<ng-template #widgetForm let-vars=\"vars\">\n <form\n *ngIf=\"\n form && {\n dataSourceItems: dataSourceItems$ | async,\n displayTypeDropdownDisabled: displayTypeDropdownDisabled$ | async,\n displayTypeItems: displayTypeItems$ | async,\n selectedDataSourceKey: selectedDataSourceKey$ | async,\n selectedDisplayTypeKey: selectedDisplayTypeKey$ | async,\n } as obs\n \"\n [formGroup]=\"form\"\n class=\"dashboard-modal__form\"\n >\n <div class=\"form__element\">\n <cds-label\n [helperText]=\"'dashboardManagement.widgets.form.titleHelperText' | translate\"\n [invalidText]=\"'dashboardManagement.widgets.form.titleHelperText' | translate\"\n [invalid]=\"title.dirty && title.invalid\"\n >\n {{ 'dashboardManagement.widgets.form.title' | translate }}\n\n <input\n cdsText\n formControlName=\"title\"\n [invalid]=\"title.dirty && title.invalid\"\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n </div>\n\n <div class=\"form__element\" *ngIf=\"obs.dataSourceItems\">\n <cds-dropdown\n [appendInline]=\"true\"\n formControlName=\"dataSource\"\n [helperText]=\"'dashboardManagement.widgets.form.dataSourceHelperText' | translate\"\n [invalidText]=\"'dashboardManagement.widgets.form.dateSourceHelperText' | translate\"\n [invalid]=\"dataSource.dirty && dataSource.invalid\"\n [label]=\"'dashboardManagement.widgets.form.dataSource' | translate\"\n (selected)=\"dataSourceSelected($event)\"\n >\n <cds-dropdown-list [items]=\"obs.dataSourceItems\" type=\"multi\"></cds-dropdown-list>\n </cds-dropdown>\n </div>\n\n <valtimo-widget-configuration-container\n *ngIf=\"obs.selectedDataSourceKey\"\n [dataSourceKey]=\"obs.selectedDataSourceKey\"\n [disabled]=\"vars.disabled\"\n [prefillConfiguration]=\"dataSourcePrefillConfig$ | async\"\n (configurationEvent)=\"dataSourceConfiguration($event)\"\n ></valtimo-widget-configuration-container>\n\n <div class=\"form__element\" *ngIf=\"obs.displayTypeItems\">\n <cds-dropdown\n [appendInline]=\"true\"\n formControlName=\"displayType\"\n [helperText]=\"'dashboardManagement.widgets.form.displayTypeHelperText' | translate\"\n [invalid]=\"displayType.dirty && displayType.invalid\"\n [invalidText]=\"'dashboardManagement.widgets.form.displayTypeHelperText' | translate\"\n [label]=\"'dashboardManagement.widgets.form.displayType' | translate\"\n (selected)=\"displayTypeSelected($event)\"\n >\n <cds-dropdown-list [items]=\"obs.displayTypeItems\" type=\"multi\"></cds-dropdown-list>\n </cds-dropdown>\n </div>\n\n <valtimo-widget-configuration-container\n *ngIf=\"obs.selectedDisplayTypeKey\"\n [disabled]=\"vars.disabled\"\n [displayTypeKey]=\"obs.selectedDisplayTypeKey\"\n [prefillConfiguration]=\"displayTypePrefillConfig$ | async\"\n (configurationEvent)=\"displayTypeConfiguration($event)\"\n ></valtimo-widget-configuration-container>\n\n <div class=\"form__element\">\n <cds-label\n [helperText]=\"'dashboardManagement.widgets.form.urlHelperText' | translate\"\n [invalidText]=\"'dashboardManagement.widgets.form.urlHelperText' | translate\"\n [invalid]=\"url.dirty && url.invalid\"\n >\n {{ 'dashboardManagement.widgets.form.url' | translate }}\n\n <input cdsText formControlName=\"url\" [invalid]=\"url.dirty && url.invalid\" />\n </cds-label>\n </div>\n </form>\n</ng-template>\n\n<ng-template #editButtons let-vars=\"vars\">\n <ng-container\n *ngIf=\"{\n dataSourceConfiguration: dataSourceConfiguration$ | async,\n displayTypeConfiguration: displayTypeConfiguration$ | async,\n } as obs\"\n >\n <button cdsButton=\"ghost\" [disabled]=\"vars.disabled\" (click)=\"closeModal()\">\n {{ 'dashboardManagement.widgets.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"\n form.invalid ||\n !obs.dataSourceConfiguration.valid ||\n !obs.displayTypeConfiguration.valid ||\n vars.disabled\n \"\n (click)=\"save()\"\n >\n {{ 'dashboardManagement.widgets.save' | translate }}\n </button>\n </ng-container>\n</ng-template>\n\n<ng-template #deleteButtons let-vars=\"vars\">\n <button cdsButton=\"secondary\" [disabled]=\"vars.disabled\" (click)=\"closeModal()\">\n {{ 'dashboardManagement.widgets.cancel' | translate }}\n </button>\n\n <button cdsButton=\"danger\" [disabled]=\"vars.disabled\" (click)=\"delete()\">\n {{ 'dashboardManagement.widgets.delete' | translate }}\n </button>\n</ng-template>\n", styles: [".widget-modal .cds--modal-container{inline-size:75%!important;max-width:1200px!important}.widget-modal .form__row{display:flex;flex-direction:row;justify-content:space-between;align-items:flex-start}.widget-modal .form__spacer{width:32px}.widget-modal .form__element{width:100%;margin-bottom:32px}.widget-modal .form__element.--with-button{display:flex;align-items:flex-end;flex-direction:row}.widget-modal .form__element.--with-button button{margin-left:16px}.widget-modal .form__element.--readonly input{background-color:transparent}\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"] }]
469
+ }], ctorParameters: () => [{ type: Document, decorators: [{
470
+ type: Inject,
471
+ args: [DOCUMENT]
472
+ }] }, { type: i1$1.FormBuilder }, { type: i6.TranslateService }, { type: i2.GlobalNotificationService }, { type: DashboardManagementService }, { type: i5.WidgetService }, { type: i5.WidgetTranslationService }], propDecorators: { showModal$: [{
473
+ type: Input
474
+ }], type: [{
475
+ type: Input
476
+ }], dashboard: [{
477
+ type: Input
478
+ }], widgetKey: [{
479
+ type: Input
480
+ }], editWidgetConfiguration: [{
481
+ type: Input
482
+ }], saveEvent: [{
483
+ type: Output
484
+ }] } });
485
+
486
+ /*
487
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
488
+ *
489
+ * Licensed under EUPL, Version 1.2 (the "License");
490
+ * you may not use this file except in compliance with the License.
491
+ * You may obtain a copy of the License at
492
+ *
493
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
494
+ *
495
+ * Unless required by applicable law or agreed to in writing, software
496
+ * distributed under the License is distributed on an "AS IS" basis,
497
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
498
+ * See the License for the specific language governing permissions and
499
+ * limitations under the License.
500
+ */
501
+ class EditDashboardModalComponent {
502
+ get dashboardTitle() {
503
+ return this.editDashboardForm.get('title');
504
+ }
505
+ get dashboardDescription() {
506
+ return this.editDashboardForm.get('description');
507
+ }
508
+ constructor(fb, dashboardManagementService) {
509
+ this.fb = fb;
510
+ this.dashboardManagementService = dashboardManagementService;
511
+ this.saveEvent = new EventEmitter();
512
+ this.open$ = new BehaviorSubject(false);
513
+ this.disabled$ = new BehaviorSubject(false);
514
+ this.editDashboardForm = this.fb.group({
515
+ title: this.fb.control('', [Validators.required]),
516
+ description: this.fb.control('', [Validators.required]),
517
+ });
518
+ }
519
+ ngOnInit() {
520
+ this.openOpenSubscription();
521
+ }
522
+ closeModal() {
523
+ this.open$.next(false);
524
+ setTimeout(() => {
525
+ this.editDashboardForm.reset();
526
+ }, CARBON_CONSTANTS.modalAnimationMs);
527
+ }
528
+ saveDashboard() {
529
+ this.disable();
530
+ this.dashboardManagementService
531
+ .updateDashboard({
532
+ description: this.dashboardDescription.value,
533
+ title: this.dashboardTitle.value,
534
+ key: this.dashboard.key,
535
+ })
536
+ .subscribe(() => {
537
+ this.saveEvent.emit();
538
+ this.closeModal();
539
+ });
540
+ }
541
+ setEditDashboardForm() {
542
+ if (this.dashboard) {
543
+ this.dashboardTitle?.setValue(this.dashboard.title);
544
+ this.dashboardDescription?.setValue(this.dashboard.description);
545
+ }
546
+ this.enable();
547
+ }
548
+ openOpenSubscription() {
549
+ this._openSubscription = this.showModal$.subscribe(show => {
550
+ this.setEditDashboardForm();
551
+ this.open$.next(show);
552
+ });
553
+ }
554
+ disable() {
555
+ this.disabled$.next(true);
556
+ }
557
+ enable() {
558
+ this.disabled$.next(false);
559
+ }
560
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EditDashboardModalComponent, deps: [{ token: i1$1.FormBuilder }, { token: DashboardManagementService }], target: i0.ɵɵFactoryTarget.Component }); }
561
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: EditDashboardModalComponent, isStandalone: false, selector: "valtimo-edit-dashboard-modal", inputs: { showModal$: "showModal$", dashboard: "dashboard" }, outputs: { saveEvent: "saveEvent" }, 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=\"{disabled: disabled$ | async} as obs\"\n valtimoCdsModal\n [open]=\"open$ | async\"\n showFooter=\"true\"\n title=\"{{ 'dashboardManagement.widgets.editDashboard' | translate }}\"\n class=\"edit-dashboard-modal\"\n (close)=\"closeModal()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'dashboardManagement.widgets.editDashboard' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <ng-container *ngTemplateOutlet=\"editDashboardFormTemplate;context:{obs: obs}\"></ng-container>\n </section>\n\n <cds-modal-footer>\n <ng-container *ngTemplateOutlet=\"editDashboardButtons;context:{obs: obs}\"></ng-container>\n </cds-modal-footer>\n</cds-modal>\n\n<ng-template #editDashboardFormTemplate let-obs=\"obs\">\n <form\n *ngIf=\"editDashboardForm\"\n [formGroup]=\"editDashboardForm\"\n class=\"dashboard-modal__form\"\n [cdsLayer]=\"1\"\n >\n <div class=\"form__element\">\n <cds-label\n [disabled]=\"obs.disabled\"\n [invalid]=\"dashboardTitle.dirty && dashboardTitle.invalid\"\n >\n {{ 'dashboardManagement.widgets.form.dashboardTitle' | translate }}\n\n <input\n cdsText\n [disabled]=\"obs.disabled\"\n [invalid]=\"dashboardTitle.dirty && dashboardTitle.invalid\"\n formControlName=\"title\"\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n </div>\n\n <div class=\"form__element\">\n <cds-label\n [disabled]=\"obs.disabled\"\n [helperText]=\"'dashboardManagement.widgets.form.dashboardDescriptionHelperText' | translate\"\n [invalid]=\"dashboardDescription.dirty && dashboardDescription.invalid\"\n [invalidText]=\"\n 'dashboardManagement.widgets.form.dashboardDescriptionHelperText' | translate\n \"\n >\n {{ 'dashboardManagement.widgets.form.dashboardDescription' | translate }}\n\n <input\n cdsText\n [disabled]=\"obs.disabled\"\n [invalid]=\"dashboardDescription.dirty && dashboardDescription.invalid\"\n formControlName=\"description\"\n />\n </cds-label>\n </div>\n </form>\n</ng-template>\n\n<ng-template #editDashboardButtons let-obs=\"obs\">\n <button cdsButton=\"ghost\" [disabled]=\"obs.disabled\" (click)=\"closeModal()\">\n {{ 'dashboardManagement.widgets.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"editDashboardForm.invalid || obs.disabled\"\n (click)=\"saveDashboard()\"\n >\n {{ 'dashboardManagement.widgets.complete' | translate }}\n </button>\n</ng-template>\n", styles: [".edit-dashboard-modal .form__row{display:flex;flex-direction:row;justify-content:space-between;align-items:flex-end}.edit-dashboard-modal .form__element{width:100%;margin-bottom:32px}\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: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "component", type: i3.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "directive", type: i4.ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
562
+ }
563
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EditDashboardModalComponent, decorators: [{
564
+ type: Component,
565
+ args: [{ selector: 'valtimo-edit-dashboard-modal', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, 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=\"{disabled: disabled$ | async} as obs\"\n valtimoCdsModal\n [open]=\"open$ | async\"\n showFooter=\"true\"\n title=\"{{ 'dashboardManagement.widgets.editDashboard' | translate }}\"\n class=\"edit-dashboard-modal\"\n (close)=\"closeModal()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'dashboardManagement.widgets.editDashboard' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <ng-container *ngTemplateOutlet=\"editDashboardFormTemplate;context:{obs: obs}\"></ng-container>\n </section>\n\n <cds-modal-footer>\n <ng-container *ngTemplateOutlet=\"editDashboardButtons;context:{obs: obs}\"></ng-container>\n </cds-modal-footer>\n</cds-modal>\n\n<ng-template #editDashboardFormTemplate let-obs=\"obs\">\n <form\n *ngIf=\"editDashboardForm\"\n [formGroup]=\"editDashboardForm\"\n class=\"dashboard-modal__form\"\n [cdsLayer]=\"1\"\n >\n <div class=\"form__element\">\n <cds-label\n [disabled]=\"obs.disabled\"\n [invalid]=\"dashboardTitle.dirty && dashboardTitle.invalid\"\n >\n {{ 'dashboardManagement.widgets.form.dashboardTitle' | translate }}\n\n <input\n cdsText\n [disabled]=\"obs.disabled\"\n [invalid]=\"dashboardTitle.dirty && dashboardTitle.invalid\"\n formControlName=\"title\"\n [attr.modal-primary-focus]=\"true\"\n />\n </cds-label>\n </div>\n\n <div class=\"form__element\">\n <cds-label\n [disabled]=\"obs.disabled\"\n [helperText]=\"'dashboardManagement.widgets.form.dashboardDescriptionHelperText' | translate\"\n [invalid]=\"dashboardDescription.dirty && dashboardDescription.invalid\"\n [invalidText]=\"\n 'dashboardManagement.widgets.form.dashboardDescriptionHelperText' | translate\n \"\n >\n {{ 'dashboardManagement.widgets.form.dashboardDescription' | translate }}\n\n <input\n cdsText\n [disabled]=\"obs.disabled\"\n [invalid]=\"dashboardDescription.dirty && dashboardDescription.invalid\"\n formControlName=\"description\"\n />\n </cds-label>\n </div>\n </form>\n</ng-template>\n\n<ng-template #editDashboardButtons let-obs=\"obs\">\n <button cdsButton=\"ghost\" [disabled]=\"obs.disabled\" (click)=\"closeModal()\">\n {{ 'dashboardManagement.widgets.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"editDashboardForm.invalid || obs.disabled\"\n (click)=\"saveDashboard()\"\n >\n {{ 'dashboardManagement.widgets.complete' | translate }}\n </button>\n</ng-template>\n", styles: [".edit-dashboard-modal .form__row{display:flex;flex-direction:row;justify-content:space-between;align-items:flex-end}.edit-dashboard-modal .form__element{width:100%;margin-bottom:32px}\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"] }]
566
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: DashboardManagementService }], propDecorators: { showModal$: [{
567
+ type: Input
568
+ }], dashboard: [{
569
+ type: Input
570
+ }], saveEvent: [{
571
+ type: Output
572
+ }] } });
573
+
574
+ class DashboardDetailsComponent {
575
+ constructor(dashboardManagementService, datePipe, iconService, pageTitleService, route, translateService, pageHeaderService) {
576
+ this.dashboardManagementService = dashboardManagementService;
577
+ this.datePipe = datePipe;
578
+ this.iconService = iconService;
579
+ this.pageTitleService = pageTitleService;
580
+ this.route = route;
581
+ this.translateService = translateService;
582
+ this.pageHeaderService = pageHeaderService;
583
+ this.modalType = 'create';
584
+ this.actionItems = [
585
+ {
586
+ label: 'Edit',
587
+ callback: this.editWidget.bind(this),
588
+ },
589
+ {
590
+ label: 'Duplicate',
591
+ callback: this.duplicateWidget.bind(this),
592
+ },
593
+ {
594
+ label: 'Delete',
595
+ callback: this.deleteWidget.bind(this),
596
+ type: 'danger',
597
+ },
598
+ ];
599
+ this._dashboardKey$ = this.route.params.pipe(map(params => params.id));
600
+ this._refreshDashboardSubject$ = new BehaviorSubject(null);
601
+ this.currentDashboard$ = combineLatest([
602
+ this._dashboardKey$,
603
+ this.translateService.stream('key'),
604
+ this._refreshDashboardSubject$,
605
+ ]).pipe(switchMap(([dashboardKey]) => this.dashboardManagementService.getDashboard(dashboardKey)), tap((currentDashboard) => {
606
+ if (!currentDashboard) {
607
+ return;
608
+ }
609
+ this.pageTitleService.setCustomPageTitle(currentDashboard.title);
610
+ this.pageTitleService.setCustomPageSubtitle(this.translateService.instant('dashboardManagement.widgets.metadata', {
611
+ createdBy: currentDashboard.createdBy,
612
+ createdOn: this.datePipe.transform(currentDashboard.createdOn ?? '', 'd/M/yy, H:mm'),
613
+ key: currentDashboard.key,
614
+ }));
615
+ }));
616
+ this.lastItemIndex$ = new BehaviorSubject(0);
617
+ this.loading$ = new BehaviorSubject(true);
618
+ this.dragAndDropDisabled$ = new BehaviorSubject(false);
619
+ this._refreshWidgetsSubject$ = new BehaviorSubject(null);
620
+ this._widgetData = null;
621
+ this.widgetData$ = combineLatest([
622
+ this._dashboardKey$,
623
+ this._refreshWidgetsSubject$,
624
+ ]).pipe(switchMap(([dashboardKey, refreshWidgets]) => {
625
+ if (!this._widgetData || !refreshWidgets) {
626
+ this.loading$.next(true);
627
+ return this.dashboardManagementService.getDashboardWidgetConfiguration(dashboardKey);
628
+ }
629
+ this.dragAndDropDisabled$.next(true);
630
+ return this.dashboardManagementService.updateDashboardWidgetConfigurations(dashboardKey, refreshWidgets);
631
+ }), tap((data) => {
632
+ this._widgetData = data;
633
+ this.lastItemIndex$.next(data.length - 1);
634
+ this.loading$.next(false);
635
+ this.dragAndDropDisabled$.next(false);
636
+ }));
637
+ this.jsonEditorModel$ = this.widgetData$.pipe(map((data) => ({
638
+ value: JSON.stringify(data),
639
+ language: 'json',
640
+ })));
641
+ this.showModal$ = new BehaviorSubject(false);
642
+ this.showEditDashboardModal$ = new BehaviorSubject(false);
643
+ this.editWidgetConfiguration$ = new BehaviorSubject(null);
644
+ this.compactMode$ = this.pageHeaderService.compactMode$;
645
+ this.$jsonEditorActive = signal(false);
646
+ this.$buttonTheme = computed(() => (this.$jsonEditorActive() ? 'primary' : 'ghost'));
647
+ }
648
+ ngAfterViewInit() {
649
+ this.iconService.registerAll([Code16, Edit16]);
650
+ this.setFields();
651
+ }
652
+ addWidget() {
653
+ this.editWidgetConfiguration$.next(null);
654
+ this.modalType = 'create';
655
+ this.showModal();
656
+ }
657
+ editDashboard() {
658
+ this.showEditDashboardModal();
659
+ }
660
+ refreshWidgets() {
661
+ this._refreshWidgetsSubject$.next(null);
662
+ }
663
+ refreshDashboard() {
664
+ this._refreshDashboardSubject$.next(null);
665
+ }
666
+ updateWidgetData(items) {
667
+ if (!items)
668
+ return;
669
+ this._refreshWidgetsSubject$.next(items);
670
+ }
671
+ editWidget(event) {
672
+ this.editWidgetConfiguration$.next({ ...event });
673
+ this.modalType = 'edit';
674
+ this.showModal();
675
+ }
676
+ switchView() {
677
+ this.$jsonEditorActive.set(!this.$jsonEditorActive());
678
+ if (!this.$jsonEditorActive())
679
+ this.refreshWidgets();
680
+ }
681
+ duplicateWidget(event) {
682
+ this.editWidgetConfiguration$.next({ ...event });
683
+ this.modalType = 'create';
684
+ this.showModal();
685
+ }
686
+ setFields() {
687
+ this.fields = [
688
+ {
689
+ viewType: ViewType.TEXT,
690
+ key: 'title',
691
+ label: 'Name',
692
+ },
693
+ ];
694
+ }
695
+ deleteWidget(event) {
696
+ this.editWidgetConfiguration$.next({ ...event });
697
+ this.modalType = 'delete';
698
+ this.showModal();
699
+ }
700
+ showModal() {
701
+ this.showModal$.next(true);
702
+ }
703
+ showEditDashboardModal() {
704
+ this.showEditDashboardModal$.next(true);
705
+ }
706
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardDetailsComponent, deps: [{ token: DashboardManagementService }, { token: i2$1.DatePipe }, { token: i3.IconService }, { token: i4.PageTitleService }, { token: i5$1.ActivatedRoute }, { token: i6.TranslateService }, { token: i4.PageHeaderService }], target: i0.ɵɵFactoryTarget.Component }); }
707
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: DashboardDetailsComponent, isStandalone: false, 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 fields && {\n currentDashboard: currentDashboard$ | async,\n editWidgetConfiguration: editWidgetConfiguration$ | async,\n loading: loading$ | async,\n widgetData: widgetData$ | async,\n dragAndDropDisabled: dragAndDropDisabled$ | async,\n jsonEditorModel: jsonEditorModel$ | async,\n } as obs\n \"\n>\n <div class=\"dashboard-detail-table\">\n @if (!$jsonEditorActive()) {\n <valtimo-carbon-list\n [actionItems]=\"actionItems\"\n [fields]=\"fields\"\n [header]=\"false\"\n [items]=\"obs.widgetData\"\n [loading]=\"obs.loading\"\n [dragAndDrop]=\"true\"\n [dragAndDropDisabled]=\"obs.dragAndDropDisabled\"\n (itemsReordered)=\"updateWidgetData($event)\"\n (rowClicked)=\"editWidget($event)\"\n >\n <div carbonToolbarContent>\n <ng-container [ngTemplateOutlet]=\"viewToggle\"></ng-container>\n\n <ng-container [ngTemplateOutlet]=\"addWidgetButton\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"addWidgetButton\"\n description=\"{{ 'dashboardManagement.widgets.noResults.description' | translate }}\"\n title=\"{{ 'dashboardManagement.widgets.noResults.title' | translate }}\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n } @else {\n <valtimo-json-editor\n [model]=\"obs.jsonEditorModel\"\n [fitPage]=\"true\"\n [fitPageSpaceAdjustment]=\"56\"\n (saveEvent)=\"updateWidgetData($event)\"\n >\n <ng-container *ngTemplateOutlet=\"viewToggle\"></ng-container>\n </valtimo-json-editor>\n }\n </div>\n\n <valtimo-widget-modal\n [dashboard]=\"obs.currentDashboard\"\n [editWidgetConfiguration]=\"obs.editWidgetConfiguration\"\n [showModal$]=\"showModal$\"\n [type]=\"modalType\"\n [widgetKey]=\"obs.editWidgetConfiguration?.key\"\n (saveEvent)=\"refreshWidgets()\"\n ></valtimo-widget-modal>\n\n <valtimo-edit-dashboard-modal\n [dashboard]=\"obs.currentDashboard\"\n [showModal$]=\"showEditDashboardModal$\"\n (saveEvent)=\"refreshDashboard()\"\n >\n </valtimo-edit-dashboard-modal>\n</ng-container>\n\n<ng-container renderInPageHeader>\n <ng-template>\n <button\n cdsButton=\"tertiary\"\n [size]=\"(compactMode$ | async) ? 'sm' : 'md'\"\n (click)=\"editDashboard()\"\n >\n {{ 'dashboardManagement.widgets.editButton' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"edit\" size=\"16\"></svg>\n </button>\n </ng-template>\n</ng-container>\n\n<ng-template #addWidgetButton>\n <button cdsButton=\"primary\" [disabled]=\"loading$ | async\" (click)=\"addWidget()\">\n {{ 'dashboardManagement.widgets.add' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #viewToggle>\n <cds-tooltip [description]=\"'JSON editor'\">\n <button\n [cdsButton]=\"$buttonTheme()\"\n data-testid=\"dashboard-details-switch-view\"\n iconOnly=\"true\"\n (click)=\"switchView()\"\n >\n <svg cdsIcon=\"code\" size=\"16\"></svg>\n </button>\n </cds-tooltip>\n</ng-template>\n", styles: [".dashboard-detail-table .move-buttons-container{width:100%;justify-content:flex-end;display:flex;flex-direction:row;right:-1rem;position:relative}.dashboard-detail-table .move-buttons-container button:not(:last-child){margin-right:8px}.dashboard-detail-table__actions{width:1px}.dashboard-detail-table-no-results{display:flex;justify-content:space-around;padding:6.25rem 0;gap:4rem}.dashboard-detail-table-no-results__title{font-size:1.75rem}.dashboard-detail-table-no-results__content{display:flex;flex-direction:column;justify-content:space-around}\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: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i4.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: i4.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "component", type: i4.JsonEditorComponent, selector: "valtimo-json-editor", inputs: ["disabled", "model", "editorOptions", "fitPage", "fitPageSpaceAdjustment", "formatOnLoad", "heightPx", "heightStyle", "jsonSchema", "showEditButton", "widthPx"], outputs: ["changeEvent", "discardEvent", "keepEditingEvent", "saveEvent"] }, { kind: "component", type: WidgetModalComponent, selector: "valtimo-widget-modal", inputs: ["showModal$", "type", "dashboard", "widgetKey", "editWidgetConfiguration"], outputs: ["saveEvent"] }, { kind: "component", type: EditDashboardModalComponent, selector: "valtimo-edit-dashboard-modal", inputs: ["showModal$", "dashboard"], outputs: ["saveEvent"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
708
+ }
709
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardDetailsComponent, decorators: [{
710
+ type: Component,
711
+ args: [{ standalone: false, encapsulation: ViewEncapsulation.None, 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 fields && {\n currentDashboard: currentDashboard$ | async,\n editWidgetConfiguration: editWidgetConfiguration$ | async,\n loading: loading$ | async,\n widgetData: widgetData$ | async,\n dragAndDropDisabled: dragAndDropDisabled$ | async,\n jsonEditorModel: jsonEditorModel$ | async,\n } as obs\n \"\n>\n <div class=\"dashboard-detail-table\">\n @if (!$jsonEditorActive()) {\n <valtimo-carbon-list\n [actionItems]=\"actionItems\"\n [fields]=\"fields\"\n [header]=\"false\"\n [items]=\"obs.widgetData\"\n [loading]=\"obs.loading\"\n [dragAndDrop]=\"true\"\n [dragAndDropDisabled]=\"obs.dragAndDropDisabled\"\n (itemsReordered)=\"updateWidgetData($event)\"\n (rowClicked)=\"editWidget($event)\"\n >\n <div carbonToolbarContent>\n <ng-container [ngTemplateOutlet]=\"viewToggle\"></ng-container>\n\n <ng-container [ngTemplateOutlet]=\"addWidgetButton\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"addWidgetButton\"\n description=\"{{ 'dashboardManagement.widgets.noResults.description' | translate }}\"\n title=\"{{ 'dashboardManagement.widgets.noResults.title' | translate }}\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n } @else {\n <valtimo-json-editor\n [model]=\"obs.jsonEditorModel\"\n [fitPage]=\"true\"\n [fitPageSpaceAdjustment]=\"56\"\n (saveEvent)=\"updateWidgetData($event)\"\n >\n <ng-container *ngTemplateOutlet=\"viewToggle\"></ng-container>\n </valtimo-json-editor>\n }\n </div>\n\n <valtimo-widget-modal\n [dashboard]=\"obs.currentDashboard\"\n [editWidgetConfiguration]=\"obs.editWidgetConfiguration\"\n [showModal$]=\"showModal$\"\n [type]=\"modalType\"\n [widgetKey]=\"obs.editWidgetConfiguration?.key\"\n (saveEvent)=\"refreshWidgets()\"\n ></valtimo-widget-modal>\n\n <valtimo-edit-dashboard-modal\n [dashboard]=\"obs.currentDashboard\"\n [showModal$]=\"showEditDashboardModal$\"\n (saveEvent)=\"refreshDashboard()\"\n >\n </valtimo-edit-dashboard-modal>\n</ng-container>\n\n<ng-container renderInPageHeader>\n <ng-template>\n <button\n cdsButton=\"tertiary\"\n [size]=\"(compactMode$ | async) ? 'sm' : 'md'\"\n (click)=\"editDashboard()\"\n >\n {{ 'dashboardManagement.widgets.editButton' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"edit\" size=\"16\"></svg>\n </button>\n </ng-template>\n</ng-container>\n\n<ng-template #addWidgetButton>\n <button cdsButton=\"primary\" [disabled]=\"loading$ | async\" (click)=\"addWidget()\">\n {{ 'dashboardManagement.widgets.add' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #viewToggle>\n <cds-tooltip [description]=\"'JSON editor'\">\n <button\n [cdsButton]=\"$buttonTheme()\"\n data-testid=\"dashboard-details-switch-view\"\n iconOnly=\"true\"\n (click)=\"switchView()\"\n >\n <svg cdsIcon=\"code\" size=\"16\"></svg>\n </button>\n </cds-tooltip>\n</ng-template>\n", styles: [".dashboard-detail-table .move-buttons-container{width:100%;justify-content:flex-end;display:flex;flex-direction:row;right:-1rem;position:relative}.dashboard-detail-table .move-buttons-container button:not(:last-child){margin-right:8px}.dashboard-detail-table__actions{width:1px}.dashboard-detail-table-no-results{display:flex;justify-content:space-around;padding:6.25rem 0;gap:4rem}.dashboard-detail-table-no-results__title{font-size:1.75rem}.dashboard-detail-table-no-results__content{display:flex;flex-direction:column;justify-content:space-around}\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"] }]
712
+ }], ctorParameters: () => [{ type: DashboardManagementService }, { type: i2$1.DatePipe }, { type: i3.IconService }, { type: i4.PageTitleService }, { type: i5$1.ActivatedRoute }, { type: i6.TranslateService }, { type: i4.PageHeaderService }] });
713
+
714
+ /*
715
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
716
+ *
717
+ * Licensed under EUPL, Version 1.2 (the "License");
718
+ * you may not use this file except in compliance with the License.
719
+ * You may obtain a copy of the License at
720
+ *
721
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
722
+ *
723
+ * Unless required by applicable law or agreed to in writing, software
724
+ * distributed under the License is distributed on an "AS IS" basis,
725
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
726
+ * See the License for the specific language governing permissions and
727
+ * limitations under the License.
728
+ */
729
+ class DashboardManagementComponent {
730
+ constructor(dashboardManagementService, fb, router) {
731
+ this.dashboardManagementService = dashboardManagementService;
732
+ this.fb = fb;
733
+ this.router = router;
734
+ this.deleteRowKey$ = new BehaviorSubject('');
735
+ this.openModal$ = new BehaviorSubject(false);
736
+ this.showDeleteModal$ = new BehaviorSubject(false);
737
+ this.tableData$ = this.dashboardManagementService.dashboards$;
738
+ this.fields = [
739
+ {
740
+ viewType: ViewType.TEXT,
741
+ key: 'title',
742
+ label: 'dashboardManagement.name',
743
+ },
744
+ {
745
+ viewType: ViewType.TEXT,
746
+ key: 'description',
747
+ label: 'dashboardManagement.description',
748
+ },
749
+ {
750
+ viewType: ViewType.TEXT,
751
+ key: 'key',
752
+ label: 'dashboardManagement.key',
753
+ },
754
+ ];
755
+ this.actionItems = [
756
+ {
757
+ label: 'interface.delete',
758
+ callback: this.deleteDashboard.bind(this),
759
+ type: 'danger',
760
+ },
761
+ ];
762
+ }
763
+ ngOnInit() {
764
+ this.dashboardManagementService.loadData();
765
+ this.form = this.fb.group({
766
+ description: this.fb.control('', [Validators.required]),
767
+ title: this.fb.control('', [Validators.required]),
768
+ });
769
+ }
770
+ closeModal() {
771
+ this.openModal$.next(false);
772
+ this.form.reset();
773
+ }
774
+ createDashboard() {
775
+ const control = this.form.get('title');
776
+ if (!control || !control.valid) {
777
+ return;
778
+ }
779
+ const newDashboard = this.form.getRawValue();
780
+ this.dashboardManagementService.dispatchAction(this.dashboardManagementService.createDashboard(newDashboard).pipe(finalize(() => {
781
+ this.closeModal();
782
+ })));
783
+ }
784
+ onConfirmEvent(dashboardKey) {
785
+ this.dashboardManagementService.dispatchAction(this.dashboardManagementService.deleteDashboard(dashboardKey).pipe(finalize(() => {
786
+ this.closeModal();
787
+ })));
788
+ }
789
+ getControlInvalid(controlKey) {
790
+ const control = this.form.get(controlKey);
791
+ if (!control) {
792
+ return true;
793
+ }
794
+ return !control.valid && !control.pristine;
795
+ }
796
+ openModal() {
797
+ this.openModal$.next(true);
798
+ }
799
+ onRowClick(item) {
800
+ this.router.navigate([`/dashboard-management/${item.key}`]);
801
+ }
802
+ deleteDashboard(dashboard) {
803
+ this.deleteRowKey$.next(dashboard.key);
804
+ this.showDeleteModal$.next(true);
805
+ }
806
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementComponent, deps: [{ token: DashboardManagementService }, { token: i1$1.FormBuilder }, { token: i5$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
807
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: DashboardManagementComponent, isStandalone: false, 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 *ngIf=\"tableData$ | async as data\">\n <valtimo-carbon-list\n [actionItems]=\"actionItems\"\n [header]=\"false\"\n [items]=\"data.items\"\n [loading]=\"data.loading\"\n [fields]=\"fields\"\n (rowClicked)=\"onRowClick($event)\"\n class=\"valtimo-dashboard-management__table\"\n >\n <div carbonToolbarContent>\n <ng-container [ngTemplateOutlet]=\"addDashboardButton\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"addDashboardButton\"\n description=\"{{ 'dashboardManagement.noResults.description' | translate }}\"\n title=\"{{ 'dashboardManagement.noResults.title' | translate }}\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n</ng-container>\n\n<cds-modal\n valtimoCdsModal\n [open]=\"openModal$ | async\"\n showFooter=\"true\"\n title=\"{{ 'dashboardManagement.addDashboard' | translate }}\"\n (close)=\"closeModal()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'dashboardManagement.addDashboard' | translate }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <form [formGroup]=\"form\" class=\"valtimo-dashboard-management__form\">\n <cds-label [invalid]=\"getControlInvalid('title')\">\n {{ 'dashboardManagement.addModal.name' | translate }}\n\n <input\n [attr.modal-primary-focus]=\"true\"\n [invalid]=\"getControlInvalid('title')\"\n formControlName=\"title\"\n cdsText\n placeholder=\"{{ 'dashboardManagement.addModal.namePlaceholder' | translate }}\"\n />\n </cds-label>\n\n <cds-label\n [helperText]=\"'dashboardManagement.addModal.descriptionHelperText' | translate\"\n [invalid]=\"getControlInvalid('description')\"\n >\n {{ 'dashboardManagement.description' | translate }}\n\n <input\n [invalid]=\"getControlInvalid('description')\"\n formControlName=\"description\"\n cdsText\n placeholder=\"{{ 'dashboardManagement.addModal.descriptionPlaceholder' | translate }}\"\n />\n </cds-label>\n </form>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'dashboardManagement.cancel' | translate }}\n </button>\n\n <button [disabled]=\"this.form.invalid\" cdsButton=\"primary\" (click)=\"createDashboard()\">\n {{ 'dashboardManagement.create' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"dashboardManagement.deleteModal.confirm\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"dashboardManagement.deleteModalContent\"\n [outputOnConfirm]=\"deleteRowKey$ | async\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"dashboardManagement.delete\"\n (confirmEvent)=\"onConfirmEvent($event)\"\n></valtimo-confirmation-modal>\n\n<ng-template #addDashboardButton>\n <button cdsButton=\"primary\" (click)=\"openModal()\">\n {{ 'dashboardManagement.addDashboard' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n", styles: [".valtimo-dashboard-management__actions{width:1px}.valtimo-dashboard-management__form>*:not(:last-child){margin-bottom:32px}\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: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "component", type: i3.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.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: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i4.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: i4.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "directive", type: i4.ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
808
+ }
809
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementComponent, decorators: [{
810
+ type: Component,
811
+ args: [{ standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, 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 *ngIf=\"tableData$ | async as data\">\n <valtimo-carbon-list\n [actionItems]=\"actionItems\"\n [header]=\"false\"\n [items]=\"data.items\"\n [loading]=\"data.loading\"\n [fields]=\"fields\"\n (rowClicked)=\"onRowClick($event)\"\n class=\"valtimo-dashboard-management__table\"\n >\n <div carbonToolbarContent>\n <ng-container [ngTemplateOutlet]=\"addDashboardButton\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"addDashboardButton\"\n description=\"{{ 'dashboardManagement.noResults.description' | translate }}\"\n title=\"{{ 'dashboardManagement.noResults.title' | translate }}\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n</ng-container>\n\n<cds-modal\n valtimoCdsModal\n [open]=\"openModal$ | async\"\n showFooter=\"true\"\n title=\"{{ 'dashboardManagement.addDashboard' | translate }}\"\n (close)=\"closeModal()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'dashboardManagement.addDashboard' | translate }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <form [formGroup]=\"form\" class=\"valtimo-dashboard-management__form\">\n <cds-label [invalid]=\"getControlInvalid('title')\">\n {{ 'dashboardManagement.addModal.name' | translate }}\n\n <input\n [attr.modal-primary-focus]=\"true\"\n [invalid]=\"getControlInvalid('title')\"\n formControlName=\"title\"\n cdsText\n placeholder=\"{{ 'dashboardManagement.addModal.namePlaceholder' | translate }}\"\n />\n </cds-label>\n\n <cds-label\n [helperText]=\"'dashboardManagement.addModal.descriptionHelperText' | translate\"\n [invalid]=\"getControlInvalid('description')\"\n >\n {{ 'dashboardManagement.description' | translate }}\n\n <input\n [invalid]=\"getControlInvalid('description')\"\n formControlName=\"description\"\n cdsText\n placeholder=\"{{ 'dashboardManagement.addModal.descriptionPlaceholder' | translate }}\"\n />\n </cds-label>\n </form>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'dashboardManagement.cancel' | translate }}\n </button>\n\n <button [disabled]=\"this.form.invalid\" cdsButton=\"primary\" (click)=\"createDashboard()\">\n {{ 'dashboardManagement.create' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"dashboardManagement.deleteModal.confirm\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"dashboardManagement.deleteModalContent\"\n [outputOnConfirm]=\"deleteRowKey$ | async\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"dashboardManagement.delete\"\n (confirmEvent)=\"onConfirmEvent($event)\"\n></valtimo-confirmation-modal>\n\n<ng-template #addDashboardButton>\n <button cdsButton=\"primary\" (click)=\"openModal()\">\n {{ 'dashboardManagement.addDashboard' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n", styles: [".valtimo-dashboard-management__actions{width:1px}.valtimo-dashboard-management__form>*:not(:last-child){margin-bottom:32px}\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"] }]
812
+ }], ctorParameters: () => [{ type: DashboardManagementService }, { type: i1$1.FormBuilder }, { type: i5$1.Router }] });
813
+
814
+ /*
815
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
816
+ *
817
+ * Licensed under EUPL, Version 1.2 (the "License");
818
+ * you may not use this file except in compliance with the License.
819
+ * You may obtain a copy of the License at
820
+ *
821
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
822
+ *
823
+ * Unless required by applicable law or agreed to in writing, software
824
+ * distributed under the License is distributed on an "AS IS" basis,
825
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
826
+ * See the License for the specific language governing permissions and
827
+ * limitations under the License.
828
+ */
829
+ const routes = [
830
+ {
831
+ path: 'dashboard-management',
832
+ component: DashboardManagementComponent,
833
+ canActivate: [AuthGuardService],
834
+ data: { title: 'Dashboard configuration', roles: [ROLE_ADMIN] },
835
+ },
836
+ {
837
+ path: 'dashboard-management/:id',
838
+ component: DashboardDetailsComponent,
839
+ canActivate: [AuthGuardService],
840
+ data: {
841
+ title: 'Dashboard details',
842
+ roles: [ROLE_ADMIN],
843
+ customPageTitle: true,
844
+ customPageSubtitle: true,
845
+ },
846
+ },
847
+ ];
848
+ class DashboardManagementRoutingModule {
849
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
850
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementRoutingModule, imports: [i5$1.RouterModule], exports: [RouterModule] }); }
851
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementRoutingModule, imports: [RouterModule.forRoot(routes), RouterModule] }); }
852
+ }
853
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementRoutingModule, decorators: [{
854
+ type: NgModule,
855
+ args: [{
856
+ imports: [RouterModule.forRoot(routes)],
857
+ exports: [RouterModule],
858
+ declarations: [],
859
+ }]
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 DashboardManagementModule {
878
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
879
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementModule, declarations: [DashboardManagementComponent,
880
+ DashboardDetailsComponent,
881
+ WidgetModalComponent,
882
+ EditDashboardModalComponent,
883
+ WidgetConfigurationContainerComponent], imports: [ButtonModule,
884
+ CommonModule,
885
+ DashboardManagementRoutingModule,
886
+ DropdownModule,
887
+ InputModule,
888
+ ModalModule,
889
+ ReactiveFormsModule,
890
+ SpinnerModule,
891
+ TranslateModule,
892
+ RenderInPageHeaderDirective,
893
+ ConfirmationModalModule,
894
+ NotificationModule,
895
+ IconModule,
896
+ WidgetTranslatePipeModule,
897
+ CarbonListModule,
898
+ LayerModule,
899
+ ValtimoCdsModalDirective,
900
+ JsonEditorComponent] }); }
901
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementModule, imports: [ButtonModule,
902
+ CommonModule,
903
+ DashboardManagementRoutingModule,
904
+ DropdownModule,
905
+ InputModule,
906
+ ModalModule,
907
+ ReactiveFormsModule,
908
+ SpinnerModule,
909
+ TranslateModule,
910
+ ConfirmationModalModule,
911
+ NotificationModule,
912
+ IconModule,
913
+ WidgetTranslatePipeModule,
914
+ CarbonListModule,
915
+ LayerModule,
916
+ JsonEditorComponent] }); }
917
+ }
918
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DashboardManagementModule, decorators: [{
919
+ type: NgModule,
920
+ args: [{
921
+ declarations: [
922
+ DashboardManagementComponent,
923
+ DashboardDetailsComponent,
924
+ WidgetModalComponent,
925
+ EditDashboardModalComponent,
926
+ WidgetConfigurationContainerComponent,
927
+ ],
928
+ imports: [
929
+ ButtonModule,
930
+ CommonModule,
931
+ DashboardManagementRoutingModule,
932
+ DropdownModule,
933
+ InputModule,
934
+ ModalModule,
935
+ ReactiveFormsModule,
936
+ SpinnerModule,
937
+ TranslateModule,
938
+ RenderInPageHeaderDirective,
939
+ ConfirmationModalModule,
940
+ NotificationModule,
941
+ IconModule,
942
+ WidgetTranslatePipeModule,
943
+ CarbonListModule,
944
+ LayerModule,
945
+ ValtimoCdsModalDirective,
946
+ JsonEditorComponent,
947
+ ],
948
+ exports: [],
949
+ }]
950
+ }] });
951
+
952
+ /*
953
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
954
+ *
955
+ * Licensed under EUPL, Version 1.2 (the "License");
956
+ * you may not use this file except in compliance with the License.
957
+ * You may obtain a copy of the License at
958
+ *
959
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
960
+ *
961
+ * Unless required by applicable law or agreed to in writing, software
962
+ * distributed under the License is distributed on an "AS IS" basis,
963
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
964
+ * See the License for the specific language governing permissions and
965
+ * limitations under the License.
966
+ */
967
+ /*
968
+ * Public API Surface of dashboard-management
969
+ */
970
+
971
+ /**
972
+ * Generated bundle index. Do not edit.
973
+ */
974
+
975
+ export { DashboardManagementModule };
976
+ //# sourceMappingURL=valtimo-dashboard-management.mjs.map