@valtimo/building-block-management 13.13.0 → 13.15.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.
@@ -1,13 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Component, Input, signal, ChangeDetectionStrategy, ViewChild, Inject, NgModule } from '@angular/core';
2
+ import { Injectable, Component, Input, signal, ChangeDetectionStrategy, ViewChild, Inject, Optional, NgModule } from '@angular/core';
3
3
  import * as i4 from '@angular/common';
4
4
  import { CommonModule, DOCUMENT } from '@angular/common';
5
5
  import * as i2$1 from '@valtimo/components';
6
6
  import { runAfterCarbonModalClosed, ValtimoCdsModalDirective, AutoKeyInputComponent, TooltipIconModule, CARBON_CONSTANTS, ViewType, CarbonListModule, ReadOnlyDirective, ConfirmationModalModule, RenderInBodyComponent, MuuriDirectiveModule, SchemaEditorComponent, FitPageDirective, ValtimoCdsOverflowButtonDirective, RenderInPageHeaderDirective } from '@valtimo/components';
7
7
  import * as i2 from '@angular/common/http';
8
- import { HttpHeaders } from '@angular/common/http';
8
+ import { HttpHeaders, HttpErrorResponse } from '@angular/common/http';
9
9
  import * as i1 from '@valtimo/shared';
10
- import { BaseApiService, InterceptorSkip, ROLE_ADMIN } from '@valtimo/shared';
10
+ import { BaseApiService, InterceptorSkip, BUILDING_BLOCK_MANAGEMENT_TAB_TOKEN, ROLE_ADMIN } from '@valtimo/shared';
11
11
  import { catchError, of, filter, switchMap, map, tap, distinctUntilChanged, BehaviorSubject, Subscription, combineLatest, take, startWith, from, finalize } from 'rxjs';
12
12
  import { isEqual } from 'lodash';
13
13
  import * as i3 from '@angular/router';
