@valtimo/connector-management 4.15.2-next-main.8

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.
Files changed (47) hide show
  1. package/README.md +24 -0
  2. package/bundles/valtimo-connector-management.umd.js +2087 -0
  3. package/bundles/valtimo-connector-management.umd.js.map +1 -0
  4. package/bundles/valtimo-connector-management.umd.min.js +16 -0
  5. package/bundles/valtimo-connector-management.umd.min.js.map +1 -0
  6. package/esm2015/lib/components/add-connector/add-connector.component.js +79 -0
  7. package/esm2015/lib/components/connector-link-extension/connector-link-extension.component.js +95 -0
  8. package/esm2015/lib/components/connector-link-extension-modal/connector-link-extension-modal.component.js +136 -0
  9. package/esm2015/lib/components/connector-management/connector-management.component.js +95 -0
  10. package/esm2015/lib/components/connector-modal/connector-modal.component.js +58 -0
  11. package/esm2015/lib/components/edit-connector-form/edit-connector-form.component.js +42 -0
  12. package/esm2015/lib/components/edit-connector-properties/edit-connector-properties.component.js +140 -0
  13. package/esm2015/lib/components/edit-product-aanvragen-connector/edit-product-aanvragen-connector.component.js +177 -0
  14. package/esm2015/lib/components/edit-product-aanvragen-connector/edit-product-aanvragen-connector.form.js +494 -0
  15. package/esm2015/lib/components/modify-connector/modify-connector.component.js +73 -0
  16. package/esm2015/lib/components/multi-value-connector-property/multi-value-connector-property.component.js +92 -0
  17. package/esm2015/lib/connector-management-routing.js +44 -0
  18. package/esm2015/lib/connector-management.module.js +76 -0
  19. package/esm2015/lib/extension/connector-management.extension.init.js +39 -0
  20. package/esm2015/lib/services/connector-management/connector-management.service.js +60 -0
  21. package/esm2015/lib/services/connector-management-state/connector-management-state.service.js +83 -0
  22. package/esm2015/lib/services/object-api-sync/object-api-sync.service.js +51 -0
  23. package/esm2015/public-api.js +32 -0
  24. package/esm2015/valtimo-connector-management.js +8 -0
  25. package/fesm2015/valtimo-connector-management.js +1771 -0
  26. package/fesm2015/valtimo-connector-management.js.map +1 -0
  27. package/lib/components/add-connector/add-connector.component.d.ts +26 -0
  28. package/lib/components/connector-link-extension/connector-link-extension.component.d.ts +25 -0
  29. package/lib/components/connector-link-extension-modal/connector-link-extension-modal.component.d.ts +40 -0
  30. package/lib/components/connector-management/connector-management.component.d.ts +28 -0
  31. package/lib/components/connector-modal/connector-modal.component.d.ts +16 -0
  32. package/lib/components/edit-connector-form/edit-connector-form.component.d.ts +15 -0
  33. package/lib/components/edit-connector-properties/edit-connector-properties.component.d.ts +35 -0
  34. package/lib/components/edit-product-aanvragen-connector/edit-product-aanvragen-connector.component.d.ts +43 -0
  35. package/lib/components/edit-product-aanvragen-connector/edit-product-aanvragen-connector.form.d.ts +215 -0
  36. package/lib/components/modify-connector/modify-connector.component.d.ts +19 -0
  37. package/lib/components/multi-value-connector-property/multi-value-connector-property.component.d.ts +26 -0
  38. package/lib/connector-management-routing.d.ts +2 -0
  39. package/lib/connector-management.module.d.ts +2 -0
  40. package/lib/extension/connector-management.extension.init.d.ts +2 -0
  41. package/lib/services/connector-management/connector-management.service.d.ts +17 -0
  42. package/lib/services/connector-management-state/connector-management-state.service.d.ts +26 -0
  43. package/lib/services/object-api-sync/object-api-sync.service.d.ts +14 -0
  44. package/package.json +19 -0
  45. package/public-api.d.ts +13 -0
  46. package/valtimo-connector-management.d.ts +7 -0
  47. package/valtimo-connector-management.metadata.json +1 -0
