@valtimo/building-block-management 13.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/fesm2022/valtimo-building-block-management.mjs +1746 -0
- package/fesm2022/valtimo-building-block-management.mjs.map +1 -0
- package/index.d.ts +6 -0
- package/lib/building-block-management-routing.d.ts +9 -0
- package/lib/building-block-management-routing.d.ts.map +1 -0
- package/lib/building-block-management.module.d.ts +9 -0
- package/lib/building-block-management.module.d.ts.map +1 -0
- package/lib/components/building-block-management-artwork/building-block-management-artwork.component.d.ts +32 -0
- package/lib/components/building-block-management-artwork/building-block-management-artwork.component.d.ts.map +1 -0
- package/lib/components/building-block-management-create-modal/building-block-management-create-modal.component.d.ts +24 -0
- package/lib/components/building-block-management-create-modal/building-block-management-create-modal.component.d.ts.map +1 -0
- package/lib/components/building-block-management-detail/building-block-management-detail.component.d.ts +24 -0
- package/lib/components/building-block-management-detail/building-block-management-detail.component.d.ts.map +1 -0
- package/lib/components/building-block-management-detail-actions/building-block-management-detail-actions.component.d.ts +38 -0
- package/lib/components/building-block-management-detail-actions/building-block-management-detail-actions.component.d.ts.map +1 -0
- package/lib/components/building-block-management-document/building-block-management-document.component.d.ts +27 -0
- package/lib/components/building-block-management-document/building-block-management-document.component.d.ts.map +1 -0
- package/lib/components/building-block-management-general/building-block-management-general.component.d.ts +9 -0
- package/lib/components/building-block-management-general/building-block-management-general.component.d.ts.map +1 -0
- package/lib/components/building-block-management-list/building-block-management-list.component.d.ts +22 -0
- package/lib/components/building-block-management-list/building-block-management-list.component.d.ts.map +1 -0
- package/lib/components/building-block-management-metadata/building-block-management-metadata.component.d.ts +23 -0
- package/lib/components/building-block-management-metadata/building-block-management-metadata.component.d.ts.map +1 -0
- package/lib/components/building-block-management-plugins/building-block-management-plugins.component.d.ts +15 -0
- package/lib/components/building-block-management-plugins/building-block-management-plugins.component.d.ts.map +1 -0
- package/lib/components/building-block-management-process-upload/building-block-management-process-upload.component.d.ts +25 -0
- package/lib/components/building-block-management-process-upload/building-block-management-process-upload.component.d.ts.map +1 -0
- package/lib/components/building-block-management-processes/building-block-management-processes.component.d.ts +40 -0
- package/lib/components/building-block-management-processes/building-block-management-processes.component.d.ts.map +1 -0
- package/lib/components/building-block-management-upload-modal/building-block-management-upload-modal.component.d.ts +45 -0
- package/lib/components/building-block-management-upload-modal/building-block-management-upload-modal.component.d.ts.map +1 -0
- package/lib/components/building-block-management-upload-modal/step/building-block-management-upload-step.component.d.ts +9 -0
- package/lib/components/building-block-management-upload-modal/step/building-block-management-upload-step.component.d.ts.map +1 -0
- package/lib/components/building-block-management-version-selector/building-block-management-version-selector.component.d.ts +19 -0
- package/lib/components/building-block-management-version-selector/building-block-management-version-selector.component.d.ts.map +1 -0
- package/lib/constants/building-block-management-upload.constants.d.ts +13 -0
- package/lib/constants/building-block-management-upload.constants.d.ts.map +1 -0
- package/lib/constants/building-block-management.constants.d.ts +7 -0
- package/lib/constants/building-block-management.constants.d.ts.map +1 -0
- package/lib/constants/index.d.ts +3 -0
- package/lib/constants/index.d.ts.map +1 -0
- package/lib/models/building-block-management.model.d.ts +8 -0
- package/lib/models/building-block-management.model.d.ts.map +1 -0
- package/lib/models/index.d.ts +2 -0
- package/lib/models/index.d.ts.map +1 -0
- package/lib/services/building-block-management-api.service.d.ts +33 -0
- package/lib/services/building-block-management-api.service.d.ts.map +1 -0
- package/lib/services/building-block-management-detail.service.d.ts +48 -0
- package/lib/services/building-block-management-detail.service.d.ts.map +1 -0
- package/lib/services/building-block-management.service.d.ts +20 -0
- package/lib/services/building-block-management.service.d.ts.map +1 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/index.d.ts.map +1 -0
- package/package.json +26 -0
- package/public-api.d.ts +3 -0
- package/public-api.d.ts.map +1 -0
- package/valtimo-building-block-management.d.ts.map +1 -0
|
@@ -0,0 +1,1746 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Component, Input, signal, ChangeDetectionStrategy, ViewChild, Inject, NgModule } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/common';
|
|
4
|
+
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
5
|
+
import * as i2$1 from '@valtimo/components';
|
|
6
|
+
import { runAfterCarbonModalClosed, ValtimoCdsModalDirective, AutoKeyInputComponent, TooltipIconModule, CARBON_CONSTANTS, ViewType, CarbonListModule, ReadOnlyDirective, ConfirmationModalModule, RenderInBodyComponent, MuuriDirectiveModule, SchemaEditorComponent, FitPageDirective, ValtimoCdsOverflowButtonDirective, RenderInPageHeaderDirective } from '@valtimo/components';
|
|
7
|
+
import * as i2 from '@angular/common/http';
|
|
8
|
+
import { HttpHeaders } from '@angular/common/http';
|
|
9
|
+
import * as i1 from '@valtimo/shared';
|
|
10
|
+
import { BaseApiService, InterceptorSkip, ROLE_ADMIN } from '@valtimo/shared';
|
|
11
|
+
import { catchError, of, filter, switchMap, map, tap, distinctUntilChanged, BehaviorSubject, Subscription, combineLatest, take, startWith, from, finalize } from 'rxjs';
|
|
12
|
+
import { isEqual } from 'lodash';
|
|
13
|
+
import * as i3 from '@angular/router';
|
|
14
|
+
import { RouterModule } from '@angular/router';
|
|
15
|
+
import * as i3$1 from 'carbon-components-angular';
|
|
16
|
+
import { ModalModule, ButtonModule, IconModule, InputModule, TooltipModule, LayerModule, FileUploaderModule, ProgressBarModule, NotificationModule, CheckboxModule, LoadingModule, TagModule, DropdownModule, DialogModule, TabsModule } from 'carbon-components-angular';
|
|
17
|
+
import * as i4$1 from '@ngx-translate/core';
|
|
18
|
+
import { TranslatePipe, TranslateModule } from '@ngx-translate/core';
|
|
19
|
+
import * as i2$2 from '@angular/forms';
|
|
20
|
+
import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
21
|
+
import { WarningFilled16, Upload16, TrashCan16, Download16 } from '@carbon/icons';
|
|
22
|
+
import { toObservable } from '@angular/core/rxjs-interop';
|
|
23
|
+
import { AuthGuardService } from '@valtimo/security';
|
|
24
|
+
import * as i2$3 from '@valtimo/plugin';
|
|
25
|
+
import { take as take$1 } from 'rxjs/operators';
|
|
26
|
+
import * as i3$2 from '@valtimo/process-link';
|
|
27
|
+
import { ProcessManagementBuilderComponent } from '@valtimo/process-management';
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
31
|
+
*
|
|
32
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
33
|
+
* you may not use this file except in compliance with the License.
|
|
34
|
+
* You may obtain a copy of the License at
|
|
35
|
+
*
|
|
36
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
37
|
+
*
|
|
38
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
39
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
40
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
41
|
+
* See the License for the specific language governing permissions and
|
|
42
|
+
* limitations under the License.
|
|
43
|
+
*/
|
|
44
|
+
class BuildingBlockManagementApiService extends BaseApiService {
|
|
45
|
+
constructor(configService, httpClient) {
|
|
46
|
+
super(httpClient, configService);
|
|
47
|
+
this.configService = configService;
|
|
48
|
+
this.httpClient = httpClient;
|
|
49
|
+
}
|
|
50
|
+
getBuildingBlockDefinitions(options) {
|
|
51
|
+
return this.httpClient
|
|
52
|
+
.get(this.getApiUrl('management/v1/building-block'), {
|
|
53
|
+
params: options,
|
|
54
|
+
headers: new HttpHeaders().set(InterceptorSkip, '404'),
|
|
55
|
+
})
|
|
56
|
+
.pipe(catchError((error) => {
|
|
57
|
+
if (error.status === 404)
|
|
58
|
+
return of([]);
|
|
59
|
+
throw error;
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
createBuildingBlockDefinition(dto) {
|
|
63
|
+
return this.httpClient.post(this.getApiUrl('management/v1/building-block'), dto);
|
|
64
|
+
}
|
|
65
|
+
getBuildingBlockDefinition(key, versionTag) {
|
|
66
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}`));
|
|
67
|
+
}
|
|
68
|
+
updateBuildingBlockDefinition(key, versionTag, dto) {
|
|
69
|
+
return this.httpClient.put(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}`), dto);
|
|
70
|
+
}
|
|
71
|
+
getBuildingBlockDocumentDefinition(key, versionTag) {
|
|
72
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/document`));
|
|
73
|
+
}
|
|
74
|
+
updateBuildingBlockDocumentDefinition(key, versionTag, schema) {
|
|
75
|
+
return this.httpClient.put(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/document`), schema);
|
|
76
|
+
}
|
|
77
|
+
getBuildingBlockProcessDefinitions(key, versionTag) {
|
|
78
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/process-definition`));
|
|
79
|
+
}
|
|
80
|
+
importBuildingBlockDefinition(file) {
|
|
81
|
+
return this.httpClient.post(this.getApiUrl(`management/v1/building-block/import`), file);
|
|
82
|
+
}
|
|
83
|
+
getBuildingBlockArtwork(key, versionTag) {
|
|
84
|
+
return this.httpClient
|
|
85
|
+
.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/artwork`), {
|
|
86
|
+
headers: new HttpHeaders().set(InterceptorSkip, '404'),
|
|
87
|
+
})
|
|
88
|
+
.pipe(catchError((error) => {
|
|
89
|
+
if (error.status === 404)
|
|
90
|
+
return of(null);
|
|
91
|
+
throw error;
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
createBuildingBlockArtwork(key, versionTag, dto) {
|
|
95
|
+
return this.httpClient.post(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/artwork`), dto);
|
|
96
|
+
}
|
|
97
|
+
deleteBuildingBlockArtwork(key, versionTag) {
|
|
98
|
+
return this.httpClient.delete(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/artwork`));
|
|
99
|
+
}
|
|
100
|
+
getPluginDefinitionsForBuildingBlock(key, versionTag) {
|
|
101
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/plugin`));
|
|
102
|
+
}
|
|
103
|
+
getVersionsForBuildingBlock(key, page = 0, size = 5, all = false) {
|
|
104
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version`), {
|
|
105
|
+
params: {
|
|
106
|
+
page,
|
|
107
|
+
size,
|
|
108
|
+
all,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
finalizeBuildingBlockDefinition(key, versionTag) {
|
|
113
|
+
return this.httpClient.post(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/finalize`), {});
|
|
114
|
+
}
|
|
115
|
+
createDraftBuildingBlockDefinition(key, basedOnVersionTag, versionTag) {
|
|
116
|
+
return this.httpClient.post(this.getApiUrl(`management/v1/building-block/${key}/version/${basedOnVersionTag}/draft`), { versionTag });
|
|
117
|
+
}
|
|
118
|
+
setMainBuildingBlockProcessDefinition(key, versionTag, processDefinitionId) {
|
|
119
|
+
return this.httpClient.post(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/process-definition/${processDefinitionId}/main`), {});
|
|
120
|
+
}
|
|
121
|
+
deleteBuildingBlockProcessDefinition(key, versionTag, processDefinitionId) {
|
|
122
|
+
return this.httpClient.delete(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/process-definition/${processDefinitionId}`));
|
|
123
|
+
}
|
|
124
|
+
exportBuildingBlock(key, versionTag) {
|
|
125
|
+
return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/export`), {
|
|
126
|
+
responseType: 'blob',
|
|
127
|
+
observe: 'response',
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementApiService, deps: [{ token: i1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
131
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementApiService, providedIn: 'root' }); }
|
|
132
|
+
}
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementApiService, decorators: [{
|
|
134
|
+
type: Injectable,
|
|
135
|
+
args: [{
|
|
136
|
+
providedIn: 'root',
|
|
137
|
+
}]
|
|
138
|
+
}], ctorParameters: () => [{ type: i1.ConfigService }, { type: i2.HttpClient }] });
|
|
139
|
+
|
|
140
|
+
/*
|
|
141
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
142
|
+
*
|
|
143
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
144
|
+
* you may not use this file except in compliance with the License.
|
|
145
|
+
* You may obtain a copy of the License at
|
|
146
|
+
*
|
|
147
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
148
|
+
*
|
|
149
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
150
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
151
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
152
|
+
* See the License for the specific language governing permissions and
|
|
153
|
+
* limitations under the License.
|
|
154
|
+
*/
|
|
155
|
+
class BuildingBlockManagementDetailService {
|
|
156
|
+
get loadingDefinition$() {
|
|
157
|
+
return this._loadingDefinition$.asObservable();
|
|
158
|
+
}
|
|
159
|
+
get _route$() {
|
|
160
|
+
return this._routeSubject$.pipe(filter(route => route !== null));
|
|
161
|
+
}
|
|
162
|
+
get buildingBlockDefinitionKey() {
|
|
163
|
+
return this._buildingBlockDefinitionKey;
|
|
164
|
+
}
|
|
165
|
+
get buildingBlockDefinitionKey$() {
|
|
166
|
+
return this._route$.pipe(switchMap(route => route.paramMap.pipe(map(params => params.get('buildingBlockDefinitionKey')), filter(key => !!key), tap(key => (this._buildingBlockDefinitionKey = key)))));
|
|
167
|
+
}
|
|
168
|
+
get buildingBlockDefinitionVersionTag() {
|
|
169
|
+
return this._buildingBlockDefinitionVersionTag;
|
|
170
|
+
}
|
|
171
|
+
get buildingBlockDefinitionVersionTag$() {
|
|
172
|
+
return this._route$.pipe(switchMap(route => route.paramMap.pipe(map(params => params.get('buildingBlockDefinitionVersionTag')), filter(version => !!version), tap(version => (this._buildingBlockDefinitionVersionTag = version)))));
|
|
173
|
+
}
|
|
174
|
+
get activeTabKey$() {
|
|
175
|
+
return this._route$.pipe(switchMap(route => route.paramMap.pipe(map(params => params.get('tabKey')), filter(key => !!key))));
|
|
176
|
+
}
|
|
177
|
+
get buildingBlockDefinition$() {
|
|
178
|
+
return this._buildingBlockDefinition$.pipe(filter(definition => definition !== null), distinctUntilChanged((a, b) => isEqual(a, b)));
|
|
179
|
+
}
|
|
180
|
+
get isFinal$() {
|
|
181
|
+
return this.buildingBlockDefinition$.pipe(map(definition => definition.final));
|
|
182
|
+
}
|
|
183
|
+
get reloadVersions$() {
|
|
184
|
+
return this._reloadVersions$.asObservable();
|
|
185
|
+
}
|
|
186
|
+
get reloadProcessDefinitions$() {
|
|
187
|
+
return this._reloadProcessDefinitions$.asObservable();
|
|
188
|
+
}
|
|
189
|
+
constructor(buildingBlockManagementApiService, pageTitleService, router) {
|
|
190
|
+
this.buildingBlockManagementApiService = buildingBlockManagementApiService;
|
|
191
|
+
this.pageTitleService = pageTitleService;
|
|
192
|
+
this.router = router;
|
|
193
|
+
this._loadingDefinition$ = new BehaviorSubject(true);
|
|
194
|
+
this._routeSubject$ = new BehaviorSubject(null);
|
|
195
|
+
this._buildingBlockDefinition$ = new BehaviorSubject(null);
|
|
196
|
+
this._showProcessDefinitionUploadModal$ = new BehaviorSubject(false);
|
|
197
|
+
this.showProcessDefinitionUploadModal$ = this._showProcessDefinitionUploadModal$.asObservable();
|
|
198
|
+
this._reload$ = new BehaviorSubject(null);
|
|
199
|
+
this._reloadVersions$ = new BehaviorSubject(null);
|
|
200
|
+
this._reloadProcessDefinitions$ = new BehaviorSubject(null);
|
|
201
|
+
this._subscriptions = new Subscription();
|
|
202
|
+
this._subscriptions.add(combineLatest([
|
|
203
|
+
this.buildingBlockDefinitionKey$,
|
|
204
|
+
this.buildingBlockDefinitionVersionTag$,
|
|
205
|
+
this._reload$,
|
|
206
|
+
])
|
|
207
|
+
.pipe(tap(() => this._loadingDefinition$.next(true)), switchMap(([key, version]) => this.buildingBlockManagementApiService.getBuildingBlockDefinition(key, version)), tap(res => {
|
|
208
|
+
this._buildingBlockDefinition$.next(res);
|
|
209
|
+
this.pageTitleService.setCustomPageTitle(res.name);
|
|
210
|
+
this._loadingDefinition$.next(false);
|
|
211
|
+
}))
|
|
212
|
+
.subscribe());
|
|
213
|
+
}
|
|
214
|
+
setRoute(route) {
|
|
215
|
+
this._routeSubject$.next(route);
|
|
216
|
+
}
|
|
217
|
+
ngOnDestroy() {
|
|
218
|
+
this._subscriptions.unsubscribe();
|
|
219
|
+
}
|
|
220
|
+
navigateToTab(tabKey) {
|
|
221
|
+
this.buildingBlockDefinition$.subscribe(definition => {
|
|
222
|
+
this.router.navigate([
|
|
223
|
+
'/building-block-management',
|
|
224
|
+
'building-block',
|
|
225
|
+
definition.key,
|
|
226
|
+
'version',
|
|
227
|
+
definition.versionTag,
|
|
228
|
+
tabKey,
|
|
229
|
+
]);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
navigateToVersionTag(versionTag) {
|
|
233
|
+
const currentUrl = this.router.url.split('?')[0];
|
|
234
|
+
const parts = currentUrl.split('/');
|
|
235
|
+
const versionIndex = parts.findIndex(segment => segment === 'version');
|
|
236
|
+
if (versionIndex === -1 || versionIndex + 1 >= parts.length) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
parts[versionIndex + 1] = versionTag;
|
|
240
|
+
const newUrl = parts.join('/');
|
|
241
|
+
this.router.navigateByUrl(newUrl);
|
|
242
|
+
}
|
|
243
|
+
reload() {
|
|
244
|
+
this._reload$.next(null);
|
|
245
|
+
}
|
|
246
|
+
reloadVersions() {
|
|
247
|
+
this._reloadVersions$.next(null);
|
|
248
|
+
}
|
|
249
|
+
showProcessDefinitionUploadModal() {
|
|
250
|
+
this._showProcessDefinitionUploadModal$.next(true);
|
|
251
|
+
}
|
|
252
|
+
hideProcessDefinitionUploadModal() {
|
|
253
|
+
this._showProcessDefinitionUploadModal$.next(false);
|
|
254
|
+
}
|
|
255
|
+
reloadProcessDefinitions() {
|
|
256
|
+
this._reloadProcessDefinitions$.next(null);
|
|
257
|
+
}
|
|
258
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementDetailService, deps: [{ token: BuildingBlockManagementApiService }, { token: i2$1.PageTitleService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
259
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementDetailService }); }
|
|
260
|
+
}
|
|
261
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementDetailService, decorators: [{
|
|
262
|
+
type: Injectable
|
|
263
|
+
}], ctorParameters: () => [{ type: BuildingBlockManagementApiService }, { type: i2$1.PageTitleService }, { type: i3.Router }] });
|
|
264
|
+
|
|
265
|
+
/*
|
|
266
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
267
|
+
*
|
|
268
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
269
|
+
* you may not use this file except in compliance with the License.
|
|
270
|
+
* You may obtain a copy of the License at
|
|
271
|
+
*
|
|
272
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
273
|
+
*
|
|
274
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
275
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
276
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
277
|
+
* See the License for the specific language governing permissions and
|
|
278
|
+
* limitations under the License.
|
|
279
|
+
*/
|
|
280
|
+
class BuildingBlockManagementService {
|
|
281
|
+
constructor() {
|
|
282
|
+
this._showCreateModal$ = new BehaviorSubject(false);
|
|
283
|
+
this.showCreateModal$ = this._showCreateModal$.asObservable();
|
|
284
|
+
this._showUploadModal$ = new BehaviorSubject(false);
|
|
285
|
+
this.showUploadModal$ = this._showUploadModal$.asObservable();
|
|
286
|
+
this._usedKeys$ = new BehaviorSubject([]);
|
|
287
|
+
this.usedKeys$ = this._usedKeys$.asObservable();
|
|
288
|
+
this._reload$ = new BehaviorSubject(null);
|
|
289
|
+
this.reload$ = this._reload$.asObservable();
|
|
290
|
+
}
|
|
291
|
+
showCreateModal() {
|
|
292
|
+
this._showCreateModal$.next(true);
|
|
293
|
+
}
|
|
294
|
+
hideCreateModal() {
|
|
295
|
+
this._showCreateModal$.next(false);
|
|
296
|
+
}
|
|
297
|
+
showUploadModal() {
|
|
298
|
+
this._showUploadModal$.next(true);
|
|
299
|
+
}
|
|
300
|
+
hideUploadModal() {
|
|
301
|
+
this._showUploadModal$.next(false);
|
|
302
|
+
}
|
|
303
|
+
setUsedKeys(keys) {
|
|
304
|
+
this._usedKeys$.next(keys);
|
|
305
|
+
}
|
|
306
|
+
reload() {
|
|
307
|
+
this._reload$.next(null);
|
|
308
|
+
}
|
|
309
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
310
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementService }); }
|
|
311
|
+
}
|
|
312
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementService, decorators: [{
|
|
313
|
+
type: Injectable
|
|
314
|
+
}] });
|
|
315
|
+
|
|
316
|
+
/*
|
|
317
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
318
|
+
*
|
|
319
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
320
|
+
* you may not use this file except in compliance with the License.
|
|
321
|
+
* You may obtain a copy of the License at
|
|
322
|
+
*
|
|
323
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
324
|
+
*
|
|
325
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
326
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
327
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
328
|
+
* See the License for the specific language governing permissions and
|
|
329
|
+
* limitations under the License.
|
|
330
|
+
*/
|
|
331
|
+
|
|
332
|
+
/*
|
|
333
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
334
|
+
*
|
|
335
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
336
|
+
* you may not use this file except in compliance with the License.
|
|
337
|
+
* You may obtain a copy of the License at
|
|
338
|
+
*
|
|
339
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
340
|
+
*
|
|
341
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
342
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
343
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
344
|
+
* See the License for the specific language governing permissions and
|
|
345
|
+
* limitations under the License.
|
|
346
|
+
*/
|
|
347
|
+
const BUILDING_BLOCK_MANAGEMENT_TABS = {
|
|
348
|
+
GENERAL: 'general',
|
|
349
|
+
PROCESSES: 'process-definition',
|
|
350
|
+
DOCUMENT: 'document',
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
/*
|
|
354
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
355
|
+
*
|
|
356
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
357
|
+
* you may not use this file except in compliance with the License.
|
|
358
|
+
* You may obtain a copy of the License at
|
|
359
|
+
*
|
|
360
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
361
|
+
*
|
|
362
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
363
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
364
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
365
|
+
* See the License for the specific language governing permissions and
|
|
366
|
+
* limitations under the License.
|
|
367
|
+
*/
|
|
368
|
+
var UPLOAD_STATUS;
|
|
369
|
+
(function (UPLOAD_STATUS) {
|
|
370
|
+
UPLOAD_STATUS["ACTIVE"] = "active";
|
|
371
|
+
UPLOAD_STATUS["ERROR"] = "error";
|
|
372
|
+
UPLOAD_STATUS["FINISHED"] = "finished";
|
|
373
|
+
})(UPLOAD_STATUS || (UPLOAD_STATUS = {}));
|
|
374
|
+
var UPLOAD_STEP;
|
|
375
|
+
(function (UPLOAD_STEP) {
|
|
376
|
+
UPLOAD_STEP["FILE_SELECT"] = "fileSelect";
|
|
377
|
+
UPLOAD_STEP["FILE_UPLOAD"] = "fileUpload";
|
|
378
|
+
UPLOAD_STEP["PLUGINS"] = "plugins";
|
|
379
|
+
})(UPLOAD_STEP || (UPLOAD_STEP = {}));
|
|
380
|
+
const STEPS = [UPLOAD_STEP.PLUGINS, UPLOAD_STEP.FILE_SELECT, UPLOAD_STEP.FILE_UPLOAD];
|
|
381
|
+
|
|
382
|
+
/*
|
|
383
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
384
|
+
*
|
|
385
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
386
|
+
* you may not use this file except in compliance with the License.
|
|
387
|
+
* You may obtain a copy of the License at
|
|
388
|
+
*
|
|
389
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
390
|
+
*
|
|
391
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
392
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
393
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
394
|
+
* See the License for the specific language governing permissions and
|
|
395
|
+
* limitations under the License.
|
|
396
|
+
*/
|
|
397
|
+
|
|
398
|
+
/*
|
|
399
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
400
|
+
*
|
|
401
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
402
|
+
* you may not use this file except in compliance with the License.
|
|
403
|
+
* You may obtain a copy of the License at
|
|
404
|
+
*
|
|
405
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
406
|
+
*
|
|
407
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
408
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
409
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
410
|
+
* See the License for the specific language governing permissions and
|
|
411
|
+
* limitations under the License.
|
|
412
|
+
*/
|
|
413
|
+
class BuildingBlockManagementCreateModalComponent {
|
|
414
|
+
get name() {
|
|
415
|
+
return this.formGroup.get('name');
|
|
416
|
+
}
|
|
417
|
+
get key() {
|
|
418
|
+
return this.formGroup.get('key');
|
|
419
|
+
}
|
|
420
|
+
get versionTag() {
|
|
421
|
+
return this.formGroup.get('versionTag');
|
|
422
|
+
}
|
|
423
|
+
get description() {
|
|
424
|
+
return this.formGroup.get('description');
|
|
425
|
+
}
|
|
426
|
+
constructor(buildingBlockManagementApiService, buildingBlockManagementService, fb, router) {
|
|
427
|
+
this.buildingBlockManagementApiService = buildingBlockManagementApiService;
|
|
428
|
+
this.buildingBlockManagementService = buildingBlockManagementService;
|
|
429
|
+
this.fb = fb;
|
|
430
|
+
this.router = router;
|
|
431
|
+
this.showModal$ = this.buildingBlockManagementService.showCreateModal$;
|
|
432
|
+
this.usedKeys$ = this.buildingBlockManagementService.usedKeys$;
|
|
433
|
+
this.formGroup = this.fb.group({
|
|
434
|
+
name: this.fb.control('', Validators.required),
|
|
435
|
+
key: this.fb.control('', [Validators.required, Validators.pattern('[A-Za-z0-9-]*')]),
|
|
436
|
+
versionTag: this.fb.control('', Validators.required),
|
|
437
|
+
description: this.fb.control(''),
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
onCloseModal() {
|
|
441
|
+
this.buildingBlockManagementService.hideCreateModal();
|
|
442
|
+
this.resetForm();
|
|
443
|
+
}
|
|
444
|
+
onSave() {
|
|
445
|
+
this.formGroup.disable();
|
|
446
|
+
this.buildingBlockManagementApiService
|
|
447
|
+
.createBuildingBlockDefinition(this.formGroup.value)
|
|
448
|
+
.pipe(catchError(() => {
|
|
449
|
+
this.formGroup.enable();
|
|
450
|
+
return of(null);
|
|
451
|
+
}))
|
|
452
|
+
.subscribe(createdBuildingBlock => {
|
|
453
|
+
this.router.navigate([
|
|
454
|
+
'/building-block-management',
|
|
455
|
+
'building-block',
|
|
456
|
+
createdBuildingBlock.key,
|
|
457
|
+
'version',
|
|
458
|
+
createdBuildingBlock.versionTag,
|
|
459
|
+
BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL,
|
|
460
|
+
]);
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
resetForm() {
|
|
464
|
+
runAfterCarbonModalClosed(() => {
|
|
465
|
+
this.formGroup.reset();
|
|
466
|
+
this.formGroup.enable();
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementCreateModalComponent, deps: [{ token: BuildingBlockManagementApiService }, { token: BuildingBlockManagementService }, { token: i2$2.FormBuilder }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
470
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BuildingBlockManagementCreateModalComponent, isStandalone: true, selector: "valtimo-building-block-management-create-modal", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{\n showModal: showModal$ | async,\n } as obs\"\n [open]=\"obs.showModal\"\n showFooter=\"true\"\n valtimoCdsModal\n (close)=\"onCloseModal()\"\n>\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"onCloseModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'buildingBlockManagement.createDefinition.modalTitle' | translate }}\n </h3>\n </cds-modal-header>\n\n <form\n [formGroup]=\"formGroup\"\n cdsModalContent\n class=\"valtimo-definition-create__content\"\n [cdsLayer]=\"1\"\n >\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\" [invalid]=\"name.touched && name.invalid\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.name' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.nameTooltip' | translate\"\n [disabled]=\"obs.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <input\n formControlName=\"name\"\n cdsText\n placeholder=\"{{ 'buildingBlockManagement.createDefinition.namePlaceholder' | translate }}\"\n />\n </cds-label>\n </div>\n\n <valtimo-auto-key-input\n [cdsLayer]=\"1\"\n formControlName=\"key\"\n labelTranslationKey=\"buildingBlockManagement.createDefinition.keyTitle\"\n placeholderTranslationKey=\"buildingBlockManagement.createDefinition.keyPlaceHolder\"\n mode=\"add\"\n [usedKeys]=\"usedKeys$ | async\"\n [sourceText]=\"name.value\"\n >\n </valtimo-auto-key-input>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"formGroup.disabled\"\n [invalid]=\"versionTag.touched && versionTag.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.version' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.versionTooltip' | translate\"\n [disabled]=\"obs.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <input\n formControlName=\"versionTag\"\n cdsText\n placeholder=\"{{\n 'buildingBlockManagement.createDefinition.versionPlaceholder' | translate\n }}\"\n />\n </cds-label>\n </div>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"formGroup.disabled\"\n [invalid]=\"description.touched && description.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.description' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.descriptionTooltip' | translate\"\n [disabled]=\"obs.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <textarea\n cdsTextArea\n formControlName=\"description\"\n placeholder=\"{{\n 'buildingBlockManagement.createDefinition.descriptionPlaceholder' | translate\n }}\"\n [rows]=\"3\"\n [cols]=\"150\"\n ></textarea>\n </cds-label>\n </div>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"onCloseModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button cdsButton=\"primary\" [disabled]=\"formGroup.invalid\" (click)=\"onSave()\">\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-definition-create__content{display:flex;flex-direction:column;gap:16px}.cds--text-input__field-wrapper cds-label{width:100%}.cds--text-input__field-wrapper ::ng-deep .cds--label{width:100%}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:16px}.label-with-tooltip{display:flex;align-items:center}.select-label{padding-bottom:8px}\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: 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: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$2.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: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i3$1.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3$1.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i3$1.TextArea, selector: "[cdsTextArea], [ibmTextArea]", inputs: ["theme", "invalid", "skeleton"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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: TooltipModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "component", type: AutoKeyInputComponent, selector: "valtimo-auto-key-input", inputs: ["labelTranslationKey", "placeholderTranslationKey", "mode", "usedKeys", "sourceText"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i3$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: TooltipIconModule }, { kind: "component", type: i2$1.TooltipIconComponent, selector: "v-tooltip-icon", inputs: ["tooltip", "disabled"] }] }); }
|
|
471
|
+
}
|
|
472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementCreateModalComponent, decorators: [{
|
|
473
|
+
type: Component,
|
|
474
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-create-modal', imports: [
|
|
475
|
+
CommonModule,
|
|
476
|
+
ModalModule,
|
|
477
|
+
ButtonModule,
|
|
478
|
+
IconModule,
|
|
479
|
+
FormsModule,
|
|
480
|
+
InputModule,
|
|
481
|
+
ReactiveFormsModule,
|
|
482
|
+
TooltipModule,
|
|
483
|
+
TranslatePipe,
|
|
484
|
+
ValtimoCdsModalDirective,
|
|
485
|
+
AutoKeyInputComponent,
|
|
486
|
+
LayerModule,
|
|
487
|
+
TooltipIconModule,
|
|
488
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{\n showModal: showModal$ | async,\n } as obs\"\n [open]=\"obs.showModal\"\n showFooter=\"true\"\n valtimoCdsModal\n (close)=\"onCloseModal()\"\n>\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"onCloseModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'buildingBlockManagement.createDefinition.modalTitle' | translate }}\n </h3>\n </cds-modal-header>\n\n <form\n [formGroup]=\"formGroup\"\n cdsModalContent\n class=\"valtimo-definition-create__content\"\n [cdsLayer]=\"1\"\n >\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\" [invalid]=\"name.touched && name.invalid\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.name' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.nameTooltip' | translate\"\n [disabled]=\"obs.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <input\n formControlName=\"name\"\n cdsText\n placeholder=\"{{ 'buildingBlockManagement.createDefinition.namePlaceholder' | translate }}\"\n />\n </cds-label>\n </div>\n\n <valtimo-auto-key-input\n [cdsLayer]=\"1\"\n formControlName=\"key\"\n labelTranslationKey=\"buildingBlockManagement.createDefinition.keyTitle\"\n placeholderTranslationKey=\"buildingBlockManagement.createDefinition.keyPlaceHolder\"\n mode=\"add\"\n [usedKeys]=\"usedKeys$ | async\"\n [sourceText]=\"name.value\"\n >\n </valtimo-auto-key-input>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"formGroup.disabled\"\n [invalid]=\"versionTag.touched && versionTag.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.version' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.versionTooltip' | translate\"\n [disabled]=\"obs.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <input\n formControlName=\"versionTag\"\n cdsText\n placeholder=\"{{\n 'buildingBlockManagement.createDefinition.versionPlaceholder' | translate\n }}\"\n />\n </cds-label>\n </div>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"formGroup.disabled\"\n [invalid]=\"description.touched && description.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.description' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.descriptionTooltip' | translate\"\n [disabled]=\"obs.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <textarea\n cdsTextArea\n formControlName=\"description\"\n placeholder=\"{{\n 'buildingBlockManagement.createDefinition.descriptionPlaceholder' | translate\n }}\"\n [rows]=\"3\"\n [cols]=\"150\"\n ></textarea>\n </cds-label>\n </div>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"onCloseModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button cdsButton=\"primary\" [disabled]=\"formGroup.invalid\" (click)=\"onSave()\">\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-definition-create__content{display:flex;flex-direction:column;gap:16px}.cds--text-input__field-wrapper cds-label{width:100%}.cds--text-input__field-wrapper ::ng-deep .cds--label{width:100%}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:16px}.label-with-tooltip{display:flex;align-items:center}.select-label{padding-bottom:8px}\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"] }]
|
|
489
|
+
}], ctorParameters: () => [{ type: BuildingBlockManagementApiService }, { type: BuildingBlockManagementService }, { type: i2$2.FormBuilder }, { type: i3.Router }] });
|
|
490
|
+
|
|
491
|
+
/*
|
|
492
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
493
|
+
*
|
|
494
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
495
|
+
* you may not use this file except in compliance with the License.
|
|
496
|
+
* You may obtain a copy of the License at
|
|
497
|
+
*
|
|
498
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
499
|
+
*
|
|
500
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
501
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
502
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
503
|
+
* See the License for the specific language governing permissions and
|
|
504
|
+
* limitations under the License.
|
|
505
|
+
*/
|
|
506
|
+
class BuildingBlockManagementUploadStepComponent {
|
|
507
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementUploadStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
508
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BuildingBlockManagementUploadStepComponent, isStandalone: true, selector: "valtimo-building-block-management-upload-step", inputs: { illustration: "illustration", message: "message", title: "title" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"valtimo-upload-step__content\">\n <div class=\"valtimo-upload-step__title\">{{ title }}</div>\n\n <div class=\"valtimo-upload-step__message\">{{ message }}</div>\n</div>\n\n<img [src]=\"illustration\" alt=\"{{ illustration }}\" class=\"valtimo-upload-step__illustration\" />\n", styles: [":host{display:flex;justify-content:space-around;align-items:center;gap:32px;height:100%}:host label{color:unset}.valtimo-upload-step__content{display:flex;flex-direction:column;gap:16px}.valtimo-upload-step__title{font-weight:600;font-size:16px}.valtimo-upload-step__message{font-size:16px;line-height:28px}.valtimo-upload-step__illustration{max-width:200px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
|
|
509
|
+
}
|
|
510
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementUploadStepComponent, decorators: [{
|
|
511
|
+
type: Component,
|
|
512
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-upload-step', imports: [CommonModule], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"valtimo-upload-step__content\">\n <div class=\"valtimo-upload-step__title\">{{ title }}</div>\n\n <div class=\"valtimo-upload-step__message\">{{ message }}</div>\n</div>\n\n<img [src]=\"illustration\" alt=\"{{ illustration }}\" class=\"valtimo-upload-step__illustration\" />\n", styles: [":host{display:flex;justify-content:space-around;align-items:center;gap:32px;height:100%}:host label{color:unset}.valtimo-upload-step__content{display:flex;flex-direction:column;gap:16px}.valtimo-upload-step__title{font-weight:600;font-size:16px}.valtimo-upload-step__message{font-size:16px;line-height:28px}.valtimo-upload-step__illustration{max-width:200px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
513
|
+
}], propDecorators: { illustration: [{
|
|
514
|
+
type: Input
|
|
515
|
+
}], message: [{
|
|
516
|
+
type: Input
|
|
517
|
+
}], title: [{
|
|
518
|
+
type: Input
|
|
519
|
+
}] } });
|
|
520
|
+
|
|
521
|
+
/*
|
|
522
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
523
|
+
*
|
|
524
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
525
|
+
* you may not use this file except in compliance with the License.
|
|
526
|
+
* You may obtain a copy of the License at
|
|
527
|
+
*
|
|
528
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
529
|
+
*
|
|
530
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
531
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
532
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
533
|
+
* See the License for the specific language governing permissions and
|
|
534
|
+
* limitations under the License.
|
|
535
|
+
*/
|
|
536
|
+
class BuildingBlockManagementUploadModalComponent {
|
|
537
|
+
constructor(buildingBlockManagementApiService, buildingBlockManagementService, fb, iconService, translateService) {
|
|
538
|
+
this.buildingBlockManagementApiService = buildingBlockManagementApiService;
|
|
539
|
+
this.buildingBlockManagementService = buildingBlockManagementService;
|
|
540
|
+
this.fb = fb;
|
|
541
|
+
this.iconService = iconService;
|
|
542
|
+
this.translateService = translateService;
|
|
543
|
+
this.acceptedFiles = ['.zip'];
|
|
544
|
+
this.showUploadModal$ = this.buildingBlockManagementService.showUploadModal$;
|
|
545
|
+
this._disabled$ = new BehaviorSubject(true);
|
|
546
|
+
this.UPLOAD_STEP = UPLOAD_STEP;
|
|
547
|
+
this.UPLOAD_STATUS = UPLOAD_STATUS;
|
|
548
|
+
this.activeStep$ = new BehaviorSubject(UPLOAD_STEP.PLUGINS);
|
|
549
|
+
this.backButtonEnabled$ = this.activeStep$.pipe(map((activeStep) => [UPLOAD_STEP.FILE_SELECT].includes(activeStep)));
|
|
550
|
+
this.isStepAfterUpload$ = this.activeStep$.pipe(map((activeStep) => ![UPLOAD_STEP.PLUGINS, UPLOAD_STEP.FILE_SELECT].includes(activeStep)));
|
|
551
|
+
this.showCloseButton$ = this.activeStep$.pipe(map((activeStep) => [UPLOAD_STEP.PLUGINS, UPLOAD_STEP.FILE_SELECT, UPLOAD_STEP.FILE_UPLOAD].includes(activeStep)));
|
|
552
|
+
this.$warningChecked = signal(false);
|
|
553
|
+
this.nextButtonDisabled$ = combineLatest([
|
|
554
|
+
this.activeStep$,
|
|
555
|
+
this._disabled$,
|
|
556
|
+
toObservable(this.$warningChecked),
|
|
557
|
+
]).pipe(map(([activeStep, disabled, warningChecked]) => {
|
|
558
|
+
const warningNotChecked = activeStep === UPLOAD_STEP.FILE_SELECT && !warningChecked;
|
|
559
|
+
return warningNotChecked || (activeStep !== UPLOAD_STEP.PLUGINS && disabled);
|
|
560
|
+
}));
|
|
561
|
+
this.notificationObj$ = combineLatest([
|
|
562
|
+
this.translateService.stream('interface.warning'),
|
|
563
|
+
this.translateService.stream('buildingBlockManagement.importDefinition.overwriteWarning'),
|
|
564
|
+
]).pipe(map(([title, message]) => ({
|
|
565
|
+
type: 'warning',
|
|
566
|
+
title,
|
|
567
|
+
message,
|
|
568
|
+
showClose: false,
|
|
569
|
+
lowContrast: true,
|
|
570
|
+
})));
|
|
571
|
+
this.showCheckboxError$ = new BehaviorSubject(false);
|
|
572
|
+
this.uploadStatus$ = new BehaviorSubject(UPLOAD_STATUS.ACTIVE);
|
|
573
|
+
this.form = this.fb.group({
|
|
574
|
+
file: this.fb.control(new Set(), [Validators.required]),
|
|
575
|
+
});
|
|
576
|
+
this._importFile$ = new BehaviorSubject('');
|
|
577
|
+
this._subscriptions = new Subscription();
|
|
578
|
+
this.iconService.register(WarningFilled16);
|
|
579
|
+
}
|
|
580
|
+
ngOnInit() {
|
|
581
|
+
const control = this.form.get('file');
|
|
582
|
+
if (!control) {
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
this._subscriptions.add(this.form.get('file').valueChanges.subscribe((fileSet) => {
|
|
586
|
+
// @ts-ignore
|
|
587
|
+
const [fileItem] = fileSet;
|
|
588
|
+
if (!fileItem) {
|
|
589
|
+
this._disabled$.next(true);
|
|
590
|
+
this.showCheckboxError$.next(false);
|
|
591
|
+
this.$warningChecked.set(false);
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
this.setZipFile(fileItem);
|
|
595
|
+
}));
|
|
596
|
+
}
|
|
597
|
+
ngOnDestroy() {
|
|
598
|
+
this._subscriptions.unsubscribe();
|
|
599
|
+
this.resetModal();
|
|
600
|
+
}
|
|
601
|
+
onCloseModal(definitionUploaded) {
|
|
602
|
+
if (definitionUploaded) {
|
|
603
|
+
this.buildingBlockManagementService.reload();
|
|
604
|
+
}
|
|
605
|
+
this.buildingBlockManagementService.hideUploadModal();
|
|
606
|
+
runAfterCarbonModalClosed(() => {
|
|
607
|
+
this.resetModal();
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
onBackClick(activeStep) {
|
|
611
|
+
const prevIndex = STEPS.findIndex((step) => step === activeStep) - 1;
|
|
612
|
+
if (prevIndex === -1) {
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
this.activeStep$.next(STEPS[prevIndex]);
|
|
616
|
+
}
|
|
617
|
+
onNextClick(activeStep) {
|
|
618
|
+
const nextIndex = STEPS.findIndex((step) => step === activeStep) + 1;
|
|
619
|
+
if (nextIndex === STEPS.length) {
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
if (activeStep === UPLOAD_STEP.FILE_SELECT && !this.$warningChecked()) {
|
|
623
|
+
this.showCheckboxError$.next(true);
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
this.activeStep$.next(STEPS[nextIndex]);
|
|
627
|
+
if (STEPS[nextIndex] !== UPLOAD_STEP.FILE_UPLOAD) {
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
this.uploadDefinition();
|
|
631
|
+
}
|
|
632
|
+
onCheckedChange(checked) {
|
|
633
|
+
this.$warningChecked.set(checked);
|
|
634
|
+
if (!checked) {
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
this.showCheckboxError$.next(false);
|
|
638
|
+
}
|
|
639
|
+
setZipFile(fileItem) {
|
|
640
|
+
const file = fileItem?.file;
|
|
641
|
+
if (!file) {
|
|
642
|
+
this._importFile$.next('');
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
const blob = new Blob([fileItem.file], { type: fileItem.file.type });
|
|
646
|
+
const fd = new FormData();
|
|
647
|
+
fd.append('file', blob, fileItem.file.name);
|
|
648
|
+
this._importFile$.next(fd);
|
|
649
|
+
this._disabled$.next(false);
|
|
650
|
+
}
|
|
651
|
+
uploadDefinition() {
|
|
652
|
+
this._disabled$.next(true);
|
|
653
|
+
this._importFile$
|
|
654
|
+
.pipe(switchMap((file) => this.buildingBlockManagementApiService.importBuildingBlockDefinition(file)), take(1))
|
|
655
|
+
.subscribe({
|
|
656
|
+
next: () => {
|
|
657
|
+
this._disabled$.next(false);
|
|
658
|
+
this.uploadStatus$.next(UPLOAD_STATUS.FINISHED);
|
|
659
|
+
},
|
|
660
|
+
error: () => {
|
|
661
|
+
this.uploadStatus$.next(UPLOAD_STATUS.ERROR);
|
|
662
|
+
this._disabled$.next(false);
|
|
663
|
+
},
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
resetModal() {
|
|
667
|
+
setTimeout(() => {
|
|
668
|
+
this.activeStep$.next(UPLOAD_STEP.PLUGINS);
|
|
669
|
+
this.uploadStatus$.next(UPLOAD_STATUS.ACTIVE);
|
|
670
|
+
this.showCheckboxError$.next(false);
|
|
671
|
+
}, CARBON_CONSTANTS.modalAnimationMs);
|
|
672
|
+
}
|
|
673
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementUploadModalComponent, deps: [{ token: BuildingBlockManagementApiService }, { token: BuildingBlockManagementService }, { token: i2$2.FormBuilder }, { token: i3$1.IconService }, { token: i4$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
674
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BuildingBlockManagementUploadModalComponent, isStandalone: true, selector: "valtimo-building-block-management-upload-modal", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{\n activeStep: activeStep$ | async,\n backButtonEnabled: backButtonEnabled$ | async,\n isStepAfterUpload: isStepAfterUpload$ | async,\n nextButtonDisabled: nextButtonDisabled$ | async,\n notificationObj: notificationObj$ | async,\n showCheckboxError: showCheckboxError$ | async,\n showCloseButton: showCloseButton$ | async,\n uploadStatus: uploadStatus$ | async,\n showUploadModal: showUploadModal$ | async,\n } as obs\"\n valtimoCdsModal\n [open]=\"obs.showUploadModal\"\n showFooter=\"true\"\n class=\"valtimo-definition-uploader\"\n (close)=\"onCloseModal()\"\n>\n <cds-modal-header\n [showCloseButton]=\"obs.showCloseButton\"\n (closeSelect)=\"onCloseModal(obs.isStepAfterUpload && obs.uploadStatus !== UPLOAD_STATUS.ERROR)\"\n >\n <h3 cdsModalHeaderHeading>\n {{ 'buildingBlockManagement.importDefinition.title' | translate }}\n </h3>\n </cds-modal-header>\n\n <section [ngSwitch]=\"obs.activeStep\" cdsModalContent class=\"valtimo-definition-uploader__content\">\n <ng-template ngSwitchDefault>\n <valtimo-building-block-management-upload-step\n [message]=\"\n 'buildingBlockManagement.importDefinition.steps.' + obs.activeStep + '.message'\n | translate\n \"\n [title]=\"\n 'buildingBlockManagement.importDefinition.steps.' + obs.activeStep + '.title' | translate\n \"\n [illustration]=\"'valtimo-layout/img/' + obs.activeStep + '.svg'\"\n >\n </valtimo-building-block-management-upload-step>\n </ng-template>\n\n <form *ngSwitchCase=\"UPLOAD_STEP.FILE_SELECT\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"acceptedFiles\"\n [buttonText]=\"'buildingBlockManagement.importDefinition.upload.buttonText' | translate\"\n [description]=\"'buildingBlockManagement.importDefinition.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'buildingBlockManagement.importDefinition.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n class=\"valtimo-definition-uploader__file-uploader\"\n >\n </cds-file-uploader>\n\n <ng-container *ngIf=\"obs.activeStep === UPLOAD_STEP.FILE_SELECT\">\n <cds-inline-notification [notificationObj]=\"obs.notificationObj\"></cds-inline-notification>\n\n <div class=\"valtimo-uploader__checkbox\">\n <cds-checkbox\n [class.valtimo-definition-uploader__checkbox--invalid]=\"obs.showCheckboxError\"\n (checkedChange)=\"onCheckedChange($event)\"\n >\n {{ 'buildingBlockManagement.importDefinition.checkbox.message' | translate }}\n </cds-checkbox>\n\n <div *ngIf=\"obs.showCheckboxError\" class=\"valtimo-definition-uploader__error\">\n <svg cdsIcon=\"warning--filled\" size=\"16\"></svg>\n {{ 'buildingBlockManagement.importDefinition.checkbox.error' | translate }}\n </div>\n </div>\n </ng-container>\n </form>\n\n <cds-progress-bar\n *ngSwitchCase=\"UPLOAD_STEP.FILE_UPLOAD\"\n class=\"valtimo-definition-uploader__progress-bar\"\n [label]=\"'buildingBlockManagement.importDefinition.progressBar.label' | translate\"\n [status]=\"obs.uploadStatus\"\n [helperText]=\"\n 'buildingBlockManagement.importDefinition.progressBar.' + obs.uploadStatus | translate\n \"\n ></cds-progress-bar>\n </section>\n\n <cds-modal-footer\n class=\"valtimo-definition-uploader__footer\"\n [class.valtimo-definition-uploader__footer--double]=\"obs.activeStep === UPLOAD_STEP.PLUGINS\"\n >\n <button\n *ngIf=\"obs.uploadStatus !== UPLOAD_STATUS.ERROR && obs.activeStep !== UPLOAD_STEP.FILE_UPLOAD\"\n class=\"valtimo-definition-uploader__cancel\"\n cdsButton=\"ghost\"\n (click)=\"onCloseModal(obs.isStepAfterUpload)\"\n >\n {{ (obs.isStepAfterUpload ? 'interface.skip' : 'interface.cancel') | translate }}\n </button>\n\n <div class=\"valtimo-definition-uploader__actions\">\n <button\n *ngIf=\"obs.backButtonEnabled\"\n cdsButton=\"secondary\"\n (click)=\"onBackClick(obs.activeStep)\"\n >\n {{ 'interface.back' | translate }}\n </button>\n\n <button\n *ngIf=\"\n obs.uploadStatus !== UPLOAD_STATUS.ERROR && obs.activeStep !== UPLOAD_STEP.FILE_UPLOAD\n \"\n cdsButton=\"primary\"\n [disabled]=\"obs.nextButtonDisabled\"\n (click)=\"onNextClick(obs.activeStep)\"\n >\n {{\n (obs.activeStep === UPLOAD_STEP.FILE_SELECT\n ? 'buildingBlockManagement.importDefinition.startUpload'\n : 'interface.next'\n ) | translate\n }}\n </button>\n\n <button\n *ngIf=\"\n obs.uploadStatus === UPLOAD_STATUS.ERROR || obs.activeStep === UPLOAD_STEP.FILE_UPLOAD\n \"\n class=\"valtimo-definition-uploader__cancel\"\n cdsButton=\"primary\"\n (click)=\"onCloseModal(true)\"\n >\n {{ 'interface.finish' | translate }}\n </button>\n </div>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-definition-uploader__content,.valtimo-definition-uploader__content form{display:flex;flex-direction:column;gap:16px}.valtimo-definition-uploader__footer ::ng-deep .cds--modal-footer{justify-content:unset!important;display:grid!important;grid-template-columns:1fr 1fr 2fr!important;grid-template-areas:\"cancel . actions\"!important}.valtimo-definition-uploader__footer--double ::ng-deep .cds--modal-footer{grid-template-columns:1fr 1fr!important;grid-template-areas:\"cancel actions\"!important}.valtimo-definition-uploader__progress-bar{height:100%;display:flex;flex-direction:column;justify-content:center}.valtimo-definition-uploader__error{display:flex;align-items:center;gap:10px;color:#da1e28;fill:#da1e28;font-size:12px}.valtimo-definition-uploader__cancel{grid-area:cancel;width:100%}.valtimo-definition-uploader__actions{grid-area:actions;display:flex}.valtimo-definition-uploader__actions button{flex:unset;width:100%}.valtimo-definition-uploader__file-uploader ::ng-deep cds-file{max-width:unset}.valtimo-definition-uploader__checkbox{display:flex;flex-direction:column;gap:8px}.valtimo-definition-uploader__checkbox--invalid ::ng-deep label:before{border-color:#da1e28;margin-inline:0}.valtimo-definition-uploader ::ng-deep .cds--modal-container{height:550px}.valtimo-definition-uploader ::ng-deep .cds--checkbox-label-text{color:#000}\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: "directive", type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { 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: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i3$1.ProgressBar, selector: "cds-progress-bar, ibm-progress-bar", inputs: ["value", "id", "label", "helperText", "max", "type", "status", "size"] }, { kind: "ngmodule", type: NotificationModule }, { kind: "component", type: i3$1.Notification, selector: "cds-notification, cds-inline-notification, ibm-notification, ibm-inline-notification", inputs: ["notificationObj"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i3$1.Checkbox, selector: "cds-checkbox, ibm-checkbox", inputs: ["disabled", "skeleton", "hideLabel", "name", "id", "required", "value", "ariaLabel", "ariaLabelledby", "indeterminate", "checked"], outputs: ["click", "checkedChange", "indeterminateChange"] }, { kind: "component", type: BuildingBlockManagementUploadStepComponent, selector: "valtimo-building-block-management-upload-step", inputs: ["illustration", "message", "title"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
675
|
+
}
|
|
676
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementUploadModalComponent, decorators: [{
|
|
677
|
+
type: Component,
|
|
678
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-upload-modal', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
679
|
+
CommonModule,
|
|
680
|
+
FileUploaderModule,
|
|
681
|
+
ModalModule,
|
|
682
|
+
TranslateModule,
|
|
683
|
+
ButtonModule,
|
|
684
|
+
ProgressBarModule,
|
|
685
|
+
NotificationModule,
|
|
686
|
+
CheckboxModule,
|
|
687
|
+
BuildingBlockManagementUploadStepComponent,
|
|
688
|
+
ReactiveFormsModule,
|
|
689
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{\n activeStep: activeStep$ | async,\n backButtonEnabled: backButtonEnabled$ | async,\n isStepAfterUpload: isStepAfterUpload$ | async,\n nextButtonDisabled: nextButtonDisabled$ | async,\n notificationObj: notificationObj$ | async,\n showCheckboxError: showCheckboxError$ | async,\n showCloseButton: showCloseButton$ | async,\n uploadStatus: uploadStatus$ | async,\n showUploadModal: showUploadModal$ | async,\n } as obs\"\n valtimoCdsModal\n [open]=\"obs.showUploadModal\"\n showFooter=\"true\"\n class=\"valtimo-definition-uploader\"\n (close)=\"onCloseModal()\"\n>\n <cds-modal-header\n [showCloseButton]=\"obs.showCloseButton\"\n (closeSelect)=\"onCloseModal(obs.isStepAfterUpload && obs.uploadStatus !== UPLOAD_STATUS.ERROR)\"\n >\n <h3 cdsModalHeaderHeading>\n {{ 'buildingBlockManagement.importDefinition.title' | translate }}\n </h3>\n </cds-modal-header>\n\n <section [ngSwitch]=\"obs.activeStep\" cdsModalContent class=\"valtimo-definition-uploader__content\">\n <ng-template ngSwitchDefault>\n <valtimo-building-block-management-upload-step\n [message]=\"\n 'buildingBlockManagement.importDefinition.steps.' + obs.activeStep + '.message'\n | translate\n \"\n [title]=\"\n 'buildingBlockManagement.importDefinition.steps.' + obs.activeStep + '.title' | translate\n \"\n [illustration]=\"'valtimo-layout/img/' + obs.activeStep + '.svg'\"\n >\n </valtimo-building-block-management-upload-step>\n </ng-template>\n\n <form *ngSwitchCase=\"UPLOAD_STEP.FILE_SELECT\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"acceptedFiles\"\n [buttonText]=\"'buildingBlockManagement.importDefinition.upload.buttonText' | translate\"\n [description]=\"'buildingBlockManagement.importDefinition.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'buildingBlockManagement.importDefinition.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n class=\"valtimo-definition-uploader__file-uploader\"\n >\n </cds-file-uploader>\n\n <ng-container *ngIf=\"obs.activeStep === UPLOAD_STEP.FILE_SELECT\">\n <cds-inline-notification [notificationObj]=\"obs.notificationObj\"></cds-inline-notification>\n\n <div class=\"valtimo-uploader__checkbox\">\n <cds-checkbox\n [class.valtimo-definition-uploader__checkbox--invalid]=\"obs.showCheckboxError\"\n (checkedChange)=\"onCheckedChange($event)\"\n >\n {{ 'buildingBlockManagement.importDefinition.checkbox.message' | translate }}\n </cds-checkbox>\n\n <div *ngIf=\"obs.showCheckboxError\" class=\"valtimo-definition-uploader__error\">\n <svg cdsIcon=\"warning--filled\" size=\"16\"></svg>\n {{ 'buildingBlockManagement.importDefinition.checkbox.error' | translate }}\n </div>\n </div>\n </ng-container>\n </form>\n\n <cds-progress-bar\n *ngSwitchCase=\"UPLOAD_STEP.FILE_UPLOAD\"\n class=\"valtimo-definition-uploader__progress-bar\"\n [label]=\"'buildingBlockManagement.importDefinition.progressBar.label' | translate\"\n [status]=\"obs.uploadStatus\"\n [helperText]=\"\n 'buildingBlockManagement.importDefinition.progressBar.' + obs.uploadStatus | translate\n \"\n ></cds-progress-bar>\n </section>\n\n <cds-modal-footer\n class=\"valtimo-definition-uploader__footer\"\n [class.valtimo-definition-uploader__footer--double]=\"obs.activeStep === UPLOAD_STEP.PLUGINS\"\n >\n <button\n *ngIf=\"obs.uploadStatus !== UPLOAD_STATUS.ERROR && obs.activeStep !== UPLOAD_STEP.FILE_UPLOAD\"\n class=\"valtimo-definition-uploader__cancel\"\n cdsButton=\"ghost\"\n (click)=\"onCloseModal(obs.isStepAfterUpload)\"\n >\n {{ (obs.isStepAfterUpload ? 'interface.skip' : 'interface.cancel') | translate }}\n </button>\n\n <div class=\"valtimo-definition-uploader__actions\">\n <button\n *ngIf=\"obs.backButtonEnabled\"\n cdsButton=\"secondary\"\n (click)=\"onBackClick(obs.activeStep)\"\n >\n {{ 'interface.back' | translate }}\n </button>\n\n <button\n *ngIf=\"\n obs.uploadStatus !== UPLOAD_STATUS.ERROR && obs.activeStep !== UPLOAD_STEP.FILE_UPLOAD\n \"\n cdsButton=\"primary\"\n [disabled]=\"obs.nextButtonDisabled\"\n (click)=\"onNextClick(obs.activeStep)\"\n >\n {{\n (obs.activeStep === UPLOAD_STEP.FILE_SELECT\n ? 'buildingBlockManagement.importDefinition.startUpload'\n : 'interface.next'\n ) | translate\n }}\n </button>\n\n <button\n *ngIf=\"\n obs.uploadStatus === UPLOAD_STATUS.ERROR || obs.activeStep === UPLOAD_STEP.FILE_UPLOAD\n \"\n class=\"valtimo-definition-uploader__cancel\"\n cdsButton=\"primary\"\n (click)=\"onCloseModal(true)\"\n >\n {{ 'interface.finish' | translate }}\n </button>\n </div>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-definition-uploader__content,.valtimo-definition-uploader__content form{display:flex;flex-direction:column;gap:16px}.valtimo-definition-uploader__footer ::ng-deep .cds--modal-footer{justify-content:unset!important;display:grid!important;grid-template-columns:1fr 1fr 2fr!important;grid-template-areas:\"cancel . actions\"!important}.valtimo-definition-uploader__footer--double ::ng-deep .cds--modal-footer{grid-template-columns:1fr 1fr!important;grid-template-areas:\"cancel actions\"!important}.valtimo-definition-uploader__progress-bar{height:100%;display:flex;flex-direction:column;justify-content:center}.valtimo-definition-uploader__error{display:flex;align-items:center;gap:10px;color:#da1e28;fill:#da1e28;font-size:12px}.valtimo-definition-uploader__cancel{grid-area:cancel;width:100%}.valtimo-definition-uploader__actions{grid-area:actions;display:flex}.valtimo-definition-uploader__actions button{flex:unset;width:100%}.valtimo-definition-uploader__file-uploader ::ng-deep cds-file{max-width:unset}.valtimo-definition-uploader__checkbox{display:flex;flex-direction:column;gap:8px}.valtimo-definition-uploader__checkbox--invalid ::ng-deep label:before{border-color:#da1e28;margin-inline:0}.valtimo-definition-uploader ::ng-deep .cds--modal-container{height:550px}.valtimo-definition-uploader ::ng-deep .cds--checkbox-label-text{color:#000}\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"] }]
|
|
690
|
+
}], ctorParameters: () => [{ type: BuildingBlockManagementApiService }, { type: BuildingBlockManagementService }, { type: i2$2.FormBuilder }, { type: i3$1.IconService }, { type: i4$1.TranslateService }] });
|
|
691
|
+
|
|
692
|
+
/*
|
|
693
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
694
|
+
*
|
|
695
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
696
|
+
* you may not use this file except in compliance with the License.
|
|
697
|
+
* You may obtain a copy of the License at
|
|
698
|
+
*
|
|
699
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
700
|
+
*
|
|
701
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
702
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
703
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
704
|
+
* See the License for the specific language governing permissions and
|
|
705
|
+
* limitations under the License.
|
|
706
|
+
*/
|
|
707
|
+
class BuildingBlockManagementListComponent {
|
|
708
|
+
constructor(buildingBlockManagementApiService, buildingBlockManagementService, iconService, router) {
|
|
709
|
+
this.buildingBlockManagementApiService = buildingBlockManagementApiService;
|
|
710
|
+
this.buildingBlockManagementService = buildingBlockManagementService;
|
|
711
|
+
this.iconService = iconService;
|
|
712
|
+
this.router = router;
|
|
713
|
+
this.$loading = signal(true);
|
|
714
|
+
this.buildingBlockDefinitions$ = this.buildingBlockManagementService.reload$.pipe(switchMap(() => this.buildingBlockManagementApiService.getBuildingBlockDefinitions()), tap(res => {
|
|
715
|
+
this.buildingBlockManagementService.setUsedKeys(res.map(item => item.key));
|
|
716
|
+
this.$loading.set(false);
|
|
717
|
+
}));
|
|
718
|
+
this.FIELDS = [
|
|
719
|
+
{ key: 'name', label: 'buildingBlockManagement.listColumns.name' },
|
|
720
|
+
{ key: 'key', label: 'buildingBlockManagement.listColumns.key' },
|
|
721
|
+
{
|
|
722
|
+
key: 'versionTag',
|
|
723
|
+
label: 'buildingBlockManagement.listColumns.versionTag',
|
|
724
|
+
viewType: ViewType.TAGS,
|
|
725
|
+
},
|
|
726
|
+
];
|
|
727
|
+
this.iconService.registerAll([Upload16]);
|
|
728
|
+
}
|
|
729
|
+
showCreateModal() {
|
|
730
|
+
this.buildingBlockManagementService.showCreateModal();
|
|
731
|
+
}
|
|
732
|
+
showUploadModal() {
|
|
733
|
+
this.buildingBlockManagementService.showUploadModal();
|
|
734
|
+
}
|
|
735
|
+
onRowClick(buildingBlockDefinition) {
|
|
736
|
+
this.router.navigate([
|
|
737
|
+
'/building-block-management',
|
|
738
|
+
'building-block',
|
|
739
|
+
buildingBlockDefinition.key,
|
|
740
|
+
'version',
|
|
741
|
+
buildingBlockDefinition.versionTag,
|
|
742
|
+
BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL,
|
|
743
|
+
]);
|
|
744
|
+
}
|
|
745
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementListComponent, deps: [{ token: BuildingBlockManagementApiService }, { token: BuildingBlockManagementService }, { token: i3$1.IconService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
746
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BuildingBlockManagementListComponent, isStandalone: true, selector: "valtimo-building-block-management-list", providers: [BuildingBlockManagementService], 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=\"{buildingBlockDefinitions: buildingBlockDefinitions$ | async} as obs\">\n <valtimo-carbon-list\n [fields]=\"FIELDS\"\n [items]=\"obs.buildingBlockDefinitions\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClick($event)\"\n >\n <ng-container\n carbonToolbarContent\n [ngTemplateOutlet]=\"buildingBlockDefinitionActions\"\n ></ng-container>\n\n <valtimo-no-results\n [action]=\"buildingBlockDefinitionActions\"\n [description]=\"'buildingBlockManagement.noResults.description' | translate\"\n [title]=\"'buildingBlockManagement.noResults.title' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n</ng-container>\n\n<ng-template #buildingBlockDefinitionActions>\n <div class=\"valtimo-building-block-management-list__actions\">\n <button cdsButton=\"ghost\" (click)=\"showUploadModal()\">\n {{ 'Upload' | translate }}\n\n <svg cdsIcon=\"upload\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n\n <button cdsButton=\"primary\" (click)=\"showCreateModal()\">\n {{ 'interface.create' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n</ng-template>\n\n<valtimo-building-block-management-create-modal></valtimo-building-block-management-create-modal>\n\n<valtimo-building-block-management-upload-modal></valtimo-building-block-management-upload-modal>\n", styles: [".valtimo-building-block-management-list__actions{display:flex}\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: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i2$1.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "skeletonRowCount", "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: i2$1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: BuildingBlockManagementCreateModalComponent, selector: "valtimo-building-block-management-create-modal" }, { kind: "component", type: BuildingBlockManagementUploadModalComponent, selector: "valtimo-building-block-management-upload-modal" }] }); }
|
|
747
|
+
}
|
|
748
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementListComponent, decorators: [{
|
|
749
|
+
type: Component,
|
|
750
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-list', imports: [
|
|
751
|
+
CommonModule,
|
|
752
|
+
CarbonListModule,
|
|
753
|
+
ButtonModule,
|
|
754
|
+
IconModule,
|
|
755
|
+
TranslatePipe,
|
|
756
|
+
BuildingBlockManagementCreateModalComponent,
|
|
757
|
+
BuildingBlockManagementUploadModalComponent,
|
|
758
|
+
], providers: [BuildingBlockManagementService], 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=\"{buildingBlockDefinitions: buildingBlockDefinitions$ | async} as obs\">\n <valtimo-carbon-list\n [fields]=\"FIELDS\"\n [items]=\"obs.buildingBlockDefinitions\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClick($event)\"\n >\n <ng-container\n carbonToolbarContent\n [ngTemplateOutlet]=\"buildingBlockDefinitionActions\"\n ></ng-container>\n\n <valtimo-no-results\n [action]=\"buildingBlockDefinitionActions\"\n [description]=\"'buildingBlockManagement.noResults.description' | translate\"\n [title]=\"'buildingBlockManagement.noResults.title' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n</ng-container>\n\n<ng-template #buildingBlockDefinitionActions>\n <div class=\"valtimo-building-block-management-list__actions\">\n <button cdsButton=\"ghost\" (click)=\"showUploadModal()\">\n {{ 'Upload' | translate }}\n\n <svg cdsIcon=\"upload\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n\n <button cdsButton=\"primary\" (click)=\"showCreateModal()\">\n {{ 'interface.create' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n</ng-template>\n\n<valtimo-building-block-management-create-modal></valtimo-building-block-management-create-modal>\n\n<valtimo-building-block-management-upload-modal></valtimo-building-block-management-upload-modal>\n", styles: [".valtimo-building-block-management-list__actions{display:flex}\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"] }]
|
|
759
|
+
}], ctorParameters: () => [{ type: BuildingBlockManagementApiService }, { type: BuildingBlockManagementService }, { type: i3$1.IconService }, { type: i3.Router }] });
|
|
760
|
+
|
|
761
|
+
/*
|
|
762
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
763
|
+
*
|
|
764
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
765
|
+
* you may not use this file except in compliance with the License.
|
|
766
|
+
* You may obtain a copy of the License at
|
|
767
|
+
*
|
|
768
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
769
|
+
*
|
|
770
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
771
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
772
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
773
|
+
* See the License for the specific language governing permissions and
|
|
774
|
+
* limitations under the License.
|
|
775
|
+
*/
|
|
776
|
+
class BuildingBlockManagementMetadataComponent {
|
|
777
|
+
get name() {
|
|
778
|
+
return this.formGroup.get('name');
|
|
779
|
+
}
|
|
780
|
+
get key() {
|
|
781
|
+
return this.formGroup.get('key');
|
|
782
|
+
}
|
|
783
|
+
get description() {
|
|
784
|
+
return this.formGroup.get('description');
|
|
785
|
+
}
|
|
786
|
+
constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService, fb) {
|
|
787
|
+
this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
|
|
788
|
+
this.buildingBlockManagementApiService = buildingBlockManagementApiService;
|
|
789
|
+
this.fb = fb;
|
|
790
|
+
this.formGroup = this.fb.group({
|
|
791
|
+
name: this.fb.control('', Validators.required),
|
|
792
|
+
key: this.fb.control('', Validators.required),
|
|
793
|
+
description: this.fb.control(''),
|
|
794
|
+
});
|
|
795
|
+
this._subscriptions = new Subscription();
|
|
796
|
+
}
|
|
797
|
+
ngOnInit() {
|
|
798
|
+
this.openBuildingBlockDefinitionSubscription();
|
|
799
|
+
this.openLoadingAndFinalSubscription();
|
|
800
|
+
}
|
|
801
|
+
ngOnDestroy() {
|
|
802
|
+
this._subscriptions.unsubscribe();
|
|
803
|
+
}
|
|
804
|
+
onSave() {
|
|
805
|
+
this.formGroup.disable();
|
|
806
|
+
this.buildingBlockManagementApiService
|
|
807
|
+
.updateBuildingBlockDefinition(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, this.formGroup.value)
|
|
808
|
+
.subscribe(() => {
|
|
809
|
+
this.buildingBlockManagementDetailService.reload();
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
openBuildingBlockDefinitionSubscription() {
|
|
813
|
+
this._subscriptions.add(this.buildingBlockManagementDetailService.buildingBlockDefinition$.subscribe(buildingBlockDefinition => {
|
|
814
|
+
this.formGroup.setValue({
|
|
815
|
+
name: buildingBlockDefinition.name,
|
|
816
|
+
key: buildingBlockDefinition.key,
|
|
817
|
+
description: buildingBlockDefinition.description,
|
|
818
|
+
});
|
|
819
|
+
}));
|
|
820
|
+
}
|
|
821
|
+
openLoadingAndFinalSubscription() {
|
|
822
|
+
this._subscriptions.add(combineLatest([
|
|
823
|
+
this.buildingBlockManagementDetailService.loadingDefinition$,
|
|
824
|
+
this.buildingBlockManagementDetailService.isFinal$,
|
|
825
|
+
]).subscribe(([loadingDefinition, isFinal]) => {
|
|
826
|
+
if (loadingDefinition) {
|
|
827
|
+
this.formGroup.disable();
|
|
828
|
+
}
|
|
829
|
+
else if (!isFinal) {
|
|
830
|
+
this.name.enable();
|
|
831
|
+
this.description.enable();
|
|
832
|
+
this.formGroup.markAsPristine();
|
|
833
|
+
}
|
|
834
|
+
}));
|
|
835
|
+
}
|
|
836
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementMetadataComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }, { token: i2$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
837
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BuildingBlockManagementMetadataComponent, isStandalone: true, selector: "valtimo-building-block-management-metadata", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<form class=\"building-block-management-metadata\" [formGroup]=\"formGroup\" [cdsLayer]=\"1\">\n <h4 class=\"building-block-management-metadata__title\">\n {{ 'buildingBlockManagement.metadata.title' | translate }}\n </h4>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\" [invalid]=\"name.touched && name.invalid\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.name' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.nameTooltip' | translate\"\n [disabled]=\"formGroup.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <input\n formControlName=\"name\"\n cdsText\n placeholder=\"{{ 'buildingBlockManagement.createDefinition.namePlaceholder' | translate }}\"\n />\n </cds-label>\n </div>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.keyTitle' | translate }}\n </span>\n\n <input formControlName=\"key\" cdsText valtimoReadOnly [isReadOnly]=\"true\" />\n </cds-label>\n </div>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"formGroup.disabled\"\n [invalid]=\"description.touched && description.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.description' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.descriptionTooltip' | translate\"\n [disabled]=\"formGroup.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <textarea\n cdsTextArea\n formControlName=\"description\"\n placeholder=\"{{\n 'buildingBlockManagement.createDefinition.descriptionPlaceholder' | translate\n }}\"\n [rows]=\"3\"\n [cols]=\"150\"\n ></textarea>\n </cds-label>\n </div>\n\n <div class=\"building-block-management-metadata__buttons\">\n <button\n cdsButton=\"primary\"\n [disabled]=\"formGroup.disabled || formGroup.invalid || formGroup.pristine\"\n (click)=\"onSave()\"\n >\n {{ 'interface.save' | translate }}\n </button>\n </div>\n</form>\n", styles: [".building-block-management-metadata{display:flex;flex-direction:column;gap:16px;padding:16px;background-color:var(--cds-layer-01);max-width:625px}.building-block-management-metadata__title{font-size:16px;line-height:24px;font-weight:600}.building-block-management-metadata__buttons{display:flex;justify-content:flex-end;width:100%}.cds--text-input__field-wrapper cds-label{width:100%}.cds--text-input__field-wrapper ::ng-deep .cds--label{width:100%}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:16px}.label-with-tooltip{display:flex;align-items:center}.select-label{padding-bottom:8px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$2.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: 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: InputModule }, { kind: "component", type: i3$1.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3$1.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i3$1.TextArea, selector: "[cdsTextArea], [ibmTextArea]", inputs: ["theme", "invalid", "skeleton"] }, { kind: "ngmodule", type: TooltipIconModule }, { kind: "component", type: i2$1.TooltipIconComponent, selector: "v-tooltip-icon", inputs: ["tooltip", "disabled"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i3$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "directive", type: ReadOnlyDirective, selector: "[valtimoReadOnly]", inputs: ["isReadOnly"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }] }); }
|
|
838
|
+
}
|
|
839
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementMetadataComponent, decorators: [{
|
|
840
|
+
type: Component,
|
|
841
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-metadata', imports: [
|
|
842
|
+
CommonModule,
|
|
843
|
+
TranslatePipe,
|
|
844
|
+
ReactiveFormsModule,
|
|
845
|
+
InputModule,
|
|
846
|
+
TooltipIconModule,
|
|
847
|
+
LayerModule,
|
|
848
|
+
ReadOnlyDirective,
|
|
849
|
+
ButtonModule,
|
|
850
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<form class=\"building-block-management-metadata\" [formGroup]=\"formGroup\" [cdsLayer]=\"1\">\n <h4 class=\"building-block-management-metadata__title\">\n {{ 'buildingBlockManagement.metadata.title' | translate }}\n </h4>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\" [invalid]=\"name.touched && name.invalid\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.name' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.nameTooltip' | translate\"\n [disabled]=\"formGroup.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <input\n formControlName=\"name\"\n cdsText\n placeholder=\"{{ 'buildingBlockManagement.createDefinition.namePlaceholder' | translate }}\"\n />\n </cds-label>\n </div>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.keyTitle' | translate }}\n </span>\n\n <input formControlName=\"key\" cdsText valtimoReadOnly [isReadOnly]=\"true\" />\n </cds-label>\n </div>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"formGroup.disabled\"\n [invalid]=\"description.touched && description.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.description' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.descriptionTooltip' | translate\"\n [disabled]=\"formGroup.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <textarea\n cdsTextArea\n formControlName=\"description\"\n placeholder=\"{{\n 'buildingBlockManagement.createDefinition.descriptionPlaceholder' | translate\n }}\"\n [rows]=\"3\"\n [cols]=\"150\"\n ></textarea>\n </cds-label>\n </div>\n\n <div class=\"building-block-management-metadata__buttons\">\n <button\n cdsButton=\"primary\"\n [disabled]=\"formGroup.disabled || formGroup.invalid || formGroup.pristine\"\n (click)=\"onSave()\"\n >\n {{ 'interface.save' | translate }}\n </button>\n </div>\n</form>\n", styles: [".building-block-management-metadata{display:flex;flex-direction:column;gap:16px;padding:16px;background-color:var(--cds-layer-01);max-width:625px}.building-block-management-metadata__title{font-size:16px;line-height:24px;font-weight:600}.building-block-management-metadata__buttons{display:flex;justify-content:flex-end;width:100%}.cds--text-input__field-wrapper cds-label{width:100%}.cds--text-input__field-wrapper ::ng-deep .cds--label{width:100%}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:16px}.label-with-tooltip{display:flex;align-items:center}.select-label{padding-bottom:8px}\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"] }]
|
|
851
|
+
}], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }, { type: i2$2.FormBuilder }] });
|
|
852
|
+
|
|
853
|
+
/*
|
|
854
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
855
|
+
*
|
|
856
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
857
|
+
* you may not use this file except in compliance with the License.
|
|
858
|
+
* You may obtain a copy of the License at
|
|
859
|
+
*
|
|
860
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
861
|
+
*
|
|
862
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
863
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
864
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
865
|
+
* See the License for the specific language governing permissions and
|
|
866
|
+
* limitations under the License.
|
|
867
|
+
*/
|
|
868
|
+
class BuildingBlockManagementArtworkComponent {
|
|
869
|
+
get file() {
|
|
870
|
+
return this.formGroup.get('file');
|
|
871
|
+
}
|
|
872
|
+
constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService, formBuilder, iconService) {
|
|
873
|
+
this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
|
|
874
|
+
this.buildingBlockManagementApiService = buildingBlockManagementApiService;
|
|
875
|
+
this.formBuilder = formBuilder;
|
|
876
|
+
this.iconService = iconService;
|
|
877
|
+
this.ACCEPTED_FILES = ['png'];
|
|
878
|
+
this.formGroup = this.formBuilder.group({
|
|
879
|
+
file: this.formBuilder.control(new Set(), [Validators.required]),
|
|
880
|
+
});
|
|
881
|
+
this.loadingArtwork$ = new BehaviorSubject(true);
|
|
882
|
+
this._refresh$ = new BehaviorSubject(null);
|
|
883
|
+
this.artwork$ = this._refresh$.pipe(switchMap(() => this.buildingBlockManagementApiService.getBuildingBlockArtwork(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag)), tap(() => this.loadingArtwork$.next(false)));
|
|
884
|
+
this.showDeleteConfirmationModal$ = new BehaviorSubject(false);
|
|
885
|
+
this._subscriptions = new Subscription();
|
|
886
|
+
this.iconService.registerAll([Upload16, TrashCan16]);
|
|
887
|
+
}
|
|
888
|
+
ngOnInit() {
|
|
889
|
+
this._subscriptions.add(this.buildingBlockManagementDetailService.isFinal$.subscribe(isFinal => {
|
|
890
|
+
if (isFinal) {
|
|
891
|
+
this.formGroup.disable();
|
|
892
|
+
}
|
|
893
|
+
else {
|
|
894
|
+
this.formGroup.enable();
|
|
895
|
+
}
|
|
896
|
+
}));
|
|
897
|
+
}
|
|
898
|
+
ngOnDestroy() {
|
|
899
|
+
this._subscriptions.unsubscribe();
|
|
900
|
+
}
|
|
901
|
+
async onSave() {
|
|
902
|
+
const file = Array.from(this.file.value)[0]?.file;
|
|
903
|
+
const imageBase64 = await this.fileToBase64(file);
|
|
904
|
+
this.formGroup.disable();
|
|
905
|
+
this.buildingBlockManagementApiService
|
|
906
|
+
.createBuildingBlockArtwork(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, {
|
|
907
|
+
imageBase64,
|
|
908
|
+
})
|
|
909
|
+
.subscribe({
|
|
910
|
+
next: () => {
|
|
911
|
+
this._refresh$.next(null);
|
|
912
|
+
this.formGroup.enable();
|
|
913
|
+
},
|
|
914
|
+
error: () => {
|
|
915
|
+
this.formGroup.enable();
|
|
916
|
+
},
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
onDeleteButtonClick() {
|
|
920
|
+
this.showDeleteConfirmationModal$.next(true);
|
|
921
|
+
}
|
|
922
|
+
onDelete() {
|
|
923
|
+
this.buildingBlockManagementApiService
|
|
924
|
+
.deleteBuildingBlockArtwork(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag)
|
|
925
|
+
.subscribe(() => {
|
|
926
|
+
this._refresh$.next(null);
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
async fileToBase64(file) {
|
|
930
|
+
return new Promise((resolve, reject) => {
|
|
931
|
+
const reader = new FileReader();
|
|
932
|
+
reader.readAsDataURL(file);
|
|
933
|
+
reader.onload = () => {
|
|
934
|
+
const result = reader.result;
|
|
935
|
+
const pureBase64 = result.split(',')[1];
|
|
936
|
+
resolve(pureBase64);
|
|
937
|
+
};
|
|
938
|
+
reader.onerror = error => reject(error);
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementArtworkComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }, { token: i2$2.FormBuilder }, { token: i3$1.IconService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
942
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: BuildingBlockManagementArtworkComponent, isStandalone: true, selector: "valtimo-building-block-management-artwork", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<form\n *ngIf=\"{\n artwork: artwork$ | async,\n loadingArtwork: loadingArtwork$ | async,\n } as obs\"\n class=\"building-block-management-artwork\"\n [formGroup]=\"formGroup\"\n [cdsLayer]=\"1\"\n>\n <h4 class=\"building-block-management-artwork__title\">\n {{ 'buildingBlockManagement.artwork.title' | translate }}\n </h4>\n\n @if (obs.loadingArtwork) {\n <div class=\"loading-container\"><cds-loading></cds-loading></div>\n }\n\n @if (!obs.loadingArtwork && obs.artwork) {\n <div class=\"building-block-management-artwork__preview\">\n <img\n class=\"building-block-management-artwork__image\"\n [src]=\"'data:image/png;base64,' + obs.artwork.imageBase64\"\n />\n </div>\n\n <div class=\"building-block-management-artwork__buttons\">\n <button cdsButton=\"danger\" (click)=\"onDeleteButtonClick()\" [disabled]=\"formGroup.disabled\">\n {{ 'interface.delete' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </div>\n }\n\n @if (!obs.loadingArtwork && !obs.artwork) {\n <cds-file-uploader\n *ngIf=\"!obs.loadingArtwork && !obs.artwork\"\n [accept]=\"ACCEPTED_FILES\"\n [multiple]=\"false\"\n buttonType=\"primary\"\n [title]=\"'buildingBlockManagement.artwork.fileUploaderTitle' | translate\"\n [description]=\"'buildingBlockManagement.artwork.fileUploaderDescription' | translate\"\n [buttonText]=\"'buildingBlockManagement.artwork.fileUploaderButton' | translate\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n\n <div class=\"building-block-management-artwork__buttons\">\n <button\n cdsButton=\"primary\"\n [disabled]=\"formGroup.disabled || formGroup.invalid || formGroup.pristine\"\n (click)=\"onSave()\"\n >\n {{ 'interface.upload' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n </div>\n }\n</form>\n\n<valtimo-render-in-body>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"buildingBlockManagement.artwork.deleteConfirmationModalText\"\n [showModalSubject$]=\"showDeleteConfirmationModal$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDelete()\"\n ></valtimo-confirmation-modal>\n</valtimo-render-in-body>\n", styles: [".building-block-management-artwork{display:flex;flex-direction:column;gap:16px;padding:16px;background-color:var(--cds-layer-01);max-width:625px}.building-block-management-artwork__title{font-size:16px;line-height:24px;font-weight:600;margin-bottom:8px}.building-block-management-artwork__preview{display:flex;justify-content:center;align-items:center;background-color:var(--cds-layer-02);padding:12px;min-height:180px}.building-block-management-artwork__image{max-width:100%;max-height:300px;object-fit:contain}.building-block-management-artwork__buttons{display:flex;justify-content:flex-end;width:100%;margin-top:12px}.building-block-management-artwork__buttons button[cdsButton]{min-width:100px}.label-with-tooltip{display:flex;align-items:center}.loading-container{display:flex;width:100%;justify-content:center;align-items:center;min-height:180px}\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: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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: InputModule }, { kind: "ngmodule", type: TooltipIconModule }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i3$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { 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: LoadingModule }, { kind: "component", type: i3$1.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { 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" }] }); }
|
|
943
|
+
}
|
|
944
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementArtworkComponent, decorators: [{
|
|
945
|
+
type: Component,
|
|
946
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-artwork', imports: [
|
|
947
|
+
CommonModule,
|
|
948
|
+
TranslatePipe,
|
|
949
|
+
ReactiveFormsModule,
|
|
950
|
+
InputModule,
|
|
951
|
+
TooltipIconModule,
|
|
952
|
+
LayerModule,
|
|
953
|
+
ButtonModule,
|
|
954
|
+
FileUploaderModule,
|
|
955
|
+
LoadingModule,
|
|
956
|
+
IconModule,
|
|
957
|
+
ConfirmationModalModule,
|
|
958
|
+
RenderInBodyComponent,
|
|
959
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<form\n *ngIf=\"{\n artwork: artwork$ | async,\n loadingArtwork: loadingArtwork$ | async,\n } as obs\"\n class=\"building-block-management-artwork\"\n [formGroup]=\"formGroup\"\n [cdsLayer]=\"1\"\n>\n <h4 class=\"building-block-management-artwork__title\">\n {{ 'buildingBlockManagement.artwork.title' | translate }}\n </h4>\n\n @if (obs.loadingArtwork) {\n <div class=\"loading-container\"><cds-loading></cds-loading></div>\n }\n\n @if (!obs.loadingArtwork && obs.artwork) {\n <div class=\"building-block-management-artwork__preview\">\n <img\n class=\"building-block-management-artwork__image\"\n [src]=\"'data:image/png;base64,' + obs.artwork.imageBase64\"\n />\n </div>\n\n <div class=\"building-block-management-artwork__buttons\">\n <button cdsButton=\"danger\" (click)=\"onDeleteButtonClick()\" [disabled]=\"formGroup.disabled\">\n {{ 'interface.delete' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </div>\n }\n\n @if (!obs.loadingArtwork && !obs.artwork) {\n <cds-file-uploader\n *ngIf=\"!obs.loadingArtwork && !obs.artwork\"\n [accept]=\"ACCEPTED_FILES\"\n [multiple]=\"false\"\n buttonType=\"primary\"\n [title]=\"'buildingBlockManagement.artwork.fileUploaderTitle' | translate\"\n [description]=\"'buildingBlockManagement.artwork.fileUploaderDescription' | translate\"\n [buttonText]=\"'buildingBlockManagement.artwork.fileUploaderButton' | translate\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n\n <div class=\"building-block-management-artwork__buttons\">\n <button\n cdsButton=\"primary\"\n [disabled]=\"formGroup.disabled || formGroup.invalid || formGroup.pristine\"\n (click)=\"onSave()\"\n >\n {{ 'interface.upload' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n </div>\n }\n</form>\n\n<valtimo-render-in-body>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"buildingBlockManagement.artwork.deleteConfirmationModalText\"\n [showModalSubject$]=\"showDeleteConfirmationModal$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDelete()\"\n ></valtimo-confirmation-modal>\n</valtimo-render-in-body>\n", styles: [".building-block-management-artwork{display:flex;flex-direction:column;gap:16px;padding:16px;background-color:var(--cds-layer-01);max-width:625px}.building-block-management-artwork__title{font-size:16px;line-height:24px;font-weight:600;margin-bottom:8px}.building-block-management-artwork__preview{display:flex;justify-content:center;align-items:center;background-color:var(--cds-layer-02);padding:12px;min-height:180px}.building-block-management-artwork__image{max-width:100%;max-height:300px;object-fit:contain}.building-block-management-artwork__buttons{display:flex;justify-content:flex-end;width:100%;margin-top:12px}.building-block-management-artwork__buttons button[cdsButton]{min-width:100px}.label-with-tooltip{display:flex;align-items:center}.loading-container{display:flex;width:100%;justify-content:center;align-items:center;min-height:180px}\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"] }]
|
|
960
|
+
}], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }, { type: i2$2.FormBuilder }, { type: i3$1.IconService }] });
|
|
961
|
+
|
|
962
|
+
/*
|
|
963
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
964
|
+
*
|
|
965
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
966
|
+
* you may not use this file except in compliance with the License.
|
|
967
|
+
* You may obtain a copy of the License at
|
|
968
|
+
*
|
|
969
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
970
|
+
*
|
|
971
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
972
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
973
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
974
|
+
* See the License for the specific language governing permissions and
|
|
975
|
+
* limitations under the License.
|
|
976
|
+
*/
|
|
977
|
+
class BuildingBlockManagementPluginsComponent {
|
|
978
|
+
constructor(buildingBlockManagementApiService, pluginManagementService, buildingBlockManagementDetailService) {
|
|
979
|
+
this.buildingBlockManagementApiService = buildingBlockManagementApiService;
|
|
980
|
+
this.pluginManagementService = pluginManagementService;
|
|
981
|
+
this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
|
|
982
|
+
this.loading$ = new BehaviorSubject(true);
|
|
983
|
+
this.usedPluginTitles$ = combineLatest([
|
|
984
|
+
this.pluginManagementService.getPluginDefinitions(),
|
|
985
|
+
this.buildingBlockManagementApiService.getPluginDefinitionsForBuildingBlock(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag),
|
|
986
|
+
]).pipe(map(([pluginDefinitions, pluginsForBuildingBlock]) => {
|
|
987
|
+
const plugins = pluginsForBuildingBlock?.plugins ?? [];
|
|
988
|
+
const pluginKeys = plugins.map(plugin => plugin.pluginDefinitionKey).filter(Boolean);
|
|
989
|
+
return pluginKeys.map(pluginDefinitionForBuildingBlock => pluginDefinitions.find(pluginDefinition => pluginDefinition.key === pluginDefinitionForBuildingBlock)?.title ?? pluginDefinitionForBuildingBlock);
|
|
990
|
+
}), tap(() => this.loading$.next(false)));
|
|
991
|
+
}
|
|
992
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementPluginsComponent, deps: [{ token: BuildingBlockManagementApiService }, { token: i2$3.PluginManagementService }, { token: BuildingBlockManagementDetailService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
993
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: BuildingBlockManagementPluginsComponent, isStandalone: true, selector: "valtimo-building-block-management-plugins", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"building-block-management-plugins\"\n *ngIf=\"{usedPluginTitles: usedPluginTitles$ | async, loading: loading$ | async} as obs\"\n>\n <h4 class=\"building-block-management-plugins__title\">\n {{ 'buildingBlockManagement.plugins.title' | translate }}\n </h4>\n\n @if (obs.loading) {\n <div class=\"loading-container\"><cds-loading size=\"sm\"></cds-loading></div>\n }\n\n @if (!obs.loading && obs.usedPluginTitles.length > 0) {\n <div class=\"building-block-management-plugins__tags\">\n @for (pluginTitle of obs.usedPluginTitles; track pluginTitle) {\n <cds-tag type=\"blue\">{{ pluginTitle }}</cds-tag>\n }\n </div>\n }\n\n @if (!obs.loading && obs.usedPluginTitles.length === 0) {\n <p class=\"building-block-management-plugins__description cds--label-description\">\n {{ 'buildingBlockManagement.plugins.noPluginsUsed' | translate }}\n </p>\n }\n</div>\n", styles: [".building-block-management-plugins{display:flex;padding:16px 24px;width:100%;background-color:var(--cds-layer-01);align-items:center;gap:16px}.building-block-management-plugins__title{font-size:16px;line-height:24px;font-weight:600;flex-shrink:0}.building-block-management-plugins__tags{display:flex;flex-flow:row wrap;height:100%;gap:8px}.building-block-management-plugins__description{padding:0;margin:0}.loading-container{display:flex;width:100%;justify-content:center}\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: LoadingModule }, { kind: "component", type: i3$1.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i3$1.Tag, selector: "cds-tag, ibm-tag", inputs: ["type", "size", "class", "skeleton"] }] }); }
|
|
994
|
+
}
|
|
995
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementPluginsComponent, decorators: [{
|
|
996
|
+
type: Component,
|
|
997
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-plugins', imports: [CommonModule, LoadingModule, TranslatePipe, TagModule], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"building-block-management-plugins\"\n *ngIf=\"{usedPluginTitles: usedPluginTitles$ | async, loading: loading$ | async} as obs\"\n>\n <h4 class=\"building-block-management-plugins__title\">\n {{ 'buildingBlockManagement.plugins.title' | translate }}\n </h4>\n\n @if (obs.loading) {\n <div class=\"loading-container\"><cds-loading size=\"sm\"></cds-loading></div>\n }\n\n @if (!obs.loading && obs.usedPluginTitles.length > 0) {\n <div class=\"building-block-management-plugins__tags\">\n @for (pluginTitle of obs.usedPluginTitles; track pluginTitle) {\n <cds-tag type=\"blue\">{{ pluginTitle }}</cds-tag>\n }\n </div>\n }\n\n @if (!obs.loading && obs.usedPluginTitles.length === 0) {\n <p class=\"building-block-management-plugins__description cds--label-description\">\n {{ 'buildingBlockManagement.plugins.noPluginsUsed' | translate }}\n </p>\n }\n</div>\n", styles: [".building-block-management-plugins{display:flex;padding:16px 24px;width:100%;background-color:var(--cds-layer-01);align-items:center;gap:16px}.building-block-management-plugins__title{font-size:16px;line-height:24px;font-weight:600;flex-shrink:0}.building-block-management-plugins__tags{display:flex;flex-flow:row wrap;height:100%;gap:8px}.building-block-management-plugins__description{padding:0;margin:0}.loading-container{display:flex;width:100%;justify-content:center}\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"] }]
|
|
998
|
+
}], ctorParameters: () => [{ type: BuildingBlockManagementApiService }, { type: i2$3.PluginManagementService }, { type: BuildingBlockManagementDetailService }] });
|
|
999
|
+
|
|
1000
|
+
/*
|
|
1001
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1002
|
+
*
|
|
1003
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1004
|
+
* you may not use this file except in compliance with the License.
|
|
1005
|
+
* You may obtain a copy of the License at
|
|
1006
|
+
*
|
|
1007
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1008
|
+
*
|
|
1009
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1010
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1011
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1012
|
+
* See the License for the specific language governing permissions and
|
|
1013
|
+
* limitations under the License.
|
|
1014
|
+
*/
|
|
1015
|
+
class BuildingBlockManagementGeneralComponent {
|
|
1016
|
+
constructor(buildingBlockManagementDetailService) {
|
|
1017
|
+
this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
|
|
1018
|
+
}
|
|
1019
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementGeneralComponent, deps: [{ token: BuildingBlockManagementDetailService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1020
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BuildingBlockManagementGeneralComponent, isStandalone: true, selector: "valtimo-building-block-management-general", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"building-block-management-general\">\n <valtimo-building-block-management-plugins></valtimo-building-block-management-plugins>\n\n <div class=\"muuri-container\">\n <div muuri [columnMinWidth]=\"450\">\n <valtimo-muuri-item>\n <valtimo-building-block-management-metadata></valtimo-building-block-management-metadata>\n </valtimo-muuri-item>\n\n <valtimo-muuri-item>\n <valtimo-building-block-management-artwork></valtimo-building-block-management-artwork>\n </valtimo-muuri-item>\n </div>\n </div>\n</div>\n", styles: [".muuri-container{display:block;width:100%}.building-block-management-general{width:100%;display:flex;flex-direction:column;gap:16px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MuuriDirectiveModule }, { kind: "directive", type: i2$1.MuuriDirective, selector: "[muuri]", inputs: ["columnMinWidth"] }, { kind: "component", type: i2$1.MuuriItemComponent, selector: "valtimo-muuri-item" }, { kind: "component", type: BuildingBlockManagementMetadataComponent, selector: "valtimo-building-block-management-metadata" }, { kind: "component", type: BuildingBlockManagementArtworkComponent, selector: "valtimo-building-block-management-artwork" }, { kind: "component", type: BuildingBlockManagementPluginsComponent, selector: "valtimo-building-block-management-plugins" }] }); }
|
|
1021
|
+
}
|
|
1022
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementGeneralComponent, decorators: [{
|
|
1023
|
+
type: Component,
|
|
1024
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-general', imports: [
|
|
1025
|
+
CommonModule,
|
|
1026
|
+
MuuriDirectiveModule,
|
|
1027
|
+
BuildingBlockManagementMetadataComponent,
|
|
1028
|
+
BuildingBlockManagementArtworkComponent,
|
|
1029
|
+
BuildingBlockManagementPluginsComponent,
|
|
1030
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"building-block-management-general\">\n <valtimo-building-block-management-plugins></valtimo-building-block-management-plugins>\n\n <div class=\"muuri-container\">\n <div muuri [columnMinWidth]=\"450\">\n <valtimo-muuri-item>\n <valtimo-building-block-management-metadata></valtimo-building-block-management-metadata>\n </valtimo-muuri-item>\n\n <valtimo-muuri-item>\n <valtimo-building-block-management-artwork></valtimo-building-block-management-artwork>\n </valtimo-muuri-item>\n </div>\n </div>\n</div>\n", styles: [".muuri-container{display:block;width:100%}.building-block-management-general{width:100%;display:flex;flex-direction:column;gap:16px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
1031
|
+
}], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }] });
|
|
1032
|
+
|
|
1033
|
+
/*
|
|
1034
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1035
|
+
*
|
|
1036
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1037
|
+
* you may not use this file except in compliance with the License.
|
|
1038
|
+
* You may obtain a copy of the License at
|
|
1039
|
+
*
|
|
1040
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1041
|
+
*
|
|
1042
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1043
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1044
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1045
|
+
* See the License for the specific language governing permissions and
|
|
1046
|
+
* limitations under the License.
|
|
1047
|
+
*/
|
|
1048
|
+
class BuildingBlockManagementDocumentComponent {
|
|
1049
|
+
constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService, iconService) {
|
|
1050
|
+
this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
|
|
1051
|
+
this.buildingBlockManagementApiService = buildingBlockManagementApiService;
|
|
1052
|
+
this.iconService = iconService;
|
|
1053
|
+
this._subscriptions = new Subscription();
|
|
1054
|
+
this._loadingDocumentDefinition$ = new BehaviorSubject(true);
|
|
1055
|
+
this.loading$ = combineLatest([
|
|
1056
|
+
this.buildingBlockManagementDetailService.loadingDefinition$,
|
|
1057
|
+
this._loadingDocumentDefinition$,
|
|
1058
|
+
]).pipe(map(([loadingDefinition, loadingDocumentDefinition]) => loadingDefinition || loadingDocumentDefinition));
|
|
1059
|
+
this._documentDefinition$ = new BehaviorSubject('');
|
|
1060
|
+
this.documentDefinition$ = this._documentDefinition$.pipe(filter(model => model !== null));
|
|
1061
|
+
this.isFinal$ = this.buildingBlockManagementDetailService.isFinal$;
|
|
1062
|
+
this._modifiedDefinition = null;
|
|
1063
|
+
this.iconService.registerAll([Download16]);
|
|
1064
|
+
}
|
|
1065
|
+
ngOnInit() {
|
|
1066
|
+
this.openBuildingBlockDefinitionSubscription();
|
|
1067
|
+
}
|
|
1068
|
+
ngOnDestroy() {
|
|
1069
|
+
this._subscriptions.unsubscribe();
|
|
1070
|
+
}
|
|
1071
|
+
downloadDefinition() {
|
|
1072
|
+
this.documentDefinition$.pipe(take$1(1)).subscribe(definition => {
|
|
1073
|
+
const dataString = 'data:text/json;charset=utf-8,' + encodeURIComponent(definition);
|
|
1074
|
+
const downloadAnchorElement = document.getElementById('downloadAnchorElement');
|
|
1075
|
+
if (!downloadAnchorElement)
|
|
1076
|
+
return;
|
|
1077
|
+
downloadAnchorElement.setAttribute('href', dataString);
|
|
1078
|
+
downloadAnchorElement.setAttribute('download', `${this.buildingBlockManagementDetailService.buildingBlockDefinitionKey}-v${this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag}.json`);
|
|
1079
|
+
downloadAnchorElement.click();
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
onSaveEvent() {
|
|
1083
|
+
if (!this._modifiedDefinition)
|
|
1084
|
+
return;
|
|
1085
|
+
this._loadingDocumentDefinition$.next(true);
|
|
1086
|
+
this.buildingBlockManagementApiService
|
|
1087
|
+
.updateBuildingBlockDocumentDefinition(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, JSON.parse(this._modifiedDefinition))
|
|
1088
|
+
.subscribe(res => {
|
|
1089
|
+
this.setDocumentDefinitionModel(res);
|
|
1090
|
+
this._modifiedDefinition = null;
|
|
1091
|
+
this._loadingDocumentDefinition$.next(false);
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
onChangeEvent(event) {
|
|
1095
|
+
this._modifiedDefinition = event;
|
|
1096
|
+
}
|
|
1097
|
+
openBuildingBlockDefinitionSubscription() {
|
|
1098
|
+
this._subscriptions.add(this.buildingBlockManagementDetailService.buildingBlockDefinition$
|
|
1099
|
+
.pipe(tap(() => this._loadingDocumentDefinition$.next(true)), switchMap(definition => this.buildingBlockManagementApiService.getBuildingBlockDocumentDefinition(definition.key, definition.versionTag)), tap(() => this._loadingDocumentDefinition$.next(false)))
|
|
1100
|
+
.subscribe(buildingBlockDocumentDefinition => this.setDocumentDefinitionModel(buildingBlockDocumentDefinition)));
|
|
1101
|
+
}
|
|
1102
|
+
setDocumentDefinitionModel(definition) {
|
|
1103
|
+
this._documentDefinition$.next(JSON.stringify(definition, null, 2));
|
|
1104
|
+
}
|
|
1105
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementDocumentComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }, { token: i3$1.IconService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1106
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: BuildingBlockManagementDocumentComponent, isStandalone: true, selector: "valtimo-building-block-management-document", 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 loading: loading$ | async,\n documentDefinition: documentDefinition$ | async,\n isFinal: isFinal$ | async,\n } as obs\"\n>\n @if (!obs.loading) {\n <valtimo-schema-editor\n [fitPage]=\"true\"\n [spaceAdjustment]=\"64\"\n [disableOverflow]=\"true\"\n [schemaJson]=\"obs.documentDefinition\"\n [disabled]=\"obs.isFinal\"\n (changeEvent)=\"onChangeEvent($event)\"\n (saveEvent)=\"onSaveEvent()\"\n >\n <button\n cdsButton=\"ghost\"\n [disabled]=\"obs.loading || !obs.documentDefinition\"\n (click)=\"downloadDefinition()\"\n >\n {{ 'interface.download' | translate }}\n\n <svg cdsIcon=\"download\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </valtimo-schema-editor>\n } @else {\n <div class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n }\n</ng-container>\n\n<a id=\"downloadAnchorElement\" style=\"display: none\"></a>\n", styles: [".loading-container{display:flex;width:100%;justify-content:center}\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: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: LoadingModule }, { kind: "component", type: i3$1.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "component", type: SchemaEditorComponent, selector: "valtimo-schema-editor", inputs: ["schemaJson", "disabled"], outputs: ["changeEvent", "saveEvent", "validEvent"] }, { kind: "directive", type: FitPageDirective, selector: "[fitPage]", inputs: ["spaceAdjustment", "fitPageDisabled", "disableOverflow"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
1107
|
+
}
|
|
1108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementDocumentComponent, decorators: [{
|
|
1109
|
+
type: Component,
|
|
1110
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-document', imports: [
|
|
1111
|
+
CommonModule,
|
|
1112
|
+
ButtonModule,
|
|
1113
|
+
IconModule,
|
|
1114
|
+
LoadingModule,
|
|
1115
|
+
SchemaEditorComponent,
|
|
1116
|
+
FitPageDirective,
|
|
1117
|
+
TranslatePipe,
|
|
1118
|
+
], 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 loading: loading$ | async,\n documentDefinition: documentDefinition$ | async,\n isFinal: isFinal$ | async,\n } as obs\"\n>\n @if (!obs.loading) {\n <valtimo-schema-editor\n [fitPage]=\"true\"\n [spaceAdjustment]=\"64\"\n [disableOverflow]=\"true\"\n [schemaJson]=\"obs.documentDefinition\"\n [disabled]=\"obs.isFinal\"\n (changeEvent)=\"onChangeEvent($event)\"\n (saveEvent)=\"onSaveEvent()\"\n >\n <button\n cdsButton=\"ghost\"\n [disabled]=\"obs.loading || !obs.documentDefinition\"\n (click)=\"downloadDefinition()\"\n >\n {{ 'interface.download' | translate }}\n\n <svg cdsIcon=\"download\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </valtimo-schema-editor>\n } @else {\n <div class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n }\n</ng-container>\n\n<a id=\"downloadAnchorElement\" style=\"display: none\"></a>\n", styles: [".loading-container{display:flex;width:100%;justify-content:center}\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"] }]
|
|
1119
|
+
}], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }, { type: i3$1.IconService }] });
|
|
1120
|
+
|
|
1121
|
+
/*
|
|
1122
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1123
|
+
*
|
|
1124
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1125
|
+
* you may not use this file except in compliance with the License.
|
|
1126
|
+
* You may obtain a copy of the License at
|
|
1127
|
+
*
|
|
1128
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1129
|
+
*
|
|
1130
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1131
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1132
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1133
|
+
* See the License for the specific language governing permissions and
|
|
1134
|
+
* limitations under the License.
|
|
1135
|
+
*/
|
|
1136
|
+
class BuildingBlockManagementProcessUploadComponent {
|
|
1137
|
+
constructor(formBuilder, notificationService, processLinkService, buildingBlockManagementDetailService, translateService) {
|
|
1138
|
+
this.formBuilder = formBuilder;
|
|
1139
|
+
this.notificationService = notificationService;
|
|
1140
|
+
this.processLinkService = processLinkService;
|
|
1141
|
+
this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
|
|
1142
|
+
this.translateService = translateService;
|
|
1143
|
+
this.modalOpen$ = this.buildingBlockManagementDetailService.showProcessDefinitionUploadModal$;
|
|
1144
|
+
this.ACCEPTED_FILES = ['bpmn'];
|
|
1145
|
+
this.form = this.formBuilder.group({
|
|
1146
|
+
file: this.formBuilder.control(new Set(), [Validators.required]),
|
|
1147
|
+
});
|
|
1148
|
+
this.fileSelected$ = this.form.get('file')?.valueChanges.pipe(startWith(null), map(value => !!(value instanceof Set && value.size > 0)));
|
|
1149
|
+
}
|
|
1150
|
+
closeModal() {
|
|
1151
|
+
this.buildingBlockManagementDetailService.hideProcessDefinitionUploadModal();
|
|
1152
|
+
setTimeout(() => {
|
|
1153
|
+
this.form.reset();
|
|
1154
|
+
}, CARBON_CONSTANTS.modalAnimationMs);
|
|
1155
|
+
}
|
|
1156
|
+
uploadProcessBpmn() {
|
|
1157
|
+
const bpmnFile = this.form.value?.file?.values()?.next()?.value?.file;
|
|
1158
|
+
if (!bpmnFile)
|
|
1159
|
+
return;
|
|
1160
|
+
from(bpmnFile.text())
|
|
1161
|
+
.pipe(switchMap(bpmnXml => this.processLinkService.deployProcessWithProcessLinksForBuildingBlock([], null, `${bpmnXml}`, this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag)))
|
|
1162
|
+
.subscribe({
|
|
1163
|
+
next: () => {
|
|
1164
|
+
this.notificationService.showNotification({
|
|
1165
|
+
type: 'success',
|
|
1166
|
+
title: this.translateService.instant('processManagement.upload.success'),
|
|
1167
|
+
});
|
|
1168
|
+
this.closeModal();
|
|
1169
|
+
this.buildingBlockManagementDetailService.reloadProcessDefinitions();
|
|
1170
|
+
},
|
|
1171
|
+
error: () => {
|
|
1172
|
+
this.notificationService.showNotification({
|
|
1173
|
+
type: 'error',
|
|
1174
|
+
title: this.translateService.instant('processManagement.upload.failure'),
|
|
1175
|
+
});
|
|
1176
|
+
},
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
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 }); }
|
|
1181
|
+
}
|
|
1182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementProcessUploadComponent, decorators: [{
|
|
1183
|
+
type: Component,
|
|
1184
|
+
args: [{ selector: 'valtimo-building-block-management-process-upload', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
1185
|
+
CommonModule,
|
|
1186
|
+
TranslateModule,
|
|
1187
|
+
FileUploaderModule,
|
|
1188
|
+
ModalModule,
|
|
1189
|
+
LayerModule,
|
|
1190
|
+
ReactiveFormsModule,
|
|
1191
|
+
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" }]
|
|
1193
|
+
}], ctorParameters: () => [{ type: i2$2.FormBuilder }, { type: i1.GlobalNotificationService }, { type: i3$2.ProcessLinkService }, { type: BuildingBlockManagementDetailService }, { type: i4$1.TranslateService }] });
|
|
1194
|
+
|
|
1195
|
+
/*
|
|
1196
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1197
|
+
*
|
|
1198
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1199
|
+
* you may not use this file except in compliance with the License.
|
|
1200
|
+
* You may obtain a copy of the License at
|
|
1201
|
+
*
|
|
1202
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1203
|
+
*
|
|
1204
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1205
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1206
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1207
|
+
* See the License for the specific language governing permissions and
|
|
1208
|
+
* limitations under the License.
|
|
1209
|
+
*/
|
|
1210
|
+
class BuildingBlockManagementProcessesComponent {
|
|
1211
|
+
constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService, translateService, iconService, router) {
|
|
1212
|
+
this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
|
|
1213
|
+
this.buildingBlockManagementApiService = buildingBlockManagementApiService;
|
|
1214
|
+
this.translateService = translateService;
|
|
1215
|
+
this.iconService = iconService;
|
|
1216
|
+
this.router = router;
|
|
1217
|
+
this.$loading = signal(true);
|
|
1218
|
+
this._buildingBlockProcessDefinitions$ = new BehaviorSubject([]);
|
|
1219
|
+
this._buildingBlockProcessDefinitionItems = [];
|
|
1220
|
+
this.buildingBlockProcessDefinitionItems$ = combineLatest([
|
|
1221
|
+
this._buildingBlockProcessDefinitions$,
|
|
1222
|
+
this.translateService.stream('key'),
|
|
1223
|
+
]).pipe(map(([processDefinitions]) => processDefinitions.map(definition => ({
|
|
1224
|
+
...definition,
|
|
1225
|
+
mainText: definition.main &&
|
|
1226
|
+
this.translateService.instant('buildingBlockManagement.processDefinition.mainText'),
|
|
1227
|
+
}))), tap(buildingBlockProcessDefinitionItems => (this._buildingBlockProcessDefinitionItems = buildingBlockProcessDefinitionItems)));
|
|
1228
|
+
this.FIELDS = [
|
|
1229
|
+
{ key: 'name', label: 'buildingBlockManagement.processDefinition.name' },
|
|
1230
|
+
{ key: 'key', label: 'buildingBlockManagement.processDefinition.key' },
|
|
1231
|
+
{
|
|
1232
|
+
key: 'mainText',
|
|
1233
|
+
label: '',
|
|
1234
|
+
viewType: ViewType.TAGS,
|
|
1235
|
+
},
|
|
1236
|
+
];
|
|
1237
|
+
this.onDeleteClick = (process) => {
|
|
1238
|
+
this._processToDelete = process;
|
|
1239
|
+
this.showDeleteModal$.next(true);
|
|
1240
|
+
};
|
|
1241
|
+
this.ACTION_ITEMS = [
|
|
1242
|
+
{
|
|
1243
|
+
label: 'buildingBlockManagement.processDefinition.markAsMain',
|
|
1244
|
+
callback: this.onMarkAsMain.bind(this),
|
|
1245
|
+
type: 'normal',
|
|
1246
|
+
disabledCallback: this.markAsMainDisabled.bind(this),
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
label: 'interface.delete',
|
|
1250
|
+
callback: this.onDeleteClick,
|
|
1251
|
+
type: 'danger',
|
|
1252
|
+
disabledCallback: this.deleteDisabled.bind(this),
|
|
1253
|
+
},
|
|
1254
|
+
];
|
|
1255
|
+
this.isFinal$ = this.buildingBlockManagementDetailService.isFinal$;
|
|
1256
|
+
this.showDeleteModal$ = new BehaviorSubject(false);
|
|
1257
|
+
this._subscriptions = new Subscription();
|
|
1258
|
+
this.iconService.registerAll([Upload16]);
|
|
1259
|
+
}
|
|
1260
|
+
ngOnInit() {
|
|
1261
|
+
this._subscriptions.add(combineLatest([
|
|
1262
|
+
this.buildingBlockManagementDetailService.buildingBlockDefinitionKey$,
|
|
1263
|
+
this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag$,
|
|
1264
|
+
])
|
|
1265
|
+
.pipe(distinctUntilChanged((a, b) => isEqual(a, b)), tap(() => this.$loading.set(true)), switchMap(([key, versionTag]) => this.buildingBlockManagementDetailService.reloadProcessDefinitions$.pipe(tap(() => this.$loading.set(true)), switchMap(() => this.buildingBlockManagementApiService.getBuildingBlockProcessDefinitions(key, versionTag)))), tap(processDefinitions => {
|
|
1266
|
+
this._buildingBlockProcessDefinitions$.next(processDefinitions);
|
|
1267
|
+
this.$loading.set(false);
|
|
1268
|
+
}))
|
|
1269
|
+
.subscribe());
|
|
1270
|
+
}
|
|
1271
|
+
ngOnDestroy() {
|
|
1272
|
+
this._subscriptions.unsubscribe();
|
|
1273
|
+
}
|
|
1274
|
+
onRowClick(processDefinition) {
|
|
1275
|
+
this.router.navigate([
|
|
1276
|
+
'/building-block-management',
|
|
1277
|
+
'building-block',
|
|
1278
|
+
this.buildingBlockManagementDetailService.buildingBlockDefinitionKey,
|
|
1279
|
+
'version',
|
|
1280
|
+
this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag,
|
|
1281
|
+
BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES,
|
|
1282
|
+
processDefinition.id,
|
|
1283
|
+
]);
|
|
1284
|
+
}
|
|
1285
|
+
showUploadModal() {
|
|
1286
|
+
this.buildingBlockManagementDetailService.showProcessDefinitionUploadModal();
|
|
1287
|
+
}
|
|
1288
|
+
onCreateClick() {
|
|
1289
|
+
this.router.navigate([
|
|
1290
|
+
'/building-block-management',
|
|
1291
|
+
'building-block',
|
|
1292
|
+
this.buildingBlockManagementDetailService.buildingBlockDefinitionKey,
|
|
1293
|
+
'version',
|
|
1294
|
+
this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag,
|
|
1295
|
+
BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES,
|
|
1296
|
+
'create',
|
|
1297
|
+
]);
|
|
1298
|
+
}
|
|
1299
|
+
onDeleteConfirm() {
|
|
1300
|
+
if (!this._processToDelete)
|
|
1301
|
+
return;
|
|
1302
|
+
this.$loading.set(true);
|
|
1303
|
+
this.buildingBlockManagementApiService
|
|
1304
|
+
.deleteBuildingBlockProcessDefinition(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, this._processToDelete.id)
|
|
1305
|
+
.subscribe({
|
|
1306
|
+
next: () => {
|
|
1307
|
+
this.buildingBlockManagementDetailService.reloadProcessDefinitions();
|
|
1308
|
+
},
|
|
1309
|
+
error: () => {
|
|
1310
|
+
this.$loading.set(false);
|
|
1311
|
+
},
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
onMarkAsMain(process) {
|
|
1315
|
+
this.$loading.set(true);
|
|
1316
|
+
this.buildingBlockManagementApiService
|
|
1317
|
+
.setMainBuildingBlockProcessDefinition(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, process.id)
|
|
1318
|
+
.subscribe({
|
|
1319
|
+
next: () => {
|
|
1320
|
+
this.buildingBlockManagementDetailService.reloadProcessDefinitions();
|
|
1321
|
+
},
|
|
1322
|
+
error: () => {
|
|
1323
|
+
this.$loading.set(false);
|
|
1324
|
+
},
|
|
1325
|
+
});
|
|
1326
|
+
}
|
|
1327
|
+
markAsMainDisabled(process) {
|
|
1328
|
+
return process.main || this._buildingBlockProcessDefinitionItems.length === 1;
|
|
1329
|
+
}
|
|
1330
|
+
deleteDisabled(process) {
|
|
1331
|
+
return process.main || this._buildingBlockProcessDefinitionItems.length === 1;
|
|
1332
|
+
}
|
|
1333
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementProcessesComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }, { token: i4$1.TranslateService }, { token: i3$1.IconService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1334
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BuildingBlockManagementProcessesComponent, isStandalone: true, selector: "valtimo-building-block-management-processes", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n [fields]=\"FIELDS\"\n [actionItems]=\"ACTION_ITEMS\"\n [items]=\"buildingBlockProcessDefinitionItems$ | async\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClick($event)\"\n>\n <div carbonToolbarContent>\n <div class=\"valtimo-building-block-management-list__actions\">\n <button\n cdsButton=\"ghost\"\n (click)=\"showUploadModal()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n {{ 'Upload' | translate }}\n\n <svg cdsIcon=\"upload\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n\n <button\n cdsButton=\"primary\"\n (click)=\"onCreateClick()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n {{ 'interface.create' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n </div>\n</valtimo-carbon-list>\n\n<valtimo-building-block-management-process-upload></valtimo-building-block-management-process-upload>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"processManagement.deleteModal.content\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"processManagement.deleteModal.title\"\n (confirmEvent)=\"onDeleteConfirm()\"\n></valtimo-confirmation-modal>\n", styles: ["/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i2$1.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "skeletonRowCount", "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: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: BuildingBlockManagementProcessUploadComponent, selector: "valtimo-building-block-management-process-upload" }, { 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"] }] }); }
|
|
1335
|
+
}
|
|
1336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementProcessesComponent, decorators: [{
|
|
1337
|
+
type: Component,
|
|
1338
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-processes', imports: [
|
|
1339
|
+
CommonModule,
|
|
1340
|
+
CarbonListModule,
|
|
1341
|
+
TranslateModule,
|
|
1342
|
+
ButtonModule,
|
|
1343
|
+
IconModule,
|
|
1344
|
+
BuildingBlockManagementProcessUploadComponent,
|
|
1345
|
+
ConfirmationModalModule,
|
|
1346
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n [fields]=\"FIELDS\"\n [actionItems]=\"ACTION_ITEMS\"\n [items]=\"buildingBlockProcessDefinitionItems$ | async\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClick($event)\"\n>\n <div carbonToolbarContent>\n <div class=\"valtimo-building-block-management-list__actions\">\n <button\n cdsButton=\"ghost\"\n (click)=\"showUploadModal()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n {{ 'Upload' | translate }}\n\n <svg cdsIcon=\"upload\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n\n <button\n cdsButton=\"primary\"\n (click)=\"onCreateClick()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n {{ 'interface.create' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n </div>\n</valtimo-carbon-list>\n\n<valtimo-building-block-management-process-upload></valtimo-building-block-management-process-upload>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"processManagement.deleteModal.content\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"processManagement.deleteModal.title\"\n (confirmEvent)=\"onDeleteConfirm()\"\n></valtimo-confirmation-modal>\n", styles: ["/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
1347
|
+
}], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }, { type: i4$1.TranslateService }, { type: i3$1.IconService }, { type: i3.Router }] });
|
|
1348
|
+
|
|
1349
|
+
/*
|
|
1350
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1351
|
+
*
|
|
1352
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1353
|
+
* you may not use this file except in compliance with the License.
|
|
1354
|
+
* You may obtain a copy of the License at
|
|
1355
|
+
*
|
|
1356
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1357
|
+
*
|
|
1358
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1359
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1360
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1361
|
+
* See the License for the specific language governing permissions and
|
|
1362
|
+
* limitations under the License.
|
|
1363
|
+
*/
|
|
1364
|
+
class BuildingBlockManagementVersionSelectorComponent {
|
|
1365
|
+
onVersionSelected(event) {
|
|
1366
|
+
const versionTag = event?.item?.id;
|
|
1367
|
+
if (!versionTag)
|
|
1368
|
+
return;
|
|
1369
|
+
this.buildingBlockManagementDetailService.navigateToVersionTag(versionTag);
|
|
1370
|
+
}
|
|
1371
|
+
constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService) {
|
|
1372
|
+
this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
|
|
1373
|
+
this.buildingBlockManagementApiService = buildingBlockManagementApiService;
|
|
1374
|
+
this._versions$ = combineLatest([
|
|
1375
|
+
this.buildingBlockManagementDetailService.buildingBlockDefinitionKey$,
|
|
1376
|
+
this.buildingBlockManagementDetailService.reloadVersions$,
|
|
1377
|
+
]).pipe(switchMap(([key]) => this.buildingBlockManagementApiService.getVersionsForBuildingBlock(key, 0, 10, true)));
|
|
1378
|
+
this.versionListItems$ = combineLatest([
|
|
1379
|
+
this._versions$,
|
|
1380
|
+
this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag$,
|
|
1381
|
+
]).pipe(map(([versions, versionTag]) => versions.content.map(version => ({
|
|
1382
|
+
id: version.versionTag,
|
|
1383
|
+
content: version.versionTag,
|
|
1384
|
+
selected: versionTag === version.versionTag,
|
|
1385
|
+
final: version.final,
|
|
1386
|
+
}))));
|
|
1387
|
+
}
|
|
1388
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementVersionSelectorComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1389
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BuildingBlockManagementVersionSelectorComponent, isStandalone: true, selector: "valtimo-building-block-management-version-selector", 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=\"{versionListItems: (versionListItems$ | async) || []} as obs\">\n <cds-dropdown\n class=\"version-selector\"\n [disabled]=\"obs.versionListItems.length === 1\"\n [displayValue]=\"versionTemplate\"\n (selected)=\"onVersionSelected($event)\"\n >\n <cds-dropdown-list\n [items]=\"obs.versionListItems\"\n [listTpl]=\"versionTemplate\"\n ></cds-dropdown-list>\n </cds-dropdown>\n</ng-container>\n\n<ng-template #versionTemplate let-item=\"item\">\n <div class=\"version-selector-dropdown-template\">\n <cds-tag\n class=\"cds-tag--no-margin\"\n [type]=\"!item?.final ? 'red' : 'green'\"\n [title]=\"item?.content\"\n >\n {{ !item?.final ? 'DRAFT: ' + item?.content : item?.content }}\n </cds-tag>\n </div>\n</ng-template>\n", styles: [".version-selector{margin:0;max-width:300px}::ng-deep .version-selector-dropdown-template{display:flex}::ng-deep .version-selector-dropdown-template .cds--tag{margin:0 8px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;line-height:24px;max-width:100%}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i3$1.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$1.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i3$1.Tag, selector: "cds-tag, ibm-tag", inputs: ["type", "size", "class", "skeleton"] }] }); }
|
|
1390
|
+
}
|
|
1391
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementVersionSelectorComponent, decorators: [{
|
|
1392
|
+
type: Component,
|
|
1393
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-version-selector', imports: [CommonModule, DropdownModule, TagModule], 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=\"{versionListItems: (versionListItems$ | async) || []} as obs\">\n <cds-dropdown\n class=\"version-selector\"\n [disabled]=\"obs.versionListItems.length === 1\"\n [displayValue]=\"versionTemplate\"\n (selected)=\"onVersionSelected($event)\"\n >\n <cds-dropdown-list\n [items]=\"obs.versionListItems\"\n [listTpl]=\"versionTemplate\"\n ></cds-dropdown-list>\n </cds-dropdown>\n</ng-container>\n\n<ng-template #versionTemplate let-item=\"item\">\n <div class=\"version-selector-dropdown-template\">\n <cds-tag\n class=\"cds-tag--no-margin\"\n [type]=\"!item?.final ? 'red' : 'green'\"\n [title]=\"item?.content\"\n >\n {{ !item?.final ? 'DRAFT: ' + item?.content : item?.content }}\n </cds-tag>\n </div>\n</ng-template>\n", styles: [".version-selector{margin:0;max-width:300px}::ng-deep .version-selector-dropdown-template{display:flex}::ng-deep .version-selector-dropdown-template .cds--tag{margin:0 8px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;line-height:24px;max-width:100%}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
1394
|
+
}], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }] });
|
|
1395
|
+
|
|
1396
|
+
/*
|
|
1397
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1398
|
+
*
|
|
1399
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1400
|
+
* you may not use this file except in compliance with the License.
|
|
1401
|
+
* You may obtain a copy of the License at
|
|
1402
|
+
*
|
|
1403
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1404
|
+
*
|
|
1405
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1406
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1407
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1408
|
+
* See the License for the specific language governing permissions and
|
|
1409
|
+
* limitations under the License.
|
|
1410
|
+
*/
|
|
1411
|
+
class BuildingBlockManagementDetailActionsComponent {
|
|
1412
|
+
get exporting$() {
|
|
1413
|
+
return this._exporting$.asObservable();
|
|
1414
|
+
}
|
|
1415
|
+
get versionTag() {
|
|
1416
|
+
return this.draftForm.get('versionTag');
|
|
1417
|
+
}
|
|
1418
|
+
constructor(buildingBlockManagementApiService, buildingBlockManagementDetailService, fb, notificationService, translateService, document) {
|
|
1419
|
+
this.buildingBlockManagementApiService = buildingBlockManagementApiService;
|
|
1420
|
+
this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
|
|
1421
|
+
this.fb = fb;
|
|
1422
|
+
this.notificationService = notificationService;
|
|
1423
|
+
this.translateService = translateService;
|
|
1424
|
+
this.document = document;
|
|
1425
|
+
this.actionInProgress$ = new BehaviorSubject(false);
|
|
1426
|
+
this.showDraftModal$ = new BehaviorSubject(false);
|
|
1427
|
+
this.definition$ = this.buildingBlockManagementDetailService.buildingBlockDefinition$;
|
|
1428
|
+
this.isFinal$ = this.buildingBlockManagementDetailService.isFinal$;
|
|
1429
|
+
this.buildingBlockName$ = this.buildingBlockManagementDetailService.buildingBlockDefinition$.pipe(map(definition => definition.name ?? definition.key));
|
|
1430
|
+
this._exporting$ = new BehaviorSubject(false);
|
|
1431
|
+
this.draftForm = this.fb.group({
|
|
1432
|
+
versionTag: this.fb.control('', Validators.required),
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
finalizeDraft() {
|
|
1436
|
+
if (this.actionInProgress$.value)
|
|
1437
|
+
return;
|
|
1438
|
+
this.actionInProgress$.next(true);
|
|
1439
|
+
this.definition$
|
|
1440
|
+
.pipe(take(1), switchMap(definition => this.buildingBlockManagementApiService.finalizeBuildingBlockDefinition(definition.key, definition.versionTag)), finalize(() => this.actionInProgress$.next(false)))
|
|
1441
|
+
.subscribe({
|
|
1442
|
+
next: () => {
|
|
1443
|
+
this.notifySuccess('buildingBlockManagement.actions.finalize.success');
|
|
1444
|
+
this.buildingBlockManagementDetailService.reload();
|
|
1445
|
+
this.buildingBlockManagementDetailService.reloadVersions();
|
|
1446
|
+
},
|
|
1447
|
+
error: () => {
|
|
1448
|
+
this.notifyError('buildingBlockManagement.actions.finalize.error');
|
|
1449
|
+
},
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
openDraftModal() {
|
|
1453
|
+
this.showDraftModal$.next(true);
|
|
1454
|
+
}
|
|
1455
|
+
closeDraftModal() {
|
|
1456
|
+
this.showDraftModal$.next(false);
|
|
1457
|
+
this.draftForm.reset();
|
|
1458
|
+
}
|
|
1459
|
+
createDraft() {
|
|
1460
|
+
if (this.draftForm.invalid || this.actionInProgress$.value)
|
|
1461
|
+
return;
|
|
1462
|
+
this.actionInProgress$.next(true);
|
|
1463
|
+
const newVersionTag = this.versionTag.value;
|
|
1464
|
+
this.definition$
|
|
1465
|
+
.pipe(take(1), switchMap(definition => this.buildingBlockManagementApiService.createDraftBuildingBlockDefinition(definition.key, definition.versionTag, newVersionTag)), finalize(() => this.actionInProgress$.next(false)))
|
|
1466
|
+
.subscribe({
|
|
1467
|
+
next: draft => {
|
|
1468
|
+
this.notifySuccess('buildingBlockManagement.actions.draft.success');
|
|
1469
|
+
this.closeDraftModal();
|
|
1470
|
+
this.buildingBlockManagementDetailService.reloadVersions();
|
|
1471
|
+
this.buildingBlockManagementDetailService.navigateToVersionTag(draft.versionTag);
|
|
1472
|
+
},
|
|
1473
|
+
error: () => {
|
|
1474
|
+
this.notifyError('buildingBlockManagement.actions.draft.error');
|
|
1475
|
+
},
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
export() {
|
|
1479
|
+
if (this.actionInProgress$.value || this._exporting$.value)
|
|
1480
|
+
return;
|
|
1481
|
+
this._currentNotification = this.notificationService.showNotification({
|
|
1482
|
+
type: 'info',
|
|
1483
|
+
title: '',
|
|
1484
|
+
showClose: false,
|
|
1485
|
+
template: this._exportMessageTemplateRef,
|
|
1486
|
+
});
|
|
1487
|
+
this._exporting$.next(true);
|
|
1488
|
+
this.buildingBlockManagementApiService
|
|
1489
|
+
.exportBuildingBlock(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag)
|
|
1490
|
+
.pipe(finalize(() => this._exporting$.next(false)))
|
|
1491
|
+
.subscribe({
|
|
1492
|
+
next: response => {
|
|
1493
|
+
this.closeCurrentNotification();
|
|
1494
|
+
this._currentNotification = this.notificationService.showNotification({
|
|
1495
|
+
type: 'success',
|
|
1496
|
+
title: this.translateService.instant('buildingBlockManagement.overflowMenu.exportSuccessTitle'),
|
|
1497
|
+
duration: 5000,
|
|
1498
|
+
});
|
|
1499
|
+
this.downloadZip(response);
|
|
1500
|
+
},
|
|
1501
|
+
error: () => {
|
|
1502
|
+
this.closeCurrentNotification();
|
|
1503
|
+
this.notifyError('buildingBlockManagement.overflowMenu.exportErrorTitle');
|
|
1504
|
+
},
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
downloadZip(response) {
|
|
1508
|
+
const link = this.document.createElement('a');
|
|
1509
|
+
const contentDisposition = response.headers.get('content-disposition');
|
|
1510
|
+
const splitContentDisposition = contentDisposition?.split('filename=') ?? [];
|
|
1511
|
+
const fileName = splitContentDisposition.length > 1 && splitContentDisposition[1];
|
|
1512
|
+
link.href = this.document.defaultView?.URL.createObjectURL(response.body) ?? '';
|
|
1513
|
+
link.download =
|
|
1514
|
+
fileName ||
|
|
1515
|
+
`${this.buildingBlockManagementDetailService.buildingBlockDefinitionKey}_${this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag}.valtimo.zip`;
|
|
1516
|
+
link.target = '_blank';
|
|
1517
|
+
link.click();
|
|
1518
|
+
link.remove();
|
|
1519
|
+
}
|
|
1520
|
+
closeCurrentNotification() {
|
|
1521
|
+
if (this._currentNotification) {
|
|
1522
|
+
this.notificationService.close(this._currentNotification);
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
notifySuccess(translationKey) {
|
|
1526
|
+
this.notificationService.showNotification({
|
|
1527
|
+
type: 'success',
|
|
1528
|
+
title: this.translateService.instant(translationKey),
|
|
1529
|
+
duration: 5000,
|
|
1530
|
+
});
|
|
1531
|
+
}
|
|
1532
|
+
notifyError(translationKey) {
|
|
1533
|
+
this.notificationService.showNotification({
|
|
1534
|
+
type: 'error',
|
|
1535
|
+
title: this.translateService.instant(translationKey),
|
|
1536
|
+
duration: 5000,
|
|
1537
|
+
});
|
|
1538
|
+
}
|
|
1539
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementDetailActionsComponent, deps: [{ token: BuildingBlockManagementApiService }, { token: BuildingBlockManagementDetailService }, { token: i2$2.FormBuilder }, { token: i1.GlobalNotificationService }, { token: i4$1.TranslateService }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1540
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BuildingBlockManagementDetailActionsComponent, isStandalone: true, selector: "valtimo-building-block-management-detail-actions", viewQueries: [{ propertyName: "_exportMessageTemplateRef", first: true, predicate: ["exportingMessage"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"building-block-actions\"\n *ngIf=\"{\n isFinal: isFinal$ | async,\n } as obs\"\n>\n <div class=\"building-block-metadata\">\n <valtimo-building-block-management-version-selector></valtimo-building-block-management-version-selector>\n </div>\n\n <div class=\"building-block-buttons\">\n <ng-template #trigger>\n <button cdsButton=\"tertiary\">\n {{ 'buildingBlockManagement.actions.more' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"overflow-menu--vertical\" size=\"16\"></svg>\n </button>\n </ng-template>\n\n <cds-overflow-menu\n [customTrigger]=\"trigger\"\n class=\"overflow-button\"\n valtimoCdsOverflowButton\n [width]=\"250\"\n [offset]=\"{y: 48, x: 37}\"\n >\n <cds-overflow-menu-option\n [id]=\"'exportBuildingBlock'\"\n (selected)=\"export()\"\n [disabled]=\"(actionInProgress$ | async) || (exporting$ | async)\"\n >\n {{\n 'buildingBlockManagement.overflowMenu.export'\n | translate: {value: buildingBlockName$ | async}\n }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n *ngIf=\"!obs.isFinal\"\n [disabled]=\"actionInProgress$ | async\"\n (selected)=\"finalizeDraft()\"\n >\n {{ 'buildingBlockManagement.actions.makeFinal' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n *ngIf=\"obs.isFinal\"\n [disabled]=\"actionInProgress$ | async\"\n (selected)=\"openDraftModal()\"\n >\n {{ 'buildingBlockManagement.actions.createDraft' | translate }}\n </cds-overflow-menu-option>\n </cds-overflow-menu>\n </div>\n</div>\n\n<ng-template #exportingMessage>\n <div class=\"exporting-message\">\n <span class=\"cds--inline-notification__title\">{{\n 'buildingBlockManagement.overflowMenu.preparingDownload' | translate\n }}</span>\n <cds-loading size=\"sm\"></cds-loading>\n </div>\n</ng-template>\n\n<cds-modal\n *ngIf=\"{open: showDraftModal$ | async} as obs\"\n [open]=\"obs.open\"\n showFooter=\"true\"\n valtimoCdsModal\n (close)=\"closeDraftModal()\"\n>\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeDraftModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'buildingBlockManagement.actions.draft.title' | translate }}\n </h3>\n </cds-modal-header>\n\n <form [formGroup]=\"draftForm\" cdsModalContent class=\"bb-management-actions__modal\" [cdsLayer]=\"1\">\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"draftForm.disabled\"\n [invalid]=\"versionTag.touched && versionTag.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.actions.draft.version' | translate }}\n </span>\n\n <input\n formControlName=\"versionTag\"\n cdsText\n placeholder=\"{{ 'buildingBlockManagement.actions.draft.placeholder' | translate }}\"\n />\n </cds-label>\n </div>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeDraftModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"draftForm.invalid || (actionInProgress$ | async)\"\n (click)=\"createDraft()\"\n >\n {{ 'buildingBlockManagement.actions.draft.confirm' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".building-block-actions{display:flex;width:100%;justify-content:space-between;align-items:flex-end}.building-block-actions ::ng-deep .version-selection{width:160px}.building-block-actions ::ng-deep .version-selection .cds--list-box__selection{display:none}.bb-management-actions__modal{min-width:320px}.building-block-metadata{display:flex;gap:24px;align-items:flex-end}.building-block-buttons{display:flex;align-items:center;gap:16px}::ng-deep .cds--list-box__field{display:flex;justify-content:space-between}::ng-deep .cds--list-box__menu-item__option{display:flex;justify-content:space-between;padding-inline-end:0}::ng-deep .cds--list-box__menu-item__option>div{margin-top:-4px}.full-width-notification{max-inline-size:100%;min-inline-size:100%}::ng-deep .cds--text-input__field-wrapper cds-label{width:100%}.exporting-message{display:flex;align-items:center;gap:8px}\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: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { 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: InputModule }, { kind: "component", type: i3$1.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3$1.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { 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.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$2.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: 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: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i3$1.OverflowMenu, selector: "cds-overflow-menu, ibm-overflow-menu", inputs: ["buttonLabel", "description", "flip", "placement", "open", "customTrigger", "offset", "wrapperClass", "triggerClass"], outputs: ["openChange"] }, { kind: "component", type: i3$1.OverflowMenuOption, selector: "cds-overflow-menu-option, ibm-overflow-menu-option", inputs: ["divider", "type", "disabled", "href", "target", "innerClass"], outputs: ["selected"] }, { kind: "component", type: BuildingBlockManagementVersionSelectorComponent, selector: "valtimo-building-block-management-version-selector" }, { kind: "directive", type: ValtimoCdsOverflowButtonDirective, selector: "[valtimoCdsOverflowButton]", inputs: ["width"] }, { kind: "ngmodule", type: LoadingModule }, { kind: "component", type: i3$1.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }] }); }
|
|
1541
|
+
}
|
|
1542
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementDetailActionsComponent, decorators: [{
|
|
1543
|
+
type: Component,
|
|
1544
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-detail-actions', imports: [
|
|
1545
|
+
CommonModule,
|
|
1546
|
+
ButtonModule,
|
|
1547
|
+
ModalModule,
|
|
1548
|
+
InputModule,
|
|
1549
|
+
LayerModule,
|
|
1550
|
+
ReactiveFormsModule,
|
|
1551
|
+
IconModule,
|
|
1552
|
+
TranslatePipe,
|
|
1553
|
+
ValtimoCdsModalDirective,
|
|
1554
|
+
DialogModule,
|
|
1555
|
+
BuildingBlockManagementVersionSelectorComponent,
|
|
1556
|
+
ValtimoCdsOverflowButtonDirective,
|
|
1557
|
+
LoadingModule,
|
|
1558
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"building-block-actions\"\n *ngIf=\"{\n isFinal: isFinal$ | async,\n } as obs\"\n>\n <div class=\"building-block-metadata\">\n <valtimo-building-block-management-version-selector></valtimo-building-block-management-version-selector>\n </div>\n\n <div class=\"building-block-buttons\">\n <ng-template #trigger>\n <button cdsButton=\"tertiary\">\n {{ 'buildingBlockManagement.actions.more' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"overflow-menu--vertical\" size=\"16\"></svg>\n </button>\n </ng-template>\n\n <cds-overflow-menu\n [customTrigger]=\"trigger\"\n class=\"overflow-button\"\n valtimoCdsOverflowButton\n [width]=\"250\"\n [offset]=\"{y: 48, x: 37}\"\n >\n <cds-overflow-menu-option\n [id]=\"'exportBuildingBlock'\"\n (selected)=\"export()\"\n [disabled]=\"(actionInProgress$ | async) || (exporting$ | async)\"\n >\n {{\n 'buildingBlockManagement.overflowMenu.export'\n | translate: {value: buildingBlockName$ | async}\n }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n *ngIf=\"!obs.isFinal\"\n [disabled]=\"actionInProgress$ | async\"\n (selected)=\"finalizeDraft()\"\n >\n {{ 'buildingBlockManagement.actions.makeFinal' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n *ngIf=\"obs.isFinal\"\n [disabled]=\"actionInProgress$ | async\"\n (selected)=\"openDraftModal()\"\n >\n {{ 'buildingBlockManagement.actions.createDraft' | translate }}\n </cds-overflow-menu-option>\n </cds-overflow-menu>\n </div>\n</div>\n\n<ng-template #exportingMessage>\n <div class=\"exporting-message\">\n <span class=\"cds--inline-notification__title\">{{\n 'buildingBlockManagement.overflowMenu.preparingDownload' | translate\n }}</span>\n <cds-loading size=\"sm\"></cds-loading>\n </div>\n</ng-template>\n\n<cds-modal\n *ngIf=\"{open: showDraftModal$ | async} as obs\"\n [open]=\"obs.open\"\n showFooter=\"true\"\n valtimoCdsModal\n (close)=\"closeDraftModal()\"\n>\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeDraftModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'buildingBlockManagement.actions.draft.title' | translate }}\n </h3>\n </cds-modal-header>\n\n <form [formGroup]=\"draftForm\" cdsModalContent class=\"bb-management-actions__modal\" [cdsLayer]=\"1\">\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"draftForm.disabled\"\n [invalid]=\"versionTag.touched && versionTag.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.actions.draft.version' | translate }}\n </span>\n\n <input\n formControlName=\"versionTag\"\n cdsText\n placeholder=\"{{ 'buildingBlockManagement.actions.draft.placeholder' | translate }}\"\n />\n </cds-label>\n </div>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeDraftModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"draftForm.invalid || (actionInProgress$ | async)\"\n (click)=\"createDraft()\"\n >\n {{ 'buildingBlockManagement.actions.draft.confirm' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".building-block-actions{display:flex;width:100%;justify-content:space-between;align-items:flex-end}.building-block-actions ::ng-deep .version-selection{width:160px}.building-block-actions ::ng-deep .version-selection .cds--list-box__selection{display:none}.bb-management-actions__modal{min-width:320px}.building-block-metadata{display:flex;gap:24px;align-items:flex-end}.building-block-buttons{display:flex;align-items:center;gap:16px}::ng-deep .cds--list-box__field{display:flex;justify-content:space-between}::ng-deep .cds--list-box__menu-item__option{display:flex;justify-content:space-between;padding-inline-end:0}::ng-deep .cds--list-box__menu-item__option>div{margin-top:-4px}.full-width-notification{max-inline-size:100%;min-inline-size:100%}::ng-deep .cds--text-input__field-wrapper cds-label{width:100%}.exporting-message{display:flex;align-items:center;gap:8px}\n"] }]
|
|
1559
|
+
}], ctorParameters: () => [{ type: BuildingBlockManagementApiService }, { type: BuildingBlockManagementDetailService }, { type: i2$2.FormBuilder }, { type: i1.GlobalNotificationService }, { type: i4$1.TranslateService }, { type: Document, decorators: [{
|
|
1560
|
+
type: Inject,
|
|
1561
|
+
args: [DOCUMENT]
|
|
1562
|
+
}] }], propDecorators: { _exportMessageTemplateRef: [{
|
|
1563
|
+
type: ViewChild,
|
|
1564
|
+
args: ['exportingMessage']
|
|
1565
|
+
}] } });
|
|
1566
|
+
|
|
1567
|
+
/*
|
|
1568
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1569
|
+
*
|
|
1570
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1571
|
+
* you may not use this file except in compliance with the License.
|
|
1572
|
+
* You may obtain a copy of the License at
|
|
1573
|
+
*
|
|
1574
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1575
|
+
*
|
|
1576
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1577
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1578
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1579
|
+
* See the License for the specific language governing permissions and
|
|
1580
|
+
* limitations under the License.
|
|
1581
|
+
*/
|
|
1582
|
+
class BuildingBlockManagementDetailComponent {
|
|
1583
|
+
constructor(route, buildingBlockManagementDetailService, pageTitleService) {
|
|
1584
|
+
this.route = route;
|
|
1585
|
+
this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
|
|
1586
|
+
this.pageTitleService = pageTitleService;
|
|
1587
|
+
this.BUILDING_BLOCK_MANAGEMENT_TABS = BUILDING_BLOCK_MANAGEMENT_TABS;
|
|
1588
|
+
this.activeTabKey$ = this.buildingBlockManagementDetailService.activeTabKey$;
|
|
1589
|
+
this.buildingBlockManagementDetailService.setRoute(this.route);
|
|
1590
|
+
}
|
|
1591
|
+
ngOnInit() {
|
|
1592
|
+
this.pageTitleService.disableReset();
|
|
1593
|
+
}
|
|
1594
|
+
ngOnDestroy() {
|
|
1595
|
+
this.pageTitleService.enableReset();
|
|
1596
|
+
}
|
|
1597
|
+
switchTab(tabKey) {
|
|
1598
|
+
this.activeTabKey$.pipe(take(1)).subscribe(activeTabKey => {
|
|
1599
|
+
if (activeTabKey === tabKey)
|
|
1600
|
+
return;
|
|
1601
|
+
this.buildingBlockManagementDetailService.navigateToTab(tabKey);
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
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 }] }); }
|
|
1606
|
+
}
|
|
1607
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementDetailComponent, decorators: [{
|
|
1608
|
+
type: Component,
|
|
1609
|
+
args: [{ standalone: true, selector: 'valtimo-building-block-management-detail', imports: [
|
|
1610
|
+
CommonModule,
|
|
1611
|
+
CarbonListModule,
|
|
1612
|
+
ButtonModule,
|
|
1613
|
+
IconModule,
|
|
1614
|
+
TabsModule,
|
|
1615
|
+
TranslatePipe,
|
|
1616
|
+
BuildingBlockManagementGeneralComponent,
|
|
1617
|
+
BuildingBlockManagementDocumentComponent,
|
|
1618
|
+
BuildingBlockManagementProcessesComponent,
|
|
1619
|
+
RenderInPageHeaderDirective,
|
|
1620
|
+
BuildingBlockManagementDetailActionsComponent,
|
|
1621
|
+
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 }] });
|
|
1624
|
+
|
|
1625
|
+
/*
|
|
1626
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1627
|
+
*
|
|
1628
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1629
|
+
* you may not use this file except in compliance with the License.
|
|
1630
|
+
* You may obtain a copy of the License at
|
|
1631
|
+
*
|
|
1632
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1633
|
+
*
|
|
1634
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1635
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1636
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1637
|
+
* See the License for the specific language governing permissions and
|
|
1638
|
+
* limitations under the License.
|
|
1639
|
+
*/
|
|
1640
|
+
const routes = [
|
|
1641
|
+
{
|
|
1642
|
+
path: 'building-block-management',
|
|
1643
|
+
component: BuildingBlockManagementListComponent,
|
|
1644
|
+
canActivate: [AuthGuardService],
|
|
1645
|
+
data: { title: 'buildingBlockManagement.title', roles: [ROLE_ADMIN] },
|
|
1646
|
+
},
|
|
1647
|
+
{
|
|
1648
|
+
path: 'building-block-management/building-block/:buildingBlockDefinitionKey/version/:buildingBlockDefinitionVersionTag/:tabKey',
|
|
1649
|
+
component: BuildingBlockManagementDetailComponent,
|
|
1650
|
+
canActivate: [AuthGuardService],
|
|
1651
|
+
data: {
|
|
1652
|
+
title: 'buildingBlockManagement.detail.title',
|
|
1653
|
+
roles: [ROLE_ADMIN],
|
|
1654
|
+
customPageTitle: true,
|
|
1655
|
+
},
|
|
1656
|
+
},
|
|
1657
|
+
{
|
|
1658
|
+
path: `building-block-management/building-block/:buildingBlockDefinitionKey/version/:buildingBlockDefinitionVersionTag/${BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES}/create`,
|
|
1659
|
+
component: ProcessManagementBuilderComponent,
|
|
1660
|
+
canActivate: [AuthGuardService],
|
|
1661
|
+
data: {
|
|
1662
|
+
title: 'Create new Process',
|
|
1663
|
+
roles: [ROLE_ADMIN],
|
|
1664
|
+
context: 'buildingBlock',
|
|
1665
|
+
},
|
|
1666
|
+
},
|
|
1667
|
+
{
|
|
1668
|
+
path: `building-block-management/building-block/:buildingBlockDefinitionKey/version/:buildingBlockDefinitionVersionTag/${BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES}/:processDefinitionKey`,
|
|
1669
|
+
component: ProcessManagementBuilderComponent,
|
|
1670
|
+
canActivate: [AuthGuardService],
|
|
1671
|
+
data: {
|
|
1672
|
+
title: 'Process details',
|
|
1673
|
+
roles: [ROLE_ADMIN],
|
|
1674
|
+
customPageTitle: true,
|
|
1675
|
+
context: 'buildingBlock',
|
|
1676
|
+
},
|
|
1677
|
+
},
|
|
1678
|
+
];
|
|
1679
|
+
class BuildingBlockManagementRouting {
|
|
1680
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementRouting, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1681
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementRouting, imports: [CommonModule, i3.RouterModule], exports: [RouterModule] }); }
|
|
1682
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementRouting, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
|
|
1683
|
+
}
|
|
1684
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementRouting, decorators: [{
|
|
1685
|
+
type: NgModule,
|
|
1686
|
+
args: [{
|
|
1687
|
+
declarations: [],
|
|
1688
|
+
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
1689
|
+
exports: [RouterModule],
|
|
1690
|
+
}]
|
|
1691
|
+
}] });
|
|
1692
|
+
|
|
1693
|
+
/*
|
|
1694
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1695
|
+
*
|
|
1696
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1697
|
+
* you may not use this file except in compliance with the License.
|
|
1698
|
+
* You may obtain a copy of the License at
|
|
1699
|
+
*
|
|
1700
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1701
|
+
*
|
|
1702
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1703
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1704
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1705
|
+
* See the License for the specific language governing permissions and
|
|
1706
|
+
* limitations under the License.
|
|
1707
|
+
*/
|
|
1708
|
+
class BuildingBlockManagementModule {
|
|
1709
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1710
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementModule, imports: [BuildingBlockManagementRouting, BuildingBlockManagementListComponent] }); }
|
|
1711
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementModule, imports: [BuildingBlockManagementRouting, BuildingBlockManagementListComponent] }); }
|
|
1712
|
+
}
|
|
1713
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BuildingBlockManagementModule, decorators: [{
|
|
1714
|
+
type: NgModule,
|
|
1715
|
+
args: [{
|
|
1716
|
+
declarations: [],
|
|
1717
|
+
imports: [BuildingBlockManagementRouting, BuildingBlockManagementListComponent],
|
|
1718
|
+
providers: [],
|
|
1719
|
+
}]
|
|
1720
|
+
}] });
|
|
1721
|
+
|
|
1722
|
+
/*
|
|
1723
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1724
|
+
*
|
|
1725
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1726
|
+
* you may not use this file except in compliance with the License.
|
|
1727
|
+
* You may obtain a copy of the License at
|
|
1728
|
+
*
|
|
1729
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1730
|
+
*
|
|
1731
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1732
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1733
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1734
|
+
* See the License for the specific language governing permissions and
|
|
1735
|
+
* limitations under the License.
|
|
1736
|
+
*/
|
|
1737
|
+
/*
|
|
1738
|
+
* Public API Surface of building-block-management
|
|
1739
|
+
*/
|
|
1740
|
+
|
|
1741
|
+
/**
|
|
1742
|
+
* Generated bundle index. Do not edit.
|
|
1743
|
+
*/
|
|
1744
|
+
|
|
1745
|
+
export { BuildingBlockManagementApiService, BuildingBlockManagementDetailService, BuildingBlockManagementModule, BuildingBlockManagementService };
|
|
1746
|
+
//# sourceMappingURL=valtimo-building-block-management.mjs.map
|