@@ -1141,6 +1141,8 @@ class BuildingBlockManagementProcessUploadComponent {
1141
1141
  this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
1142
1142
  this.translateService = translateService;
1143
1143
  this.modalOpen$ = this.buildingBlockManagementDetailService.showProcessDefinitionUploadModal$;
1144
+ this.showReplaceConfirmationModal$ = new BehaviorSubject(false);
1145
+ this.replaceModalContent = '';
1144
1146
  this.ACCEPTED_FILES = ['bpmn'];
1145
1147
  this.form = this.formBuilder.group({
1146
1148
  file: this.formBuilder.control(new Set(), [Validators.required]),
@@ -1153,12 +1155,12 @@ class BuildingBlockManagementProcessUploadComponent {
1153
1155
  this.form.reset();
1154
1156
  }, CARBON_CONSTANTS.modalAnimationMs);
1155
1157
  }
1156
- uploadProcessBpmn() {
1158
+ uploadProcessBpmn(replace = false) {
1157
1159
  const bpmnFile = this.form.value?.file?.values()?.next()?.value?.file;
1158
1160
  if (!bpmnFile)
1159
1161
  return;
1160
1162
  from(bpmnFile.text())
1161
- .pipe(switchMap(bpmnXml => this.processLinkService.deployProcessWithProcessLinksForBuildingBlock([], null, `${bpmnXml}`, this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag)))
1163
+ .pipe(switchMap(bpmnXml => this.processLinkService.deployProcessWithProcessLinksForBuildingBlock([], null, `${bpmnXml}`, this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, replace)))
1162
1164
  .subscribe({
1163
1165
  next: () => {
1164
1166
  this.notificationService.showNotification({
@@ -1168,7 +1170,13 @@ class BuildingBlockManagementProcessUploadComponent {
1168
1170
  this.closeModal();
1169
1171
  this.buildingBlockManagementDetailService.reloadProcessDefinitions();
1170
1172
  },
1171
- error: () => {
1173
+ error: (error) => {
1174
+ const duplicateKey = error instanceof HttpErrorResponse && error.status === 409;
1175
+ if (duplicateKey) {
1176
+ this.replaceModalContent = this.buildReplaceModalContent(error);
1177
+ this.showReplaceConfirmationModal$.next(true);
1178
+ return;
1179
+ }
1172
1180
  this.notificationService.showNotification({
1173
1181
  type: 'error',
1174
1182
  title: this.translateService.instant('processManagement.upload.failure'),
@@ -1176,8 +1184,39 @@ class BuildingBlockManagementProcessUploadComponent {
1176
1184
  },
1177
1185
  });
1178
1186
  }
1187
+ confirmReplace() {
1188
+ this.replaceModalContent = '';
1189
+ this.uploadProcessBpmn(true);
1190
+ }
1191
+ clearReplaceModal() {
1192
+ this.replaceModalContent = '';
1193
+ }
1194
+ getDuplicateKeyMessage(error) {
1195
+ const response = error.error;
1196
+ const duplicates = response?.duplicateProcessDefinitions || response?.parameters?.duplicateProcessDefinitions;
1197
+ if (Array.isArray(duplicates) && duplicates.length > 0) {
1198
+ const duplicateList = duplicates
1199
+ .map(item => {
1200
+ if (!item?.key)
1201
+ return null;
1202
+ return item.name ? `${item.key} (${item.name})` : item.key;
1203
+ })
1204
+ .filter(Boolean)
1205
+ .join(', ');
1206
+ if (duplicateList) {
1207
+ return this.translateService.instant('processManagement.upload.replaceContentWithDuplicates', {
1208
+ duplicates: duplicateList,
1209
+ });
1210
+ }
1211
+ }
1212
+ return null;
1213
+ }
1214
+ buildReplaceModalContent(error) {
1215
+ return (this.getDuplicateKeyMessage(error) ||
1216
+ this.translateService.instant('processManagement.upload.replaceContent'));
1217
+ }
1179
1218
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementProcessUploadComponent, deps: [{ token: i2$2.FormBuilder }, { token: i1.GlobalNotificationService }, { token: i3$2.ProcessLinkService }, { token: BuildingBlockManagementDetailService }, { token: i4$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
1180
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BuildingBlockManagementProcessUploadComponent, isStandalone: true, selector: "valtimo-building-block-management-process-upload", 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 valtimoCdsModal [open]=\"modalOpen$ | async\" size=\"sm\" (close)=\"closeModal()\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'processManagement.upload.modalTitle' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"ACCEPTED_FILES\"\n [buttonText]=\"'processManagement.upload.buttonText' | translate\"\n [description]=\"'processManagement.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'processManagement.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"(fileSelected$ | async) === false\"\n (click)=\"uploadProcessBpmn()\"\n >\n {{ 'interface.upload' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: FileUploaderModule }, { kind: "component", type: i3$1.FileUploader, selector: "cds-file-uploader, ibm-file-uploader", inputs: ["buttonText", "buttonType", "title", "description", "accept", "multiple", "skeleton", "size", "fileItemSize", "drop", "dropText", "fileUploaderId", "files", "disabled"], outputs: ["filesChange"] }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i3$1.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3$1.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3$1.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3$1.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3$1.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i3$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1219
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BuildingBlockManagementProcessUploadComponent, isStandalone: true, selector: "valtimo-building-block-management-process-upload", 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 valtimoCdsModal [open]=\"modalOpen$ | async\" size=\"sm\" (close)=\"closeModal()\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'processManagement.upload.modalTitle' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"ACCEPTED_FILES\"\n [buttonText]=\"'processManagement.upload.buttonText' | translate\"\n [description]=\"'processManagement.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'processManagement.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"(fileSelected$ | async) === false\"\n (click)=\"uploadProcessBpmn()\"\n >\n {{ 'interface.upload' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n\n<valtimo-render-in-body>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"processManagement.upload.replaceConfirm\"\n confirmButtonType=\"danger\"\n cancelButtonTextTranslationKey=\"interface.cancel\"\n [content]=\"replaceModalContent\"\n [showModalSubject$]=\"showReplaceConfirmationModal$\"\n titleTranslationKey=\"processManagement.upload.replaceTitle\"\n (confirmEvent)=\"confirmReplace()\"\n (cancelEvent)=\"clearReplaceModal()\"\n ></valtimo-confirmation-modal>\n</valtimo-render-in-body>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: FileUploaderModule }, { kind: "component", type: i3$1.FileUploader, selector: "cds-file-uploader, ibm-file-uploader", inputs: ["buttonText", "buttonType", "title", "description", "accept", "multiple", "skeleton", "size", "fileItemSize", "drop", "dropText", "fileUploaderId", "files", "disabled"], outputs: ["filesChange"] }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i3$1.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3$1.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3$1.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3$1.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3$1.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i3$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i2$1.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }, { kind: "component", type: RenderInBodyComponent, selector: "valtimo-render-in-body" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1181
1220
  }
1182
1221
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementProcessUploadComponent, decorators: [{
1183
1222
  type: Component,
@@ -1189,7 +1228,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
1189
1228
  LayerModule,
1190
1229
  ReactiveFormsModule,
1191
1230
  ButtonModule,
1192
- ], 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 valtimoCdsModal [open]=\"modalOpen$ | async\" size=\"sm\" (close)=\"closeModal()\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'processManagement.upload.modalTitle' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"ACCEPTED_FILES\"\n [buttonText]=\"'processManagement.upload.buttonText' | translate\"\n [description]=\"'processManagement.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'processManagement.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"(fileSelected$ | async) === false\"\n (click)=\"uploadProcessBpmn()\"\n >\n {{ 'interface.upload' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n" }]
1231
+ ConfirmationModalModule,
1232
+ RenderInBodyComponent,
1233
+ ], 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 valtimoCdsModal [open]=\"modalOpen$ | async\" size=\"sm\" (close)=\"closeModal()\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'processManagement.upload.modalTitle' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"ACCEPTED_FILES\"\n [buttonText]=\"'processManagement.upload.buttonText' | translate\"\n [description]=\"'processManagement.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'processManagement.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"(fileSelected$ | async) === false\"\n (click)=\"uploadProcessBpmn()\"\n >\n {{ 'interface.upload' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n\n<valtimo-render-in-body>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"processManagement.upload.replaceConfirm\"\n confirmButtonType=\"danger\"\n cancelButtonTextTranslationKey=\"interface.cancel\"\n [content]=\"replaceModalContent\"\n [showModalSubject$]=\"showReplaceConfirmationModal$\"\n titleTranslationKey=\"processManagement.upload.replaceTitle\"\n (confirmEvent)=\"confirmReplace()\"\n (cancelEvent)=\"clearReplaceModal()\"\n ></valtimo-confirmation-modal>\n</valtimo-render-in-body>\n" }]
1193
1234
  }], ctorParameters: () => [{ type: i2$2.FormBuilder }, { type: i1.GlobalNotificationService }, { type: i3$2.ProcessLinkService }, { type: BuildingBlockManagementDetailService }, { type: i4$1.TranslateService }] });
1194
1235
 
1195
1236
  /*
@@ -1580,14 +1621,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
1580
1621
  * limitations under the License.
1581
1622
  */
1582
1623
  class BuildingBlockManagementDetailComponent {
1583
- constructor(route, buildingBlockManagementDetailService, pageTitleService) {
1624
+ constructor(route, buildingBlockManagementDetailService, pageTitleService, buildingBlockManagementTabConfig) {
1584
1625
  this.route = route;
1585
1626
  this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
1586
1627
  this.pageTitleService = pageTitleService;
1628
+ this.buildingBlockManagementTabConfig = buildingBlockManagementTabConfig;
1587
1629
  this.BUILDING_BLOCK_MANAGEMENT_TABS = BUILDING_BLOCK_MANAGEMENT_TABS;
1588
1630
  this.activeTabKey$ = this.buildingBlockManagementDetailService.activeTabKey$;
1589
1631
  this.buildingBlockManagementDetailService.setRoute(this.route);
1590
1632
  }
1633
+ get customTabs() {
1634
+ return this.toArray(this.buildingBlockManagementTabConfig).map(tab => ({
1635
+ ...tab,
1636
+ enabled$: tab.enabled$ ?? of(true),
1637
+ }));
1638
+ }
1591
1639
  ngOnInit() {
1592
1640
  this.pageTitleService.disableReset();
1593
1641
  }
@@ -1601,8 +1649,15 @@ class BuildingBlockManagementDetailComponent {
1601
1649
  this.buildingBlockManagementDetailService.navigateToTab(tabKey);
1602
1650
  });
1603
1651
  }
1604
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementDetailComponent, deps: [{ token: i3.ActivatedRoute }, { token: BuildingBlockManagementDetailService }, { token: i2$1.PageTitleService }], target: i0.ɵɵFactoryTarget.Component }); }
1605
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BuildingBlockManagementDetailComponent, isStandalone: true, selector: "valtimo-building-block-management-detail", providers: [BuildingBlockManagementDetailService], 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-tabs *ngIf=\"activeTabKey$ | async as activeTabKey\" type=\"line\">\n <cds-tab\n *ngIf=\"{active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL} as obs\"\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.general' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL)\"\n >\n <valtimo-building-block-management-general\n *ngIf=\"obs.active\"\n ></valtimo-building-block-management-general>\n </cds-tab>\n\n <cds-tab\n *ngIf=\"{active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.DOCUMENT} as obs\"\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.document' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.DOCUMENT)\"\n >\n <valtimo-building-block-management-document\n *ngIf=\"obs.active\"\n ></valtimo-building-block-management-document>\n </cds-tab>\n\n <cds-tab\n *ngIf=\"{active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES} as obs\"\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.processes' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES)\"\n >\n <valtimo-building-block-management-processes\n *ngIf=\"obs.active\"\n ></valtimo-building-block-management-processes>\n </cds-tab>\n</cds-tabs>\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div class=\"building-block-management-detail__header\">\n <valtimo-building-block-management-detail-actions></valtimo-building-block-management-detail-actions>\n </div>\n </ng-template>\n</ng-container>\n", styles: [".valtimo-building-block-management-list__actions{display:flex}:host ::ng-deep .building-block-management-detail__header{display:flex;align-items:center;gap:.75rem;justify-content:flex-end}:host ::ng-deep .cds--tab-content{margin:0!important;padding-left:0!important;padding-right:0!important;outline:none!important}.building-block-management-header{display:flex;justify-content:space-between}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: IconModule }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i3$1.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i3$1.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive", "tabContent", "templateContext"], outputs: ["selected"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: BuildingBlockManagementGeneralComponent, selector: "valtimo-building-block-management-general" }, { kind: "component", type: BuildingBlockManagementDocumentComponent, selector: "valtimo-building-block-management-document" }, { kind: "component", type: BuildingBlockManagementProcessesComponent, selector: "valtimo-building-block-management-processes" }, { kind: "directive", type: RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "component", type: BuildingBlockManagementDetailActionsComponent, selector: "valtimo-building-block-management-detail-actions" }, { kind: "ngmodule", type: DialogModule }] }); }
1652
+ toArray(value) {
1653
+ if (Array.isArray(value))
1654
+ return value;
1655
+ if (value)
1656
+ return [value];
1657
+ return [];
1658
+ }
1659
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementDetailComponent, deps: [{ token: i3.ActivatedRoute }, { token: BuildingBlockManagementDetailService }, { token: i2$1.PageTitleService }, { token: BUILDING_BLOCK_MANAGEMENT_TAB_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
1660
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: BuildingBlockManagementDetailComponent, isStandalone: true, selector: "valtimo-building-block-management-detail", providers: [BuildingBlockManagementDetailService], ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n@if (activeTabKey$ | async; as activeTabKey) {\n <cds-tabs type=\"line\">\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.general' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-general></valtimo-building-block-management-general>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.DOCUMENT}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.document' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.DOCUMENT)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-document></valtimo-building-block-management-document>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.processes' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-processes></valtimo-building-block-management-processes>\n }\n </cds-tab>\n }\n\n @for (customTab of customTabs; track customTab.tabRoute) {\n @if ((customTab.enabled$ | async) && {active: activeTabKey === customTab.tabRoute}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"customTab.translationKey | translate\"\n (selected)=\"switchTab(customTab.tabRoute)\"\n >\n @if (obs.active) {\n <ng-container *ngComponentOutlet=\"customTab.component\"></ng-container>\n }\n </cds-tab>\n }\n }\n </cds-tabs>\n}\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div class=\"building-block-management-detail__header\">\n <valtimo-building-block-management-detail-actions></valtimo-building-block-management-detail-actions>\n </div>\n </ng-template>\n</ng-container>\n", styles: [".valtimo-building-block-management-list__actions{display:flex}:host ::ng-deep .building-block-management-detail__header{display:flex;align-items:center;gap:.75rem;justify-content:flex-end}:host ::ng-deep .cds--tab-content{margin:0!important;padding-left:0!important;padding-right:0!important;outline:none!important}.building-block-management-header{display:flex;justify-content:space-between}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: IconModule }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i3$1.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i3$1.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive", "tabContent", "templateContext"], outputs: ["selected"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: BuildingBlockManagementGeneralComponent, selector: "valtimo-building-block-management-general" }, { kind: "component", type: BuildingBlockManagementDocumentComponent, selector: "valtimo-building-block-management-document" }, { kind: "component", type: BuildingBlockManagementProcessesComponent, selector: "valtimo-building-block-management-processes" }, { kind: "directive", type: RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "component", type: BuildingBlockManagementDetailActionsComponent, selector: "valtimo-building-block-management-detail-actions" }, { kind: "ngmodule", type: DialogModule }] }); }
1606
1661
  }