@@ -0,0 +1,1771 @@
1
+ import { ɵɵdefineInjectable, ɵɵinject, Injectable, Component, NgModule, ViewChild, Input, EventEmitter, Output } from '@angular/core';
2
+ import { RouterModule, ActivatedRoute } from '@angular/router';
3
+ import { CommonModule } from '@angular/common';
4
+ import { AuthGuardService } from '@valtimo/security';
5
+ import { ROLE_ADMIN, Extension, BasicExtensionPoint } from '@valtimo/contract';
6
+ import { BehaviorSubject, combineLatest, of, Subject } from 'rxjs';
7
+ import { map, tap, switchMap, take, catchError } from 'rxjs/operators';
8
+ import { TranslateService, TranslateModule } from '@ngx-translate/core';
9
+ import { HttpClient } from '@angular/common/http';
10
+ import { ConfigService } from '@valtimo/config';
11
+ import { AlertService, WidgetModule, ListModule, SpinnerModule, ModalModule, FormIoModule } from '@valtimo/components';
12
+ import { get, set, cloneDeep } from 'lodash';
13
+ import { FormTranslationService, FormMappingService } from '@valtimo/form';
14
+ import { DocumentService } from '@valtimo/document';
15
+ import { NGXLogger } from 'ngx-logger';
16
+
17
+ /*
18
+ * Copyright 2020 Dimpact.
19
+ *
20
+ * Licensed under EUPL, Version 1.2 (the "License");
21
+ * you may not use this file except in compliance with the License.
22
+ * You may obtain a copy of the License at
23
+ *
24
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
25
+ *
26
+ * Unless required by applicable law or agreed to in writing, software
27
+ * distributed under the License is distributed on an "AS IS" basis,
28
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
+ * See the License for the specific language governing permissions and
30
+ * limitations under the License.
31
+ */
32
+ class ConnectorManagementService {
33
+ constructor(http, configService) {
34
+ this.http = http;
35
+ this.configService = configService;
36
+ this.valtimoApiConfig = configService.config.valtimoApi;
37
+ }
38
+ getConnectorInstances(params) {
39
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}connector/instance`, { params });
40
+ }
41
+ getConnectorInstancesByType(typeId, params) {
42
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}connector/instance/${typeId}`, { params });
43
+ }
44
+ getConnectorInstanceById(instanceId) {
45
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}connector/instance?instanceId=${instanceId}`);
46
+ }
47
+ getConnectorTypes() {
48
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}connector/type`);
49
+ }
50
+ createConnectorInstance(request) {
51
+ return this.http.post(`${this.valtimoApiConfig.endpointUri}connector/instance`, request);
52
+ }
53
+ updateConnectorInstance(request) {
54
+ return this.http.put(`${this.valtimoApiConfig.endpointUri}connector/instance`, request);
55
+ }
56
+ deleteConnectorInstance(connectorInstanceId) {
57
+ return this.http.delete(`${this.valtimoApiConfig.endpointUri}connector/instance/${connectorInstanceId}`);
58
+ }
59
+ }
60
+ ConnectorManagementService.ɵprov = ɵɵdefineInjectable({ factory: function ConnectorManagementService_Factory() { return new ConnectorManagementService(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: ConnectorManagementService, providedIn: "root" });
61
+ ConnectorManagementService.decorators = [
62
+ { type: Injectable, args: [{
63
+ providedIn: 'root'
64
+ },] }
65
+ ];
66
+ ConnectorManagementService.ctorParameters = () => [
67
+ { type: HttpClient },
68
+ { type: ConfigService }
69
+ ];
70
+
71
+ /*
72
+ * Copyright 2020 Dimpact.
73
+ *
74
+ * Licensed under EUPL, Version 1.2 (the "License");
75
+ * you may not use this file except in compliance with the License.
76
+ * You may obtain a copy of the License at
77
+ *
78
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
79
+ *
80
+ * Unless required by applicable law or agreed to in writing, software
81
+ * distributed under the License is distributed on an "AS IS" basis,
82
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
83
+ * See the License for the specific language governing permissions and
84
+ * limitations under the License.
85
+ */
86
+ class ConnectorManagementStateService {
87
+ constructor() {
88
+ this._showModal$ = new BehaviorSubject(false);
89
+ this._showExtensionModal$ = new BehaviorSubject(false);
90
+ this._inputDisabled$ = new BehaviorSubject(false);
91
+ this._refresh$ = new BehaviorSubject('refresh');
92
+ this._selectedInstance$ = new BehaviorSubject(undefined);
93
+ this._lastConfigIdAdded$ = new BehaviorSubject('');
94
+ }
95
+ get showModal$() {
96
+ return this._showModal$.asObservable();
97
+ }
98
+ get showExtensionModal$() {
99
+ return this._showExtensionModal$.asObservable();
100
+ }
101
+ get inputDisabled$() {
102
+ return this._inputDisabled$.asObservable();
103
+ }
104
+ get refresh$() {
105
+ return this._refresh$.asObservable();
106
+ }
107
+ get selectedInstance$() {
108
+ return this._selectedInstance$.asObservable();
109
+ }
110
+ get lastConfigIdAdded$() {
111
+ return this._lastConfigIdAdded$.asObservable();
112
+ }
113
+ showModal() {
114
+ this._showModal$.next(true);
115
+ }
116
+ hideModal() {
117
+ this._showModal$.next(false);
118
+ }
119
+ showExtensionModal() {
120
+ this._showExtensionModal$.next(true);
121
+ }
122
+ hideExtensionModal() {
123
+ this._showExtensionModal$.next(false);
124
+ }
125
+ disableInput() {
126
+ this._inputDisabled$.next(true);
127
+ }
128
+ enableInput() {
129
+ this._inputDisabled$.next(false);
130
+ }
131
+ refresh() {
132
+ this._refresh$.next('refresh');
133
+ }
134
+ setConnectorInstance(instance) {
135
+ this._selectedInstance$.next(instance);
136
+ }
137
+ setLastConfigIdAdded(id) {
138
+ this._lastConfigIdAdded$.next(id);
139
+ }
140
+ clearLastConfigIdAdded() {
141
+ this._lastConfigIdAdded$.next('');
142
+ }
143
+ }
144
+ ConnectorManagementStateService.ɵprov = ɵɵdefineInjectable({ factory: function ConnectorManagementStateService_Factory() { return new ConnectorManagementStateService(); }, token: ConnectorManagementStateService, providedIn: "root" });
145
+ ConnectorManagementStateService.decorators = [
146
+ { type: Injectable, args: [{
147
+ providedIn: 'root'
148
+ },] }
149
+ ];
150
+
151
+ /*
152
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
153
+ *
154
+ * Licensed under EUPL, Version 1.2 (the "License");
155
+ * you may not use this file except in compliance with the License.
156
+ * You may obtain a copy of the License at
157
+ *
158
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
159
+ *
160
+ * Unless required by applicable law or agreed to in writing, software
161
+ * distributed under the License is distributed on an "AS IS" basis,
162
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
163
+ * See the License for the specific language governing permissions and
164
+ * limitations under the License.
165
+ */
166
+ class ConnectorManagementComponent {
167
+ constructor(connectorManagementService, translateService, stateService) {
168
+ this.connectorManagementService = connectorManagementService;
169
+ this.translateService = translateService;
170
+ this.stateService = stateService;
171
+ this.loading$ = new BehaviorSubject(true);
172
+ this.fields$ = new BehaviorSubject([]);
173
+ this.currentPageAndSize$ = new BehaviorSubject({
174
+ page: 0,
175
+ size: 10,
176
+ });
177
+ this.pageSizes$ = new BehaviorSubject({
178
+ collectionSize: 0,
179
+ maxPaginationItemSize: 5
180
+ });
181
+ this.pagination$ = combineLatest([this.currentPageAndSize$, this.pageSizes$])
182
+ .pipe(map(([currentPage, sizes]) => (Object.assign(Object.assign(Object.assign({}, currentPage), sizes), { page: currentPage.page + 1 }))));
183
+ this.connectorInstances$ = combineLatest([this.currentPageAndSize$, this.translateService.stream('key'), this.stateService.refresh$])
184
+ .pipe(tap(() => this.setFields()), switchMap(([currentPage]) => combineLatest([
185
+ this.connectorManagementService.getConnectorInstances({ page: currentPage.page, size: currentPage.size }),
186
+ this.connectorManagementService.getConnectorTypes()
187
+ ])), tap(([instanceRes]) => {
188
+ this.pageSizes$.pipe(take(1)).subscribe((sizes) => {
189
+ this.pageSizes$.next(Object.assign(Object.assign({}, sizes), { collectionSize: instanceRes.totalElements }));
190
+ });
191
+ }), map(([instanceRes, typesRes]) => instanceRes.content.map((instance) => {
192
+ var _a;
193
+ return Object.assign(Object.assign({}, instance), { typeName: (_a = typesRes.find((type) => type.id === instance.type.id)) === null || _a === void 0 ? void 0 : _a.name });
194
+ })), tap(() => this.loading$.next(false)));
195
+ this.modalType$ = new BehaviorSubject('add');
196
+ }
197
+ ngOnDestroy() {
198
+ this.stateService.hideModal();
199
+ }
200
+ paginationClicked(newPageNumber) {
201
+ this.currentPageAndSize$.pipe(take(1)).subscribe((currentPage) => {
202
+ this.currentPageAndSize$.next(Object.assign(Object.assign({}, currentPage), { page: newPageNumber - 1 }));
203
+ });
204
+ }
205
+ paginationSet(newPageSize) {
206
+ if (newPageSize) {
207
+ this.currentPageAndSize$.pipe(take(1)).subscribe((currentPage) => {
208
+ this.currentPageAndSize$.next(Object.assign(Object.assign({}, currentPage), { size: newPageSize }));
209
+ });
210
+ }
211
+ }
212
+ rowClicked(instance) {
213
+ this.modalType$.next('modify');
214
+ this.stateService.setConnectorInstance(instance);
215
+ this.stateService.showModal();
216
+ }
217
+ showAddModal() {
218
+ this.modalType$.next('add');
219
+ this.stateService.showModal();
220
+ }
221
+ setFields() {
222
+ const getTranslatedLabel = (key) => this.translateService.instant(`connectorManagement.labels.${key}`);
223
+ const keys = ['name', 'typeName'];
224
+ this.fields$.next(keys.map((key) => ({ label: getTranslatedLabel(key), key })));
225
+ }
226
+ }
227
+ ConnectorManagementComponent.decorators = [
228
+ { type: Component, args: [{
229
+ selector: 'valtimo-connector-management',
230
+ template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\" *ngIf=\"{\n connectorInstances: connectorInstances$ | async,\n fields: fields$ | async,\n pagination: pagination$ | async,\n loading: loading$ | async\n } as obs\">\n <div class=\"container-fluid\">\n <ng-container *ngTemplateOutlet=\"buttons;context:{loading: obs.loading}\"></ng-container>\n <valtimo-widget *ngIf=\"obs.loading === false; else loading\">\n <valtimo-list\n [items]=\"obs.connectorInstances\"\n [fields]=\"obs.fields\"\n [header]=\"true\"\n [viewMode]=\"true\"\n [isSearchable]=\"false\"\n [pagination]=\"obs.pagination\"\n paginationIdentifier=\"connectorManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"rowClicked($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'connectorManagement.title' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'connectorManagement.subtitle' | translate }}</h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n</div>\n\n<valtimo-connector-modal [modalType]=\"modalType$ | async\">\n</valtimo-connector-modal>\n\n<ng-template #buttons let-loading=\"loading\">\n <div class=\"btn-group mt-m3px mb-3 float-right\">\n <button class=\"btn btn-primary btn-space mr-0\" [disabled]=\"loading\" (click)=\"showAddModal()\">\n <i class=\"icon mdi mdi-plus\"></i>&nbsp;\n {{ 'connectorManagement.add' | translate }}\n </button>\n </div>\n <div class=\"clearfix\"></div>\n</ng-template>\n\n<ng-template #loading>\n <valtimo-spinner></valtimo-spinner>\n</ng-template>\n\n",
231
+ styles: ["/*!\n * Copyright 2015-2020 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 */"]
232
+ },] }
233
+ ];
234
+ ConnectorManagementComponent.ctorParameters = () => [
235
+ { type: ConnectorManagementService },
236
+ { type: TranslateService },
237
+ { type: ConnectorManagementStateService }
238
+ ];
239
+
240
+ /*
241
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
242
+ *
243
+ * Licensed under EUPL, Version 1.2 (the "License");
244
+ * you may not use this file except in compliance with the License.
245
+ * You may obtain a copy of the License at
246
+ *
247
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
248
+ *
249
+ * Unless required by applicable law or agreed to in writing, software
250
+ * distributed under the License is distributed on an "AS IS" basis,
251
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
252
+ * See the License for the specific language governing permissions and
253
+ * limitations under the License.
254
+ */
255
+ const ɵ0 = { title: 'Connectors', roles: [ROLE_ADMIN] };
256
+ const routes = [
257
+ {
258
+ path: 'connectors',
259
+ component: ConnectorManagementComponent,
260
+ canActivate: [AuthGuardService],
261
+ data: ɵ0
262
+ },
263
+ ];
264
+ class ConnectorManagementRoutingModule {
265
+ }
266
+ ConnectorManagementRoutingModule.decorators = [
267
+ { type: NgModule, args: [{
268
+ declarations: [],
269
+ imports: [
270
+ CommonModule,
271
+ RouterModule.forChild(routes),
272
+ ],
273
+ exports: [RouterModule]
274
+ },] }
275
+ ];
276
+
277
+ /*
278
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
279
+ *
280
+ * Licensed under EUPL, Version 1.2 (the "License");
281
+ * you may not use this file except in compliance with the License.
282
+ * You may obtain a copy of the License at
283
+ *
284
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
285
+ *
286
+ * Unless required by applicable law or agreed to in writing, software
287
+ * distributed under the License is distributed on an "AS IS" basis,
288
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
289
+ * See the License for the specific language governing permissions and
290
+ * limitations under the License.
291
+ */
292
+ class ObjectApiSyncService {
293
+ constructor(http, configService) {
294
+ this.http = http;
295
+ this.configService = configService;
296
+ this.valtimoApiConfig = configService.config.valtimoApi;
297
+ }
298
+ getObjectSyncConfigs(documentDefinitionName) {
299
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}object/sync/config`, { params: { documentDefinitionName } });
300
+ }
301
+ createObjectSyncConfig(request) {
302
+ return this.http.post(`${this.valtimoApiConfig.endpointUri}object/sync/config`, request);
303
+ }
304
+ modifyObjectSyncConfig(request) {
305
+ return this.http.put(`${this.valtimoApiConfig.endpointUri}object/sync/config`, request);
306
+ }
307
+ deleteObjectSyncConfig(configId) {
308
+ return this.http.delete(`${this.valtimoApiConfig.endpointUri}object/sync/config/${configId}`);
309
+ }
310
+ }
311
+ ObjectApiSyncService.ɵprov = ɵɵdefineInjectable({ factory: function ObjectApiSyncService_Factory() { return new ObjectApiSyncService(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: ObjectApiSyncService, providedIn: "root" });
312
+ ObjectApiSyncService.decorators = [
313
+ { type: Injectable, args: [{
314
+ providedIn: 'root'
315
+ },] }
316
+ ];
317
+ ObjectApiSyncService.ctorParameters = () => [
318
+ { type: HttpClient },
319
+ { type: ConfigService }
320
+ ];
321
+
322
+ /*
323
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
324
+ *
325
+ * Licensed under EUPL, Version 1.2 (the "License");
326
+ * you may not use this file except in compliance with the License.
327
+ * You may obtain a copy of the License at
328
+ *
329
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
330
+ *
331
+ * Unless required by applicable law or agreed to in writing, software
332
+ * distributed under the License is distributed on an "AS IS" basis,
333
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
334
+ * See the License for the specific language governing permissions and
335
+ * limitations under the License.
336
+ */
337
+ class ConnectorLinkExtensionModalComponent {
338
+ constructor(connectorManagementService, translateService, stateService, objectApiSyncService, route, alertService) {
339
+ this.connectorManagementService = connectorManagementService;
340
+ this.translateService = translateService;
341
+ this.stateService = stateService;
342
+ this.objectApiSyncService = objectApiSyncService;
343
+ this.route = route;
344
+ this.alertService = alertService;
345
+ this.loading$ = new BehaviorSubject(true);
346
+ this.fields$ = new BehaviorSubject([]);
347
+ this.currentPageAndSize$ = new BehaviorSubject({
348
+ page: 0,
349
+ size: 10,
350
+ });
351
+ this.pageSizes$ = new BehaviorSubject({
352
+ collectionSize: 0,
353
+ maxPaginationItemSize: 5
354
+ });
355
+ this.pagination$ = combineLatest([this.currentPageAndSize$, this.pageSizes$])
356
+ .pipe(map(([currentPage, sizes]) => (Object.assign(Object.assign(Object.assign({}, currentPage), sizes), { page: currentPage.page + 1 }))));
357
+ this.connectorInstances$ = combineLatest([
358
+ this.currentPageAndSize$,
359
+ this.connectorManagementService.getConnectorTypes(),
360
+ this.translateService.stream('key'),
361
+ this.stateService.refresh$
362
+ ])
363
+ .pipe(tap(() => this.setFields()), switchMap(([currentPage, types]) => this.connectorManagementService.getConnectorInstancesByType(types.find((type) => type.name.toLowerCase().includes('objectsapi')).id, { page: currentPage.page, size: currentPage.size })), tap((instanceRes) => {
364
+ this.pageSizes$.pipe(take(1)).subscribe((sizes) => {
365
+ this.pageSizes$.next(Object.assign(Object.assign({}, sizes), { collectionSize: instanceRes.totalElements }));
366
+ });
367
+ }), map((res) => res.content), tap(() => this.loading$.next(false)));
368
+ this.noObjectsApiConnectors$ = this.connectorInstances$.pipe(map((instances) => !instances || instances.length === 0));
369
+ this.disabled$ = this.stateService.inputDisabled$;
370
+ }
371
+ ngAfterViewInit() {
372
+ this.showSubscription = this.stateService.showExtensionModal$.subscribe((show) => {
373
+ if (show) {
374
+ this.show();
375
+ }
376
+ else {
377
+ this.hide();
378
+ }
379
+ });
380
+ }
381
+ ngOnDestroy() {
382
+ var _a;
383
+ (_a = this.showSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
384
+ }
385
+ paginationClicked(newPageNumber) {
386
+ this.currentPageAndSize$.pipe(take(1)).subscribe((currentPage) => {
387
+ this.currentPageAndSize$.next(Object.assign(Object.assign({}, currentPage), { page: newPageNumber - 1 }));
388
+ });
389
+ }
390
+ paginationSet(newPageSize) {
391
+ if (newPageSize) {
392
+ this.currentPageAndSize$.pipe(take(1)).subscribe((currentPage) => {
393
+ this.currentPageAndSize$.next(Object.assign(Object.assign({}, currentPage), { size: newPageSize }));
394
+ });
395
+ }
396
+ }
397
+ rowClicked(instance) {
398
+ var _a, _b;
399
+ const connectorInstanceId = instance.id;
400
+ const enabled = true;
401
+ const documentDefinitionName = this.route.snapshot.paramMap.get('name');
402
+ const objectTypeUrl = (_b = (_a = instance.properties) === null || _a === void 0 ? void 0 : _a.objectType) === null || _b === void 0 ? void 0 : _b.url;
403
+ const splitObjectTypeUrl = objectTypeUrl === null || objectTypeUrl === void 0 ? void 0 : objectTypeUrl.split('/');
404
+ const objectTypeId = splitObjectTypeUrl[splitObjectTypeUrl.length - 1];
405
+ this.stateService.disableInput();
406
+ this.objectApiSyncService.createObjectSyncConfig({ connectorInstanceId, enabled, documentDefinitionName, objectTypeId })
407
+ .subscribe((res) => {
408
+ this.alertService.success(this.translateService.instant('connectorManagement.extension.addSyncSuccess'));
409
+ this.stateService.hideExtensionModal();
410
+ this.stateService.enableInput();
411
+ this.stateService.refresh();
412
+ this.stateService.setLastConfigIdAdded(res.objectSyncConfig.id);
413
+ }, () => {
414
+ this.stateService.enableInput();
415
+ });
416
+ }
417
+ setFields() {
418
+ const getTranslatedLabel = (key) => this.translateService.instant(`connectorManagement.labels.${key}`);
419
+ const keys = ['name'];
420
+ this.fields$.next(keys.map((key) => ({ label: getTranslatedLabel(key), key })));
421
+ }
422
+ show() {
423
+ this.modal.show();
424
+ }
425
+ hide() {
426
+ this.modal.hide();
427
+ }
428
+ }
429
+ ConnectorLinkExtensionModalComponent.decorators = [
430
+ { type: Component, args: [{
431
+ selector: 'valtimo-connector-link-extension-modal',
432
+ template: "<valtimo-modal #modal [title]=\"'connectorManagement.extension.buttonText'| translate\">\n <div class=\"mt-2\" body *ngIf=\"{\n connectorInstances: connectorInstances$ | async,\n fields: fields$ | async,\n pagination: pagination$ | async,\n loading: loading$ | async,\n disabled: disabled$ | async,\n noConnectors: noObjectsApiConnectors$ | async\n } as obs\">\n <div *ngIf=\"obs.loading === false; else loading\" [ngClass]=\"{disabled: obs.disabled }\">\n <ng-container *ngIf=\"!obs.noConnectors; else noConnectors\">\n <p class=\"lead\">{{'connectorManagement.extension.clickToSync' | translate}}</p>\n <valtimo-widget>\n <valtimo-list\n [items]=\"obs.connectorInstances\"\n [fields]=\"obs.fields\"\n [header]=\"false\"\n [viewMode]=\"false\"\n [isSearchable]=\"false\"\n [pagination]=\"obs.pagination\"\n paginationIdentifier=\"connectorManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"rowClicked($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'connectorManagement.title' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'connectorManagement.subtitle' | translate }}</h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </ng-container>\n </div>\n </div>\n</valtimo-modal>\n\n\n<ng-template #loading>\n <valtimo-spinner></valtimo-spinner>\n</ng-template>\n\n<ng-template #noConnectors>\n <p class=\"lead\">{{'connectorManagement.extension.noConnectors' | translate}}</p>\n</ng-template>\n",
433
+ styles: [".disabled{filter:grayscale(1);opacity:.8;pointer-events:none}"]
434
+ },] }
435
+ ];
436
+ ConnectorLinkExtensionModalComponent.ctorParameters = () => [
437
+ { type: ConnectorManagementService },
438
+ { type: TranslateService },
439
+ { type: ConnectorManagementStateService },
440
+ { type: ObjectApiSyncService },
441
+ { type: ActivatedRoute },
442
+ { type: AlertService }
443
+ ];
444
+ ConnectorLinkExtensionModalComponent.propDecorators = {
445
+ modal: [{ type: ViewChild, args: ['modal',] }]
446
+ };
447
+
448
+ /*
449
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
450
+ *
451
+ * Licensed under EUPL, Version 1.2 (the "License");
452
+ * you may not use this file except in compliance with the License.
453
+ * You may obtain a copy of the License at
454
+ *
455
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
456
+ *
457
+ * Unless required by applicable law or agreed to in writing, software
458
+ * distributed under the License is distributed on an "AS IS" basis,
459
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
460
+ * See the License for the specific language governing permissions and
461
+ * limitations under the License.
462
+ */
463
+ class AddConnectorComponent {
464
+ constructor(connectorManagementService, stateService, alertService, translateService) {
465
+ this.connectorManagementService = connectorManagementService;
466
+ this.stateService = stateService;
467
+ this.alertService = alertService;
468
+ this.translateService = translateService;
469
+ this.connectorTypes$ = this.connectorManagementService.getConnectorTypes();
470
+ this.selectedConnector$ = new BehaviorSubject(undefined);
471
+ this.disabled$ = this.stateService.inputDisabled$;
472
+ }
473
+ ngOnInit() {
474
+ this.refreshSubscription = combineLatest([this.stateService.showModal$, this.stateService.refresh$])
475
+ .subscribe(() => {
476
+ this.goBack();
477
+ });
478
+ }
479
+ ngOnDestroy() {
480
+ var _a;
481
+ (_a = this.refreshSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
482
+ }
483
+ selectConnector(connectorType) {
484
+ this.selectedConnector$.next(connectorType);
485
+ }
486
+ goBack() {
487
+ this.selectedConnector$.next(undefined);
488
+ }
489
+ onSave(event) {
490
+ this.selectedConnector$.pipe(take(1)).subscribe((selectedConnectorType) => {
491
+ this.connectorManagementService.createConnectorInstance({
492
+ name: event.name,
493
+ typeId: selectedConnectorType.id,
494
+ connectorProperties: event.properties
495
+ }).subscribe(() => {
496
+ this.alertService.success(this.translateService.instant('connectorManagement.messages.addSuccess'));
497
+ this.stateService.hideModal();
498
+ this.stateService.enableInput();
499
+ this.stateService.refresh();
500
+ }, () => {
501
+ this.stateService.enableInput();
502
+ });
503
+ });
504
+ }
505
+ }
506
+ AddConnectorComponent.decorators = [
507
+ { type: Component, args: [{
508
+ selector: 'valtimo-add-connector',
509
+ template: "<!--\n ~ Copyright 2015-2020 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=\"connectorTypes$ | async as connectorTypes; else loading\">\n <ng-container *ngIf=\"(selectedConnector$ | async) === undefined; else configure\">\n <p class=\"lead\">\n {{'connectorManagement.' + (connectorTypes?.length > 0 ? 'addHeader' : 'noConnectorsAvailable') | translate}}\n </p>\n <div class=\"cards-container mt-3\">\n <div *ngFor=\"let connectorType of connectorTypes\" class=\"card card-border text-center\">\n <div class=\"card-header\">{{connectorType.name}}</div>\n <div class=\"card-body\">\n <button class=\"btn btn-primary\" (click)=\"selectConnector(connectorType)\">\n {{'connectorManagement.configureButton' | translate}}\n </button>\n </div>\n </div>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #configure>\n <ng-container *ngIf=\"selectedConnector$ | async as connector\">\n <button class=\"btn btn-outline-secondary btn-sm btn-back\" (click)=\"goBack()\" [disabled]=\"disabled$ | async\">\n <i class=\"icon mdi mdi-arrow-left mr-1\"></i>\n {{'connectorManagement.goBack' | translate}}\n </button>\n <p class=\"lead text-center mb-3 pb-3 border-bottom\">\n {{('connectorManagement.configureWith' | translate) + ' ' + connector.name}}\n </p>\n <valtimo-edit-connector-form\n [connectorName]=\"connector.name\"\n [properties]=\"(selectedConnector$ | async).properties\"\n (propertiesSave)=\"onSave($event)\"\n >\n </valtimo-edit-connector-form>\n </ng-container>\n</ng-template>\n\n<ng-template #loading>\n <valtimo-spinner></valtimo-spinner>\n</ng-template>\n",
510
+ styles: ["/*!\n * Copyright 2015-2020 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 */.btn-back{position:absolute}.cards-container{display:flex;flex-flow:row wrap;width:100%}.card{margin-right:30px;width:calc(33.3% - 20px)}.card:nth-child(3n+3){margin-right:0}.card-header{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"]
511
+ },] }
512
+ ];
513
+ AddConnectorComponent.ctorParameters = () => [
514
+ { type: ConnectorManagementService },
515
+ { type: ConnectorManagementStateService },
516
+ { type: AlertService },
517
+ { type: TranslateService }
518
+ ];
519
+
520
+ /*
521
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
522
+ *
523
+ * Licensed under EUPL, Version 1.2 (the "License");
524
+ * you may not use this file except in compliance with the License.
525
+ * You may obtain a copy of the License at
526
+ *
527
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
528
+ *
529
+ * Unless required by applicable law or agreed to in writing, software
530
+ * distributed under the License is distributed on an "AS IS" basis,
531
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
532
+ * See the License for the specific language governing permissions and
533
+ * limitations under the License.
534
+ */
535
+ class ModifyConnectorComponent {
536
+ constructor(connectorManagementService, stateService, alertService, translateService) {
537
+ this.connectorManagementService = connectorManagementService;
538
+ this.stateService = stateService;
539
+ this.alertService = alertService;
540
+ this.translateService = translateService;
541
+ this.instance$ = this.stateService.selectedInstance$;
542
+ }
543
+ onSave(event) {
544
+ this.instance$.pipe(take(1)).subscribe((instance) => {
545
+ this.connectorManagementService.updateConnectorInstance({
546
+ name: event.name,
547
+ typeId: instance.type.id,
548
+ id: instance.id,
549
+ connectorProperties: event.properties
550
+ }).subscribe(() => {
551
+ this.alertService.success(this.translateService.instant('connectorManagement.messages.modifySuccess'));
552
+ this.stateService.hideModal();
553
+ this.stateService.enableInput();
554
+ this.stateService.refresh();
555
+ }, () => {
556
+ this.stateService.enableInput();
557
+ });
558
+ });
559
+ }
560
+ onDelete() {
561
+ this.instance$.pipe(take(1)).subscribe((instance) => {
562
+ this.connectorManagementService.deleteConnectorInstance(instance.id).subscribe(() => {
563
+ this.alertService.success(this.translateService.instant('connectorManagement.messages.deleteSuccess'));
564
+ this.stateService.hideModal();
565
+ this.stateService.enableInput();
566
+ this.stateService.refresh();
567
+ }, () => {
568
+ this.stateService.enableInput();
569
+ });
570
+ });
571
+ }
572
+ }
573
+ ModifyConnectorComponent.decorators = [
574
+ { type: Component, args: [{
575
+ selector: 'valtimo-modify-connector',
576
+ template: "<!--\n ~ Copyright 2015-2020 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=\"instance$ | async as instance\">\n <p class=\"lead text-center mb-3 pb-3 border-bottom\">\n {{('connectorManagement.modifyWith' | translate) + ' ' + instance.type.name}}\n </p>\n <valtimo-edit-connector-form\n [properties]=\"instance.properties\"\n [withDefaults]=\"true\"\n [defaultName]=\"instance.name\"\n [showDeleteButton]=\"true\"\n [connectorName]=\"instance.type.name\"\n (propertiesSave)=\"onSave($event)\"\n (connectorDelete)=\"onDelete()\"\n >\n </valtimo-edit-connector-form>\n</ng-container>\n",
577
+ styles: ["/*!\n * Copyright 2015-2020 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 */"]
578
+ },] }
579
+ ];
580
+ ModifyConnectorComponent.ctorParameters = () => [
581
+ { type: ConnectorManagementService },
582
+ { type: ConnectorManagementStateService },
583
+ { type: AlertService },
584
+ { type: TranslateService }
585
+ ];
586
+
587
+ /*
588
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
589
+ *
590
+ * Licensed under EUPL, Version 1.2 (the "License");
591
+ * you may not use this file except in compliance with the License.
592
+ * You may obtain a copy of the License at
593
+ *
594
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
595
+ *
596
+ * Unless required by applicable law or agreed to in writing, software
597
+ * distributed under the License is distributed on an "AS IS" basis,
598
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
599
+ * See the License for the specific language governing permissions and
600
+ * limitations under the License.
601
+ */
602
+ class ConnectorModalComponent {
603
+ constructor(stateService) {
604
+ this.stateService = stateService;
605
+ }
606
+ ngAfterViewInit() {
607
+ this.showSubscription = this.stateService.showModal$.subscribe((show) => {
608
+ if (show) {
609
+ this.show();
610
+ }
611
+ else {
612
+ this.hide();
613
+ }
614
+ });
615
+ }
616
+ ngOnDestroy() {
617
+ var _a;
618
+ (_a = this.showSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
619
+ }
620
+ show() {
621
+ this.modal.show();
622
+ }
623
+ hide() {
624
+ this.modal.hide();
625
+ }
626
+ }
627
+ ConnectorModalComponent.decorators = [
628
+ { type: Component, args: [{
629
+ selector: 'valtimo-connector-modal',
630
+ template: "<!--\n ~ Copyright 2015-2020 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-modal #modal [title]=\"'connectorManagement.' + modalType | translate\">\n <div class=\"mt-2\" body>\n <valtimo-add-connector *ngIf=\"modalType === 'add'\"></valtimo-add-connector>\n <valtimo-modify-connector *ngIf=\"modalType === 'modify'\"></valtimo-modify-connector>\n </div>\n</valtimo-modal>\n",
631
+ styles: ["/*!\n * Copyright 2015-2020 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 */"]
632
+ },] }
633
+ ];
634
+ ConnectorModalComponent.ctorParameters = () => [
635
+ { type: ConnectorManagementStateService }
636
+ ];
637
+ ConnectorModalComponent.propDecorators = {
638
+ modal: [{ type: ViewChild, args: ['modal',] }],
639
+ modalType: [{ type: Input }]
640
+ };
641
+
642
+ /*
643
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
644
+ *
645
+ * Licensed under EUPL, Version 1.2 (the "License");
646
+ * you may not use this file except in compliance with the License.
647
+ * You may obtain a copy of the License at
648
+ *
649
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
650
+ *
651
+ * Unless required by applicable law or agreed to in writing, software
652
+ * distributed under the License is distributed on an "AS IS" basis,
653
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
654
+ * See the License for the specific language governing permissions and
655
+ * limitations under the License.
656
+ */
657
+ class EditConnectorPropertiesComponent {
658
+ constructor(stateService) {
659
+ this.stateService = stateService;
660
+ this.withDefaults = false;
661
+ this.showDeleteButton = false;
662
+ this.propertiesSave = new EventEmitter();
663
+ this.connectorDelete = new EventEmitter();
664
+ this.modifiedProperties$ = new BehaviorSubject(undefined);
665
+ this.editFields$ = new BehaviorSubject([]);
666
+ this.connectorName$ = new BehaviorSubject('');
667
+ this.saveButtonDisabled$ = combineLatest([this.editFields$, this.modifiedProperties$, this.connectorName$]).pipe(map(([editFields, modifiedProperties, connectorName]) => {
668
+ const values = editFields.map((field) => get(modifiedProperties, field.key));
669
+ const validValues = values.filter((value) => Array.isArray(value) ? value.length > 0 : value === 0 || value);
670
+ return (editFields.length !== validValues.length) || !connectorName;
671
+ }));
672
+ this.disabled$ = this.stateService.inputDisabled$;
673
+ }
674
+ ngOnInit() {
675
+ this.setEditFields();
676
+ this.setName();
677
+ }
678
+ ngOnChanges() {
679
+ this.setEditFields();
680
+ this.setName();
681
+ }
682
+ multiFieldValuesSet(event) {
683
+ this.modifiedProperties$.pipe(take(1)).subscribe((properties) => {
684
+ set(properties, event.editFieldKey, event.values);
685
+ this.modifiedProperties$.next(properties);
686
+ });
687
+ }
688
+ onSingleValueChange(value, editField) {
689
+ this.modifiedProperties$.pipe(take(1)).subscribe((properties) => {
690
+ set(properties, editField.key, editField.editType === 'string' ? value.trim() : parseInt(value, 10));
691
+ this.modifiedProperties$.next(properties);
692
+ });
693
+ }
694
+ onNameValueChange(value) {
695
+ this.connectorName$.next(value.trim());
696
+ }
697
+ onSave() {
698
+ this.stateService.disableInput();
699
+ combineLatest([this.modifiedProperties$, this.connectorName$])
700
+ .pipe(take(1)).subscribe(([properties, name]) => {
701
+ this.propertiesSave.emit({ properties, name });
702
+ });
703
+ }
704
+ onDelete() {
705
+ this.stateService.disableInput();
706
+ this.connectorDelete.emit();
707
+ }
708
+ setName() {
709
+ if (this.withDefaults && this.defaultName) {
710
+ this.connectorName$.next(this.defaultName);
711
+ }
712
+ else {
713
+ this.connectorName$.next('');
714
+ }
715
+ }
716
+ setModifiedProperties(editFields) {
717
+ const propertiesCopy = cloneDeep(this.properties);
718
+ if (!this.withDefaults) {
719
+ editFields.forEach((editField) => {
720
+ set(propertiesCopy, editField.key, undefined);
721
+ });
722
+ }
723
+ this.modifiedProperties$.next(propertiesCopy);
724
+ }
725
+ setEditFields() {
726
+ const editFields = [];
727
+ const keysToFilter = ['className'];
728
+ const handlePropertyLevel = (propertyLevel, previousKeys) => {
729
+ const propertyLevelKeys = Object.keys(propertyLevel)
730
+ .filter((key) => !keysToFilter.includes(key));
731
+ propertyLevelKeys.forEach((key) => {
732
+ const propertyValue = propertyLevel[key];
733
+ const baseEditField = Object.assign({ key: previousKeys + key }, (this.withDefaults && { defaultValue: propertyValue }));
734
+ if (typeof propertyValue === 'number') {
735
+ editFields.push(Object.assign(Object.assign({}, baseEditField), { editType: 'number' }));
736
+ }
737
+ else if (Array.isArray(propertyValue)) {
738
+ if (propertyValue[0] && typeof propertyValue[0] === 'number') {
739
+ editFields.push(Object.assign(Object.assign({}, baseEditField), { editType: 'number[]' }));
740
+ }
741
+ else {
742
+ editFields.push(Object.assign(Object.assign({}, baseEditField), { editType: 'string[]' }));
743
+ }
744
+ }
745
+ else if (typeof propertyValue === 'string') {
746
+ editFields.push(Object.assign(Object.assign({}, baseEditField), { editType: 'string' }));
747
+ }
748
+ else if (typeof propertyValue === 'object') {
749
+ handlePropertyLevel(propertyValue, `${previousKeys}${key}.`);
750
+ }
751
+ });
752
+ };
753
+ handlePropertyLevel(this.properties, '');
754
+ this.editFields$.next(editFields);
755
+ this.setModifiedProperties(editFields);
756
+ }
757
+ }
758
+ EditConnectorPropertiesComponent.decorators = [
759
+ { type: Component, args: [{
760
+ selector: 'valtimo-edit-connector-properties',
761
+ template: "<!--\n ~ Copyright 2015-2020 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=\"edit-fields\" *ngIf=\"{editFields: editFields$ | async, disabled: disabled$ | async} as obs\">\n <ng-container *ngTemplateOutlet=\"nameInput;context:{disabled: obs.disabled}\"></ng-container>\n <ng-container *ngFor=\"let editField of obs.editFields\">\n <ng-container *ngIf=\"editField.editType === 'string' || editField.editType === 'number'\">\n <ng-container *ngTemplateOutlet=\"singleInput;context:{editField: editField, disabled: obs.disabled}\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"editField.editType === 'string[]' || editField.editType === 'number[]'\">\n <valtimo-multi-value-connector-property\n [editField]=\"editField\"\n (valuesSet)=\"multiFieldValuesSet($event)\"\n [disabled]=\"obs.disabled\"\n [defaultValue]=\"withDefaults && editField.defaultValue\"\n >\n </valtimo-multi-value-connector-property>\n </ng-container>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"buttons;context:{disabled: obs.disabled}\"></ng-container>\n</div>\n\n<ng-template #nameInput let-disabled=\"disabled\">\n <div class=\"form-group row\">\n <label class=\"col-3 col-form-label text-sm-right\">\n {{'connectorManagement.inputLabels.connectorName' | translate}}\n </label>\n <div class=\"col-7\">\n <input\n class=\"form-control\"\n type=\"text\"\n (input)=\"onNameValueChange($event.target.value)\"\n [disabled]=\"disabled\"\n [value]=\"(withDefaults && defaultName) ? defaultName : ''\"\n >\n </div>\n </div>\n</ng-template>\n\n<ng-template #singleInput let-editField=\"editField\" let-disabled=\"disabled\">\n <div class=\"form-group row\">\n <label class=\"col-3 col-form-label text-sm-right\">\n {{'connectorManagement.inputLabels.' + editField.key | translate}}\n </label>\n <div class=\"col-7\">\n <input\n *ngIf=\"editField.editType === 'string'\"\n class=\"form-control\"\n type=\"text\"\n (input)=\"onSingleValueChange($event.target.value, editField)\"\n [disabled]=\"disabled\"\n [value]=\"withDefaults ? editField.defaultValue : ''\"\n >\n <input\n *ngIf=\"editField.editType === 'number'\"\n class=\"form-control\"\n type=\"number\"\n step=\"1\"\n min=\"0\"\n oninput=\"validity.valid||(value='');\"\n (input)=\"onSingleValueChange($event.target.value, editField)\"\n [disabled]=\"disabled\"\n [value]=\"withDefaults ? editField.defaultValue : ''\"\n >\n </div>\n </div>\n</ng-template>\n\n<ng-template #buttons let-disabled=\"disabled\">\n <div class=\"border-top mt-3 pt-6\">\n <div class=\"button-container\">\n <button class=\"btn btn-primary\" [disabled]=\"disabled || (saveButtonDisabled$ | async)\" (click)=\"onSave()\">\n <i class=\"icon mdi mdi-save mr-1\"></i>\n {{'connectorManagement.save' | translate}}\n </button>\n <button *ngIf=\"showDeleteButton\" class=\"btn btn-danger btn-space\" (click)=\"onDelete()\" [disabled]=\"disabled\">\n <i class=\"icon mdi mdi-delete mr-1\"></i>\n {{'connectorManagement.remove' | translate}}\n </button>\n </div>\n </div>\n</ng-template>\n",
762
+ styles: ["/*!\n * Copyright 2015-2020 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 */.button-container{display:flex;flex-flow:row-reverse;justify-content:space-between;width:100%}"]
763
+ },] }
764
+ ];
765
+ EditConnectorPropertiesComponent.ctorParameters = () => [
766
+ { type: ConnectorManagementStateService }
767
+ ];
768
+ EditConnectorPropertiesComponent.propDecorators = {
769
+ properties: [{ type: Input }],
770
+ withDefaults: [{ type: Input }],
771
+ showDeleteButton: [{ type: Input }],
772
+ defaultName: [{ type: Input }],
773
+ propertiesSave: [{ type: Output }],
774
+ connectorDelete: [{ type: Output }]
775
+ };
776
+
777
+ /*
778
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
779
+ *
780
+ * Licensed under EUPL, Version 1.2 (the "License");
781
+ * you may not use this file except in compliance with the License.
782
+ * You may obtain a copy of the License at
783
+ *
784
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
785
+ *
786
+ * Unless required by applicable law or agreed to in writing, software
787
+ * distributed under the License is distributed on an "AS IS" basis,
788
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
789
+ * See the License for the specific language governing permissions and
790
+ * limitations under the License.
791
+ */
792
+ class ConnectorLinkExtensionComponent {
793
+ constructor(stateService, objectApiSyncService, translateService, route, alertService, connectorManagementService) {
794
+ this.stateService = stateService;
795
+ this.objectApiSyncService = objectApiSyncService;
796
+ this.translateService = translateService;
797
+ this.route = route;
798
+ this.alertService = alertService;
799
+ this.connectorManagementService = connectorManagementService;
800
+ this.loading$ = new BehaviorSubject(true);
801
+ this.objectApiSyncConfig$ = combineLatest([this.route.params, this.translateService.stream('key'), this.stateService.refresh$]).pipe(switchMap(([params]) => this.objectApiSyncService.getObjectSyncConfigs(params.name)), switchMap((configs) => combineLatest([of(configs),
802
+ ...configs.map((config) => this.connectorManagementService.getConnectorInstanceById(config.connectorInstanceId).pipe(catchError(() => of(''))))
803
+ ])), map((results) => {
804
+ const [, ...instances] = results.filter((result) => result);
805
+ return results[0]
806
+ .map((syncConfig) => {
807
+ var _a;
808
+ return (Object.assign(Object.assign({}, syncConfig), { title: ((_a = instances.find((instance) => instance.id === syncConfig.connectorInstanceId)) === null || _a === void 0 ? void 0 : _a.name) || 'Objects API' }));
809
+ });
810
+ }), map((results) => Array.isArray(results) && results.length > 0 ? results[0] : null), tap(() => {
811
+ this.loading$.next(false);
812
+ }));
813
+ this.disabled$ = this.stateService.inputDisabled$;
814
+ }
815
+ ngOnDestroy() {
816
+ this.stateService.hideExtensionModal();
817
+ }
818
+ openModal() {
819
+ this.stateService.showExtensionModal();
820
+ }
821
+ toggleSync(config) {
822
+ this.stateService.disableInput();
823
+ this.objectApiSyncService.modifyObjectSyncConfig(Object.assign(Object.assign({}, config), { enabled: !config.enabled })).subscribe(() => {
824
+ if (!config.enabled) {
825
+ this.alertService.success(this.translateService.instant('connectorManagement.extension.addSyncSuccess'));
826
+ }
827
+ else {
828
+ this.alertService.success(this.translateService.instant('connectorManagement.extension.disableSyncSuccess'));
829
+ }
830
+ this.stateService.enableInput();
831
+ this.stateService.refresh();
832
+ }, () => {
833
+ this.stateService.enableInput();
834
+ });
835
+ }
836
+ deleteSync(configId) {
837
+ this.stateService.disableInput();
838
+ this.objectApiSyncService.deleteObjectSyncConfig(configId).subscribe(() => {
839
+ this.alertService.success(this.translateService.instant('connectorManagement.extension.deleteSyncSuccess'));
840
+ this.stateService.enableInput();
841
+ this.stateService.refresh();
842
+ }, () => {
843
+ this.stateService.enableInput();
844
+ });
845
+ }
846
+ }
847
+ ConnectorLinkExtensionComponent.decorators = [
848
+ { type: Component, args: [{
849
+ selector: 'valtimo-connector-link-extension',
850
+ template: "<h2 class=\"mb-4 mt-6\">{{'connectorManagement.extension.title' | translate}}</h2>\n\n<ng-container *ngIf=\"{\n syncConfig: objectApiSyncConfig$ | async,\n loading: loading$ | async,\n disabled: disabled$ | async\n } as obs\"\n>\n <ng-container *ngIf=\"obs.loading === false; else loading\">\n <ng-container *ngIf=\"obs.syncConfig; else addSync\">\n <div class=\"card card-border\">\n <div class=\"card-body\">\n <h4 class=\"connector-name mr-2\" [ngClass]=\"{'text-success': obs.syncConfig.enabled, 'text-warning': !obs.syncConfig.enabled}\">\n {{obs.syncConfig.title}}\n </h4>\n <div class=\"controls\">\n <div class=\"switch-button switch-button-success\">\n <input type=\"checkbox\" [checked]=\"obs.syncConfig.enabled\" [disabled]=\"obs.disabled\" name=\"sync\" id=\"sync\" (click)=\"toggleSync(obs.syncConfig)\">\n <span><label for=\"sync\"></label></span>\n </div>\n <button class=\"btn btn-danger ml-3\" [disabled]=\"obs.disabled\" (click)=\"deleteSync(obs.syncConfig.id)\">\n <i class=\"fa fa-trash\"></i>\n </button>\n </div>\n </div>\n </div>\n </ng-container>\n </ng-container>\n</ng-container>\n\n<valtimo-connector-link-extension-modal></valtimo-connector-link-extension-modal>\n\n<ng-template #loading>\n <valtimo-spinner></valtimo-spinner>\n</ng-template>\n\n<ng-template #addSync>\n <div class=\"text-right mt-5\">\n <button class=\"btn btn-primary\" (click)=\"openModal()\" [disabled]=\"disabled$ | async\">\n <i class=\"icon mdi mdi-plus\"></i> &nbsp;\n {{'connectorManagement.extension.buttonText' | translate}}\n </button>\n </div>\n</ng-template>\n",
851
+ styles: [".card-body{align-items:center;display:flex;flex-direction:row;justify-content:space-between}.connector-name{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.controls{align-items:center;display:flex}"]
852
+ },] }
853
+ ];
854
+ ConnectorLinkExtensionComponent.ctorParameters = () => [
855
+ { type: ConnectorManagementStateService },
856
+ { type: ObjectApiSyncService },
857
+ { type: TranslateService },
858
+ { type: ActivatedRoute },
859
+ { type: AlertService },
860
+ { type: ConnectorManagementService }
861
+ ];
862
+
863
+ /*
864
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
865
+ *
866
+ * Licensed under EUPL, Version 1.2 (the "License");
867
+ * you may not use this file except in compliance with the License.
868
+ * You may obtain a copy of the License at
869
+ *
870
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
871
+ *
872
+ * Unless required by applicable law or agreed to in writing, software
873
+ * distributed under the License is distributed on an "AS IS" basis,
874
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
875
+ * See the License for the specific language governing permissions and
876
+ * limitations under the License.
877
+ */
878
+ class MultiValueConnectorPropertyComponent {
879
+ constructor() {
880
+ this.valuesSet = new EventEmitter();
881
+ this.amountOfValues$ = new BehaviorSubject([null]);
882
+ this.removeButtonDisabled$ = this.amountOfValues$.pipe(map((amountOfValues) => amountOfValues.length === 1));
883
+ this.values$ = new BehaviorSubject({});
884
+ this.addButtonDisabled$ = combineLatest([this.values$, this.amountOfValues$]).pipe(map(([values, amountOfValues]) => {
885
+ const objectValues = Object.values(values);
886
+ const validObjectValues = objectValues.filter((value) => value === 0 || value);
887
+ return amountOfValues.length !== validObjectValues.length;
888
+ }));
889
+ }
890
+ ngOnInit() {
891
+ this.openValuesSubscription();
892
+ this.setDefaults();
893
+ }
894
+ ngOnDestroy() {
895
+ var _a;
896
+ (_a = this.valuesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
897
+ }
898
+ onValueChange(value, editField, index) {
899
+ this.values$.pipe(take(1)).subscribe((values) => {
900
+ this.values$.next(Object.assign(Object.assign({}, values), { [index]: editField.editType === 'string[]' ? value.trim() : parseInt(value, 10) }));
901
+ });
902
+ }
903
+ addRow() {
904
+ this.amountOfValues$.pipe(take(1)).subscribe((amountOfValues) => {
905
+ this.amountOfValues$.next([...amountOfValues, null]);
906
+ });
907
+ }
908
+ removeRow() {
909
+ combineLatest([this.values$, this.amountOfValues$]).pipe(take(1)).subscribe(([values, amountOfValues]) => {
910
+ const lastValueIndex = amountOfValues.length - 1;
911
+ const valuesCopy = Object.assign({}, values);
912
+ delete valuesCopy[lastValueIndex];
913
+ this.values$.next(valuesCopy);
914
+ this.amountOfValues$.next(amountOfValues.filter((curr, index) => index !== lastValueIndex));
915
+ });
916
+ }
917
+ openValuesSubscription() {
918
+ this.valuesSubscription = this.values$.subscribe((values) => {
919
+ this.valuesSet.emit({
920
+ editFieldKey: this.editField.key,
921
+ values: Object.values(values).filter((value) => value === 0 || value)
922
+ });
923
+ });
924
+ }
925
+ setDefaults() {
926
+ const defaultValue = this.defaultValue;
927
+ const validValues = Array.isArray(defaultValue) && defaultValue.filter((value) => value === 0 || value);
928
+ if (validValues && validValues.length > 0) {
929
+ const valuesObject = {};
930
+ validValues.forEach((value, index) => {
931
+ valuesObject[index] = value;
932
+ });
933
+ this.values$.next(valuesObject);
934
+ this.amountOfValues$.next(validValues.map(() => null));
935
+ }
936
+ }
937
+ }
938
+ MultiValueConnectorPropertyComponent.decorators = [
939
+ { type: Component, args: [{
940
+ selector: 'valtimo-multi-value-connector-property',
941
+ template: "<!--\n ~ Copyright 2015-2020 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=\"form-group row\"\n *ngIf=\"{amountOfValues: amountOfValues$ | async, values: values$ | async} as obs\"\n>\n <label class=\"col-3 col-form-label text-sm-right\">\n {{'connectorManagement.inputLabels.' + editField.key | translate}}\n </label>\n <div class=\"col-7\">\n <ng-container *ngFor=\"let value of obs.amountOfValues; let index = index\">\n <ng-container *ngTemplateOutlet=\"input;context:{index: index, disabled: disabled, values: obs.values}\">\n </ng-container>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"buttons;context:{disabled: disabled}\"></ng-container>\n </div>\n</div>\n\n<ng-template #input let-index=\"index\" let-disabled=\"disabled\" let-values=\"values\">\n <input\n *ngIf=\"editField.editType === 'string[]'\"\n class=\"form-control mb-2\"\n type=\"text\"\n (input)=\"onValueChange($event.target.value, editField, index)\"\n [disabled]=\"disabled\"\n [value]=\"(defaultValue && values[index]) ? values[index] : ''\"\n >\n <input\n *ngIf=\"editField.editType === 'number[]'\"\n class=\"form-control mb-2\"\n type=\"number\"\n step=\"1\"\n min=\"0\"\n oninput=\"validity.valid||(value='');\"\n (input)=\"onValueChange($event.target.value, editField, index)\"\n [disabled]=\"disabled\"\n [value]=\"(defaultValue && values[index]) ? values[index] : ''\"\n >\n</ng-template>\n\n<ng-template #buttons let-disabled=\"disabled\">\n <div class=\"button-container mt-1\">\n <button class=\"btn btn-danger btn-space btn-sm\" (click)=\"removeRow()\" [disabled]=\"disabled || (removeButtonDisabled$ | async)\">\n <i class=\"icon mdi mdi-delete mr-1\"></i>\n {{'connectorManagement.removeValue' | translate}}\n </button>\n <button class=\"btn btn-secondary btn-space mr-0 btn-sm\" (click)=\"addRow()\" [disabled]=\"disabled || (addButtonDisabled$ | async)\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n {{'connectorManagement.addValue' | translate}}\n </button>\n </div>\n</ng-template>\n",
942
+ styles: ["/*!\n * Copyright 2015-2020 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 */.button-container{display:flex;justify-content:flex-end;width:100%}"]
943
+ },] }
944
+ ];
945
+ MultiValueConnectorPropertyComponent.propDecorators = {
946
+ editField: [{ type: Input }],
947
+ disabled: [{ type: Input }],
948
+ defaultValue: [{ type: Input }],
949
+ valuesSet: [{ type: Output }]
950
+ };
951
+
952
+ const editProductAanvragenConnectorForm = {
953
+ display: 'wizard',
954
+ settings: {
955
+ pdf: {
956
+ id: '1ec0f8ee-6685-5d98-a847-26f67b67d6f0',
957
+ src: 'https://files.form.io/pdf/5692b91fd1028f01000407e3/file/1ec0f8ee-6685-5d98-a847-26f67b67d6f0'
958
+ }
959
+ },
960
+ components: [
961
+ {
962
+ title: 'connectorForm.productaanvraag.step0.title',
963
+ breadcrumbClickable: true,
964
+ buttonSettings: {
965
+ previous: true,
966
+ cancel: true,
967
+ next: true
968
+ },
969
+ navigateOnEnter: false,
970
+ saveOnEnter: false,
971
+ scrollToTop: false,
972
+ collapsible: false,
973
+ key: 'page0',
974
+ type: 'panel',
975
+ label: 'Page 0',
976
+ input: false,
977
+ tableView: false,
978
+ components: [
979
+ {
980
+ label: 'HTML',
981
+ attrs: [
982
+ {
983
+ attr: '',
984
+ value: ''
985
+ }
986
+ ],
987
+ content: 'connectorForm.productaanvraag.step0.tip',
988
+ refreshOnChange: false,
989
+ key: 'html4',
990
+ type: 'htmlelement',
991
+ input: false,
992
+ tableView: false
993
+ },
994
+ {
995
+ title: 'connectorForm.productaanvraag.step0.typeMapping.panelTitle',
996
+ collapsible: false,
997
+ key: 'connectorFormProductaanvraagStep0TypeMappingsPanelTitle',
998
+ type: 'panel',
999
+ label: 'Panel',
1000
+ input: false,
1001
+ tableView: false,
1002
+ components: [
1003
+ {
1004
+ label: 'connectorForm.productaanvraag.step0.typeMapping.productAanvraagType.label',
1005
+ tooltip: 'connectorForm.productaanvraag.step0.typeMapping.productAanvraagType.tooltip',
1006
+ tableView: true,
1007
+ validate: {
1008
+ required: true
1009
+ },
1010
+ key: 'productAanvraagType',
1011
+ type: 'textfield',
1012
+ input: true
1013
+ },
1014
+ {
1015
+ label: 'connectorForm.productaanvraag.step0.typeMapping.caseDefinitionKey.label',
1016
+ widget: 'choicesjs',
1017
+ placeholder: 'connectorForm.productaanvraag.step0.typeMapping.caseDefinitionKey.placeholder',
1018
+ tableView: true,
1019
+ validate: {
1020
+ required: true
1021
+ },
1022
+ key: 'caseDefinitionKey',
1023
+ type: 'select',
1024
+ input: true
1025
+ },
1026
+ {
1027
+ label: 'connectorForm.productaanvraag.step0.typeMapping.processDefinitionKey.label',
1028
+ widget: 'choicesjs',
1029
+ placeholder: 'connectorForm.productaanvraag.step0.typeMapping.processDefinitionKey.placeholder',
1030
+ tableView: true,
1031
+ validate: {
1032
+ required: true
1033
+ },
1034
+ key: 'processDefinitionKey',
1035
+ type: 'select',
1036
+ input: true,
1037
+ refreshOn: 'caseDefinitionKey',
1038
+ clearOnRefresh: true,
1039
+ disabled: true
1040
+ }
1041
+ ]
1042
+ }
1043
+ ]
1044
+ },
1045
+ {
1046
+ title: 'connectorForm.productaanvraag.step1.title',
1047
+ breadcrumbClickable: true,
1048
+ buttonSettings: {
1049
+ previous: true,
1050
+ cancel: true,
1051
+ next: true
1052
+ },
1053
+ navigateOnEnter: false,
1054
+ saveOnEnter: false,
1055
+ scrollToTop: false,
1056
+ collapsible: false,
1057
+ key: 'page1',
1058
+ type: 'panel',
1059
+ label: 'Page 1',
1060
+ input: false,
1061
+ tableView: false,
1062
+ components: [
1063
+ {
1064
+ label: 'HTML',
1065
+ attrs: [
1066
+ {
1067
+ attr: '',
1068
+ value: ''
1069
+ }
1070
+ ],
1071
+ content: 'connectorForm.productaanvraag.step1.tip',
1072
+ refreshOnChange: false,
1073
+ key: 'html',
1074
+ type: 'htmlelement',
1075
+ input: false,
1076
+ tableView: false
1077
+ },
1078
+ {
1079
+ title: 'connectorForm.productaanvraag.step1.objectsApi.panelTitle',
1080
+ collapsible: false,
1081
+ key: 'connectorFormProductaanvraagStep1ObjectsApiPanelTitle',
1082
+ type: 'panel',
1083
+ label: 'Panel',
1084
+ input: false,
1085
+ tableView: false,
1086
+ components: [
1087
+ {
1088
+ label: 'connectorForm.productaanvraag.step1.objectsApi.url.label',
1089
+ tooltip: 'connectorForm.productaanvraag.step1.objectsApi.url.tooltip',
1090
+ tableView: true,
1091
+ validate: {
1092
+ required: true
1093
+ },
1094
+ key: 'objectsApiUrl',
1095
+ type: 'textfield',
1096
+ input: true
1097
+ },
1098
+ {
1099
+ label: 'connectorForm.productaanvraag.step1.objectsApi.token.label',
1100
+ tooltip: 'connectorForm.productaanvraag.step1.objectsApi.token.tooltip',
1101
+ tableView: true,
1102
+ validate: {
1103
+ required: true
1104
+ },
1105
+ key: 'objectsApiToken',
1106
+ type: 'textfield',
1107
+ input: true
1108
+ }
1109
+ ]
1110
+ },
1111
+ {
1112
+ title: 'connectorForm.productaanvraag.step1.objectTypesApi.panelTitle',
1113
+ collapsible: false,
1114
+ key: 'connectorFormProductaanvraagStep1ObjectTypesApiPanelTitle',
1115
+ type: 'panel',
1116
+ label: 'Panel',
1117
+ input: false,
1118
+ tableView: false,
1119
+ components: [
1120
+ {
1121
+ label: 'connectorForm.productaanvraag.step1.objectTypesApi.url.label',
1122
+ tooltip: 'connectorForm.productaanvraag.step1.objectTypesApi.url.tooltip',
1123
+ tableView: true,
1124
+ validate: {
1125
+ required: true
1126
+ },
1127
+ key: 'objectTypesApiUrl',
1128
+ type: 'textfield',
1129
+ input: true
1130
+ },
1131
+ {
1132
+ label: 'connectorForm.productaanvraag.step1.objectTypesApi.token.label',
1133
+ tooltip: 'connectorForm.productaanvraag.step1.objectTypesApi.token.tooltip',
1134
+ tableView: true,
1135
+ validate: {
1136
+ required: true
1137
+ },
1138
+ key: 'objectTypesApiToken',
1139
+ type: 'textfield',
1140
+ input: true
1141
+ }
1142
+ ]
1143
+ }
1144
+ ]
1145
+ },
1146
+ {
1147
+ title: 'connectorForm.productaanvraag.step2.title',
1148
+ breadcrumbClickable: true,
1149
+ buttonSettings: {
1150
+ previous: true,
1151
+ cancel: true,
1152
+ next: true
1153
+ },
1154
+ navigateOnEnter: false,
1155
+ saveOnEnter: false,
1156
+ scrollToTop: false,
1157
+ collapsible: false,
1158
+ key: 'page2',
1159
+ type: 'panel',
1160
+ label: 'Page 2',
1161
+ input: false,
1162
+ tableView: false,
1163
+ components: [
1164
+ {
1165
+ label: 'HTML',
1166
+ attrs: [
1167
+ {
1168
+ attr: '',
1169
+ value: ''
1170
+ }
1171
+ ],
1172
+ content: 'connectorForm.productaanvraag.step2.tip',
1173
+ refreshOnChange: false,
1174
+ key: 'html2',
1175
+ type: 'htmlelement',
1176
+ input: false,
1177
+ tableView: false
1178
+ },
1179
+ {
1180
+ title: 'connectorForm.productaanvraag.step2.objectType.panelTitle',
1181
+ collapsible: false,
1182
+ key: 'connectorFormProductaanvraagStep2ObjectTypePanelTitle',
1183
+ type: 'panel',
1184
+ label: 'Panel',
1185
+ input: false,
1186
+ tableView: false,
1187
+ components: [
1188
+ {
1189
+ label: 'connectorForm.productaanvraag.step2.objectType.name.label',
1190
+ tooltip: 'connectorForm.productaanvraag.step2.objectType.name.tooltip',
1191
+ tableView: true,
1192
+ validate: {
1193
+ required: true
1194
+ },
1195
+ key: 'objectTypeName',
1196
+ type: 'textfield',
1197
+ input: true
1198
+ },
1199
+ {
1200
+ label: 'connectorForm.productaanvraag.step2.objectType.title.label',
1201
+ tooltip: 'connectorForm.productaanvraag.step2.objectType.title.tooltip',
1202
+ tableView: true,
1203
+ validate: {
1204
+ required: true
1205
+ },
1206
+ key: 'objectTypeTitle',
1207
+ type: 'textfield',
1208
+ input: true
1209
+ },
1210
+ {
1211
+ label: 'connectorForm.productaanvraag.step2.objectType.url.label',
1212
+ tooltip: 'connectorForm.productaanvraag.step2.objectType.url.tooltip',
1213
+ tableView: true,
1214
+ validate: {
1215
+ required: true
1216
+ },
1217
+ key: 'objectTypeUrl',
1218
+ type: 'textfield',
1219
+ input: true
1220
+ },
1221
+ {
1222
+ label: 'connectorForm.productaanvraag.step2.objectType.typeVersion.label',
1223
+ tooltip: 'connectorForm.productaanvraag.step2.objectType.typeVersion.tooltip',
1224
+ tableView: true,
1225
+ validate: {
1226
+ required: true
1227
+ },
1228
+ key: 'objectTypeVersion',
1229
+ type: 'textfield',
1230
+ input: true
1231
+ }
1232
+ ]
1233
+ }
1234
+ ]
1235
+ },
1236
+ {
1237
+ title: 'connectorForm.productaanvraag.step3.title',
1238
+ breadcrumbClickable: true,
1239
+ buttonSettings: {
1240
+ previous: true,
1241
+ cancel: true,
1242
+ next: true
1243
+ },
1244
+ navigateOnEnter: false,
1245
+ saveOnEnter: false,
1246
+ scrollToTop: false,
1247
+ collapsible: false,
1248
+ key: 'page3',
1249
+ type: 'panel',
1250
+ label: 'Page 3',
1251
+ input: false,
1252
+ tableView: false,
1253
+ components: [
1254
+ {
1255
+ label: 'HTML',
1256
+ attrs: [
1257
+ {
1258
+ attr: '',
1259
+ value: ''
1260
+ }
1261
+ ],
1262
+ content: 'connectorForm.productaanvraag.step3.tip',
1263
+ refreshOnChange: false,
1264
+ key: 'html1',
1265
+ type: 'htmlelement',
1266
+ input: false,
1267
+ tableView: false
1268
+ },
1269
+ {
1270
+ title: 'connectorForm.productaanvraag.step3.openNotifications.panelTitle',
1271
+ collapsible: false,
1272
+ key: 'connectorFormProductaanvraagStep3OpenNotificationsPanelTitle',
1273
+ type: 'panel',
1274
+ label: 'Panel',
1275
+ input: false,
1276
+ tableView: false,
1277
+ components: [
1278
+ {
1279
+ label: 'connectorForm.productaanvraag.step3.openNotifications.baseUrl.label',
1280
+ tooltip: 'connectorForm.productaanvraag.step3.openNotifications.baseUrl.tooltip',
1281
+ tableView: true,
1282
+ validate: {
1283
+ required: true
1284
+ },
1285
+ key: 'openNotificationsBaseUrl',
1286
+ type: 'textfield',
1287
+ input: true
1288
+ },
1289
+ {
1290
+ label: 'connectorForm.productaanvraag.step3.openNotifications.clientId.label',
1291
+ tooltip: 'connectorForm.productaanvraag.step3.openNotifications.clientId.tooltip',
1292
+ tableView: true,
1293
+ validate: {
1294
+ required: true
1295
+ },
1296
+ key: 'openNotificationsClientId',
1297
+ type: 'textfield',
1298
+ input: true
1299
+ },
1300
+ {
1301
+ label: 'connectorForm.productaanvraag.step3.openNotifications.secret.label',
1302
+ tooltip: 'connectorForm.productaanvraag.step3.openNotifications.secret.tooltip',
1303
+ tableView: true,
1304
+ validate: {
1305
+ required: true
1306
+ },
1307
+ key: 'openNotificationsSecret',
1308
+ type: 'textfield',
1309
+ input: true
1310
+ },
1311
+ {
1312
+ label: 'connectorForm.productaanvraag.step3.openNotifications.callbackBaseUrl.label',
1313
+ tooltip: 'connectorForm.productaanvraag.step3.openNotifications.callbackBaseUrl.tooltip',
1314
+ tableView: true,
1315
+ validate: {
1316
+ required: true
1317
+ },
1318
+ key: 'openNotificationsCallbackBaseUrl',
1319
+ type: 'textfield',
1320
+ input: true
1321
+ }
1322
+ ]
1323
+ }
1324
+ ]
1325
+ },
1326
+ {
1327
+ title: 'connectorForm.productaanvraag.step4.title',
1328
+ breadcrumbClickable: true,
1329
+ buttonSettings: {
1330
+ previous: true,
1331
+ cancel: true,
1332
+ next: true
1333
+ },
1334
+ navigateOnEnter: false,
1335
+ saveOnEnter: false,
1336
+ scrollToTop: false,
1337
+ collapsible: false,
1338
+ key: 'page4',
1339
+ type: 'panel',
1340
+ label: 'Page 4',
1341
+ input: false,
1342
+ tableView: false,
1343
+ components: [
1344
+ {
1345
+ label: 'HTML',
1346
+ attrs: [
1347
+ {
1348
+ attr: '',
1349
+ value: ''
1350
+ }
1351
+ ],
1352
+ content: 'connectorForm.productaanvraag.step4.tip',
1353
+ refreshOnChange: false,
1354
+ key: 'html3',
1355
+ type: 'htmlelement',
1356
+ input: false,
1357
+ tableView: false
1358
+ },
1359
+ {
1360
+ title: 'connectorForm.productaanvraag.step4.applicant.panelTitle',
1361
+ collapsible: false,
1362
+ key: 'connectorFormProductaanvraagStep4ApplicantPanelTitle',
1363
+ type: 'panel',
1364
+ label: 'Panel',
1365
+ input: false,
1366
+ tableView: false,
1367
+ components: [
1368
+ {
1369
+ label: 'HTML',
1370
+ attrs: [
1371
+ {
1372
+ attr: '',
1373
+ value: ''
1374
+ }
1375
+ ],
1376
+ content: 'connectorForm.productaanvraag.step4.applicant.tip',
1377
+ refreshOnChange: false,
1378
+ key: 'html5',
1379
+ type: 'htmlelement',
1380
+ input: false,
1381
+ tableView: false
1382
+ },
1383
+ {
1384
+ label: 'connectorForm.productaanvraag.step4.applicant.roleTypeUrl.label',
1385
+ tooltip: 'connectorForm.productaanvraag.step4.applicant.roleTypeUrl.tooltip',
1386
+ tableView: true,
1387
+ validate: {
1388
+ required: true
1389
+ },
1390
+ key: 'applicantRoleTypeUrl',
1391
+ type: 'textfield',
1392
+ input: true
1393
+ }
1394
+ ]
1395
+ }
1396
+ ]
1397
+ },
1398
+ {
1399
+ title: 'connectorForm.productaanvraag.step5.title',
1400
+ breadcrumbClickable: true,
1401
+ buttonSettings: {
1402
+ previous: true,
1403
+ cancel: true,
1404
+ next: true
1405
+ },
1406
+ navigateOnEnter: false,
1407
+ saveOnEnter: false,
1408
+ scrollToTop: false,
1409
+ collapsible: false,
1410
+ key: 'page6',
1411
+ type: 'panel',
1412
+ label: 'Page 5',
1413
+ input: false,
1414
+ tableView: false,
1415
+ components: [
1416
+ {
1417
+ label: 'HTML',
1418
+ attrs: [
1419
+ {
1420
+ attr: '',
1421
+ value: ''
1422
+ }
1423
+ ],
1424
+ content: 'connectorForm.productaanvraag.step5.tip',
1425
+ refreshOnChange: false,
1426
+ key: 'html6',
1427
+ type: 'htmlelement',
1428
+ input: false,
1429
+ tableView: false
1430
+ },
1431
+ {
1432
+ label: 'connectorForm.productaanvraag.step5.name',
1433
+ tableView: true,
1434
+ validate: {
1435
+ required: true
1436
+ },
1437
+ key: 'connectorName',
1438
+ type: 'textfield',
1439
+ input: true
1440
+ }
1441
+ ]
1442
+ }
1443
+ ]
1444
+ };
1445
+
1446
+ /*
1447
+ * Copyright 2015-2021 Ritense BV, the Netherlands.
1448
+ *
1449
+ * Licensed under EUPL, Version 1.2 (the "License");
1450
+ * you may not use this file except in compliance with the License.
1451
+ * You may obtain a copy of the License at
1452
+ *
1453
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1454
+ *
1455
+ * Unless required by applicable law or agreed to in writing, software
1456
+ * distributed under the License is distributed on an "AS IS" basis,
1457
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1458
+ * See the License for the specific language governing permissions and
1459
+ * limitations under the License.
1460
+ */
1461
+ class EditProductAanvragenConnectorComponent {
1462
+ constructor(formTranslationService, formMappingService, documentService, translateService) {
1463
+ this.formTranslationService = formTranslationService;
1464
+ this.formMappingService = formMappingService;
1465
+ this.documentService = documentService;
1466
+ this.translateService = translateService;
1467
+ this.showDeleteButton = false;
1468
+ this.propertiesSave = new EventEmitter();
1469
+ this.connectorDelete = new EventEmitter();
1470
+ this.formRefresh$ = new Subject();
1471
+ this.formDefinition$ = new BehaviorSubject(undefined);
1472
+ this.translatedFormDefinition$ = this.formDefinition$.pipe(map((definition) => this.formTranslationService.translateForm(definition)));
1473
+ this.caseDefinitionId$ = new BehaviorSubject('');
1474
+ this.options = {
1475
+ disableAlerts: true
1476
+ };
1477
+ this.mapCaseDefinitionKeyComponent = (component) => {
1478
+ var _a;
1479
+ if (component.key === 'caseDefinitionKey') {
1480
+ const definitionOptions = (_a = this.documentDefinitions) === null || _a === void 0 ? void 0 : _a.content.map((definition) => ({ label: definition.id.name, value: definition.id.name }));
1481
+ return Object.assign(Object.assign({}, component), { disabled: false, data: { values: definitionOptions } });
1482
+ }
1483
+ return component;
1484
+ };
1485
+ this.mapProcessDefinitionKeyComponent = (component) => {
1486
+ var _a;
1487
+ if (component.key === 'processDefinitionKey') {
1488
+ const processOptions = this.processDocumentDefinitions.map((definition) => ({ label: definition.processName, value: definition.id.processDefinitionKey }));
1489
+ if (((_a = this.processDocumentDefinitions) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1490
+ return Object.assign(Object.assign({}, component), { disabled: false, data: { values: processOptions } });
1491
+ }
1492
+ else {
1493
+ return Object.assign(Object.assign({}, component), { disabled: true, data: { values: [] } });
1494
+ }
1495
+ }
1496
+ return component;
1497
+ };
1498
+ }
1499
+ ngOnInit() {
1500
+ this.openFormDefinitionSubscription();
1501
+ this.formDefinition$.next(editProductAanvragenConnectorForm);
1502
+ this.loadDocumentDefinitions();
1503
+ }
1504
+ ngOnDestroy() {
1505
+ var _a, _b;
1506
+ (_a = this.formDefinitionSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
1507
+ (_b = this.translateSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
1508
+ }
1509
+ onChange(object) {
1510
+ var _a;
1511
+ const caseDefinitionKeyValue = (_a = object === null || object === void 0 ? void 0 : object.data) === null || _a === void 0 ? void 0 : _a.caseDefinitionKey;
1512
+ const currentCaseDefinitionId = this.caseDefinitionId$.getValue();
1513
+ if (caseDefinitionKeyValue && caseDefinitionKeyValue !== currentCaseDefinitionId) {
1514
+ this.documentService.findProcessDocumentDefinitions(caseDefinitionKeyValue).subscribe((processDocumentDefinitions) => {
1515
+ this.processDocumentDefinitions = processDocumentDefinitions;
1516
+ const definitionWithProcessDefinitionKeyValues = this.formMappingService.mapComponents(this.formDefinition$.getValue(), this.mapProcessDefinitionKeyComponent);
1517
+ this.formDefinition$.next(definitionWithProcessDefinitionKeyValues);
1518
+ this.caseDefinitionId$.next(caseDefinitionKeyValue);
1519
+ });
1520
+ }
1521
+ }
1522
+ onSubmit(event) {
1523
+ const submission = event.data;
1524
+ const properties = cloneDeep(this.properties);
1525
+ properties.objectsApiProperties.objectsApi.url = submission.objectsApiUrl;
1526
+ properties.objectsApiProperties.objectsApi.token = submission.objectsApiToken;
1527
+ properties.objectsApiProperties.objectsTypeApi.url = submission.objectTypesApiUrl;
1528
+ properties.objectsApiProperties.objectsTypeApi.token = submission.objectTypesApiToken;
1529
+ properties.objectsApiProperties.objectType.name = submission.objectTypeName;
1530
+ properties.objectsApiProperties.objectType.title = submission.objectTypeTitle;
1531
+ properties.objectsApiProperties.objectType.url = submission.objectTypeUrl;
1532
+ properties.objectsApiProperties.objectType.typeVersion = submission.objectTypeVersion;
1533
+ properties.openNotificatieProperties.baseUrl = submission.openNotificationsBaseUrl;
1534
+ properties.openNotificatieProperties.clientId = submission.openNotificationsClientId;
1535
+ properties.openNotificatieProperties.secret = submission.openNotificationsSecret;
1536
+ properties.openNotificatieProperties.callbackBaseUrl = submission.openNotificationsCallbackBaseUrl;
1537
+ properties.aanvragerRolTypeUrl = submission.applicantRoleTypeUrl;
1538
+ properties.typeMapping = [
1539
+ {
1540
+ productAanvraagType: submission.productAanvraagType,
1541
+ caseDefinitionKey: submission.caseDefinitionKey,
1542
+ processDefinitionKey: submission.processDefinitionKey
1543
+ }
1544
+ ];
1545
+ this.propertiesSave.emit({ properties, name: submission.connectorName });
1546
+ }
1547
+ onDelete() {
1548
+ this.connectorDelete.emit();
1549
+ }
1550
+ openFormDefinitionSubscription() {
1551
+ this.formDefinitionSubscription = combineLatest([this.formDefinition$, this.translateService.stream('key')])
1552
+ .subscribe(([form]) => {
1553
+ const translatedForm = this.formTranslationService.translateForm(form);
1554
+ this.refreshForm({ form: translatedForm });
1555
+ });
1556
+ }
1557
+ prefillForm() {
1558
+ const properties = cloneDeep(this.properties);
1559
+ const submission = {};
1560
+ submission.objectsApiUrl = properties.objectsApiProperties.objectsApi.url;
1561
+ submission.objectsApiToken = properties.objectsApiProperties.objectsApi.token;
1562
+ submission.objectTypesApiUrl = properties.objectsApiProperties.objectsTypeApi.url;
1563
+ submission.objectTypesApiToken = properties.objectsApiProperties.objectsTypeApi.token;
1564
+ submission.objectTypeName = properties.objectsApiProperties.objectType.name;
1565
+ submission.objectTypeTitle = properties.objectsApiProperties.objectType.title;
1566
+ submission.objectTypeUrl = properties.objectsApiProperties.objectType.url;
1567
+ submission.objectTypeVersion = properties.objectsApiProperties.objectType.typeVersion;
1568
+ submission.openNotificationsBaseUrl = properties.openNotificatieProperties.baseUrl;
1569
+ submission.openNotificationsClientId = properties.openNotificatieProperties.clientId;
1570
+ submission.openNotificationsSecret = properties.openNotificatieProperties.secret;
1571
+ submission.openNotificationsCallbackBaseUrl = properties.openNotificatieProperties.callbackBaseUrl;
1572
+ submission.applicantRoleTypeUrl = properties.aanvragerRolTypeUrl;
1573
+ submission.productAanvraagType = properties.typeMapping[0].productAanvraagType;
1574
+ submission.caseDefinitionKey = properties.typeMapping[0].caseDefinitionKey;
1575
+ submission.processDefinitionKey = properties.typeMapping[0].processDefinitionKey;
1576
+ submission.connectorName = this.defaultName;
1577
+ this.refreshForm({ submission: { data: submission } });
1578
+ }
1579
+ refreshForm(refreshValue) {
1580
+ this.formRefresh$.next(refreshValue);
1581
+ }
1582
+ loadDocumentDefinitions() {
1583
+ this.documentService.getAllDefinitions().subscribe((definitions) => {
1584
+ var _a;
1585
+ this.documentDefinitions = definitions;
1586
+ const definitionWithCaseDefinitionKeyValues = this.formMappingService.mapComponents(this.formDefinition$.getValue(), this.mapCaseDefinitionKeyComponent);
1587
+ this.formDefinition$.next(definitionWithCaseDefinitionKeyValues);
1588
+ if ((_a = this.properties) === null || _a === void 0 ? void 0 : _a.aanvragerRolTypeUrl) {
1589
+ this.prefillForm();
1590
+ }
1591
+ });
1592
+ }
1593
+ }
1594
+ EditProductAanvragenConnectorComponent.decorators = [
1595
+ { type: Component, args: [{
1596
+ selector: 'valtimo-edit-product-aanvragen-connector',
1597
+ template: "<!--\n ~ Copyright 2015-2021 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 *ngIf=\"translatedFormDefinition$ | async as definition\"\n class=\"edit-product-request\"\n [ngClass]=\"{'has-delete': showDeleteButton}\"\n>\n <valtimo-form-io\n [form]=\"definition\"\n [formRefresh$]=\"formRefresh$\"\n [useFormRefresh]=\"true\"\n [options]=\"options\"\n (change)=\"onChange($event)\"\n (submit)=\"onSubmit($event)\"\n >\n </valtimo-form-io>\n\n <button *ngIf=\"showDeleteButton\" class=\"btn btn-danger btn-space\" (click)=\"onDelete()\">\n <i class=\"icon mdi mdi-delete mr-1\"></i>\n {{'connectorManagement.remove' | translate}}\n </button>\n</div>\n\n",
1598
+ styles: ["/*!\n * Copyright 2015-2021 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 */.edit-product-request ::ng-deep .btn-wizard-nav-cancel{display:none}.edit-product-request ::ng-deep .list-inline{display:flex;flex-direction:row;justify-content:flex-end}.edit-product-request.has-delete ::ng-deep .list-inline{margin-bottom:-30px}.edit-product-request .btn-danger{position:relative}"]
1599
+ },] }
1600
+ ];
1601
+ EditProductAanvragenConnectorComponent.ctorParameters = () => [
1602
+ { type: FormTranslationService },
1603
+ { type: FormMappingService },
1604
+ { type: DocumentService },
1605
+ { type: TranslateService }
1606
+ ];
1607
+ EditProductAanvragenConnectorComponent.propDecorators = {
1608
+ properties: [{ type: Input }],
1609
+ defaultName: [{ type: Input }],
1610
+ showDeleteButton: [{ type: Input }],
1611
+ propertiesSave: [{ type: Output }],
1612
+ connectorDelete: [{ type: Output }]
1613
+ };
1614
+
1615
+ /*
1616
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1617
+ *
1618
+ * Licensed under EUPL, Version 1.2 (the "License");
1619
+ * you may not use this file except in compliance with the License.
1620
+ * You may obtain a copy of the License at
1621
+ *
1622
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1623
+ *
1624
+ * Unless required by applicable law or agreed to in writing, software
1625
+ * distributed under the License is distributed on an "AS IS" basis,
1626
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1627
+ * See the License for the specific language governing permissions and
1628
+ * limitations under the License.
1629
+ */
1630
+ class EditConnectorFormComponent {
1631
+ constructor() {
1632
+ this.withDefaults = false;
1633
+ this.showDeleteButton = false;
1634
+ this.propertiesSave = new EventEmitter();
1635
+ this.connectorDelete = new EventEmitter();
1636
+ this.productAanvragenName = 'ProductAanvragen';
1637
+ }
1638
+ }
1639
+ EditConnectorFormComponent.decorators = [
1640
+ { type: Component, args: [{
1641
+ selector: 'valtimo-edit-connector-form',
1642
+ template: "<!--\n ~ Copyright 2015-2020 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-edit-connector-properties\n *ngIf=\"connectorName !== productAanvragenName\"\n [properties]=\"properties\"\n [withDefaults]=\"withDefaults\"\n [defaultName]=\"defaultName\"\n [showDeleteButton]=\"showDeleteButton\"\n (propertiesSave)=\"propertiesSave.emit($event)\"\n (connectorDelete)=\"connectorDelete.emit()\"\n>\n</valtimo-edit-connector-properties>\n\n<valtimo-edit-product-aanvragen-connector\n *ngIf=\"connectorName === productAanvragenName\"\n [defaultName]=\"defaultName\"\n [properties]=\"properties\"\n [showDeleteButton]=\"showDeleteButton\"\n (propertiesSave)=\"propertiesSave.emit($event)\"\n (connectorDelete)=\"connectorDelete.emit()\"\n>\n</valtimo-edit-product-aanvragen-connector>\n",
1643
+ styles: ["/*!\n * Copyright 2015-2020 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 */"]
1644
+ },] }
1645
+ ];
1646
+ EditConnectorFormComponent.propDecorators = {
1647
+ properties: [{ type: Input }],
1648
+ withDefaults: [{ type: Input }],
1649
+ showDeleteButton: [{ type: Input }],
1650
+ defaultName: [{ type: Input }],
1651
+ connectorName: [{ type: Input }],
1652
+ propertiesSave: [{ type: Output }],
1653
+ connectorDelete: [{ type: Output }]
1654
+ };
1655
+
1656
+ /*
1657
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1658
+ *
1659
+ * Licensed under EUPL, Version 1.2 (the "License");
1660
+ * you may not use this file except in compliance with the License.
1661
+ * You may obtain a copy of the License at
1662
+ *
1663
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1664
+ *
1665
+ * Unless required by applicable law or agreed to in writing, software
1666
+ * distributed under the License is distributed on an "AS IS" basis,
1667
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1668
+ * See the License for the specific language governing permissions and
1669
+ * limitations under the License.
1670
+ */
1671
+ class ConnectorManagementModule {
1672
+ }
1673
+ ConnectorManagementModule.decorators = [
1674
+ { type: NgModule, args: [{
1675
+ providers: [ConnectorManagementStateService],
1676
+ declarations: [
1677
+ ConnectorManagementComponent,
1678
+ AddConnectorComponent,
1679
+ ConnectorModalComponent,
1680
+ ModifyConnectorComponent,
1681
+ EditConnectorPropertiesComponent,
1682
+ MultiValueConnectorPropertyComponent,
1683
+ ConnectorLinkExtensionComponent,
1684
+ ConnectorLinkExtensionModalComponent,
1685
+ EditProductAanvragenConnectorComponent,
1686
+ EditConnectorFormComponent
1687
+ ],
1688
+ imports: [
1689
+ CommonModule,
1690
+ ConnectorManagementRoutingModule,
1691
+ TranslateModule,
1692
+ WidgetModule,
1693
+ ListModule,
1694
+ SpinnerModule,
1695
+ ModalModule,
1696
+ FormIoModule
1697
+ ],
1698
+ exports: [
1699
+ ConnectorManagementComponent,
1700
+ AddConnectorComponent,
1701
+ ConnectorModalComponent,
1702
+ ModifyConnectorComponent,
1703
+ EditConnectorPropertiesComponent,
1704
+ MultiValueConnectorPropertyComponent,
1705
+ ConnectorLinkExtensionComponent,
1706
+ ConnectorLinkExtensionModalComponent,
1707
+ EditProductAanvragenConnectorComponent
1708
+ ],
1709
+ entryComponents: [
1710
+ ConnectorLinkExtensionComponent,
1711
+ ]
1712
+ },] }
1713
+ ];
1714
+
1715
+ /*
1716
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1717
+ *
1718
+ * Licensed under EUPL, Version 1.2 (the "License");
1719
+ * you may not use this file except in compliance with the License.
1720
+ * You may obtain a copy of the License at
1721
+ *
1722
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1723
+ *
1724
+ * Unless required by applicable law or agreed to in writing, software
1725
+ * distributed under the License is distributed on an "AS IS" basis,
1726
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1727
+ * See the License for the specific language governing permissions and
1728
+ * limitations under the License.
1729
+ */
1730
+ function connectorLinkExtensionInitializer(injector) {
1731
+ const configService = injector.get(ConfigService);
1732
+ const logger = injector.get(NGXLogger);
1733
+ return () => {
1734
+ return new Promise((resolve, reject) => {
1735
+ try {
1736
+ logger.debug('connector link extension initializer before init');
1737
+ const extension = new Extension('ConnectorLink', new BasicExtensionPoint('dossier-management', 'dossier', 'connector-link', ConnectorLinkExtensionComponent));
1738
+ configService.addExtension(extension);
1739
+ logger.debug('connector link extension initializer after init');
1740
+ resolve();
1741
+ }
1742
+ catch (error) {
1743
+ logger.debug('connector link extension initializer error', error);
1744
+ reject(error);
1745
+ }
1746
+ });
1747
+ };
1748
+ }
1749
+
1750
+ /*
1751
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
1752
+ *
1753
+ * Licensed under EUPL, Version 1.2 (the "License");
1754
+ * you may not use this file except in compliance with the License.
1755
+ * You may obtain a copy of the License at
1756
+ *
1757
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1758
+ *
1759
+ * Unless required by applicable law or agreed to in writing, software
1760
+ * distributed under the License is distributed on an "AS IS" basis,
1761
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1762
+ * See the License for the specific language governing permissions and
1763
+ * limitations under the License.
1764
+ */
1765
+
1766
+ /**
1767
+ * Generated bundle index. Do not edit.
1768
+ */
1769
+
1770
+ export { AddConnectorComponent, ConnectorLinkExtensionComponent, ConnectorLinkExtensionModalComponent, ConnectorManagementComponent, ConnectorManagementModule, ConnectorManagementService, ConnectorManagementStateService, ConnectorModalComponent, EditConnectorPropertiesComponent, ModifyConnectorComponent, MultiValueConnectorPropertyComponent, ObjectApiSyncService, connectorLinkExtensionInitializer, EditProductAanvragenConnectorComponent as ɵa, EditConnectorFormComponent as ɵb, ConnectorManagementRoutingModule as ɵc };
1771
+ //# sourceMappingURL=valtimo-connector-management.js.map