1607
1662
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementDetailComponent, decorators: [{
1608
1663
  type: Component,
@@ -1619,8 +1674,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
1619
1674
  RenderInPageHeaderDirective,
1620
1675
  BuildingBlockManagementDetailActionsComponent,
1621
1676
  DialogModule,
1622
- ], providers: [BuildingBlockManagementDetailService], 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-tabs *ngIf=\"activeTabKey$ | async as activeTabKey\" type=\"line\">\n <cds-tab\n *ngIf=\"{active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL} as obs\"\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.general' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL)\"\n >\n <valtimo-building-block-management-general\n *ngIf=\"obs.active\"\n ></valtimo-building-block-management-general>\n </cds-tab>\n\n <cds-tab\n *ngIf=\"{active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.DOCUMENT} as obs\"\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.document' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.DOCUMENT)\"\n >\n <valtimo-building-block-management-document\n *ngIf=\"obs.active\"\n ></valtimo-building-block-management-document>\n </cds-tab>\n\n <cds-tab\n *ngIf=\"{active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES} as obs\"\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.processes' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES)\"\n >\n <valtimo-building-block-management-processes\n *ngIf=\"obs.active\"\n ></valtimo-building-block-management-processes>\n </cds-tab>\n</cds-tabs>\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div class=\"building-block-management-detail__header\">\n <valtimo-building-block-management-detail-actions></valtimo-building-block-management-detail-actions>\n </div>\n </ng-template>\n</ng-container>\n", styles: [".valtimo-building-block-management-list__actions{display:flex}:host ::ng-deep .building-block-management-detail__header{display:flex;align-items:center;gap:.75rem;justify-content:flex-end}:host ::ng-deep .cds--tab-content{margin:0!important;padding-left:0!important;padding-right:0!important;outline:none!important}.building-block-management-header{display:flex;justify-content:space-between}\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"] }]
1623
- }], ctorParameters: () => [{ type: i3.ActivatedRoute }, { type: BuildingBlockManagementDetailService }, { type: i2$1.PageTitleService }] });
1677
+ ], providers: [BuildingBlockManagementDetailService], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n@if (activeTabKey$ | async; as activeTabKey) {\n <cds-tabs type=\"line\">\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.general' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-general></valtimo-building-block-management-general>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.DOCUMENT}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.document' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.DOCUMENT)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-document></valtimo-building-block-management-document>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.processes' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-processes></valtimo-building-block-management-processes>\n }\n </cds-tab>\n }\n\n @for (customTab of customTabs; track customTab.tabRoute) {\n @if ((customTab.enabled$ | async) && {active: activeTabKey === customTab.tabRoute}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"customTab.translationKey | translate\"\n (selected)=\"switchTab(customTab.tabRoute)\"\n >\n @if (obs.active) {\n <ng-container *ngComponentOutlet=\"customTab.component\"></ng-container>\n }\n </cds-tab>\n }\n }\n </cds-tabs>\n}\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div class=\"building-block-management-detail__header\">\n <valtimo-building-block-management-detail-actions></valtimo-building-block-management-detail-actions>\n </div>\n </ng-template>\n</ng-container>\n", styles: [".valtimo-building-block-management-list__actions{display:flex}:host ::ng-deep .building-block-management-detail__header{display:flex;align-items:center;gap:.75rem;justify-content:flex-end}:host ::ng-deep .cds--tab-content{margin:0!important;padding-left:0!important;padding-right:0!important;outline:none!important}.building-block-management-header{display:flex;justify-content:space-between}\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"] }]
1678
+ }], ctorParameters: () => [{ type: i3.ActivatedRoute }, { type: BuildingBlockManagementDetailService }, { type: i2$1.PageTitleService }, { type: undefined, decorators: [{
1679
+ type: Optional
1680
+ }, {
1681
+ type: Inject,
1682
+ args: [BUILDING_BLOCK_MANAGEMENT_TAB_TOKEN]
1683
+ }] }] });
1624
1684
 
1625
1685
  /*
1626
1686
  * Copyright 2015-2025 Ritense BV, the Netherlands.